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

fix: ensure refresh runtime init is stable across module boundaries #290

Merged
merged 4 commits into from
Feb 28, 2021

Conversation

pmmmwh
Copy link
Owner

@pmmmwh pmmmwh commented Jan 1, 2021

The previous implementation would have side-effects when a non-processed require pop up within the module, effectively causing runtime to be cleaned before the module have finished executing. As a result some parts of the update chain became unbound and causes bailouts that shouldn't happen.

To fix this, the init and setup stages are consolidated into one, which will trigger on EVERY call to __webpack_require__, setting boundaries for all helpers and also ensures all fields on the refresh global would be properly restored after the module's execution.

TODO: Test cases to ensure the behaviour by mocking Webpack's main template

Fixes #260
Fixes #287
Fixes #314

@pmmmwh pmmmwh added the bug Something isn't working label Jan 1, 2021
@pmmmwh pmmmwh merged commit ae91952 into main Feb 28, 2021
@pmmmwh pmmmwh deleted the fix/stable-runtime-init branch February 28, 2021 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant