From 1cd7102fcd4018abdc28f9a4499109a25bc28247 Mon Sep 17 00:00:00 2001 From: bluwy Date: Mon, 15 Jul 2024 16:57:07 +0800 Subject: [PATCH 1/3] Fix Svelte 5 slots change --- examples/framework-svelte/astro.config.mjs | 6 + package.json | 3 +- packages/integrations/svelte/client-v5.js | 38 +--- packages/integrations/svelte/server-v5.js | 21 +-- pnpm-lock.yaml | 201 +++++++++------------ 5 files changed, 107 insertions(+), 162 deletions(-) diff --git a/examples/framework-svelte/astro.config.mjs b/examples/framework-svelte/astro.config.mjs index 194e4591765f..2b13cb03f64c 100644 --- a/examples/framework-svelte/astro.config.mjs +++ b/examples/framework-svelte/astro.config.mjs @@ -5,4 +5,10 @@ import svelte from '@astrojs/svelte'; export default defineConfig({ // Enable Svelte to support Svelte components. integrations: [svelte()], + devToolbar: { enabled: false }, + vite: { + optimizeDeps: { + force: true, + }, + }, }); diff --git a/package.json b/package.json index e99e740da097..b0980f57b86b 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,8 @@ }, "overrides": { "organize-imports-cli>ts-morph": "^19.0.0", - "tsconfig-resolver>type-fest": "3.0.0" + "tsconfig-resolver>type-fest": "3.0.0", + "svelte": "link:../svelte/packages/svelte" }, "peerDependencyRules": { "ignoreMissing": [ diff --git a/packages/integrations/svelte/client-v5.js b/packages/integrations/svelte/client-v5.js index 755a6aa5381e..d9cc9a239bf4 100644 --- a/packages/integrations/svelte/client-v5.js +++ b/packages/integrations/svelte/client-v5.js @@ -1,22 +1,20 @@ -import { hydrate, mount, unmount } from 'svelte'; -import { add_snippet_symbol } from 'svelte/internal/client'; - -// Allow a slot to be rendered as a snippet (dev validation only) -const tagSlotAsSnippet = import.meta.env.DEV ? add_snippet_symbol : (s) => s; +import { createRawSnippet, hydrate, mount, unmount } from 'svelte'; export default (element) => { return async (Component, props, slotted, { client }) => { if (!element.hasAttribute('ssr')) return; - let children = undefined; let $$slots = undefined; for (const [key, value] of Object.entries(slotted)) { - if (key === 'default') { - children = createSlotDefinition(key, value); - } else { - $$slots ??= {}; - $$slots[key] = createSlotDefinition(key, value); - } + $$slots ??= {}; + $$slots[key] = createRawSnippet({ + mount() { + const el = document.createElement('astro-slot'); + if (key !== 'default') el.setAttribute('name', key); + el.innerHTML = value; + return el; + }, + }); } const bootstrap = client !== 'only' ? hydrate : mount; @@ -25,7 +23,6 @@ export default (element) => { target: element, props: { ...props, - children, $$slots, }, }); @@ -33,18 +30,3 @@ export default (element) => { element.addEventListener('astro:unmount', () => unmount(component), { once: true }); }; }; - -function createSlotDefinition(key, children) { - /** - * @param {Comment} $$anchor A comment node for slots in Svelte 5 - */ - const fn = ($$anchor, _$$slotProps) => { - const parent = $$anchor.parentNode; - const el = document.createElement('div'); - el.innerHTML = `${children}`; - parent.insertBefore(el.children[0], $$anchor); - }; - return tagSlotAsSnippet(fn); -} diff --git a/packages/integrations/svelte/server-v5.js b/packages/integrations/svelte/server-v5.js index 04a24eff2474..4380427dbbc7 100644 --- a/packages/integrations/svelte/server-v5.js +++ b/packages/integrations/svelte/server-v5.js @@ -1,9 +1,6 @@ -import { add_snippet_symbol } from 'svelte/internal/server'; +import { createRawSnippet } from 'svelte'; import { render } from 'svelte/server'; -// Allow a slot to be rendered as a snippet (dev validation only) -const tagSlotAsSnippet = import.meta.env.DEV ? add_snippet_symbol : (s) => s; - function check(Component) { // Svelte 5 generated components always accept these two props const str = Component.toString(); @@ -18,25 +15,21 @@ function needsHydration(metadata) { async function renderToStaticMarkup(Component, props, slotted, metadata) { const tagName = needsHydration(metadata) ? 'astro-slot' : 'astro-static-slot'; - let children = undefined; let $$slots = undefined; for (const [key, value] of Object.entries(slotted)) { - if (key === 'default') { - children = tagSlotAsSnippet(() => `<${tagName}>${value}`); - } else { - $$slots ??= {}; - $$slots[key] = tagSlotAsSnippet(() => `<${tagName} name="${key}">${value}`); - } + $$slots ??= {}; + $$slots[key] = createRawSnippet({ + render: () => `<${tagName}${key === 'default' ? '' : ` name="${key}"`}>${value}`, + }); } - const { html } = render(Component, { + const result = render(Component, { props: { ...props, - children, $$slots, }, }); - return { html }; + return { html: result.body }; } export default { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 934cd36fcb26..e938da838ff7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,7 @@ settings: overrides: organize-imports-cli>ts-morph: ^19.0.0 tsconfig-resolver>type-fest: 3.0.0 + svelte: link:../svelte/packages/svelte packageExtensionsChecksum: 43e9b7451c9943c617aef017ec172155 @@ -246,8 +247,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../svelte/packages/svelte + version: link:../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -309,8 +310,8 @@ importers: specifier: ^4.11.5 version: link:../../packages/astro svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../svelte/packages/svelte + version: link:../../../svelte/packages/svelte examples/framework-vue: dependencies: @@ -385,8 +386,8 @@ importers: specifier: ^4.11.5 version: link:../../packages/astro svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../svelte/packages/svelte + version: link:../../../svelte/packages/svelte examples/starlog: dependencies: @@ -989,8 +990,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -1113,8 +1114,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -1182,8 +1183,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -1241,8 +1242,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -1281,8 +1282,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -1321,8 +1322,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -1361,8 +1362,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -1401,8 +1402,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -1441,8 +1442,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -1607,8 +1608,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte packages/astro/e2e/fixtures/tailwindcss: dependencies: @@ -1667,8 +1668,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -1811,8 +1812,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -1832,8 +1833,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte packages/astro/test/fixtures/alias-tsconfig: dependencies: @@ -1847,8 +1848,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte packages/astro/test/fixtures/alias-tsconfig-baseurl-only: dependencies: @@ -1859,8 +1860,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte packages/astro/test/fixtures/alias-tsconfig/deps/namespace-package: {} @@ -1984,8 +1985,8 @@ importers: specifier: ^10.22.1 version: 10.22.1 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -2017,8 +2018,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte packages/astro/test/fixtures/astro-client-only/pkg: {} @@ -2109,8 +2110,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte packages/astro/test/fixtures/astro-env: dependencies: @@ -2427,8 +2428,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -2511,8 +2512,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte packages/astro/test/fixtures/component-library-shared: dependencies: @@ -2763,8 +2764,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte packages/astro/test/fixtures/css-import-as-inline: dependencies: @@ -3015,8 +3016,8 @@ importers: specifier: ^10.22.1 version: 10.22.1 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -3213,8 +3214,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -3401,8 +3402,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -3652,8 +3653,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte packages/astro/test/fixtures/slots-vue: dependencies: @@ -3977,8 +3978,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte packages/astro/test/fixtures/tailwindcss: dependencies: @@ -4100,8 +4101,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../../../svelte/packages/svelte + version: link:../../../../../../svelte/packages/svelte vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.2) @@ -5255,10 +5256,10 @@ importers: dependencies: '@sveltejs/vite-plugin-svelte': specifier: ^3.1.1 - version: 3.1.1(svelte@4.2.18)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6)) + version: 3.1.1(svelte@svelte+packages+svelte)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6)) svelte2tsx: specifier: ^0.7.13 - version: 0.7.13(svelte@4.2.18)(typescript@5.5.2) + version: 0.7.13(svelte@svelte+packages+svelte)(typescript@5.5.2) devDependencies: astro: specifier: workspace:* @@ -5267,8 +5268,8 @@ importers: specifier: workspace:* version: link:../../../scripts svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../../../svelte/packages/svelte + version: link:../../../../svelte/packages/svelte vite: specifier: ^5.3.2 version: 5.3.2(@types/node@20.12.7)(sass@1.77.6) @@ -5872,8 +5873,8 @@ importers: specifier: ^5.0.0 version: 5.0.0 svelte: - specifier: ^4.2.18 - version: 4.2.18 + specifier: link:../../svelte/packages/svelte + version: link:../../svelte/packages/svelte tar: specifier: ^7.4.0 version: 7.4.0 @@ -7221,14 +7222,14 @@ packages: engines: {node: ^18.0.0 || >=20} peerDependencies: '@sveltejs/vite-plugin-svelte': ^3.0.0 - svelte: ^4.0.0 || ^5.0.0-next.0 + svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte vite: ^5.0.0 '@sveltejs/vite-plugin-svelte@3.1.1': resolution: {integrity: sha512-rimpFEAboBBHIlzISibg94iP09k/KYdHgVhJlcsTfn7KMBhc70jFX/GRWkRdFCc2fdnk+4+Bdfej23cMDnJS6A==} engines: {node: ^18.0.0 || >=20} peerDependencies: - svelte: ^4.0.0 || ^5.0.0-next.0 + svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte vite: ^5.0.0 '@trysound/sax@0.2.0': @@ -8071,9 +8072,6 @@ packages: code-block-writer@12.0.0: resolution: {integrity: sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==} - code-red@1.0.4: - resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} - collapse-white-space@2.1.0: resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} @@ -9315,7 +9313,6 @@ packages: libsql@0.3.12: resolution: {integrity: sha512-to30hj8O3DjS97wpbKN6ERZ8k66MN1IaOfFLR6oHqd25GMiPJ/ZX0VaZ7w+TsPmxcFS3p71qArj/hiedCyvXCg==} - cpu: [x64, arm64, wasm32] os: [darwin, linux, win32] lilconfig@2.1.0: @@ -9355,9 +9352,6 @@ packages: resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} engines: {node: '>=14'} - locate-character@3.0.0: - resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} - locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -10938,18 +10932,14 @@ packages: resolution: {integrity: sha512-Gyc7cOS3VJzLlfj7wKS0ZnzDVdv3Pn2IuVeJPk9m2skfhcu5bq3wtIZyQGggr7/Iim5rH5cncyQft/kRLupcnA==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: - svelte: ^3.19.0 || ^4.0.0 + svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte svelte2tsx@0.7.13: resolution: {integrity: sha512-aObZ93/kGAiLXA/I/kP+x9FriZM+GboB/ReOIGmLNbVGEd2xC+aTCppm3mk1cc9I/z60VQf7b2QDxC3jOXu3yw==} peerDependencies: - svelte: ^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0 + svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte typescript: ^4.9.4 || ^5.0.0 - svelte@4.2.18: - resolution: {integrity: sha512-d0FdzYIiAePqRJEb90WlJDkjUEx42xhivxN8muUBmfZnP+tzUgz12DJ2hRJi8sIHCME7jeK1PTMgKPSfTd8JrA==} - engines: {node: '>=16'} - svg-tags@1.0.0: resolution: {integrity: sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==} @@ -13149,24 +13139,24 @@ snapshots: dependencies: solid-js: 1.8.18 - '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6)))(svelte@4.2.18)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6))': + '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@svelte+packages+svelte)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6)))(svelte@svelte+packages+svelte)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.1(svelte@4.2.18)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6)) + '@sveltejs/vite-plugin-svelte': 3.1.1(svelte@svelte+packages+svelte)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6)) debug: 4.3.5 - svelte: 4.2.18 + svelte: link:../svelte/packages/svelte vite: 5.3.2(@types/node@20.12.7)(sass@1.77.6) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6))': + '@sveltejs/vite-plugin-svelte@3.1.1(svelte@svelte+packages+svelte)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6)))(svelte@4.2.18)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6)) + '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@svelte+packages+svelte)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6)))(svelte@svelte+packages+svelte)(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6)) debug: 4.3.5 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.10 - svelte: 4.2.18 - svelte-hmr: 0.16.0(svelte@4.2.18) + svelte: link:../svelte/packages/svelte + svelte-hmr: 0.16.0(svelte@svelte+packages+svelte) vite: 5.3.2(@types/node@20.12.7)(sass@1.77.6) vitefu: 0.2.5(vite@5.3.2(@types/node@20.12.7)(sass@1.77.6)) transitivePeerDependencies: @@ -14210,14 +14200,6 @@ snapshots: code-block-writer@12.0.0: {} - code-red@1.0.4: - dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 - '@types/estree': 1.0.5 - acorn: 8.12.0 - estree-walker: 3.0.3 - periscopic: 3.1.0 - collapse-white-space@2.1.0: {} color-convert@1.9.3: @@ -15574,8 +15556,6 @@ snapshots: mlly: 1.6.1 pkg-types: 1.0.3 - locate-character@3.0.0: {} - locate-path@5.0.0: dependencies: p-locate: 4.1.0 @@ -17570,34 +17550,17 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-hmr@0.16.0(svelte@4.2.18): + svelte-hmr@0.16.0(svelte@svelte+packages+svelte): dependencies: - svelte: 4.2.18 + svelte: link:../svelte/packages/svelte - svelte2tsx@0.7.13(svelte@4.2.18)(typescript@5.5.2): + svelte2tsx@0.7.13(svelte@svelte+packages+svelte)(typescript@5.5.2): dependencies: dedent-js: 1.0.1 pascal-case: 3.1.2 - svelte: 4.2.18 + svelte: link:../svelte/packages/svelte typescript: 5.5.2 - svelte@4.2.18: - dependencies: - '@ampproject/remapping': 2.3.0 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.25 - '@types/estree': 1.0.5 - acorn: 8.12.0 - aria-query: 5.3.0 - axobject-query: 4.0.0 - code-red: 1.0.4 - css-tree: 2.3.1 - estree-walker: 3.0.3 - is-reference: 3.0.2 - locate-character: 3.0.0 - magic-string: 0.30.10 - periscopic: 3.1.0 - svg-tags@1.0.0: {} svgo@3.2.0: From 3b53c638ccc48b532c77b9e9da9cfb7ab23b31d6 Mon Sep 17 00:00:00 2001 From: bluwy Date: Wed, 17 Jul 2024 16:48:40 +0800 Subject: [PATCH 2/3] Use alternative --- packages/integrations/svelte/client-v5.js | 20 ++++++++++++-------- packages/integrations/svelte/server-v5.js | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/packages/integrations/svelte/client-v5.js b/packages/integrations/svelte/client-v5.js index d9cc9a239bf4..fda68ee54878 100644 --- a/packages/integrations/svelte/client-v5.js +++ b/packages/integrations/svelte/client-v5.js @@ -4,17 +4,20 @@ export default (element) => { return async (Component, props, slotted, { client }) => { if (!element.hasAttribute('ssr')) return; + let children = undefined; let $$slots = undefined; for (const [key, value] of Object.entries(slotted)) { $$slots ??= {}; - $$slots[key] = createRawSnippet({ - mount() { - const el = document.createElement('astro-slot'); - if (key !== 'default') el.setAttribute('name', key); - el.innerHTML = value; - return el; - }, - }); + if (key === 'default') { + $$slots.default = true; + children = createRawSnippet(() => ({ + render: () => `${value}`, + })); + } else { + $$slots[key] = createRawSnippet(() => ({ + render: () => `${value}`, + })); + } } const bootstrap = client !== 'only' ? hydrate : mount; @@ -23,6 +26,7 @@ export default (element) => { target: element, props: { ...props, + children, $$slots, }, }); diff --git a/packages/integrations/svelte/server-v5.js b/packages/integrations/svelte/server-v5.js index 4380427dbbc7..acffd10dfef0 100644 --- a/packages/integrations/svelte/server-v5.js +++ b/packages/integrations/svelte/server-v5.js @@ -15,17 +15,26 @@ function needsHydration(metadata) { async function renderToStaticMarkup(Component, props, slotted, metadata) { const tagName = needsHydration(metadata) ? 'astro-slot' : 'astro-static-slot'; + let children = undefined; let $$slots = undefined; for (const [key, value] of Object.entries(slotted)) { $$slots ??= {}; - $$slots[key] = createRawSnippet({ - render: () => `<${tagName}${key === 'default' ? '' : ` name="${key}"`}>${value}`, - }); + if (key === 'default') { + $$slots.default = true; + children = createRawSnippet(() => ({ + render: () => `<${tagName}>${value}`, + })); + } else { + $$slots[key] = createRawSnippet(() => ({ + render: () => `<${tagName} name="${key}">${value}`, + })); + } } const result = render(Component, { props: { ...props, + children, $$slots, }, }); From daefd5769506dfa3abc77d5b1f07a23cacacdda0 Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 18 Jul 2024 20:21:22 +0800 Subject: [PATCH 3/3] Fix Svelte 5 slots --- .changeset/nine-carpets-doubt.md | 5 + examples/framework-svelte/astro.config.mjs | 6 - package.json | 3 +- packages/integrations/svelte/package.json | 2 +- pnpm-lock.yaml | 208 ++++++++++++--------- 5 files changed, 129 insertions(+), 95 deletions(-) create mode 100644 .changeset/nine-carpets-doubt.md diff --git a/.changeset/nine-carpets-doubt.md b/.changeset/nine-carpets-doubt.md new file mode 100644 index 000000000000..5abe918afe65 --- /dev/null +++ b/.changeset/nine-carpets-doubt.md @@ -0,0 +1,5 @@ +--- +'@astrojs/svelte': minor +--- + +Bumps Svelte 5 peer dependency to `^5.0.0-next.190` and support the latest slots/snippets API diff --git a/examples/framework-svelte/astro.config.mjs b/examples/framework-svelte/astro.config.mjs index 2b13cb03f64c..194e4591765f 100644 --- a/examples/framework-svelte/astro.config.mjs +++ b/examples/framework-svelte/astro.config.mjs @@ -5,10 +5,4 @@ import svelte from '@astrojs/svelte'; export default defineConfig({ // Enable Svelte to support Svelte components. integrations: [svelte()], - devToolbar: { enabled: false }, - vite: { - optimizeDeps: { - force: true, - }, - }, }); diff --git a/package.json b/package.json index baeb1f7e871f..d1948fb2bb06 100644 --- a/package.json +++ b/package.json @@ -91,8 +91,7 @@ }, "overrides": { "organize-imports-cli>ts-morph": "^19.0.0", - "tsconfig-resolver>type-fest": "3.0.0", - "svelte": "link:../svelte/packages/svelte" + "tsconfig-resolver>type-fest": "3.0.0" }, "peerDependencyRules": { "ignoreMissing": [ diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index 7d544328aca7..521daae536e3 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -61,7 +61,7 @@ }, "peerDependencies": { "astro": "^4.0.0", - "svelte": "^4.0.0 || ^5.0.0-next.90", + "svelte": "^4.0.0 || ^5.0.0-next.190", "typescript": "^5.3.3" }, "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 897ab681df38..b73390f55349 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,7 +7,6 @@ settings: overrides: organize-imports-cli>ts-morph: ^19.0.0 tsconfig-resolver>type-fest: 3.0.0 - svelte: link:../svelte/packages/svelte packageExtensionsChecksum: 43e9b7451c9943c617aef017ec172155 @@ -247,8 +246,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../svelte/packages/svelte - version: link:../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -310,8 +309,8 @@ importers: specifier: ^4.11.6 version: link:../../packages/astro svelte: - specifier: link:../../../svelte/packages/svelte - version: link:../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 examples/framework-vue: dependencies: @@ -425,8 +424,8 @@ importers: specifier: ^4.11.6 version: link:../../packages/astro svelte: - specifier: link:../../../svelte/packages/svelte - version: link:../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 examples/starlog: dependencies: @@ -1029,8 +1028,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1153,8 +1152,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1222,8 +1221,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1281,8 +1280,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1321,8 +1320,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1361,8 +1360,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1401,8 +1400,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1441,8 +1440,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1481,8 +1480,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1668,8 +1667,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/e2e/fixtures/tailwindcss: dependencies: @@ -1728,8 +1727,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1872,8 +1871,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1893,8 +1892,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/alias-tsconfig: dependencies: @@ -1908,8 +1907,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/alias-tsconfig-baseurl-only: dependencies: @@ -1920,8 +1919,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/alias-tsconfig/deps/namespace-package: {} @@ -2045,8 +2044,8 @@ importers: specifier: ^10.22.1 version: 10.22.1 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -2078,8 +2077,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/astro-client-only/pkg: {} @@ -2170,8 +2169,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/astro-env: dependencies: @@ -2494,8 +2493,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -2578,8 +2577,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/component-library-shared: dependencies: @@ -2830,8 +2829,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/css-import-as-inline: dependencies: @@ -3082,8 +3081,8 @@ importers: specifier: ^10.22.1 version: 10.22.1 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -3280,8 +3279,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -3468,8 +3467,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -3662,8 +3661,8 @@ importers: specifier: workspace:* version: link:../../../.. svelte: - specifier: link:../../../../../../../svelte/packages/svelte - version: link:../../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/server-islands/ssr: dependencies: @@ -3674,8 +3673,8 @@ importers: specifier: workspace:* version: link:../../../.. svelte: - specifier: link:../../../../../../../svelte/packages/svelte - version: link:../../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/set-html: dependencies: @@ -3743,8 +3742,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/slots-vue: dependencies: @@ -4068,8 +4067,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/tailwindcss: dependencies: @@ -4191,8 +4190,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -5352,10 +5351,10 @@ importers: dependencies: '@sveltejs/vite-plugin-svelte': specifier: ^3.1.1 - version: 3.1.1(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) + version: 3.1.1(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) svelte2tsx: specifier: ^0.7.13 - version: 0.7.13(svelte@svelte+packages+svelte)(typescript@5.5.3) + version: 0.7.13(svelte@4.2.18)(typescript@5.5.3) devDependencies: astro: specifier: workspace:* @@ -5364,8 +5363,8 @@ importers: specifier: workspace:* version: link:../../../scripts svelte: - specifier: link:../../../../svelte/packages/svelte - version: link:../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vite: specifier: ^5.3.4 version: 5.3.4(@types/node@20.12.7)(sass@1.77.8) @@ -5969,8 +5968,8 @@ importers: specifier: ^6.1.0 version: 6.1.0 svelte: - specifier: link:../../svelte/packages/svelte - version: link:../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 tar: specifier: ^7.4.0 version: 7.4.0 @@ -7318,14 +7317,14 @@ packages: engines: {node: ^18.0.0 || >=20} peerDependencies: '@sveltejs/vite-plugin-svelte': ^3.0.0 - svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte + svelte: ^4.0.0 || ^5.0.0-next.0 vite: ^5.0.0 '@sveltejs/vite-plugin-svelte@3.1.1': resolution: {integrity: sha512-rimpFEAboBBHIlzISibg94iP09k/KYdHgVhJlcsTfn7KMBhc70jFX/GRWkRdFCc2fdnk+4+Bdfej23cMDnJS6A==} engines: {node: ^18.0.0 || >=20} peerDependencies: - svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte + svelte: ^4.0.0 || ^5.0.0-next.0 vite: ^5.0.0 '@tailwindcss/forms@0.5.7': @@ -8168,6 +8167,9 @@ packages: code-block-writer@12.0.0: resolution: {integrity: sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==} + code-red@1.0.4: + resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} + collapse-white-space@2.1.0: resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} @@ -9447,6 +9449,9 @@ packages: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} + locate-character@3.0.0: + resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} + locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -11012,14 +11017,18 @@ packages: resolution: {integrity: sha512-Gyc7cOS3VJzLlfj7wKS0ZnzDVdv3Pn2IuVeJPk9m2skfhcu5bq3wtIZyQGggr7/Iim5rH5cncyQft/kRLupcnA==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: - svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte + svelte: ^3.19.0 || ^4.0.0 svelte2tsx@0.7.13: resolution: {integrity: sha512-aObZ93/kGAiLXA/I/kP+x9FriZM+GboB/ReOIGmLNbVGEd2xC+aTCppm3mk1cc9I/z60VQf7b2QDxC3jOXu3yw==} peerDependencies: - svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte + svelte: ^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0 typescript: ^4.9.4 || ^5.0.0 + svelte@4.2.18: + resolution: {integrity: sha512-d0FdzYIiAePqRJEb90WlJDkjUEx42xhivxN8muUBmfZnP+tzUgz12DJ2hRJi8sIHCME7jeK1PTMgKPSfTd8JrA==} + engines: {node: '>=16'} + svg-tags@1.0.0: resolution: {integrity: sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==} @@ -13219,24 +13228,24 @@ snapshots: dependencies: solid-js: 1.8.18 - '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)))(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8))': + '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)))(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.1(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) + '@sveltejs/vite-plugin-svelte': 3.1.1(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) debug: 4.3.5 - svelte: link:../svelte/packages/svelte + svelte: 4.2.18 vite: 5.3.4(@types/node@20.12.7)(sass@1.77.8) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.1.1(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8))': + '@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)))(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) + '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)))(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) debug: 4.3.5 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.10 - svelte: link:../svelte/packages/svelte - svelte-hmr: 0.16.0(svelte@svelte+packages+svelte) + svelte: 4.2.18 + svelte-hmr: 0.16.0(svelte@4.2.18) vite: 5.3.4(@types/node@20.12.7)(sass@1.77.8) vitefu: 0.2.5(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) transitivePeerDependencies: @@ -14275,6 +14284,14 @@ snapshots: code-block-writer@12.0.0: {} + code-red@1.0.4: + dependencies: + '@jridgewell/sourcemap-codec': 1.4.15 + '@types/estree': 1.0.5 + acorn: 8.12.1 + estree-walker: 3.0.3 + periscopic: 3.1.0 + collapse-white-space@2.1.0: {} color-convert@1.9.3: @@ -15622,6 +15639,8 @@ snapshots: pify: 4.0.1 strip-bom: 3.0.0 + locate-character@3.0.0: {} + locate-path@5.0.0: dependencies: p-locate: 4.1.0 @@ -17594,17 +17613,34 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-hmr@0.16.0(svelte@svelte+packages+svelte): + svelte-hmr@0.16.0(svelte@4.2.18): dependencies: - svelte: link:../svelte/packages/svelte + svelte: 4.2.18 - svelte2tsx@0.7.13(svelte@svelte+packages+svelte)(typescript@5.5.3): + svelte2tsx@0.7.13(svelte@4.2.18)(typescript@5.5.3): dependencies: dedent-js: 1.0.1 pascal-case: 3.1.2 - svelte: link:../svelte/packages/svelte + svelte: 4.2.18 typescript: 5.5.3 + svelte@4.2.18: + dependencies: + '@ampproject/remapping': 2.3.0 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.25 + '@types/estree': 1.0.5 + acorn: 8.12.1 + aria-query: 5.3.0 + axobject-query: 4.1.0 + code-red: 1.0.4 + css-tree: 2.3.1 + estree-walker: 3.0.3 + is-reference: 3.0.2 + locate-character: 3.0.0 + magic-string: 0.30.10 + periscopic: 3.1.0 + svg-tags@1.0.0: {} svgo@3.2.0: