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

feat: allow postponing applying webpack hot updates #3

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pieh
Copy link

@pieh pieh commented Nov 18, 2022

Adding new feature to hot middleware that allow to delay/postpone applying hot updates. This might be needed by gatsbyjs/gatsby#37040 to allow gatsby's resource loader to fetch newly discovered static queries etc before applying code update and hence "syncing" data and code updates together. Without ability to manage when updates are applied, runtime often fails because newly compiled code often relies on static queries that weren't loaded yet and resulting in dreaded "The result of this StaticQuery could not be fetched." errors

};
if (__resourceQuery) {
var { URLSearchParams } = require('url');
Copy link
Author

Choose a reason for hiding this comment

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

we hit node builtin polyfill not set with webpack 5, but URLSearchParams seems to be available in all browsers we support natively.

I also realized there is #2 PR that seems to try to do something about this require as well, so might be good to resolve those 2 together

@LekoArts
Copy link

Can be tried with @gatsbyjs/webpack-hot-middleware@alpha-lazy-comp

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.

2 participants