Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update svelte-hmr and enable partial accept (#440)
* fix: update svelte-hmr and enable partial accept to allow context=module updates, see issue #134 * test: harden partialAccept test (#441) * refactor: improve test logic to avoid jest syntax from hell Co-authored-by: rixo <rixo@rixo.fr>
- Loading branch information
Showing
12 changed files
with
84 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
--- | ||
'@sveltejs/vite-plugin-svelte': patch | ||
--- | ||
|
||
update svelte-hmr and enable partial hmr accept by default (fixes #134) |
This file contains 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
This file contains 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
12 changes: 12 additions & 0 deletions
12
packages/e2e-tests/hmr/src/components/partial-hmr/ModuleContext.svelte
This file contains 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,12 @@ | ||
<script context="module"> | ||
export let y = 1; | ||
</script> | ||
|
||
<script> | ||
export let id; | ||
let x = 0; | ||
</script> | ||
|
||
<pre {id}> | ||
x={x} y={y} slot=<slot /> | ||
</pre> |
7 changes: 7 additions & 0 deletions
7
packages/e2e-tests/hmr/src/components/partial-hmr/PartialHmr.svelte
This file contains 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,7 @@ | ||
<script> | ||
import UsingNamed from './UsingNamed.svelte'; | ||
import UsingOnlyDefault from './UsingOnlyDefault.svelte'; | ||
</script> | ||
|
||
<UsingNamed /> | ||
<UsingOnlyDefault /> |
5 changes: 5 additions & 0 deletions
5
packages/e2e-tests/hmr/src/components/partial-hmr/UsingNamed.svelte
This file contains 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 @@ | ||
<script> | ||
import ModuleContext, { y } from './ModuleContext.svelte'; | ||
</script> | ||
|
||
<ModuleContext id="hmr-with-context">{y}</ModuleContext> |
5 changes: 5 additions & 0 deletions
5
packages/e2e-tests/hmr/src/components/partial-hmr/UsingOnlyDefault.svelte
This file contains 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 @@ | ||
<script> | ||
import ModuleContext from './ModuleContext.svelte'; | ||
</script> | ||
|
||
<ModuleContext id="hmr-without-context" /> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.