Skip to content
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

Make ART Concurrent if Legacy Mode is disabled #28662

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Mar 27, 2024

Pulling this out of #28657.

This runs react-art in concurrent mode if disableLegacyMode is true. Effectively this means that the OSS version will be in concurrent mode and the .modern.js version for Meta will be in concurrent mode, once the flag flips for modern, but the .classic.js version for Meta will be in legacy mode.

Updates flowing in from above flush synchronously so that they commit as a unit. This also ensures that refs are resolved before the parent life cycles. setStates deep in the tree will now be batched using "discrete" priority but should still happen same task.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Mar 27, 2024
@react-sizebot
Copy link

react-sizebot commented Mar 27, 2024

Comparing: 48ec17b...3e3589f

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 176.99 kB 176.99 kB = 55.01 kB 55.01 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 172.85 kB 172.85 kB = 53.90 kB 53.89 kB
facebook-www/ReactDOM-prod.classic.js = 591.27 kB 591.27 kB = 103.75 kB 103.75 kB
facebook-www/ReactDOM-prod.modern.js = 573.01 kB 573.01 kB = 100.80 kB 100.80 kB
test_utils/ReactAllWarnings.js Deleted 64.93 kB 0.00 kB Deleted 16.24 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
facebook-www/ReactART-prod.modern.js +0.45% 351.97 kB 353.54 kB +0.33% 59.53 kB 59.73 kB
facebook-www/ReactART-prod.classic.js +0.43% 363.37 kB 364.95 kB +0.35% 61.50 kB 61.72 kB
oss-experimental/react-art/cjs/react-art.production.js +0.33% 598.92 kB 600.89 kB +0.29% 133.81 kB 134.20 kB
oss-stable-semver/react-art/cjs/react-art.production.js +0.33% 601.90 kB 603.86 kB +0.28% 134.46 kB 134.84 kB
oss-stable/react-art/cjs/react-art.production.js +0.33% 601.93 kB 603.89 kB +0.28% 134.49 kB 134.86 kB
oss-experimental/react-art/cjs/react-art.production.min.js +0.31% 98.13 kB 98.44 kB +0.28% 30.17 kB 30.26 kB
oss-stable-semver/react-art/cjs/react-art.production.min.js +0.31% 100.25 kB 100.55 kB +0.36% 30.74 kB 30.85 kB
oss-stable/react-art/cjs/react-art.production.min.js +0.31% 100.30 kB 100.60 kB +0.35% 30.77 kB 30.88 kB
oss-experimental/react-art/umd/react-art.production.min.js +0.23% 135.34 kB 135.66 kB +0.20% 42.23 kB 42.32 kB
oss-stable-semver/react-art/umd/react-art.production.min.js +0.23% 137.45 kB 137.76 kB +0.21% 42.82 kB 42.91 kB
oss-stable/react-art/umd/react-art.production.min.js +0.23% 137.50 kB 137.81 kB +0.21% 42.85 kB 42.94 kB
test_utils/ReactAllWarnings.js Deleted 64.93 kB 0.00 kB Deleted 16.24 kB 0.00 kB

Generated by 🚫 dangerJS against 3e3589f

@sebmarkbage
Copy link
Collaborator Author

Hm. This should work fine in prod but there's an interesting interaction with act() here that fails tests.

@sebmarkbage sebmarkbage force-pushed the concurrentart branch 4 times, most recently from 3a3e6ee to 4adfe2b Compare April 2, 2024 17:44
Updated flowing in from above as well as setStates will now be batched
using "discrete" priority but should still happen same task.

We need to use the right scheduler in tests for act to work properly.
@sebmarkbage sebmarkbage merged commit 5fcaa0a into facebook:main Apr 2, 2024
38 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 2, 2024
Pulling this out of #28657.

This runs react-art in concurrent mode if disableLegacyMode is true.
Effectively this means that the OSS version will be in concurrent mode
and the `.modern.js` version for Meta will be in concurrent mode, once
the flag flips for modern, but the `.classic.js` version for Meta will
be in legacy mode.

Updates flowing in from above flush synchronously so that they commit as
a unit. This also ensures that refs are resolved before the parent life
cycles. setStates deep in the tree will now be batched using "discrete"
priority but should still happen same task.

DiffTrain build for [5fcaa0a](5fcaa0a)
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
Pulling this out of facebook#28657.

This runs react-art in concurrent mode if disableLegacyMode is true.
Effectively this means that the OSS version will be in concurrent mode
and the `.modern.js` version for Meta will be in concurrent mode, once
the flag flips for modern, but the `.classic.js` version for Meta will
be in legacy mode.

Updates flowing in from above flush synchronously so that they commit as
a unit. This also ensures that refs are resolved before the parent life
cycles. setStates deep in the tree will now be batched using "discrete"
priority but should still happen same task.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants