From 5dcfa1ddeea3946f27f2c48c5bbb992b05ee7752 Mon Sep 17 00:00:00 2001 From: ocavue Date: Fri, 22 Aug 2025 11:40:56 +1000 Subject: [PATCH 1/3] wip --- e2e/src/svelte.config.js | 6 ++++++ e2e/src/svelte/components/Editor.svelte | 1 + examples/svelte/svelte.config.js | 6 ++++++ packages/svelte/src/mount.ts | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/e2e/src/svelte.config.js b/e2e/src/svelte.config.js index f8c8d01e..03bfade5 100644 --- a/e2e/src/svelte.config.js +++ b/e2e/src/svelte.config.js @@ -7,4 +7,10 @@ export default { // Consult https://svelte.dev/docs#compile-time-svelte-preprocess // for more information about preprocessors preprocess: vitePreprocess(), + + compilerOptions: { + experimental: { + async: true, + }, + }, } diff --git a/e2e/src/svelte/components/Editor.svelte b/e2e/src/svelte/components/Editor.svelte index 4d6bf606..85652a32 100644 --- a/e2e/src/svelte/components/Editor.svelte +++ b/e2e/src/svelte/components/Editor.svelte @@ -63,6 +63,7 @@ const widget = getHashWidget($from.before() + 1, { side: -1, level: node.attrs.level, + ignoreSelection: true }) return DecorationSet.create(state.doc, [widget]) diff --git a/examples/svelte/svelte.config.js b/examples/svelte/svelte.config.js index 1a204af1..38e93e9a 100644 --- a/examples/svelte/svelte.config.js +++ b/examples/svelte/svelte.config.js @@ -15,6 +15,12 @@ const config = { // See https://svelte.dev/docs/kit/adapters for more information about adapters. adapter: adapter(), }, + + compilerOptions: { + experimental: { + async: true, + }, + }, } export default config diff --git a/packages/svelte/src/mount.ts b/packages/svelte/src/mount.ts index ca951767..10bd11e0 100644 --- a/packages/svelte/src/mount.ts +++ b/packages/svelte/src/mount.ts @@ -15,7 +15,7 @@ function mountFunctionComponent(UserComponent: SvelteComponentConstructor, optio // Unlike `new UserComponent()` in Svelte v4, `mount()` in Svelte v5 doesn't // call `onMount()` and action functions automatically. So we need to call // `flushSync()` to ensure they run. - svelte.flushSync() + // svelte.flushSync() return () => svelte.unmount(component) } From 2ef015e33921049526cc92818342612192f10bcb Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 22 Aug 2025 01:42:21 +0000 Subject: [PATCH 2/3] [autofix.ci] apply automated fixes --- e2e/src/svelte/components/Editor.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/src/svelte/components/Editor.svelte b/e2e/src/svelte/components/Editor.svelte index 85652a32..a36a92cb 100644 --- a/e2e/src/svelte/components/Editor.svelte +++ b/e2e/src/svelte/components/Editor.svelte @@ -63,7 +63,7 @@ const widget = getHashWidget($from.before() + 1, { side: -1, level: node.attrs.level, - ignoreSelection: true + ignoreSelection: true, }) return DecorationSet.create(state.doc, [widget]) From 1858fbfe3d4bb89123fde35bd9c73965746e78e9 Mon Sep 17 00:00:00 2001 From: ocavue Date: Sun, 7 Dec 2025 19:20:46 +1100 Subject: [PATCH 3/3] wip --- e2e/src/svelte/components/Editor.svelte | 1 - e2e/svelte.config.js | 5 +++++ packages/svelte/src/mount.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/e2e/src/svelte/components/Editor.svelte b/e2e/src/svelte/components/Editor.svelte index 1627f801..7cadab0d 100644 --- a/e2e/src/svelte/components/Editor.svelte +++ b/e2e/src/svelte/components/Editor.svelte @@ -63,7 +63,6 @@ const widget = getHashWidget($from.before() + 1, { side: -1, level: node.attrs.level, - ignoreSelection: true, }) return DecorationSet.create(state.doc, [widget]) diff --git a/e2e/svelte.config.js b/e2e/svelte.config.js index d0ce7b1e..ffdf30f8 100644 --- a/e2e/svelte.config.js +++ b/e2e/svelte.config.js @@ -2,4 +2,9 @@ import { vitePreprocess } from '@astrojs/svelte' export default { preprocess: vitePreprocess(), + compilerOptions: { + experimental: { + async: true, + }, + }, } diff --git a/packages/svelte/src/mount.ts b/packages/svelte/src/mount.ts index 10bd11e0..ca951767 100644 --- a/packages/svelte/src/mount.ts +++ b/packages/svelte/src/mount.ts @@ -15,7 +15,7 @@ function mountFunctionComponent(UserComponent: SvelteComponentConstructor, optio // Unlike `new UserComponent()` in Svelte v4, `mount()` in Svelte v5 doesn't // call `onMount()` and action functions automatically. So we need to call // `flushSync()` to ensure they run. - // svelte.flushSync() + svelte.flushSync() return () => svelte.unmount(component) }