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

lower default aggregateTimeout to 20ms #15041

Merged
merged 1 commit into from Jan 10, 2022

Conversation

markjm
Copy link
Contributor

@markjm markjm commented Dec 22, 2021

Resolves #15040

What kind of change does this PR introduce?
default config change

Did you add tests for your changes?
no, all tests pass though

Does this PR introduce a breaking change?
no

What needs to be documented once your changes are merged?
https://webpack.js.org/configuration/watch/#watchoptionsaggregatetimeout
above default should be updated. not sure if docs defaults are updated automatically

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@markjm markjm changed the title Lower default aggregateTimeout to 20ms lower default aggregateTimeout to 20ms Dec 22, 2021
@sokra sokra merged commit 5929bfc into webpack:main Jan 10, 2022
@sokra
Copy link
Member

sokra commented Jan 10, 2022

Thanks

@levymetal
Copy link

The docs still state this value is 200: https://webpack.js.org/configuration/watch/#watchoptionsaggregatetimeout

FWIW, this causes double-rebuilds when using Visual Studio Code (all extensions disabled). For brevity I've created a repro https://github.com/levymetal/webpack5-double-compile-repro but this occurs on all my projects upgraded to webpack>=5.66.0 on multiple machines.

This might be because VSCode has previously been known to touch files twice when saving: microsoft/vscode#9419. This wasn't fixed at the time and I don't know if it's still the case as I haven't yet attempted to log filesystem events, but it seems likely.

I'm not sure if it's Webpack's job to work around the limitations of VSCode, but as it currently stands this is a tricky issue to debug that will affect a significant number of people. IMHO this seems big enough to warrant calling out in the docs, that some editors require an aggregateTimeout of at least 100ms to avoid compiling twice on every save.

I wonder if this may even be the historical reason for 200ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thoughts on lowering default watchOptions.aggregateTimeout?
5 participants