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

Separate EventPriority from Lane #25460

Closed
wants to merge 1 commit into from
Closed

Conversation

tyao1
Copy link
Contributor

@tyao1 tyao1 commented Oct 11, 2022

Summary

Breaks down #25438, we are going to merge Default and Continuous lane into Sync lane, so EventPriority no longer maps to Lane anymore.

How did you test this change?

yarn test
flow
lint

@tyao1 tyao1 requested a review from acdlite October 11, 2022 00:33
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Oct 11, 2022
@@ -80,3 +83,13 @@ export function lanesToEventPriority(lanes: Lanes): EventPriority {
}
return IdleEventPriority;
}

export function laneToEventPriority(lane: Lane): EventPriority {
if (lane === DefaultLane) {

Choose a reason for hiding this comment

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

@tyao1
Why don't you use switch here?

switch(lane) {
  case DefaultLane:
    return DefaultEventPriority;
  case  InputContinuousLane:
    return ContinuousEventPriority;
  default:
    return (lane: any);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are the same. I would use switch if there were more cases to cover.

@tyao1 tyao1 force-pushed the ty-event-priorities-enum branch from cfed715 to 96c7ce3 Compare November 10, 2022 20:07
@sizebot
Copy link

sizebot commented Nov 10, 2022

Comparing: d1e35c7...96c7ce3

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 +0.05% 153.65 kB 153.73 kB +0.06% 48.90 kB 48.93 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.05% 155.57 kB 155.65 kB +0.09% 49.51 kB 49.56 kB
facebook-www/ReactDOM-prod.classic.js +0.03% 530.48 kB 530.66 kB +0.03% 94.68 kB 94.71 kB
facebook-www/ReactDOM-prod.modern.js +0.03% 515.74 kB 515.92 kB +0.04% 92.50 kB 92.53 kB
facebook-www/ReactDOMForked-prod.classic.js +0.03% 530.48 kB 530.66 kB +0.04% 94.68 kB 94.71 kB
oss-experimental/react-reconciler/cjs/react-reconciler-constants.development.js = 1.05 kB 0.96 kB = 0.44 kB 0.43 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler-constants.development.js = 1.05 kB 0.96 kB = 0.44 kB 0.43 kB
oss-stable/react-reconciler/cjs/react-reconciler-constants.development.js = 1.05 kB 0.96 kB = 0.44 kB 0.43 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-reconciler/cjs/react-reconciler-constants.production.min.js = 0.45 kB 0.45 kB = 0.29 kB 0.29 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler-constants.production.min.js = 0.45 kB 0.45 kB = 0.29 kB 0.29 kB
oss-stable/react-reconciler/cjs/react-reconciler-constants.production.min.js = 0.45 kB 0.45 kB = 0.29 kB 0.29 kB
oss-experimental/react-reconciler/cjs/react-reconciler-constants.development.js = 1.05 kB 0.96 kB = 0.44 kB 0.43 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler-constants.development.js = 1.05 kB 0.96 kB = 0.44 kB 0.43 kB
oss-stable/react-reconciler/cjs/react-reconciler-constants.development.js = 1.05 kB 0.96 kB = 0.44 kB 0.43 kB

Generated by 🚫 dangerJS against 96c7ce3

@tyao1
Copy link
Contributor Author

tyao1 commented Dec 2, 2022

closing for now since we are starting with the other approach: #25700

@tyao1 tyao1 closed this Dec 2, 2022
@tyao1 tyao1 deleted the ty-event-priorities-enum branch March 31, 2023 05:10
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