From c4a1657bd7c26e751e214eca839b4d9011707dd3 Mon Sep 17 00:00:00 2001 From: razinshafayet Date: Thu, 11 Dec 2025 18:48:59 +0600 Subject: [PATCH 1/2] chore: add regression test for issue #17277 --- .../samples/boundary-array-binding/_config.js | 25 +++++++++++++++++++ .../boundary-array-binding/main.svelte | 12 +++++++++ 2 files changed, 37 insertions(+) create mode 100644 packages/svelte/tests/runtime-runes/samples/boundary-array-binding/_config.js create mode 100644 packages/svelte/tests/runtime-runes/samples/boundary-array-binding/main.svelte diff --git a/packages/svelte/tests/runtime-runes/samples/boundary-array-binding/_config.js b/packages/svelte/tests/runtime-runes/samples/boundary-array-binding/_config.js new file mode 100644 index 000000000000..6c7dfe110d94 --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/boundary-array-binding/_config.js @@ -0,0 +1,25 @@ +export default { + // 🔴 THIS IS THE KEY: Force production mode to trigger the bug + compileOptions: { + dev: false, + immutable: true // strict mode + }, + async test({ assert, target, window }) { + // 1. Wait for the async await block to resolve + await Promise.resolve(); + await Promise.resolve(); + + const input = target.querySelector('input'); + const p = target.querySelector('p'); + + // 2. Simulate user typing "updated" + input.value = 'updated'; + input.dispatchEvent(new window.Event('input')); + + // 3. Wait for reactivity + await Promise.resolve(); + + // 4. Assert + assert.equal(p.innerHTML, 'Value: updated'); + } +}; \ No newline at end of file diff --git a/packages/svelte/tests/runtime-runes/samples/boundary-array-binding/main.svelte b/packages/svelte/tests/runtime-runes/samples/boundary-array-binding/main.svelte new file mode 100644 index 000000000000..d00d2da06133 --- /dev/null +++ b/packages/svelte/tests/runtime-runes/samples/boundary-array-binding/main.svelte @@ -0,0 +1,12 @@ + + + {}}> + {#await Promise.resolve()} + {:then} + + {/await} + + +

Value: {items[0]}

\ No newline at end of file From 2194c7ea3c99d5e098762ffcf28fcedf1cb304c7 Mon Sep 17 00:00:00 2001 From: razinshafayet Date: Thu, 11 Dec 2025 19:03:06 +0600 Subject: [PATCH 2/2] chore: fix types and formatting --- .../samples/boundary-array-binding/_config.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/svelte/tests/runtime-runes/samples/boundary-array-binding/_config.js b/packages/svelte/tests/runtime-runes/samples/boundary-array-binding/_config.js index 6c7dfe110d94..89ffb9e0d74f 100644 --- a/packages/svelte/tests/runtime-runes/samples/boundary-array-binding/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/boundary-array-binding/_config.js @@ -1,9 +1,8 @@ +// @ts-nocheck export default { - // 🔴 THIS IS THE KEY: Force production mode to trigger the bug compileOptions: { - dev: false, - immutable: true // strict mode - }, + dev: false + }, async test({ assert, target, window }) { // 1. Wait for the async await block to resolve await Promise.resolve(); @@ -15,11 +14,11 @@ export default { // 2. Simulate user typing "updated" input.value = 'updated'; input.dispatchEvent(new window.Event('input')); - + // 3. Wait for reactivity await Promise.resolve(); // 4. Assert assert.equal(p.innerHTML, 'Value: updated'); } -}; \ No newline at end of file +};