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

perf(nuxt): use granular watcher to avoid crawling ignored dirs #20836

Merged
merged 13 commits into from May 18, 2023

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented May 13, 2023

πŸ”— Linked issue

#12376

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This follows up previous focus on watcher improvements (#20179) as a hybrid solution using chokidar - it filters out/ignores child directories within srcDir directly. In tests in the monorepo, it reduces chokdar startup on a M1 Mac by 50%. I would expect even more significant performance improvements on a windows machine.

To enable this you'll need to set experimental.watcher to granular. (Otherwise behaviour will stay the same as currently.)

I'd appreciate review - my main concern is whether we ought to make provision for users deliberately seeking to watch changes in .nuxt or node_modules (which they have enabled with a negative glob pattern in ignore).

cc: @stafyniaksacha

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe marked this pull request as ready for review May 13, 2023 20:29
@danielroe
Copy link
Member Author

/trigger release

@github-actions
Copy link
Contributor

πŸš€ Release triggered! You can now install nuxt@npm:nuxt3@pr-20836

1 similar comment
@github-actions
Copy link
Contributor

πŸš€ Release triggered! You can now install nuxt@npm:nuxt3@pr-20836

@danielroe danielroe added the 🧷 edge release This PR will be released via the edge channel. label May 16, 2023
@danielroe
Copy link
Member Author

/trigger release

@github-actions
Copy link
Contributor

πŸš€ Release triggered! You can now install nuxt@npm:nuxt3@pr-20836

Copy link
Member

@antfu antfu left a comment

Choose a reason for hiding this comment

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

Amazing idea! Love the approach!

@danielroe danielroe changed the title perf(nuxt): create granular watchers to avoid parsing entire file tree perf(nuxt): use granular watcher to avoid crawling ignored dirs May 18, 2023
@danielroe danielroe merged commit 9dea9bc into main May 18, 2023
19 checks passed
@danielroe danielroe deleted the perf/many-watchers branch May 18, 2023 13:44
This was referenced May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants