-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: skip
is_standalone
optimisation for dynamic components (#12767)
* fix: skip `is_standalone` optimisation for dynamic components * changeset
- Loading branch information
1 parent
60148d3
commit ec8a029
Showing
5 changed files
with
40 additions
and
0 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 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: skip `is_standalone` optimisation for dynamic components |
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
5 changes: 5 additions & 0 deletions
5
packages/svelte/tests/runtime-runes/samples/member-expression-component/Row.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> | ||
let { id } = $props(); | ||
</script> | ||
|
||
<span>{id}</span> |
16 changes: 16 additions & 0 deletions
16
packages/svelte/tests/runtime-runes/samples/member-expression-component/_config.js
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,16 @@ | ||
import { flushSync } from 'svelte'; | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
html: `<button>flip</button> <span>0</span><span>1</span><span>2</span>`, | ||
|
||
async test({ assert, target }) { | ||
const button = target.querySelector('button'); | ||
|
||
flushSync(() => button?.click()); | ||
assert.htmlEqual( | ||
target.innerHTML, | ||
`<button>flip</button> <span>2</span><span>1</span><span>0</span>` | ||
); | ||
} | ||
}); |
13 changes: 13 additions & 0 deletions
13
packages/svelte/tests/runtime-runes/samples/member-expression-component/main.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,13 @@ | ||
<script> | ||
import Row from './Row.svelte'; | ||
const items = $state([{ id: 0 }, { id: 1 }, { id: 2 }]); | ||
const Table = { Row }; | ||
</script> | ||
|
||
<button onclick={() => items.reverse()}> flip </button> | ||
|
||
{#each items as item (item.id)} | ||
<Table.Row id={item.id} /> | ||
{/each} |