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

[WIP] Refactor beginWork replay #14130

Closed
wants to merge 1 commit into from

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Nov 6, 2018

WIP, doesn’t work

I want to follow up on #14104 (comment) and try to simplify this logic.

So far, I've tried to separate beginWorkInDEV that would call beingWork and fall back to replay in a catch block. A dozen tests are currently failing with a context mismatch or something like this, but I’m not sure why. I also realized that there might be a reason replaying calls workLoop rather than beginWork directly (which seems like it would be simpler?) — for example, beginWork might assume the profiler timer has already started. So we need to make sure that any initialization that happens prior to beginWork also happens on the replay code path, or revert to calling workLoop.

@sizebot
Copy link

sizebot commented Nov 6, 2018

ReactDOM: size: -0.0%, gzip: -0.0%

Details of bundled changes.

Comparing: 3c69a18...10eddb1

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -0.1% -0.2% 708.98 KB 708.26 KB 163.88 KB 163.62 KB UMD_DEV
react-dom.production.min.js -0.0% -0.0% 98.04 KB 98.03 KB 31.89 KB 31.88 KB UMD_PROD
react-dom.development.js -0.1% -0.2% 704.29 KB 703.57 KB 162.51 KB 162.24 KB NODE_DEV
react-dom.production.min.js -0.0% -0.0% 98.03 KB 98.02 KB 31.42 KB 31.41 KB NODE_PROD
ReactDOM-dev.js -0.1% -0.1% 725.26 KB 724.67 KB 163.73 KB 163.51 KB FB_WWW_DEV
ReactDOM-prod.js -0.0% -0.0% 311.34 KB 311.28 KB 57.25 KB 57.24 KB FB_WWW_PROD
react-dom.profiling.min.js 0.0% 0.0% 100.8 KB 100.8 KB 31.96 KB 31.96 KB NODE_PROFILING
ReactDOM-profiling.js -0.0% 0.0% 317.54 KB 317.53 KB 58.5 KB 58.51 KB FB_WWW_PROFILING
react-dom.profiling.min.js -0.0% 0.0% 100.72 KB 100.71 KB 32.51 KB 32.51 KB UMD_PROFILING

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js -0.1% -0.2% 495.65 KB 494.92 KB 109.44 KB 109.17 KB UMD_DEV
react-art.production.min.js -0.0% -0.0% 90.12 KB 90.11 KB 27.67 KB 27.66 KB UMD_PROD
react-art.development.js -0.2% -0.3% 427.43 KB 426.71 KB 92.39 KB 92.14 KB NODE_DEV
react-art.production.min.js -0.0% -0.0% 55.11 KB 55.1 KB 16.99 KB 16.98 KB NODE_PROD
ReactART-dev.js -0.1% -0.3% 434.73 KB 434.14 KB 91.37 KB 91.13 KB FB_WWW_DEV
ReactART-prod.js -0.0% -0.0% 184.7 KB 184.65 KB 31.51 KB 31.5 KB FB_WWW_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js -0.2% -0.3% 440.09 KB 439.37 KB 95.1 KB 94.84 KB UMD_DEV
react-test-renderer.production.min.js -0.0% 0.0% 56.32 KB 56.31 KB 17.28 KB 17.28 KB UMD_PROD
react-test-renderer.development.js -0.2% -0.3% 435.31 KB 434.59 KB 93.95 KB 93.69 KB NODE_DEV
react-test-renderer.production.min.js -0.0% -0.1% 56 KB 55.99 KB 17.13 KB 17.12 KB NODE_PROD
ReactTestRenderer-dev.js -0.1% -0.2% 442.79 KB 442.21 KB 93.21 KB 92.98 KB FB_WWW_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js -0.2% -0.3% 425.27 KB 424.55 KB 90.89 KB 90.61 KB NODE_DEV
react-reconciler.production.min.js -0.0% -0.1% 56.24 KB 56.23 KB 16.84 KB 16.83 KB NODE_PROD
react-reconciler-persistent.development.js -0.2% -0.3% 423.72 KB 423 KB 90.26 KB 89.98 KB NODE_DEV
react-reconciler-persistent.production.min.js -0.0% -0.1% 56.25 KB 56.24 KB 16.84 KB 16.83 KB NODE_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.1% -0.2% 560.46 KB 559.89 KB 122.15 KB 121.92 KB RN_FB_DEV
ReactNativeRenderer-prod.js -0.1% -0.1% 240.25 KB 240.04 KB 42.22 KB 42.17 KB RN_FB_PROD
ReactNativeRenderer-dev.js -0.1% -0.2% 560.15 KB 559.58 KB 122.06 KB 121.83 KB RN_OSS_DEV
ReactNativeRenderer-prod.js -0.1% -0.2% 225.69 KB 225.48 KB 39.14 KB 39.08 KB RN_OSS_PROD
ReactFabric-dev.js -0.1% -0.2% 550.77 KB 550.2 KB 119.66 KB 119.44 KB RN_FB_DEV
ReactFabric-prod.js -0.1% -0.1% 219.93 KB 219.73 KB 37.83 KB 37.78 KB RN_FB_PROD
ReactFabric-dev.js -0.1% -0.2% 550.81 KB 550.24 KB 119.67 KB 119.45 KB RN_OSS_DEV
ReactFabric-prod.js -0.1% -0.1% 219.97 KB 219.76 KB 37.84 KB 37.79 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js -0.1% -0.1% 230.88 KB 230.71 KB 40.34 KB 40.29 KB RN_OSS_PROFILING
ReactFabric-profiling.js -0.1% -0.1% 224.24 KB 224.07 KB 39.07 KB 39.04 KB RN_OSS_PROFILING
ReactNativeRenderer-profiling.js -0.1% -0.1% 245.68 KB 245.52 KB 43.42 KB 43.37 KB RN_FB_PROFILING
ReactFabric-profiling.js -0.1% -0.1% 224.2 KB 224.03 KB 39.06 KB 39.02 KB RN_FB_PROFILING

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
scheduler.development.js n/a n/a 0 B 19.17 KB 0 B 5.74 KB UMD_DEV
scheduler.production.min.js n/a n/a 0 B 3.16 KB 0 B 1.53 KB UMD_PROD

Generated by 🚫 dangerJS

} catch (thrownValue) {
resetContextDependences();
resetHooks();
if (nextUnitOfWork === null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think there's any way to hit this condition. nextUnitOfWork should always be workInProgress.

@necolas necolas added the React Core Team Opened by a member of the React Core Team label Jan 8, 2020
@gaearon
Copy link
Collaborator Author

gaearon commented Jan 23, 2020

@acdlite Do you still care that I follow up on this refactor?

@acdlite
Copy link
Collaborator

acdlite commented Jan 23, 2020

I addressed this when I rewrote the work loop last year so we can close this

@acdlite acdlite closed this Jan 23, 2020
@gaearon gaearon deleted the refactor-replay branch January 24, 2020 12:17
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