mirror of https://github.com/sveltejs/svelte
fix: skip `is_standalone` optimisation for dynamic components (#12767)
* fix: skip `is_standalone` optimisation for dynamic components * changesetpull/12750/head
parent
60148d3352
commit
ec8a029db4
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: skip `is_standalone` optimisation for dynamic components
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
let { id } = $props();
|
||||
</script>
|
||||
|
||||
<span>{id}</span>
|
@ -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>`
|
||||
);
|
||||
}
|
||||
});
|
@ -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}
|
Loading…
Reference in new issue