fix(react/runtime): fix MainThreadRef modification failure in certain cases#1884
fix(react/runtime): fix MainThreadRef modification failure in certain cases#1884Yradex merged 1 commit intolynx-family:mainfrom
MainThreadRef modification failure in certain cases#1884Conversation
🦋 Changeset detectedLatest commit: 71d82b0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
📝 WalkthroughWalkthroughUpdates tests to reflect structured ref shapes during hydration, refactors hydrateMainThreadRef to store full WorkletRefImpl objects directly in the map and narrows its parameter type, and adds a changeset entry documenting a patch fix. No public API changes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (1).changeset/*.md📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧬 Code graph analysis (2)packages/react/worklet-runtime/__test__/workletRef.test.js (2)
packages/react/worklet-runtime/src/hydrate.ts (1)
🔇 Additional comments (4)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Web Explorer#5881 Bundle Size — 364.58KiB (0%).71d82b0(current) vs e42b906 main#5880(baseline) Bundle metrics
Bundle size by type
|
| Current #5881 |
Baseline #5880 |
|
|---|---|---|
238.67KiB |
238.67KiB |
|
93.8KiB |
93.8KiB |
|
32.11KiB |
32.11KiB |
Bundle analysis report Branch Yradex:mts/fix-hydration Project dashboard
Generated by RelativeCI Documentation Report issue
React Example#5885 Bundle Size — 237.56KiB (0%).71d82b0(current) vs e42b906 main#5884(baseline) Bundle metrics
|
| Current #5885 |
Baseline #5884 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
166 |
166 |
|
68 |
68 |
|
46.82% |
46.82% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #5885 |
Baseline #5884 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
91.8KiB |
91.8KiB |
Bundle analysis report Branch Yradex:mts/fix-hydration Project dashboard
Generated by RelativeCI Documentation Report issue
CodSpeed Performance ReportMerging #1884 will improve performances by 12.2%Comparing Summary
Benchmarks breakdown
Footnotes
|
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/react@0.114.3 ### Patch Changes - Initialize `ctxNotFoundEventListener` before each test in testing library ([#1888](#1888)) - fix: main thread functions created during the initial render cannot correctly modify `MainThreadRef`s after hydration ([#1884](#1884)) ## @lynx-js/rspeedy@0.11.7 ### Patch Changes - Bump Rsbuild v1.5.17. ([#1889](#1889)) - feat: support web preview in rspeedy dev ([#1893](#1893)) - support web preview in rspeedy dev (experimental) - Updated dependencies \[]: - @lynx-js/web-rsbuild-server-middleware@0.18.1 ## @lynx-js/web-constants@0.18.1 ### Patch Changes - Updated dependencies \[]: - @lynx-js/web-worker-rpc@0.18.1 ## @lynx-js/web-core@0.18.1 ### Patch Changes - fix: mts freeze after reload() ([#1892](#1892)) The mts may be freezed after reload() called. We fixed it by waiting until the all-on-ui Javascript realm implementation, an iframe, to be fully loaded. - Updated dependencies \[[`70a18fc`](70a18fc)]: - @lynx-js/web-mainthread-apis@0.18.1 - @lynx-js/web-worker-runtime@0.18.1 - @lynx-js/web-constants@0.18.1 - @lynx-js/web-worker-rpc@0.18.1 ## @lynx-js/web-elements@0.8.9 ### Patch Changes - fix: layoutchange event result `detail.top` and `detail.left` was `0` incorrectly ([#1887](#1887)) - textarea placeholder inherits font-size by default ([#1874](#1874)) - feat: support <x-text text="content"></x-text> ([#1881](#1881)) - Updated dependencies \[]: - @lynx-js/web-elements-template@0.8.9 ## @lynx-js/web-mainthread-apis@0.18.1 ### Patch Changes - fix: mts freeze after reload() ([#1892](#1892)) The mts may be freezed after reload() called. We fixed it by waiting until the all-on-ui Javascript realm implementation, an iframe, to be fully loaded. - Updated dependencies \[]: - @lynx-js/web-constants@0.18.1 - @lynx-js/web-style-transformer@0.18.1 ## @lynx-js/web-worker-runtime@0.18.1 ### Patch Changes - Updated dependencies \[[`70a18fc`](70a18fc)]: - @lynx-js/web-mainthread-apis@0.18.1 - @lynx-js/web-constants@0.18.1 - @lynx-js/web-worker-rpc@0.18.1 ## create-rspeedy@0.11.7 ## upgrade-rspeedy@0.11.7 ## @lynx-js/web-core-server@0.18.1 ## @lynx-js/web-elements-template@0.8.9 ## @lynx-js/web-rsbuild-server-middleware@0.18.1 ## @lynx-js/web-style-transformer@0.18.1 ## @lynx-js/web-worker-rpc@0.18.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary by CodeRabbit
Bug Fixes
Tests
Chores
Checklist