-
Notifications
You must be signed in to change notification settings - Fork 111
fix(web): \_\_ElementFromBinary should mark all elements actively #1484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(web): \_\_ElementFromBinary should mark all elements actively #1484
Conversation
🦋 Changeset detectedLatest commit: 7e8cb40 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughAdds a changeset and tests; updates element-template processing to call __MarkPartElement when a builtin Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
🔇 Additional comments (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.changeset/silly-rockets-bet.md (1)
5-5: Nit: Make the release note a touch more descriptive.Consider clarifying the impact, e.g., “Ensure elements produced by __ElementFromBinary are marked for template handling, fixing cases where downstream logic depended on the marker.”
packages/web-platform/web-mainthread-apis/src/createMainThreadGlobalThis.ts (1)
760-761: Use forEach instead of map for side effects.map allocates an unused array. forEach communicates intent and avoids the waste.
Apply:
- clonedElements.map(__MarkTemplateElement); + clonedElements.forEach(__MarkTemplateElement);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.changeset/silly-rockets-bet.md(1 hunks)packages/web-platform/web-mainthread-apis/src/createMainThreadGlobalThis.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-07-22T09:23:07.797Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:23:07.797Z
Learning: In the lynx-family/lynx-stack repository, changesets are only required for meaningful changes to end-users such as bugfixes and features. Internal/development changes like chores, refactoring, or removing debug info do not need changeset entries.
Applied to files:
.changeset/silly-rockets-bet.md
📚 Learning: 2025-07-22T09:26:16.722Z
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:26:16.722Z
Learning: In the lynx-family/lynx-stack repository, CI checks require changesets when files matching the pattern "src/**" are modified (as configured in .changeset/config.json). For internal changes that don't need meaningful changesets, an empty changeset file is used to satisfy the CI requirement while not generating any release notes.
Applied to files:
.changeset/silly-rockets-bet.md
🧬 Code Graph Analysis (1)
packages/web-platform/web-mainthread-apis/src/createMainThreadGlobalThis.ts (1)
packages/web-platform/web-mainthread-apis/src/pureElementPAPIs.ts (1)
__MarkTemplateElement(354-358)
🔇 Additional comments (1)
.changeset/silly-rockets-bet.md (1)
1-5: Changeset is appropriate for a user-visible bugfix (patch).Targets the correct package and succinctly documents the fix. Good.
packages/web-platform/web-mainthread-apis/src/createMainThreadGlobalThis.ts
Outdated
Show resolved
Hide resolved
CodSpeed Performance ReportMerging #1484 will not alter performanceComparing Summary
|
React Example#4099 Bundle Size — 236.88KiB (0%).7e8cb40(current) vs 517ac33 main#4069(baseline) Bundle metrics
|
| Current #4099 |
Baseline #4069 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
158 |
158 |
|
64 |
64 |
|
45.85% |
45.85% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #4099 |
Baseline #4069 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
91.12KiB |
91.12KiB |
Bundle analysis report Branch Sherry-hue:fix/element-binary-ma... Project dashboard
Generated by RelativeCI Documentation Report issue
Web Explorer#4095 Bundle Size — 344.15KiB (+0.01%).7e8cb40(current) vs 517ac33 main#4064(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch Sherry-hue:fix/element-binary-ma... Project dashboard Generated by RelativeCI Documentation Report issue |
bbe5138 to
324ea1c
Compare
packages/web-platform/web-mainthread-apis/src/createMainThreadGlobalThis.ts
Show resolved
Hide resolved
324ea1c to
61dc218
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/web-platform/web-tests/tests/main-thread-apis.test.ts (1)
1333-1349: Consider adding a negative case for robustnessAdd a companion test ensuring that when builtinAttributes.dirtyID does not match the element id, the element is not marked as a part. This guards against accidental over-marking in the template processing logic.
If you want, I can draft the fixture tweak and the corresponding test that loads a similar template where dirtyID ≠ id and asserts that the parts map remains empty.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.changeset/silly-rockets-bet.md(1 hunks)packages/web-platform/web-mainthread-apis/src/createMainThreadGlobalThis.ts(2 hunks)packages/web-platform/web-tests/resources/web-core.main-thread.json(1 hunks)packages/web-platform/web-tests/tests/main-thread-apis.test.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/web-platform/web-mainthread-apis/src/createMainThreadGlobalThis.ts
- .changeset/silly-rockets-bet.md
🔇 Additional comments (1)
packages/web-platform/web-tests/resources/web-core.main-thread.json (1)
53-55: LGTM: Dirty part marking fixture looks correctAssigning builtinAttributes.dirtyID to "id-2" on the text node aligns with the intended behavior to mark that element as a part via __MarkPartElement and enables the new test to validate the parts map.
61dc218 to
fa6acda
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
fa6acda to
7e8cb40
Compare
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @lynx-js/[email protected] ### Patch Changes - fix css transform error in testing library ([#1500](#1500)) - fix the type error of `wrapper` option in testing library's `render` and `renderHook` function ([#1502](#1502)) - Introduce recursive hydration for lists to prevent double remove/insert on moves. ([#1401](#1401)) - Handle `<frame/>` correctly. ([#1497](#1497)) ## @lynx-js/[email protected] ### Patch Changes - `output.inlineScripts` defaults to `false` when chunkSplit strategy is not `'all-in-one'` ([#1504](#1504)) ## @lynx-js/[email protected] ### Patch Changes - `output.inlineScripts` defaults to `false` when chunkSplit strategy is not `'all-in-one'` ([#1504](#1504)) - Updated dependencies \[[`51a0b19`](51a0b19), [`b391ef5`](b391ef5)]: - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - Fix that `lynxTestingEnv.jsdom` cannot be initialized correctly when `global.jsdom` is not defined. ([#1422](#1422)) ## @lynx-js/[email protected] ### Patch Changes - fix: systeminfo in mts function ([#1537](#1537)) - feat: add MTS API: \_\_UpdateComponentInfo ([#1485](#1485)) - fix: `__ElementFromBinary` needs to correctly apply the dataset in elementTemplate to the Element ([#1487](#1487)) - fix: all attributes except `id` and `type` under ElementTemplateData are optional. ([#1483](#1483)) - feat: add MTS API \_\_GetAttributeByName ([#1486](#1486)) - Updated dependencies \[]: - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - fix: systeminfo in mts function ([#1537](#1537)) - refactor: use utf-8 string ([#1473](#1473)) - Fix mtsGlobalThis race condition in createRenderAllOnUI ([#1506](#1506)) - Updated dependencies \[[`405a917`](405a917), [`b8f89e2`](b8f89e2), [`f76aae9`](f76aae9), [`b8b060b`](b8b060b), [`d8381a5`](d8381a5), [`214898b`](214898b), [`ab8cee4`](ab8cee4)]: - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - refactor: use utf-8 string ([#1473](#1473)) ## @lynx-js/[email protected] ### Patch Changes - fix: systeminfo in mts function ([#1537](#1537)) - refactor: use utf-8 string ([#1473](#1473)) - feat: add MTS API: \_\_UpdateComponentInfo ([#1485](#1485)) - fix: \_\_ElementFromBinary should mark all elements actively ([#1484](#1484)) - fix: `__ElementFromBinary` needs to correctly apply the dataset in elementTemplate to the Element ([#1487](#1487)) - fix: all attributes except `id` and `type` under ElementTemplateData are optional. ([#1483](#1483)) - feat: add MTS API \_\_GetAttributeByName ([#1486](#1486)) - Updated dependencies \[[`405a917`](405a917), [`b8f89e2`](b8f89e2), [`f76aae9`](f76aae9), [`d8381a5`](d8381a5), [`214898b`](214898b), [`ab8cee4`](ab8cee4)]: - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - refactor: use utf-8 string ([#1473](#1473)) ## @lynx-js/[email protected] ### Patch Changes - Updated dependencies \[[`405a917`](405a917), [`b8f89e2`](b8f89e2), [`f76aae9`](f76aae9), [`b8b060b`](b8b060b), [`d8381a5`](d8381a5), [`214898b`](214898b), [`ab8cee4`](ab8cee4)]: - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - Fix "emit different content to the same filename" error ([#1482](#1482)) ## @lynx-js/[email protected] ### Patch Changes - Fix invalid `module.exports=;` syntax in app-service.js. ([#1501](#1501)) ## [email protected] ## @lynx-js/[email protected] ## [email protected] ## @lynx-js/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary by CodeRabbit
Bug Fixes
Tests
Chores
Checklist