-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Improve config change handling #12319
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4b2434d
Improve config change handling
markdalgleish 113c90a
Refactor
markdalgleish 5620c65
Add comment
markdalgleish 193ea8a
Merge branch 'dev' into markdalgleish/handle-new-config-file
markdalgleish 8842539
Fix entry file dependency logic
markdalgleish 6847668
Merge branch 'dev' into markdalgleish/handle-new-config-file
markdalgleish 7a6ffb8
PR feedback
markdalgleish 27e6c28
Merge branch 'dev' into markdalgleish/handle-new-config-file
pcattori 6ac624b
refactor
pcattori df8d61c
Merge branch 'dev' into markdalgleish/handle-new-config-file
pcattori c3d0225
Merge branch 'dev' into markdalgleish/handle-new-config-file
pcattori File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@react-router/dev": patch | ||
--- | ||
|
||
Update config when `react-router.config.ts` is created or deleted during development. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we could watch the root for only changes to
<root>/react-router.config.ts
(and its module graph) and the corresponding app directory, rather than coarse-grained allowlist for any file in the root. But that's not a blocker.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think this would be relatively easy to do with Vite Node's
.devserver.watcher.on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we've since disabled the
watcher
for the Vite Node context. But my point still stands: its better to watch for changes in the app directory and the React Router config directly, rather than watching the root and ignoring paths.We'd need to take care to add any files that are part of the module graph for the React Router config to the watched files and then clean them up as needed. So there is a bit of complexity to get this working.