-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix: prevent infinite loop when HMRing a component with an await
#17380
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 8ae4726 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
/ecosystem-ci run vite-plugin-svelte |
|
vite-plugin-svelte contains an e2e test for hmr modificactions but the components in there are not using await so this bug wasn't caught there. Updating the test components there would help if ecosystem-ci was triggered in PRs, otherwise the svelte repo would need hmr tests itself where a devserver is started, files edited and result of hmr is asserted. v-p-s tests can only be updated after a svelte release so its not ideal for testing changes to the generated hmr code. For this case i think it would be best if the svelte repo itself had an e2e test that edits files in a "kitchensink" app and tests all behaviors for hmr. |
|
This wasn't quite the same as before: Might need another review now but good to go from my side |
Alternative to #17374. I think this is a more correct fix — it makes the
$.hmrblock effect a no-op when it isn't running as a result of ahot.acceptcallback, rather than excluding all block effects from re-running after the firstawaitis encountered during traversal.It also makes the HMR implementation simpler, both in terms of the generated code...
...and the dance that needs to happen inside
$.hmr.Before submitting the PR, please make sure you do the following
feat:,fix:,chore:, ordocs:.packages/svelte/src, add a changeset (npx changeset).Tests and linting
pnpm testand lint the project withpnpm lint