-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
refactor(develop): expose APIs to suspend/resume webpack watching to gatsby internals #25236
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good assuming it works as you want. I had a question about needing the returned key to be a function to access the webpack watching value. But if it works as you want, then I'm good with this!
adcadab
to
b1ac123
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. I'm really glad that you've unearthed this. It's going to be very useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
@pieh code looks great! I don't see much value in abstracting this away from the larger PR as this doesn't show me usage of the functionality so I won't be able to see test failing, ... cause it's unused. I know I can go to the larger PR but what's the point of abstracting it away? |
@wardpeet the reason for exposing those methods is to be able to control when webpack recompiles (and emit hot update). Current (master) method of running Query modules to work need to add things to The follow up PR for this will look something like 2cc9227...df0c7fd (I'm still having some issues with e2e tests, so there likely be still some changes, but the idea of those changes is:
For this model to work we need to be able to control when things are running and webpack is only thing from the list that we don't control Also just note that this follow up PR will be eventually made redundant with more robust solution in form of state machine (ideally I would wait for it, but it's still quite some time before it lands fully) |
b1ac123
to
ad21352
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great!
Description
This pull request just exposes ability to
pause
/resume
webpack watching, but doesn't make any use of it yet. Main reason to split this to its own PR is the hairy TS situation:webpack-dev-middleware
-context
is skipped there, but according to clarification ifcontext
is public or private API webpack/webpack-dev-middleware#656 (comment)context
is public API and needs documentationwebpack.Watching
- feat(watching): allow suspend/resume compilation webpack/webpack#9214 addedsuspend
/resume
toWatching
but those are missing from@types/webpack
Related Issues
Tracking PR for data-driven code-splitting - #24903
[CH9864]