Remove unused Vite file system watcher #10510
Merged
+54
−48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #10324.
This PR completely disables the vite-node file watcher because, even in dev, it's unused. The Vite dev server created for resolving
routes.ts
is only updated when the main dev server's file system watcher picks up a change. If the change is at all relevant toroutes.ts
, its module graph is completely invalidated. Relevant code:remix/packages/remix-dev/vite/plugin.ts
Lines 1377 to 1414 in 04d4fa2
We can be confident in this change because we have tests that check you can update a file in the
routes.ts
module graph and get a new route config during dev:remix/integration/vite-route-config-test.ts
Lines 229 to 297 in 04d4fa2
Since the issue was caused by our use of
vite.mergeConfig
, I also simplified the code to avoid this API entirely.