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

Less indirection in SchedulerWithReactIntegration #20800

Closed
wants to merge 1 commit into from

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Feb 11, 2021

I originally kept the React PriorityLevel and Scheduler PriorityLevel types separate in case there was a versioning mismatch between the two modules. However, it looks like we're going to keep the Scheduler module private in the short to medium term, and longer term the public interface will match postTask. So I've removed the extra indirection (the switch statements that convert between the two types).

@acdlite acdlite requested a review from rickhanlonii February 11, 2021 04:02
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 11, 2021
I originally kept the React PriorityLevel and Scheduler PriorityLevel
types separate in case there was a versioning mismatch between the
two modules. However, it looks like we're going to keep the Scheduler
module private in the short to medium term, and longer term the public
interface will match `postTask`. So I've removed the extra indirection
(the switch statements that convert between the two types).
@acdlite acdlite force-pushed the less-scheduler-indirection branch from b26c555 to f733695 Compare February 11, 2021 04:05
@acdlite acdlite marked this pull request as draft February 11, 2021 04:07
@acdlite
Copy link
Collaborator Author

acdlite commented Feb 11, 2021

Forgot we compare these numbers in a few places. Lemme think about this a bit more.

@sizebot
Copy link

sizebot commented Feb 11, 2021

Comparing: 47dd9f4...f733695

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 = 122.34 kB 121.95 kB = 39.40 kB 39.28 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 128.92 kB 128.54 kB = 41.46 kB 41.35 kB
facebook-www/ReactDOM-prod.classic.js +0.08% 404.69 kB 405.00 kB = 75.17 kB 75.14 kB
facebook-www/ReactDOM-prod.modern.js +0.08% 393.04 kB 393.35 kB = 73.27 kB 73.24 kB
facebook-www/ReactDOMForked-prod.classic.js +0.07% 404.70 kB 405.00 kB = 75.18 kB 75.14 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
facebook-www/ReactDOMTesting-dev.classic.js = 973.97 kB 972.00 kB = 218.80 kB 218.32 kB
oss-experimental/react-dom/umd/react-dom.development.js = 1,008.59 kB 1,006.51 kB = 220.25 kB 219.55 kB
oss-experimental/react-dom/cjs/react-dom.development.js = 959.71 kB 957.73 kB = 217.33 kB 216.88 kB
facebook-www/ReactDOMTesting-dev.modern.js = 944.95 kB 942.98 kB = 212.71 kB 212.23 kB
oss-stable/react-dom/umd/react-dom.development.js = 954.79 kB 952.72 kB = 209.93 kB 209.45 kB
oss-stable/react-dom/cjs/react-dom.development.js = 908.48 kB 906.49 kB = 207.31 kB 206.84 kB
oss-experimental/react-dom/umd/react-dom.profiling.min.js = 134.58 kB 134.23 kB = 43.89 kB 43.82 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js = 695.34 kB 693.53 kB = 148.89 kB 148.45 kB
react-native/implementations/ReactNativeRenderer-dev.fb.js = 715.98 kB 714.05 kB = 155.07 kB 154.53 kB
react-native/implementations/ReactNativeRenderer-dev.js = 710.47 kB 708.54 kB = 154.14 kB 153.61 kB
react-native/implementations/ReactFabric-dev.fb.js = 696.99 kB 695.05 kB = 150.22 kB 149.75 kB
oss-experimental/react-dom/umd/react-dom.production.min.js = 128.76 kB 128.40 kB = 42.14 kB 42.03 kB
oss-stable/react-reconciler/cjs/react-reconciler.development.js = 651.48 kB 649.67 kB = 139.97 kB 139.54 kB
oss-stable/react-dom/umd/react-dom.profiling.min.js = 126.45 kB 126.09 kB = 41.33 kB 41.27 kB
react-native/implementations/ReactFabric-dev.js = 691.47 kB 689.53 kB = 149.35 kB 148.89 kB
oss-experimental/react-art/umd/react-art.development.js = 739.85 kB 737.77 kB = 157.19 kB 156.71 kB
facebook-www/ReactART-dev.classic.js = 692.44 kB 690.47 kB = 146.92 kB 146.46 kB
oss-experimental/react-dom/cjs/react-dom.profiling.min.js = 134.93 kB 134.54 kB = 43.26 kB 43.14 kB
facebook-www/ReactART-dev.modern.js = 682.19 kB 680.22 kB = 144.84 kB 144.38 kB
oss-stable/react-dom/umd/react-dom.production.min.js = 122.26 kB 121.90 kB = 40.07 kB 40.01 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 128.92 kB 128.54 kB = 41.46 kB 41.35 kB
oss-stable/react-art/umd/react-art.development.js = 696.58 kB 694.51 kB = 148.60 kB 148.13 kB
oss-stable/react-dom/cjs/react-dom.profiling.min.js = 126.69 kB 126.30 kB = 40.69 kB 40.56 kB
oss-experimental/react-art/umd/react-art.production.min.js = 117.32 kB 116.96 kB = 36.60 kB 36.50 kB
oss-experimental/react-art/cjs/react-art.development.js = 637.10 kB 635.12 kB = 138.90 kB 138.41 kB
facebook-www/ReactTestRenderer-dev.modern.js = 629.15 kB 627.18 kB = 135.14 kB 134.68 kB
facebook-www/ReactTestRenderer-dev.classic.js = 629.14 kB 627.17 kB = 135.13 kB 134.67 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-dev.js = 616.63 kB 614.69 kB = 133.77 kB 133.30 kB
oss-stable/react-dom/cjs/react-dom.production.min.js = 122.34 kB 121.95 kB = 39.40 kB 39.28 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.development.js = 621.77 kB 619.79 kB = 136.19 kB 135.72 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.development.js = 652.76 kB 650.67 kB = 137.80 kB 137.32 kB
oss-stable/react-art/umd/react-art.production.min.js = 112.42 kB 112.06 kB = 35.06 kB 34.94 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js = 605.57 kB 603.58 kB = 132.78 kB 132.30 kB
oss-stable/react-test-renderer/umd/react-test-renderer.development.js = 635.70 kB 633.61 kB = 134.37 kB 133.90 kB
oss-stable/react-art/cjs/react-art.development.js = 595.90 kB 593.92 kB = 130.48 kB 130.01 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.min.js = 97.73 kB 97.37 kB = 30.31 kB 30.20 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.min.js = 91.81 kB 91.45 kB = 28.54 kB 28.43 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.min.js = 90.71 kB 90.35 kB = 28.15 kB 28.04 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.min.js = 86.45 kB 86.09 kB = 26.93 kB 26.82 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.production.min.js = 81.93 kB 81.56 kB = 25.93 kB 25.81 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.min.js = 81.76 kB 81.37 kB = 25.65 kB 25.53 kB
oss-experimental/react-art/cjs/react-art.production.min.js = 81.44 kB 81.06 kB = 25.46 kB 25.34 kB
oss-stable/react-test-renderer/umd/react-test-renderer.production.min.js = 79.52 kB 79.14 kB = 25.09 kB 25.00 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.min.js = 79.33 kB 78.95 kB = 24.81 kB 24.70 kB
oss-stable/react-art/cjs/react-art.production.min.js = 76.60 kB 76.22 kB = 23.96 kB 23.85 kB

Generated by 🚫 dangerJS against f733695


export function getCurrentPriorityLevel(): ReactPriorityLevel {
switch (Scheduler_getCurrentPriorityLevel()) {
Copy link
Member

Choose a reason for hiding this comment

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

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Busy night, eh Rick?

@acdlite
Copy link
Collaborator Author

acdlite commented Mar 26, 2021

Closed by #21107

@acdlite acdlite closed this Mar 26, 2021
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.

4 participants