-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: create wrapper template for components in HMR mode #12304
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
Conversation
|
@@ -279,6 +279,7 @@ export function clean_nodes( | |||
trimmed.length === 1 && | |||
((first.type === 'RenderTag' && !first.metadata.dynamic) || | |||
(first.type === 'Component' && | |||
!state.options.hmr && |
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.
probably good to have a comment explaining a bit why we can't go without a wrapper in HMR mode
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.
Let's marge this for now so it unblocks people, we can always have a follow up PR to add comments.
@@ -279,6 +279,7 @@ export function clean_nodes( | |||
trimmed.length === 1 && | |||
((first.type === 'RenderTag' && !first.metadata.dynamic) || | |||
(first.type === 'Component' && | |||
!state.options.hmr && |
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.
My proposal for a comment:
!state.options.hmr && | |
// HMR components can be destroyed/recreated independently. In that sense they're a bit | |
// like a dynamic Svelte component and therefore the anchor is necessary. | |
!state.options.hmr && |
fixes #12273, fixes #12280
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint