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(compiler): handle file rename in watch mode #5971

Merged
merged 3 commits into from
Sep 6, 2024

Conversation

tanner-reits
Copy link
Member

What is the current behavior?

Fixes: #3443

When renaming a file in watch mode, it is possible to run into two errors:

  1. A build error resulting from the compiler believing that two components exist with the same tag name (one from the old file name, and one from the new)
  2. An HMR issue where the new file name is not correctly registered with the file watcher. So, changes to the renamed file did not trigger an HMR reload

What is the new behavior?

Addresses both of the issues mentioned above by updating the watched files and compiler context whenever a change is detected that triggers the watch callback

Documentation

N/A

Does this introduce a breaking change?

  • Yes
  • No

Testing

This is a difficult issue to test (especially the HMR since that was not always consistent), so I was only able to perform manual tests

Other information

@tanner-reits tanner-reits marked this pull request as ready for review September 5, 2024 20:15
@tanner-reits tanner-reits requested a review from a team as a code owner September 5, 2024 20:15
@tanner-reits tanner-reits added this pull request to the merge queue Sep 6, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 6, 2024
@tanner-reits tanner-reits added this pull request to the merge queue Sep 6, 2024
Merged via the queue into main with commit 8f0a882 Sep 6, 2024
88 checks passed
@tanner-reits tanner-reits deleted the tr/file-watch-rename branch September 6, 2024 13:41
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.

bug: renaming a a component file whilst being watched causes an error
2 participants