Skip to content

defer bailing out of updates to the render phase #3621

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

Merged
merged 5 commits into from
Jul 19, 2022

Conversation

JoviDeCroock
Copy link
Member

Fixes #2715

This introduces a _nextState for our reducer/state hooks, what this effectively does is it will trigger a render for all WIP states and check in our shouldComponentUpdate whether we can bail or not. This increases our feature parity for bailing out of updates, React does this a bit later even post render-phase.

@coveralls
Copy link

coveralls commented Jul 18, 2022

Coverage Status

Coverage increased (+0.7%) to 99.457% when pulling a1fc94f on defer-state-equality into cef315a on master.

@github-actions
Copy link

github-actions bot commented Jul 18, 2022

Size Change: +196 B (0%)

Total Size: 43.5 kB

Filename Size Change
hooks/dist/hooks.js 1.31 kB +65 B (4%)
hooks/dist/hooks.module.js 1.33 kB +66 B (4%)
hooks/dist/hooks.umd.js 1.39 kB +65 B (4%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.67 kB 0 B
compat/dist/compat.module.js 3.65 kB 0 B
compat/dist/compat.umd.js 3.73 kB 0 B
debug/dist/debug.js 3 kB 0 B
debug/dist/debug.module.js 3 kB 0 B
debug/dist/debug.umd.js 3.08 kB 0 B
devtools/dist/devtools.js 230 B 0 B
devtools/dist/devtools.module.js 238 B 0 B
devtools/dist/devtools.umd.js 305 B 0 B
dist/preact.js 4 kB 0 B
dist/preact.min.js 4.03 kB 0 B
dist/preact.module.js 4.02 kB 0 B
dist/preact.umd.js 4.06 kB 0 B
jsx-runtime/dist/jsxRuntime.js 317 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 327 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 395 B 0 B
test-utils/dist/testUtils.js 444 B 0 B
test-utils/dist/testUtils.module.js 444 B 0 B
test-utils/dist/testUtils.umd.js 521 B 0 B

compressed-size-action

@JoviDeCroock JoviDeCroock changed the title defer bailing out of render to the render phase defer bailing out of updates to the render phase Jul 18, 2022
Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

This fantastic! Thank you so much for tackling this 💯

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.

Infinite loop caused by unstable context value
3 participants