Skip to content

fix(react/runtime): revert #239 'batch multiple patches for main thread communication'#637

Merged
Yradex merged 1 commit intolynx-family:mainfrom
Yradex:lifecycle/fix
Apr 27, 2025
Merged

fix(react/runtime): revert #239 'batch multiple patches for main thread communication'#637
Yradex merged 1 commit intolynx-family:mainfrom
Yradex:lifecycle/fix

Conversation

@Yradex
Copy link
Collaborator

@Yradex Yradex commented Apr 27, 2025

Summary

Reverts #239: "batch multiple patches for main thread communication"

This reverts the change that batched updates sent to the main thread in a single render pass.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@changeset-bot
Copy link

changeset-bot bot commented Apr 27, 2025

🦋 Changeset detected

Latest commit: d114e6d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lynx-js/react Minor

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

@codecov
Copy link

codecov bot commented Apr 27, 2025

❌ 16 Tests Failed:

Tests completed Failed Passed Skipped
2505 16 2489 67
View the top 3 failed test(s) by shortest run time
packages/react/testing-library/src/__tests__/end-to-end.test.jsx > src/__tests__/end-to-end.test.jsx
Stack Traces | 0s run time
TypeError: (0 , clearPatchesToCommit) is not a functionglobalThis.onInjectBackgroundThreadGlobals dist/vitest-global-setup.js:90:105dist/vitest-global-setup.js:115:12
packages/react/testing-library/src/__tests__/lynx.test.jsx > src/__tests__/lynx.test.jsx
Stack Traces | 0s run time
TypeError: (0 , clearPatchesToCommit) is not a functionglobalThis.onInjectBackgroundThreadGlobals dist/vitest-global-setup.js:90:105dist/vitest-global-setup.js:115:12
packages/react/testing-library/src/__tests__/ref.test.jsx > src/__tests__/ref.test.jsx
Stack Traces | 0s run time
TypeError: (0 , clearPatchesToCommit) is not a functionglobalThis.onInjectBackgroundThreadGlobals dist/vitest-global-setup.js:90:105dist/vitest-global-setup.js:115:12

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 27, 2025

CodSpeed Performance Report

Merging #637 will not alter performance

Comparing Yradex:lifecycle/fix (d114e6d) with main (74b5bd1)

Summary

✅ 1 untouched benchmarks

@codecov
Copy link

codecov bot commented Apr 27, 2025

Bundle Report

Changes will decrease total bundle size by 912 bytes (-0.14%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
@lynx-js/example-react-lynx-cjs 316.63kB -912 bytes (-0.29%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: @lynx-js/example-react-lynx-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
main.lynx.bundle -454 bytes 87.43kB -0.52%
.rspeedy/main/background.*.js -458 bytes 38.96kB -1.16%

@Yradex Yradex marked this pull request as ready for review April 27, 2025 07:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reverts the changes introduced in #239 that batched multiple patches for main thread communication. The updates restore the previous commit flow and update the render calls accordingly.

  • Revert batched patch commits.
  • Replace renderBackground calls with direct render calls.
  • Update test files and import statements to reflect these changes.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/react/testing-library/src/vitest-global-setup.js Reverted snapshot import and cleared batched patch calls adjustments.
packages/react/testing-library/src/pure.jsx Removed the extra commitToMainThread invocation and updated imports.
packages/react/testing-library/src/tests/worklet.test.jsx Updated patch data format to remove batched patches.
packages/react/runtime/src/lynx/tt.ts Replaced call to renderBackground with render in runWithForce.
packages/react/runtime/src/lynx-api.ts Updated render call to use render instead of renderBackground.
packages/react/runtime/src/lifecycle/render.ts Removed the renderBackground helper function.
packages/react/runtime/src/lifecycle/reload.ts Replaced renderBackground with render to re-render the main thread.
packages/react/runtime/src/lifecycle/patch/commit.ts Removed batching of patches and the associated commitToMainThread logic.
packages/react/runtime/src/lifecycle/destroy.ts Updated to call render directly for component destruction.
Other test files Adjusted imports to reference render instead of renderBackground.

@Yradex Yradex added this pull request to the merge queue Apr 27, 2025
Merged via the queue into lynx-family:main with commit 0be475d Apr 27, 2025
28 checks passed
@Yradex Yradex deleted the lifecycle/fix branch April 27, 2025 10:13
github-merge-queue bot pushed a commit that referenced this pull request Apr 27, 2025
@Yradex Yradex restored the lifecycle/fix branch April 28, 2025 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants