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 .addWatchFile() dependencies failing to invalidate in watch mode #3112

Merged

Conversation

tivac
Copy link
Contributor

@tivac tivac commented Sep 12, 2019

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • not yet

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Fixes #3111

Description

Fixes dependency invalidation in watch mode when using this.addWatchFile() from a plugin. Code was refactored in #3081 to use a for...of but the return was kept from the previous .forEach(...) version, so as soon as a module w/o any matching transformDependencies is found iteration halts immediately.

TODO

  • Figure out how to write a test for this

instead of using return and having it end the entire function invocation.

Fixes rollup#3111
@codecov
Copy link

codecov bot commented Sep 12, 2019

Codecov Report

Merging #3112 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3112   +/-   ##
=======================================
  Coverage   89.28%   89.28%           
=======================================
  Files         165      165           
  Lines        5731     5731           
  Branches     1740     1740           
=======================================
  Hits         5117     5117           
  Misses        380      380           
  Partials      234      234
Impacted Files Coverage Δ
src/watch/index.ts 85.32% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed34bc5...aaba1dd. Read the comment docs.

@tivac tivac changed the title fix: use continue to end the loop iteration Fix .addWatchFile() dependencies failing to invalidate in watch mode Sep 12, 2019
@lukastaegert
Copy link
Member

I added a test using your repro as a basis. It I did not mess up, we can merge this.

@lukastaegert lukastaegert merged commit ed880a0 into rollup:master Sep 14, 2019
@tivac
Copy link
Contributor Author

tivac commented Sep 14, 2019

Thanks for the test help and the merge @lukastaegert! 👍🏻

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.

.addWatchFiles() dependencies can fail to trigger rebuilds in 1.21.0+
2 participants