Skip to content

Symlink support on new watcher#13707

Merged
nachocodoner merged 9 commits intorelease-3.3from
symlink-support
Apr 30, 2025
Merged

Symlink support on new watcher#13707
nachocodoner merged 9 commits intorelease-3.3from
symlink-support

Conversation

@nachocodoner
Copy link
Copy Markdown
Member

@nachocodoner nachocodoner commented Apr 24, 2025

Continues: #13699

This PR addresses part of the feedback from @zodern in the previous PR. It improves support for symbolic links by detecting symlinks and all traversed files, using a polling strategy to reliably watch for changes. I also enabled support for direct packages linked with npm link in the project's node_modules. I tested these and they work well.

Polling is used because native recursive watching isn't supported consistently across all OS when using symlinks, so polling is applied in these cases. Tools like chokidar could handle this more smartly, but for now this approach works well enough.

I considered enabling native watching and polling for all project files simultanously, not just symlinks. However, polling puts significant load on the CPU and impacts performance. So for now, polling remains opt-in via an environment variable (METEOR_WATCH_FORCE_POLLING and METEOR_WATCH_POLLING_INTERVAL_MS).

Most modern bundlers rely on native watchers, and for edge cases like working with volumes or network files, you can opt into polling. See Vite and rspack as examples. This favors performance in common scenarios while keeping compatibility available when needed.

Since Meteor 3.4 will favor using a modern bundler for app and node_modules code, it makes sense to align with how they handle things. As app code will be managed by the bundler, its options will become the new configuration standard for modern Meteor apps, including watching. Using @parcel/watcher still makes sense on Meteor core, as it improves file change detection for atmosphere packages code and intermediate outputs from the modern bundler.


We'll mention in Meteor 3.3 that this could be a breaking change in cases like using WSL2 from host machine, working with volumes, or over network setups, where polling needs to be enabled manually. I'll test some of these cases too. It’s also a chance to collect feedback, but since performance is the priority, and this aligns with other modern tools, this seems like the right path.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 24, 2025

Deploy Preview for v3-meteor-api-docs canceled.

Name Link
🔨 Latest commit 90b5ccc
🔍 Latest deploy log https://app.netlify.com/sites/v3-meteor-api-docs/deploys/680b45a43ee1ad0008d45b3f

@nachocodoner nachocodoner marked this pull request as ready for review April 24, 2025 08:49
@StorytellerCZ StorytellerCZ added this to the Release 3.3 milestone Apr 27, 2025
@nachocodoner nachocodoner merged commit ff45143 into release-3.3 Apr 30, 2025
10 checks passed
@nachocodoner nachocodoner deleted the symlink-support branch April 30, 2025 07:49
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.

3 participants