From 5c98047445f98a57bfe40acbc5627c1f32663216 Mon Sep 17 00:00:00 2001 From: Jacob Jenkins Date: Fri, 1 Nov 2024 01:48:14 +0000 Subject: [PATCH 01/15] Removes Svelte v4 code --- packages/integrations/svelte/client-v5.js | 45 ------ packages/integrations/svelte/client.js | 148 ++++-------------- packages/integrations/svelte/package.json | 124 +++++++-------- packages/integrations/svelte/server-v5.d.ts | 2 - packages/integrations/svelte/server-v5.js | 48 ------ packages/integrations/svelte/server.js | 35 ++++- packages/integrations/svelte/src/index.ts | 56 +++---- .../svelte-component/astro.config.mjs | 7 + .../fixtures/svelte-component/package.json | 10 ++ .../src/components/TestComponent.svelte | 9 ++ .../svelte-component/src/pages/index.astro | 7 + .../svelte/test/svelte-component.test.js | 28 ++++ pnpm-lock.yaml | 119 ++++++++++---- 13 files changed, 291 insertions(+), 347 deletions(-) delete mode 100644 packages/integrations/svelte/client-v5.js delete mode 100644 packages/integrations/svelte/server-v5.d.ts delete mode 100644 packages/integrations/svelte/server-v5.js create mode 100644 packages/integrations/svelte/test/fixtures/svelte-component/astro.config.mjs create mode 100644 packages/integrations/svelte/test/fixtures/svelte-component/package.json create mode 100644 packages/integrations/svelte/test/fixtures/svelte-component/src/components/TestComponent.svelte create mode 100644 packages/integrations/svelte/test/fixtures/svelte-component/src/pages/index.astro create mode 100644 packages/integrations/svelte/test/svelte-component.test.js diff --git a/packages/integrations/svelte/client-v5.js b/packages/integrations/svelte/client-v5.js deleted file mode 100644 index 7a046b5bfd08..000000000000 --- a/packages/integrations/svelte/client-v5.js +++ /dev/null @@ -1,45 +0,0 @@ -import { createRawSnippet, hydrate, mount, unmount } from 'svelte'; - -const existingApplications = new WeakMap(); - -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 ??= {}; - if (key === 'default') { - $$slots.default = true; - children = createRawSnippet(() => ({ - render: () => `${value}`, - })); - } else { - $$slots[key] = createRawSnippet(() => ({ - render: () => `${value}`, - })); - } - } - - const bootstrap = client !== 'only' ? hydrate : mount; - if (existingApplications.has(element)) { - existingApplications.get(element).$set({ - ...props, - children, - $$slots, - }); - } else { - const component = bootstrap(Component, { - target: element, - props: { - ...props, - children, - $$slots, - }, - }); - existingApplications.set(element, component); - element.addEventListener('astro:unmount', () => unmount(component), { once: true }); - } - }; -}; diff --git a/packages/integrations/svelte/client.js b/packages/integrations/svelte/client.js index 288c7a661b6f..7a046b5bfd08 100644 --- a/packages/integrations/svelte/client.js +++ b/packages/integrations/svelte/client.js @@ -1,125 +1,45 @@ -const noop = () => {}; - -let originalConsoleWarning; -let consoleFilterRefs = 0; +import { createRawSnippet, hydrate, mount, unmount } from 'svelte'; const existingApplications = new WeakMap(); export default (element) => { - return (Component, props, slotted, { client }) => { + return async (Component, props, slotted, { client }) => { if (!element.hasAttribute('ssr')) return; - const slots = {}; - for (const [key, value] of Object.entries(slotted)) { - slots[key] = createSlotDefinition(key, value); - } - try { - if (import.meta.env.DEV) useConsoleFilter(); - - if (existingApplications.has(element)) { - existingApplications.get(element).$set({ ...props, $$slots: slots, $$scope: { ctx: [] } }); + let children = undefined; + let $$slots = undefined; + for (const [key, value] of Object.entries(slotted)) { + $$slots ??= {}; + if (key === 'default') { + $$slots.default = true; + children = createRawSnippet(() => ({ + render: () => `${value}`, + })); } else { - const component = new Component({ - target: element, - props: { - ...props, - $$slots: slots, - $$scope: { ctx: [] }, - }, - hydrate: client !== 'only', - $$inline: true, - }); - existingApplications.set(element, component); - - element.addEventListener('astro:unmount', () => component.$destroy(), { once: true }); + $$slots[key] = createRawSnippet(() => ({ + render: () => `${value}`, + })); } - } finally { - if (import.meta.env.DEV) finishUsingConsoleFilter(); } - }; -}; - -function createSlotDefinition(key, children) { - let parent; - return [ - () => ({ - // mount - m(target) { - parent = target; - target.insertAdjacentHTML( - 'beforeend', - `${children}`, - ); - }, - // create - c: noop, - // hydrate - l: noop, - // destroy - d() { - if (!parent) return; - const slot = parent.querySelector( - `astro-slot${key === 'default' ? ':not([name])' : `[name="${key}"]`}`, - ); - if (slot) slot.remove(); - }, - }), - noop, - noop, - ]; -} -/** - * Reduces console noise by filtering known non-problematic warnings. - * - * Performs reference counting to allow parallel usage from async code. - * - * To stop filtering, please ensure that there always is a matching call - * to `finishUsingConsoleFilter` afterwards. - */ -function useConsoleFilter() { - consoleFilterRefs++; - - if (!originalConsoleWarning) { - originalConsoleWarning = console.warn; - try { - console.warn = filteredConsoleWarning; - } catch { - // If we're unable to hook `console.warn`, just accept it + const bootstrap = client !== 'only' ? hydrate : mount; + if (existingApplications.has(element)) { + existingApplications.get(element).$set({ + ...props, + children, + $$slots, + }); + } else { + const component = bootstrap(Component, { + target: element, + props: { + ...props, + children, + $$slots, + }, + }); + existingApplications.set(element, component); + element.addEventListener('astro:unmount', () => unmount(component), { once: true }); } - } -} - -/** - * Indicates that the filter installed by `useConsoleFilter` - * is no longer needed by the calling code. - */ -function finishUsingConsoleFilter() { - consoleFilterRefs--; - - // Note: Instead of reverting `console.warning` back to the original - // when the reference counter reaches 0, we leave our hook installed - // to prevent potential race conditions once `check` is made async -} - -/** - * Hook/wrapper function for the global `console.warning` function. - * - * Ignores known non-problematic errors while any code is using the console filter. - * Otherwise, simply forwards all arguments to the original function. - */ -function filteredConsoleWarning(msg, ...rest) { - if (consoleFilterRefs > 0 && typeof msg === 'string') { - // Astro passes `class` and `data-astro-cid` props to the Svelte component, which - // outputs the following warning, which we can safely filter out. - - // NOTE: In practice data-astro-cid props have a hash suffix. Hence the use of a - // quoted prop name string without a closing quote. - - const isKnownSvelteError = - msg.endsWith("was created with unknown prop 'class'") || - msg.includes("was created with unknown prop 'data-astro-cid"); - if (isKnownSvelteError) return; - } - originalConsoleWarning(msg, ...rest); -} + }; +}; diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index 9eccc4fe7667..a4c95ca7a9aa 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -1,73 +1,55 @@ { - "name": "@astrojs/svelte", - "version": "5.7.2", - "description": "Use Svelte components within Astro", - "type": "module", - "types": "./dist/index.d.ts", - "author": "withastro", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/withastro/astro.git", - "directory": "packages/integrations/svelte" - }, - "keywords": [ - "astro-integration", - "astro-component", - "renderer", - "svelte" - ], - "bugs": "https://github.com/withastro/astro/issues", - "homepage": "https://docs.astro.build/en/guides/integrations-guide/svelte/", - "exports": { - ".": "./dist/index.js", - "./editor": "./dist/editor.cjs", - "./*": "./*", - "./client.js": "./client.js", - "./client-v5.js": "./client-v5.js", - "./server.js": { - "default": "./server.js", - "types": "./server.d.ts" - }, - "./server-v5.js": { - "default": "./server-v5.js", - "types": "./server-v5.d.ts" - }, - "./package.json": "./package.json" - }, - "files": [ - "dist", - "client.js", - "client-v5.js", - "server.js", - "server.d.ts", - "server-v5.js", - "server-v5.d.ts" - ], - "scripts": { - "build": "astro-scripts build \"src/index.ts\" && astro-scripts build \"src/editor.cts\" --force-cjs --no-clean-dist && tsc", - "build:ci": "astro-scripts build \"src/**/*.ts\" && astro-scripts build \"src/editor.cts\" --force-cjs --no-clean-dist", - "dev": "astro-scripts dev \"src/**/*.ts\"" - }, - "dependencies": { - "@sveltejs/vite-plugin-svelte": "^3.1.2", - "svelte2tsx": "^0.7.22" - }, - "devDependencies": { - "astro": "workspace:*", - "astro-scripts": "workspace:*", - "svelte": "^4.2.19", - "vite": "^5.4.10" - }, - "peerDependencies": { - "astro": "^4.0.0", - "svelte": "^4.0.0 || ^5.0.0-next.190", - "typescript": "^5.3.3" - }, - "engines": { - "node": "^18.17.1 || ^20.3.0 || >=21.0.0" - }, - "publishConfig": { - "provenance": true - } + "name": "@astrojs/svelte", + "version": "5.7.2", + "description": "Use Svelte components within Astro", + "type": "module", + "types": "./dist/index.d.ts", + "author": "withastro", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/withastro/astro.git", + "directory": "packages/integrations/svelte" + }, + "keywords": ["astro-integration", "astro-component", "renderer", "svelte"], + "bugs": "https://github.com/withastro/astro/issues", + "homepage": "https://docs.astro.build/en/guides/integrations-guide/svelte/", + "exports": { + ".": "./dist/index.js", + "./editor": "./dist/editor.cjs", + "./*": "./*", + "./client.js": "./client.js", + "./server.js": { + "default": "./server.js", + "types": "./server.d.ts" + }, + "./package.json": "./package.json" + }, + "files": ["dist", "client.js", "server.js", "server.d.ts"], + "scripts": { + "build": "astro-scripts build \"src/index.ts\" && astro-scripts build \"src/editor.cts\" --force-cjs --no-clean-dist && tsc", + "build:ci": "astro-scripts build \"src/**/*.ts\" && astro-scripts build \"src/editor.cts\" --force-cjs --no-clean-dist", + "dev": "astro-scripts dev \"src/**/*.ts\"", + "test": "astro-scripts test \"test/**/*.test.js\"" + }, + "dependencies": { + "@sveltejs/vite-plugin-svelte": "^4.0.0", + "svelte2tsx": "^0.7.22" + }, + "devDependencies": { + "astro": "workspace:*", + "astro-scripts": "workspace:*", + "svelte": "^5.1.9", + "cheerio": "1.0.0", + "vite": "^5.4.10" + }, + "peerDependencies": { + "svelte": "^5.1.9" + }, + "engines": { + "node": "^18.17.1 || ^20.3.0 || >=21.0.0" + }, + "publishConfig": { + "provenance": true + } } diff --git a/packages/integrations/svelte/server-v5.d.ts b/packages/integrations/svelte/server-v5.d.ts deleted file mode 100644 index bb2f29556c14..000000000000 --- a/packages/integrations/svelte/server-v5.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { NamedSSRLoadedRendererValue } from 'astro'; -export default NamedSSRLoadedRendererValue; diff --git a/packages/integrations/svelte/server-v5.js b/packages/integrations/svelte/server-v5.js deleted file mode 100644 index acffd10dfef0..000000000000 --- a/packages/integrations/svelte/server-v5.js +++ /dev/null @@ -1,48 +0,0 @@ -import { createRawSnippet } from 'svelte'; -import { render } from 'svelte/server'; - -function check(Component) { - // Svelte 5 generated components always accept these two props - const str = Component.toString(); - return str.includes('$$payload') && str.includes('$$props'); -} - -function needsHydration(metadata) { - // Adjust how this is hydrated only when the version of Astro supports `astroStaticSlot` - return metadata.astroStaticSlot ? !!metadata.hydrate : true; -} - -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 ??= {}; - 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, - }, - }); - return { html: result.body }; -} - -export default { - check, - renderToStaticMarkup, - supportsAstroStaticSlot: true, -}; diff --git a/packages/integrations/svelte/server.js b/packages/integrations/svelte/server.js index 9878d3b59dcf..acffd10dfef0 100644 --- a/packages/integrations/svelte/server.js +++ b/packages/integrations/svelte/server.js @@ -1,5 +1,10 @@ +import { createRawSnippet } from 'svelte'; +import { render } from 'svelte/server'; + function check(Component) { - return Component['render'] && Component['$$render']; + // Svelte 5 generated components always accept these two props + const str = Component.toString(); + return str.includes('$$payload') && str.includes('$$props'); } function needsHydration(metadata) { @@ -9,13 +14,31 @@ function needsHydration(metadata) { async function renderToStaticMarkup(Component, props, slotted, metadata) { const tagName = needsHydration(metadata) ? 'astro-slot' : 'astro-static-slot'; - const slots = {}; + + let children = undefined; + let $$slots = undefined; for (const [key, value] of Object.entries(slotted)) { - slots[key] = () => - `<${tagName}${key === 'default' ? '' : ` name="${key}"`}>${value}`; + $$slots ??= {}; + if (key === 'default') { + $$slots.default = true; + children = createRawSnippet(() => ({ + render: () => `<${tagName}>${value}`, + })); + } else { + $$slots[key] = createRawSnippet(() => ({ + render: () => `<${tagName} name="${key}">${value}`, + })); + } } - const { html } = Component.render(props, { $$slots: slots }); - return { html }; + + const result = render(Component, { + props: { + ...props, + children, + $$slots, + }, + }); + return { html: result.body }; } export default { diff --git a/packages/integrations/svelte/src/index.ts b/packages/integrations/svelte/src/index.ts index b0db3505c83a..84126877efd3 100644 --- a/packages/integrations/svelte/src/index.ts +++ b/packages/integrations/svelte/src/index.ts @@ -1,29 +1,30 @@ -import { fileURLToPath } from 'node:url'; -import type { Options } from '@sveltejs/vite-plugin-svelte'; -import { svelte, vitePreprocess } from '@sveltejs/vite-plugin-svelte'; -import type { AstroIntegration, AstroRenderer, ContainerRenderer } from 'astro'; -import { VERSION } from 'svelte/compiler'; -import type { UserConfig } from 'vite'; - -const isSvelte5 = Number.parseInt(VERSION.split('.').at(0)!) >= 5; +import { fileURLToPath } from "node:url"; +import type { Options } from "@sveltejs/vite-plugin-svelte"; +import { svelte, vitePreprocess } from "@sveltejs/vite-plugin-svelte"; +import type { AstroIntegration, AstroRenderer, ContainerRenderer } from "astro"; +import type { UserConfig } from "vite"; function getRenderer(): AstroRenderer { return { - name: '@astrojs/svelte', - clientEntrypoint: isSvelte5 ? '@astrojs/svelte/client-v5.js' : '@astrojs/svelte/client.js', - serverEntrypoint: isSvelte5 ? '@astrojs/svelte/server-v5.js' : '@astrojs/svelte/server.js', + name: "@astrojs/svelte", + clientEntrypoint: "@astrojs/svelte/client.js", + serverEntrypoint: "@astrojs/svelte/server.js", }; } export function getContainerRenderer(): ContainerRenderer { return { - name: '@astrojs/svelte', - serverEntrypoint: isSvelte5 ? '@astrojs/svelte/server-v5.js' : '@astrojs/svelte/server.js', + name: "@astrojs/svelte", + serverEntrypoint: "@astrojs/svelte/server.js", }; } async function svelteConfigHasPreprocess(root: URL) { - const svelteConfigFiles = ['./svelte.config.js', './svelte.config.cjs', './svelte.config.mjs']; + const svelteConfigFiles = [ + "./svelte.config.js", + "./svelte.config.cjs", + "./svelte.config.mjs", + ]; for (const file of svelteConfigFiles) { const filePath = fileURLToPath(new URL(file, root)); try { @@ -50,12 +51,6 @@ async function getViteConfiguration({ compilerOptions: { dev: isDev }, }; - // `hydratable` does not need to be set in Svelte 5 as it's always hydratable by default - if (!isSvelte5) { - // @ts-ignore ignore Partial type above - defaultOptions.compilerOptions.hydratable = true; - } - // Disable hot mode during the build if (!isDev) { defaultOptions.hot = false; @@ -65,7 +60,7 @@ async function getViteConfiguration({ if (!options) { resolvedOptions = defaultOptions; - } else if (typeof options === 'function') { + } else if (typeof options === "function") { resolvedOptions = options(defaultOptions); } else { resolvedOptions = { @@ -85,25 +80,32 @@ async function getViteConfiguration({ return { optimizeDeps: { - include: [isSvelte5 ? '@astrojs/svelte/client-v5.js' : '@astrojs/svelte/client.js'], - exclude: [isSvelte5 ? '@astrojs/svelte/server-v5.js' : '@astrojs/svelte/server.js'], + include: ["@astrojs/svelte/client.js"], + exclude: ["@astrojs/svelte/server.js"], }, plugins: [svelte(resolvedOptions)], }; } type OptionsCallback = (defaultOptions: Options) => Options; -export default function (options?: Options | OptionsCallback): AstroIntegration { +export default function ( + options?: Options | OptionsCallback, +): AstroIntegration { return { - name: '@astrojs/svelte', + name: "@astrojs/svelte", hooks: { // Anything that gets returned here is merged into Astro Config - 'astro:config:setup': async ({ command, updateConfig, addRenderer, config }) => { + "astro:config:setup": async ({ + command, + updateConfig, + addRenderer, + config, + }) => { addRenderer(getRenderer()); updateConfig({ vite: await getViteConfiguration({ options, - isDev: command === 'dev', + isDev: command === "dev", root: config.root, }), }); diff --git a/packages/integrations/svelte/test/fixtures/svelte-component/astro.config.mjs b/packages/integrations/svelte/test/fixtures/svelte-component/astro.config.mjs new file mode 100644 index 000000000000..e720c84f8794 --- /dev/null +++ b/packages/integrations/svelte/test/fixtures/svelte-component/astro.config.mjs @@ -0,0 +1,7 @@ +import svelte from "@astrojs/svelte"; +import { defineConfig } from "astro/config"; + +// https://astro.build/config +export default defineConfig({ + integrations: [svelte()], +}); diff --git a/packages/integrations/svelte/test/fixtures/svelte-component/package.json b/packages/integrations/svelte/test/fixtures/svelte-component/package.json new file mode 100644 index 000000000000..e404ba86ac50 --- /dev/null +++ b/packages/integrations/svelte/test/fixtures/svelte-component/package.json @@ -0,0 +1,10 @@ +{ + "name": "@test/svelte-component", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/svelte": "workspace:*", + "astro": "workspace:*", + "svelte": "^5.1.9" + } +} diff --git a/packages/integrations/svelte/test/fixtures/svelte-component/src/components/TestComponent.svelte b/packages/integrations/svelte/test/fixtures/svelte-component/src/components/TestComponent.svelte new file mode 100644 index 000000000000..a0d1b0952153 --- /dev/null +++ b/packages/integrations/svelte/test/fixtures/svelte-component/src/components/TestComponent.svelte @@ -0,0 +1,9 @@ + + +

Hello from Svelte!

+

{subheading}

+

{count}

diff --git a/packages/integrations/svelte/test/fixtures/svelte-component/src/pages/index.astro b/packages/integrations/svelte/test/fixtures/svelte-component/src/pages/index.astro new file mode 100644 index 000000000000..550afb7bc105 --- /dev/null +++ b/packages/integrations/svelte/test/fixtures/svelte-component/src/pages/index.astro @@ -0,0 +1,7 @@ +--- +import TestComponent from '../components/TestComponent.svelte' + +const subheading = "Hello world! From Astro!" +--- + + diff --git a/packages/integrations/svelte/test/svelte-component.test.js b/packages/integrations/svelte/test/svelte-component.test.js new file mode 100644 index 000000000000..96b275e2196b --- /dev/null +++ b/packages/integrations/svelte/test/svelte-component.test.js @@ -0,0 +1,28 @@ +import assert from "node:assert/strict"; +import { after, before, describe, it } from "node:test"; +import { load as cheerioLoad } from "cheerio"; +import { isWindows, loadFixture } from "../../../astro/test/test-utils.js"; + +let fixture; + +describe("React Components", () => { + before(async () => { + fixture = await loadFixture({ + root: new URL("./fixtures/svelte-component/", import.meta.url), + }); + }); + + describe("build", () => { + before(async () => { + await fixture.build(); + }); + + it("Should hyrade a Svelte component", async () => { + const html = await fixture.readFile("/index.html"); + const $ = cheerioLoad(html); + + // test 1: basic component renders + assert.equal($("#my-heading").text(), "Hello from Svelte!"); + }); + }); +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 85f984d02a29..7f397c825259 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5141,11 +5141,11 @@ importers: packages/integrations/svelte: dependencies: '@sveltejs/vite-plugin-svelte': - specifier: ^3.1.2 - version: 3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)) + specifier: ^4.0.0 + version: 4.0.0(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)) svelte2tsx: specifier: ^0.7.22 - version: 0.7.22(svelte@4.2.19)(typescript@5.6.3) + version: 0.7.22(svelte@5.1.9)(typescript@5.6.3) devDependencies: astro: specifier: workspace:* @@ -5153,13 +5153,28 @@ importers: astro-scripts: specifier: workspace:* version: link:../../../scripts + cheerio: + specifier: 1.0.0 + version: 1.0.0 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vite: specifier: ^5.4.10 version: 5.4.10(@types/node@18.19.50)(sass@1.80.4) + packages/integrations/svelte/test/fixtures/svelte-component: + dependencies: + '@astrojs/svelte': + specifier: workspace:* + version: link:../../.. + astro: + specifier: workspace:* + version: link:../../../../../astro + svelte: + specifier: ^5.1.9 + version: 5.1.9 + packages/integrations/tailwind: dependencies: autoprefixer: @@ -6887,19 +6902,19 @@ packages: peerDependencies: solid-js: ^1.8.6 - '@sveltejs/vite-plugin-svelte-inspector@2.1.0': - resolution: {integrity: sha512-9QX28IymvBlSCqsCll5t0kQVxipsfhFFL+L2t3nTWfXnddYwxBuAEtTtlaVQpRz9c37BhJjltSeY4AJSC03SSg==} - engines: {node: ^18.0.0 || >=20} + '@sveltejs/vite-plugin-svelte-inspector@3.0.1': + resolution: {integrity: sha512-2CKypmj1sM4GE7HjllT7UKmo4Q6L5xFRd7VMGEWhYnZ+wc6AUVU01IBd7yUi6WnFndEwWoMNOd6e8UjoN0nbvQ==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22} peerDependencies: - '@sveltejs/vite-plugin-svelte': ^3.0.0 - svelte: ^4.0.0 || ^5.0.0-next.0 + '@sveltejs/vite-plugin-svelte': ^4.0.0-next.0||^4.0.0 + svelte: ^5.0.0-next.96 || ^5.0.0 vite: ^5.0.0 - '@sveltejs/vite-plugin-svelte@3.1.2': - resolution: {integrity: sha512-Txsm1tJvtiYeLUVRNqxZGKR/mI+CzuIQuc2gn+YCs9rMTowpNZ2Nqt53JdL8KF9bLhAf2ruR/dr9eZCwdTriRA==} - engines: {node: ^18.0.0 || >=20} + '@sveltejs/vite-plugin-svelte@4.0.0': + resolution: {integrity: sha512-kpVJwF+gNiMEsoHaw+FJL76IYiwBikkxYU83+BpqQLdVMff19KeRKLd2wisS8niNBMJ2omv5gG+iGDDwd8jzag==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22} peerDependencies: - svelte: ^4.0.0 || ^5.0.0-next.0 + svelte: ^5.0.0-next.96 || ^5.0.0 vite: ^5.0.0 '@trysound/sax@0.2.0': @@ -7286,6 +7301,11 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + acorn-typescript@1.4.13: + resolution: {integrity: sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==} + peerDependencies: + acorn: '>=8.9.0' + acorn@8.14.0: resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} engines: {node: '>=0.4.0'} @@ -8079,6 +8099,9 @@ packages: jiti: optional: true + esm-env@1.1.4: + resolution: {integrity: sha512-oO82nKPHKkzIj/hbtuDYy/JHqBHFlMIW36SDiPCVsj87ntDLcWN+sJ1erdVryd4NxODacFTsdrIE3b7IamqbOg==} + esm@3.2.25: resolution: {integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==} engines: {node: '>=6'} @@ -8096,6 +8119,9 @@ packages: resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} + esrap@1.2.2: + resolution: {integrity: sha512-F2pSJklxx1BlQIQgooczXCPHmcWpn6EsP5oo73LQfonG9fIlIENQ8vMmfGXeojP9MrkzUNAfyU5vdFlR9shHAw==} + esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} @@ -10206,12 +10232,6 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - svelte-hmr@0.16.0: - resolution: {integrity: sha512-Gyc7cOS3VJzLlfj7wKS0ZnzDVdv3Pn2IuVeJPk9m2skfhcu5bq3wtIZyQGggr7/Iim5rH5cncyQft/kRLupcnA==} - engines: {node: ^12.20 || ^14.13.1 || >= 16} - peerDependencies: - svelte: ^3.19.0 || ^4.0.0 - svelte2tsx@0.7.22: resolution: {integrity: sha512-hf55ujq17ufVpDQlJzaQfRr9EjlLIwGmFlpKq4uYrQAQFw/99q1OcVYyBT6568iJySgBUY9PdccURrORmfetmQ==} peerDependencies: @@ -10222,6 +10242,10 @@ packages: resolution: {integrity: sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==} engines: {node: '>=16'} + svelte@5.1.9: + resolution: {integrity: sha512-nzq+PPKGS2PoEWDjAcXSrKSbXmmmOAxd6dAz1IhRusUpVkFS6DMELWPyBPGwu6TpO/gsgtFXwX0M4+pAR5gzKw==} + engines: {node: '>=18'} + svg-tags@1.0.0: resolution: {integrity: sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==} @@ -10935,6 +10959,9 @@ packages: resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} engines: {node: '>=12.20'} + zimmerframe@1.1.2: + resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==} + zod-to-json-schema@3.23.5: resolution: {integrity: sha512-5wlSS0bXfF/BrL4jPAbz9da5hDlDptdEppYfe+x4eIJ7jioqKG9uUxOwPzqof09u/XeVdrgFu29lZi+8XNDJtA==} peerDependencies: @@ -12367,26 +12394,25 @@ snapshots: dependencies: solid-js: 1.9.3 - '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)))(svelte@4.2.19)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4))': + '@sveltejs/vite-plugin-svelte-inspector@3.0.1(@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)))(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)) + '@sveltejs/vite-plugin-svelte': 4.0.0(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)) debug: 4.3.7 - svelte: 4.2.19 + svelte: 5.1.9 vite: 5.4.10(@types/node@18.19.50)(sass@1.80.4) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4))': + '@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.2(svelte@4.2.19)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)))(svelte@4.2.19)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)) + '@sveltejs/vite-plugin-svelte-inspector': 3.0.1(@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)))(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)) debug: 4.3.7 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.12 - svelte: 4.2.19 - svelte-hmr: 0.16.0(svelte@4.2.19) + svelte: 5.1.9 vite: 5.4.10(@types/node@18.19.50)(sass@1.80.4) - vitefu: 0.2.5(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)) + vitefu: 1.0.3(vite@5.4.10(@types/node@18.19.50)(sass@1.80.4)) transitivePeerDependencies: - supports-color @@ -12898,6 +12924,10 @@ snapshots: dependencies: acorn: 8.14.0 + acorn-typescript@1.4.13(acorn@8.14.0): + dependencies: + acorn: 8.14.0 + acorn@8.14.0: {} agent-base@7.1.1: @@ -13631,6 +13661,8 @@ snapshots: transitivePeerDependencies: - supports-color + esm-env@1.1.4: {} + esm@3.2.25: {} espree@10.2.0: @@ -13645,6 +13677,11 @@ snapshots: dependencies: estraverse: 5.3.0 + esrap@1.2.2: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 + '@types/estree': 1.0.6 + esrecurse@4.3.0: dependencies: estraverse: 5.3.0 @@ -16302,15 +16339,11 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-hmr@0.16.0(svelte@4.2.19): - dependencies: - svelte: 4.2.19 - - svelte2tsx@0.7.22(svelte@4.2.19)(typescript@5.6.3): + svelte2tsx@0.7.22(svelte@5.1.9)(typescript@5.6.3): dependencies: dedent-js: 1.0.1 pascal-case: 3.1.2 - svelte: 4.2.19 + svelte: 5.1.9 typescript: 5.6.3 svelte@4.2.19: @@ -16330,6 +16363,22 @@ snapshots: magic-string: 0.30.12 periscopic: 3.1.0 + svelte@5.1.9: + dependencies: + '@ampproject/remapping': 2.3.0 + '@jridgewell/sourcemap-codec': 1.5.0 + '@types/estree': 1.0.6 + acorn: 8.14.0 + acorn-typescript: 1.4.13(acorn@8.14.0) + aria-query: 5.3.2 + axobject-query: 4.1.0 + esm-env: 1.1.4 + esrap: 1.2.2 + is-reference: 3.0.2 + locate-character: 3.0.0 + magic-string: 0.30.12 + zimmerframe: 1.1.2 + svg-tags@1.0.0: {} svgo@3.3.2: @@ -17062,6 +17111,8 @@ snapshots: yocto-queue@1.1.1: {} + zimmerframe@1.1.2: {} + zod-to-json-schema@3.23.5(zod@3.23.8): dependencies: zod: 3.23.8 From 3769559d687690086d014909a2b09588dc1a1916 Mon Sep 17 00:00:00 2001 From: Jacob Jenkins Date: Fri, 1 Nov 2024 17:26:29 +0000 Subject: [PATCH 02/15] Update test fixtures to Svelte 5 --- examples/framework-multiple/package.json | 2 +- .../components/svelte/SvelteCounter.svelte | 6 +- examples/framework-svelte/package.json | 2 +- .../src/components/Counter.svelte | 6 +- examples/ssr/package.json | 2 +- examples/ssr/src/components/AddToCart.svelte | 3 +- examples/ssr/src/components/Cart.svelte | 2 +- .../e2e/fixtures/client-only/package.json | 2 +- .../components/svelte/SvelteCounter.svelte | 5 +- .../astro/e2e/fixtures/errors/package.json | 2 +- .../svelte/SvelteRuntimeError.svelte | 2 +- .../fixtures/multiple-frameworks/package.json | 2 +- .../components/svelte/SvelteCounter.svelte | 8 +- .../fixtures/nested-in-preact/package.json | 2 +- .../components/svelte/SvelteCounter.svelte | 9 +- .../e2e/fixtures/nested-in-react/package.json | 2 +- .../components/svelte/SvelteCounter.svelte | 9 +- .../e2e/fixtures/nested-in-solid/package.json | 2 +- .../components/svelte/SvelteCounter.svelte | 9 +- .../fixtures/nested-in-svelte/package.json | 2 +- .../components/svelte/SvelteCounter.svelte | 9 +- .../e2e/fixtures/nested-in-vue/package.json | 2 +- .../components/svelte/SvelteCounter.svelte | 9 +- .../fixtures/nested-recursive/package.json | 2 +- .../components/svelte/SvelteCounter.svelte | 9 +- .../fixtures/svelte-component/package.json | 2 +- .../src/components/Counter.svelte | 7 +- .../src/components/Stuff.svelte | 2 +- .../src/components/SvelteComponent.svelte | 2 +- .../src/components/ToggleSlots.svelte | 4 +- .../fixtures/view-transitions/package.json | 8 +- .../src/components/SvelteCounter.svelte | 8 +- .../astro/test/fixtures/0-css/package.json | 2 +- .../alias-tsconfig-baseurl-only/package.json | 2 +- .../test/fixtures/alias-tsconfig/package.json | 2 +- .../astro/test/fixtures/alias/package.json | 2 +- .../test/fixtures/astro-children/package.json | 2 +- .../fixtures/astro-client-only/package.json | 2 +- .../src/components/PersistentCounter.svelte | 8 +- .../PersistentCounterStandalone.svelte | 8 +- .../test/fixtures/astro-dynamic/package.json | 2 +- .../src/components/PersistentCounter.svelte | 8 +- .../src/components/SvelteCounter.svelte | 7 +- .../fixtures/astro-markdown/astro.config.mjs | 6 +- .../test/fixtures/astro-markdown/package.json | 13 +- .../src/components/Counter.svelte | 5 - .../fixtures/astro-slots-nested/package.json | 2 +- .../component-library-shared/Counter.svelte | 6 +- .../fixtures/component-library/package.json | 2 +- .../css-dangling-references/package.json | 2 +- .../src/components/Wrapper.svelte | 3 +- .../astro/test/fixtures/fetch/package.json | 2 +- .../src/components/SvelteComponent.svelte | 2 +- packages/astro/test/fixtures/jsx/package.json | 2 +- .../jsx/src/components/SvelteCounter.svelte | 6 +- .../astro/test/fixtures/postcss/package.json | 34 ++-- .../server-islands/hybrid/package.json | 2 +- .../fixtures/server-islands/ssr/package.json | 2 +- .../test/fixtures/slots-svelte/package.json | 18 +- .../src/components/Counter.svelte | 8 +- .../fixtures/svelte-component/package.json | 16 +- .../src/components/TypeScript.svelte | 2 +- .../vue-with-multi-renderer/package.json | 2 +- packages/integrations/svelte/package.json | 3 +- .../svelte-component/astro.config.mjs | 7 - .../fixtures/svelte-component/package.json | 10 - .../src/components/TestComponent.svelte | 9 - .../svelte-component/src/pages/index.astro | 7 - .../svelte/test/svelte-component.test.js | 28 --- pnpm-lock.yaml | 184 ++++++------------ 70 files changed, 217 insertions(+), 354 deletions(-) delete mode 100644 packages/astro/test/fixtures/astro-markdown/src/components/Counter.svelte delete mode 100644 packages/integrations/svelte/test/fixtures/svelte-component/astro.config.mjs delete mode 100644 packages/integrations/svelte/test/fixtures/svelte-component/package.json delete mode 100644 packages/integrations/svelte/test/fixtures/svelte-component/src/components/TestComponent.svelte delete mode 100644 packages/integrations/svelte/test/fixtures/svelte-component/src/pages/index.astro delete mode 100644 packages/integrations/svelte/test/svelte-component.test.js diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index 9099bb551a77..eb1d41484de0 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -23,7 +23,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^4.2.19", + "svelte": "^5.1.9", "vue": "^3.5.12" } } diff --git a/examples/framework-multiple/src/components/svelte/SvelteCounter.svelte b/examples/framework-multiple/src/components/svelte/SvelteCounter.svelte index 01e58574a6ec..b27452352f7a 100644 --- a/examples/framework-multiple/src/components/svelte/SvelteCounter.svelte +++ b/examples/framework-multiple/src/components/svelte/SvelteCounter.svelte @@ -2,7 +2,7 @@ A counter written with Svelte -->
- +
{count}
- +
diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index f5851c318ed5..ca68ae6972b4 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -13,6 +13,6 @@ "dependencies": { "@astrojs/svelte": "^5.7.2", "astro": "^4.16.8", - "svelte": "^4.2.19" + "svelte": "^5.1.9" } } diff --git a/examples/framework-svelte/src/components/Counter.svelte b/examples/framework-svelte/src/components/Counter.svelte index 1353736aaab7..c0da13b266ab 100644 --- a/examples/framework-svelte/src/components/Counter.svelte +++ b/examples/framework-svelte/src/components/Counter.svelte @@ -1,5 +1,5 @@
- +
{count}
- +
diff --git a/examples/ssr/package.json b/examples/ssr/package.json index 644db40237a2..7a883f5b2363 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -15,6 +15,6 @@ "@astrojs/node": "^8.3.4", "@astrojs/svelte": "^5.7.2", "astro": "^4.16.8", - "svelte": "^4.2.19" + "svelte": "^5.1.9" } } diff --git a/examples/ssr/src/components/AddToCart.svelte b/examples/ssr/src/components/AddToCart.svelte index 0f7a97a93499..f212f0960def 100644 --- a/examples/ssr/src/components/AddToCart.svelte +++ b/examples/ssr/src/components/AddToCart.svelte @@ -1,7 +1,6 @@
- +
{ count }
- +
diff --git a/packages/astro/e2e/fixtures/nested-in-preact/package.json b/packages/astro/e2e/fixtures/nested-in-preact/package.json index 75416af37d96..b59ed2574722 100644 --- a/packages/astro/e2e/fixtures/nested-in-preact/package.json +++ b/packages/astro/e2e/fixtures/nested-in-preact/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^4.2.19", + "svelte": "^5.1.9", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/nested-in-preact/src/components/svelte/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-in-preact/src/components/svelte/SvelteCounter.svelte index 733f58076a24..c468df340c98 100644 --- a/packages/astro/e2e/fixtures/nested-in-preact/src/components/svelte/SvelteCounter.svelte +++ b/packages/astro/e2e/fixtures/nested-in-preact/src/components/svelte/SvelteCounter.svelte @@ -1,8 +1,7 @@
- +
{ count }
- +
diff --git a/packages/astro/e2e/fixtures/nested-in-react/package.json b/packages/astro/e2e/fixtures/nested-in-react/package.json index 533ddb1568c9..426ab2eb45e8 100644 --- a/packages/astro/e2e/fixtures/nested-in-react/package.json +++ b/packages/astro/e2e/fixtures/nested-in-react/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^4.2.19", + "svelte": "^5.1.9", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/nested-in-react/src/components/svelte/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-in-react/src/components/svelte/SvelteCounter.svelte index 733f58076a24..c468df340c98 100644 --- a/packages/astro/e2e/fixtures/nested-in-react/src/components/svelte/SvelteCounter.svelte +++ b/packages/astro/e2e/fixtures/nested-in-react/src/components/svelte/SvelteCounter.svelte @@ -1,8 +1,7 @@
- +
{ count }
- +
diff --git a/packages/astro/e2e/fixtures/nested-in-solid/package.json b/packages/astro/e2e/fixtures/nested-in-solid/package.json index b8c3a4dbc40a..d75153ef7f27 100644 --- a/packages/astro/e2e/fixtures/nested-in-solid/package.json +++ b/packages/astro/e2e/fixtures/nested-in-solid/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^4.2.19", + "svelte": "^5.1.9", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/nested-in-solid/src/components/svelte/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-in-solid/src/components/svelte/SvelteCounter.svelte index 733f58076a24..c468df340c98 100644 --- a/packages/astro/e2e/fixtures/nested-in-solid/src/components/svelte/SvelteCounter.svelte +++ b/packages/astro/e2e/fixtures/nested-in-solid/src/components/svelte/SvelteCounter.svelte @@ -1,8 +1,7 @@
- +
{ count }
- +
diff --git a/packages/astro/e2e/fixtures/nested-in-svelte/package.json b/packages/astro/e2e/fixtures/nested-in-svelte/package.json index d40b37c67c29..c65bd8a170a7 100644 --- a/packages/astro/e2e/fixtures/nested-in-svelte/package.json +++ b/packages/astro/e2e/fixtures/nested-in-svelte/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^4.2.19", + "svelte": "^5.1.9", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/nested-in-svelte/src/components/svelte/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-in-svelte/src/components/svelte/SvelteCounter.svelte index 733f58076a24..c468df340c98 100644 --- a/packages/astro/e2e/fixtures/nested-in-svelte/src/components/svelte/SvelteCounter.svelte +++ b/packages/astro/e2e/fixtures/nested-in-svelte/src/components/svelte/SvelteCounter.svelte @@ -1,8 +1,7 @@
- +
{ count }
- +
diff --git a/packages/astro/e2e/fixtures/nested-in-vue/package.json b/packages/astro/e2e/fixtures/nested-in-vue/package.json index 82c8c6d3219a..8c0294bbfbe7 100644 --- a/packages/astro/e2e/fixtures/nested-in-vue/package.json +++ b/packages/astro/e2e/fixtures/nested-in-vue/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^4.2.19", + "svelte": "^5.1.9", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/nested-in-vue/src/components/svelte/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-in-vue/src/components/svelte/SvelteCounter.svelte index 733f58076a24..c468df340c98 100644 --- a/packages/astro/e2e/fixtures/nested-in-vue/src/components/svelte/SvelteCounter.svelte +++ b/packages/astro/e2e/fixtures/nested-in-vue/src/components/svelte/SvelteCounter.svelte @@ -1,8 +1,7 @@
- +
{ count }
- +
diff --git a/packages/astro/e2e/fixtures/nested-recursive/package.json b/packages/astro/e2e/fixtures/nested-recursive/package.json index f2ac36dc7944..60f915912c63 100644 --- a/packages/astro/e2e/fixtures/nested-recursive/package.json +++ b/packages/astro/e2e/fixtures/nested-recursive/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^4.2.19", + "svelte": "^5.1.9", "vue": "^3.5.12" }, "scripts": { diff --git a/packages/astro/e2e/fixtures/nested-recursive/src/components/svelte/SvelteCounter.svelte b/packages/astro/e2e/fixtures/nested-recursive/src/components/svelte/SvelteCounter.svelte index 733f58076a24..c468df340c98 100644 --- a/packages/astro/e2e/fixtures/nested-recursive/src/components/svelte/SvelteCounter.svelte +++ b/packages/astro/e2e/fixtures/nested-recursive/src/components/svelte/SvelteCounter.svelte @@ -1,8 +1,7 @@
- +
{ count }
- +
diff --git a/packages/astro/e2e/fixtures/svelte-component/package.json b/packages/astro/e2e/fixtures/svelte-component/package.json index 04acc35e777d..8e0070443f99 100644 --- a/packages/astro/e2e/fixtures/svelte-component/package.json +++ b/packages/astro/e2e/fixtures/svelte-component/package.json @@ -6,6 +6,6 @@ "@astrojs/mdx": "workspace:*", "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^4.2.19" + "svelte": "^5.1.9" } } diff --git a/packages/astro/e2e/fixtures/svelte-component/src/components/Counter.svelte b/packages/astro/e2e/fixtures/svelte-component/src/components/Counter.svelte index 2f05ce7988c6..f269afcfd064 100644 --- a/packages/astro/e2e/fixtures/svelte-component/src/components/Counter.svelte +++ b/packages/astro/e2e/fixtures/svelte-component/src/components/Counter.svelte @@ -1,6 +1,5 @@
- +
{ count }
- +
diff --git a/packages/astro/e2e/fixtures/svelte-component/src/components/Stuff.svelte b/packages/astro/e2e/fixtures/svelte-component/src/components/Stuff.svelte index 9d7f1d4e0971..556acd2a3d5e 100644 --- a/packages/astro/e2e/fixtures/svelte-component/src/components/Stuff.svelte +++ b/packages/astro/e2e/fixtures/svelte-component/src/components/Stuff.svelte @@ -1,4 +1,4 @@
Slot goes here:
diff --git a/packages/astro/e2e/fixtures/svelte-component/src/components/SvelteComponent.svelte b/packages/astro/e2e/fixtures/svelte-component/src/components/SvelteComponent.svelte index ff6894c00540..0076cbe12071 100644 --- a/packages/astro/e2e/fixtures/svelte-component/src/components/SvelteComponent.svelte +++ b/packages/astro/e2e/fixtures/svelte-component/src/components/SvelteComponent.svelte @@ -1,5 +1,5 @@
Framework client:only component
diff --git a/packages/astro/e2e/fixtures/svelte-component/src/components/ToggleSlots.svelte b/packages/astro/e2e/fixtures/svelte-component/src/components/ToggleSlots.svelte index 3a8595ff596d..1d404b3b7779 100644 --- a/packages/astro/e2e/fixtures/svelte-component/src/components/ToggleSlots.svelte +++ b/packages/astro/e2e/fixtures/svelte-component/src/components/ToggleSlots.svelte @@ -1,9 +1,9 @@ - +
{prefix}{count}
- +
diff --git a/packages/astro/test/fixtures/0-css/package.json b/packages/astro/test/fixtures/0-css/package.json index c460f11db1d1..010aa3dbf01d 100644 --- a/packages/astro/test/fixtures/0-css/package.json +++ b/packages/astro/test/fixtures/0-css/package.json @@ -9,7 +9,7 @@ "astro": "workspace:*", "react": "^18.3.1", "react-dom": "^18.3.1", - "svelte": "^4.2.19", + "svelte": "^5.1.9", "vue": "^3.5.12" } } diff --git a/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/package.json b/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/package.json index 0ae8cb82cf4d..00fe64e7d187 100644 --- a/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/package.json +++ b/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/package.json @@ -5,6 +5,6 @@ "dependencies": { "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^4.2.19" + "svelte": "^5.1.9" } } diff --git a/packages/astro/test/fixtures/alias-tsconfig/package.json b/packages/astro/test/fixtures/alias-tsconfig/package.json index 833a0a06811d..e40ba8b102cc 100644 --- a/packages/astro/test/fixtures/alias-tsconfig/package.json +++ b/packages/astro/test/fixtures/alias-tsconfig/package.json @@ -6,6 +6,6 @@ "@astrojs/svelte": "workspace:*", "@test/namespace-package": "workspace:*", "astro": "workspace:*", - "svelte": "^4.2.19" + "svelte": "^5.1.9" } } diff --git a/packages/astro/test/fixtures/alias/package.json b/packages/astro/test/fixtures/alias/package.json index bd0599c5d623..e4b965e782e1 100644 --- a/packages/astro/test/fixtures/alias/package.json +++ b/packages/astro/test/fixtures/alias/package.json @@ -5,6 +5,6 @@ "dependencies": { "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^4.2.19" + "svelte": "^5.1.9" } } diff --git a/packages/astro/test/fixtures/astro-children/package.json b/packages/astro/test/fixtures/astro-children/package.json index 14e6da06e236..11e987db4f2a 100644 --- a/packages/astro/test/fixtures/astro-children/package.json +++ b/packages/astro/test/fixtures/astro-children/package.json @@ -8,7 +8,7 @@ "@astrojs/vue": "workspace:*", "astro": "workspace:*", "preact": "^10.24.3", - "svelte": "^4.2.19", + "svelte": "^5.1.9", "vue": "^3.5.12" } } diff --git a/packages/astro/test/fixtures/astro-client-only/package.json b/packages/astro/test/fixtures/astro-client-only/package.json index e6f71f353924..50f2eeee0e80 100644 --- a/packages/astro/test/fixtures/astro-client-only/package.json +++ b/packages/astro/test/fixtures/astro-client-only/package.json @@ -9,6 +9,6 @@ "astro": "workspace:*", "react": "^18.3.1", "react-dom": "^18.3.1", - "svelte": "^4.2.19" + "svelte": "^5.1.9" } } diff --git a/packages/astro/test/fixtures/astro-client-only/src/components/PersistentCounter.svelte b/packages/astro/test/fixtures/astro-client-only/src/components/PersistentCounter.svelte index 855be29ea056..f4d7180dffba 100644 --- a/packages/astro/test/fixtures/astro-client-only/src/components/PersistentCounter.svelte +++ b/packages/astro/test/fixtures/astro-client-only/src/components/PersistentCounter.svelte @@ -1,8 +1,8 @@
- +
{ count }
- +
\ No newline at end of file diff --git a/packages/astro/test/fixtures/astro-dynamic/src/components/SvelteCounter.svelte b/packages/astro/test/fixtures/astro-dynamic/src/components/SvelteCounter.svelte index 8d6b3f5e1688..9b9241da0f02 100644 --- a/packages/astro/test/fixtures/astro-dynamic/src/components/SvelteCounter.svelte +++ b/packages/astro/test/fixtures/astro-dynamic/src/components/SvelteCounter.svelte @@ -1,7 +1,6 @@
- +
{ count }
- +
diff --git a/packages/astro/test/fixtures/astro-markdown/astro.config.mjs b/packages/astro/test/fixtures/astro-markdown/astro.config.mjs index ac3f1ab6439e..201ce52f26ef 100644 --- a/packages/astro/test/fixtures/astro-markdown/astro.config.mjs +++ b/packages/astro/test/fixtures/astro-markdown/astro.config.mjs @@ -1,8 +1,6 @@ -import svelte from "@astrojs/svelte"; -import { defineConfig } from 'astro/config'; +import { defineConfig } from "astro/config"; // https://astro.build/config export default defineConfig({ - integrations: [svelte()], - site: 'https://astro.build/', + site: "https://astro.build/", }); diff --git a/packages/astro/test/fixtures/astro-markdown/package.json b/packages/astro/test/fixtures/astro-markdown/package.json index c1903a941ea1..d108a77cdb2f 100644 --- a/packages/astro/test/fixtures/astro-markdown/package.json +++ b/packages/astro/test/fixtures/astro-markdown/package.json @@ -1,9 +1,8 @@ { - "name": "@test/astro-markdown", - "version": "0.0.0", - "private": true, - "dependencies": { - "@astrojs/svelte": "workspace:*", - "astro": "workspace:*" - } + "name": "@test/astro-markdown", + "version": "0.0.0", + "private": true, + "dependencies": { + "astro": "workspace:*" + } } diff --git a/packages/astro/test/fixtures/astro-markdown/src/components/Counter.svelte b/packages/astro/test/fixtures/astro-markdown/src/components/Counter.svelte deleted file mode 100644 index 4e91b26596c4..000000000000 --- a/packages/astro/test/fixtures/astro-markdown/src/components/Counter.svelte +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/packages/astro/test/fixtures/astro-slots-nested/package.json b/packages/astro/test/fixtures/astro-slots-nested/package.json index 114e369d6cd6..24d97a2e2207 100644 --- a/packages/astro/test/fixtures/astro-slots-nested/package.json +++ b/packages/astro/test/fixtures/astro-slots-nested/package.json @@ -13,7 +13,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^4.2.19", + "svelte": "^5.1.9", "vue": "^3.5.12" } } diff --git a/packages/astro/test/fixtures/component-library-shared/Counter.svelte b/packages/astro/test/fixtures/component-library-shared/Counter.svelte index 2f4c07339060..486ec8d065dd 100644 --- a/packages/astro/test/fixtures/component-library-shared/Counter.svelte +++ b/packages/astro/test/fixtures/component-library-shared/Counter.svelte @@ -1,5 +1,5 @@
- +
{ count }
- +
diff --git a/packages/astro/test/fixtures/component-library/package.json b/packages/astro/test/fixtures/component-library/package.json index 02f65ab8d288..33e22db04fef 100644 --- a/packages/astro/test/fixtures/component-library/package.json +++ b/packages/astro/test/fixtures/component-library/package.json @@ -11,6 +11,6 @@ "preact": "^10.24.3", "react": "^18.3.1", "react-dom": "^18.3.1", - "svelte": "^4.2.19" + "svelte": "^5.1.9" } } diff --git a/packages/astro/test/fixtures/css-dangling-references/package.json b/packages/astro/test/fixtures/css-dangling-references/package.json index be0392db0c9f..c7232eb81963 100644 --- a/packages/astro/test/fixtures/css-dangling-references/package.json +++ b/packages/astro/test/fixtures/css-dangling-references/package.json @@ -5,6 +5,6 @@ "dependencies": { "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^4.2.19" + "svelte": "^5.1.9" } } \ No newline at end of file diff --git a/packages/astro/test/fixtures/css-dangling-references/src/components/Wrapper.svelte b/packages/astro/test/fixtures/css-dangling-references/src/components/Wrapper.svelte index 083040742c15..33ab3b380741 100644 --- a/packages/astro/test/fixtures/css-dangling-references/src/components/Wrapper.svelte +++ b/packages/astro/test/fixtures/css-dangling-references/src/components/Wrapper.svelte @@ -1,6 +1,5 @@
- +
{ count }
- +

Fallback

diff --git a/packages/astro/test/fixtures/svelte-component/package.json b/packages/astro/test/fixtures/svelte-component/package.json index 830d980b72b0..e404ba86ac50 100644 --- a/packages/astro/test/fixtures/svelte-component/package.json +++ b/packages/astro/test/fixtures/svelte-component/package.json @@ -1,10 +1,10 @@ { - "name": "@test/svelte-component", - "version": "0.0.0", - "private": true, - "dependencies": { - "@astrojs/svelte": "workspace:*", - "astro": "workspace:*", - "svelte": "^4.2.19" - } + "name": "@test/svelte-component", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/svelte": "workspace:*", + "astro": "workspace:*", + "svelte": "^5.1.9" + } } diff --git a/packages/astro/test/fixtures/svelte-component/src/components/TypeScript.svelte b/packages/astro/test/fixtures/svelte-component/src/components/TypeScript.svelte index d74ae47ec531..bbacb3b24861 100644 --- a/packages/astro/test/fixtures/svelte-component/src/components/TypeScript.svelte +++ b/packages/astro/test/fixtures/svelte-component/src/components/TypeScript.svelte @@ -1,5 +1,5 @@
{ message }
diff --git a/packages/astro/test/fixtures/vue-with-multi-renderer/package.json b/packages/astro/test/fixtures/vue-with-multi-renderer/package.json index d2e756c974a3..d4e9f2f7f57a 100644 --- a/packages/astro/test/fixtures/vue-with-multi-renderer/package.json +++ b/packages/astro/test/fixtures/vue-with-multi-renderer/package.json @@ -6,7 +6,7 @@ "@astrojs/svelte": "workspace:*", "@astrojs/vue": "workspace:*", "astro": "workspace:*", - "svelte": "^4.2.19", + "svelte": "^5.1.9", "vue": "^3.5.12" } } diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index a4c95ca7a9aa..a94381b3d22d 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -29,8 +29,7 @@ "scripts": { "build": "astro-scripts build \"src/index.ts\" && astro-scripts build \"src/editor.cts\" --force-cjs --no-clean-dist && tsc", "build:ci": "astro-scripts build \"src/**/*.ts\" && astro-scripts build \"src/editor.cts\" --force-cjs --no-clean-dist", - "dev": "astro-scripts dev \"src/**/*.ts\"", - "test": "astro-scripts test \"test/**/*.test.js\"" + "dev": "astro-scripts dev \"src/**/*.ts\"" }, "dependencies": { "@sveltejs/vite-plugin-svelte": "^4.0.0", diff --git a/packages/integrations/svelte/test/fixtures/svelte-component/astro.config.mjs b/packages/integrations/svelte/test/fixtures/svelte-component/astro.config.mjs deleted file mode 100644 index e720c84f8794..000000000000 --- a/packages/integrations/svelte/test/fixtures/svelte-component/astro.config.mjs +++ /dev/null @@ -1,7 +0,0 @@ -import svelte from "@astrojs/svelte"; -import { defineConfig } from "astro/config"; - -// https://astro.build/config -export default defineConfig({ - integrations: [svelte()], -}); diff --git a/packages/integrations/svelte/test/fixtures/svelte-component/package.json b/packages/integrations/svelte/test/fixtures/svelte-component/package.json deleted file mode 100644 index e404ba86ac50..000000000000 --- a/packages/integrations/svelte/test/fixtures/svelte-component/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@test/svelte-component", - "version": "0.0.0", - "private": true, - "dependencies": { - "@astrojs/svelte": "workspace:*", - "astro": "workspace:*", - "svelte": "^5.1.9" - } -} diff --git a/packages/integrations/svelte/test/fixtures/svelte-component/src/components/TestComponent.svelte b/packages/integrations/svelte/test/fixtures/svelte-component/src/components/TestComponent.svelte deleted file mode 100644 index a0d1b0952153..000000000000 --- a/packages/integrations/svelte/test/fixtures/svelte-component/src/components/TestComponent.svelte +++ /dev/null @@ -1,9 +0,0 @@ - - -

Hello from Svelte!

-

{subheading}

-

{count}

diff --git a/packages/integrations/svelte/test/fixtures/svelte-component/src/pages/index.astro b/packages/integrations/svelte/test/fixtures/svelte-component/src/pages/index.astro deleted file mode 100644 index 550afb7bc105..000000000000 --- a/packages/integrations/svelte/test/fixtures/svelte-component/src/pages/index.astro +++ /dev/null @@ -1,7 +0,0 @@ ---- -import TestComponent from '../components/TestComponent.svelte' - -const subheading = "Hello world! From Astro!" ---- - - diff --git a/packages/integrations/svelte/test/svelte-component.test.js b/packages/integrations/svelte/test/svelte-component.test.js deleted file mode 100644 index 96b275e2196b..000000000000 --- a/packages/integrations/svelte/test/svelte-component.test.js +++ /dev/null @@ -1,28 +0,0 @@ -import assert from "node:assert/strict"; -import { after, before, describe, it } from "node:test"; -import { load as cheerioLoad } from "cheerio"; -import { isWindows, loadFixture } from "../../../astro/test/test-utils.js"; - -let fixture; - -describe("React Components", () => { - before(async () => { - fixture = await loadFixture({ - root: new URL("./fixtures/svelte-component/", import.meta.url), - }); - }); - - describe("build", () => { - before(async () => { - await fixture.build(); - }); - - it("Should hyrade a Svelte component", async () => { - const html = await fixture.readFile("/index.html"); - const $ = cheerioLoad(html); - - // test 1: basic component renders - assert.equal($("#my-heading").text(), "Hello from Svelte!"); - }); - }); -}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7f397c825259..516d39ffb2fc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -231,8 +231,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -294,8 +294,8 @@ importers: specifier: ^4.16.8 version: link:../../packages/astro svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 examples/framework-vue: dependencies: @@ -348,8 +348,8 @@ importers: specifier: ^4.16.8 version: link:../../packages/astro svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 examples/starlog: dependencies: @@ -908,8 +908,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1032,8 +1032,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1101,8 +1101,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1160,8 +1160,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1200,8 +1200,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1240,8 +1240,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1280,8 +1280,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1320,8 +1320,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1360,8 +1360,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1556,8 +1556,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/e2e/fixtures/tailwindcss: dependencies: @@ -1622,8 +1622,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1760,8 +1760,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1781,8 +1781,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/test/fixtures/alias-tsconfig: dependencies: @@ -1796,8 +1796,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/test/fixtures/alias-tsconfig-baseurl-only: dependencies: @@ -1808,8 +1808,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/test/fixtures/alias-tsconfig/deps/namespace-package: {} @@ -1933,8 +1933,8 @@ importers: specifier: ^10.24.3 version: 10.24.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1966,8 +1966,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/test/fixtures/astro-client-only/pkg: {} @@ -2058,8 +2058,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/test/fixtures/astro-env: dependencies: @@ -2165,9 +2165,6 @@ importers: packages/astro/test/fixtures/astro-markdown: dependencies: - '@astrojs/svelte': - specifier: workspace:* - version: link:../../../../integrations/svelte astro: specifier: workspace:* version: link:../../.. @@ -2388,8 +2385,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -2472,8 +2469,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/test/fixtures/component-library-shared: dependencies: @@ -2775,8 +2772,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/test/fixtures/css-import-as-inline: dependencies: @@ -3027,8 +3024,8 @@ importers: specifier: ^10.24.3 version: 10.24.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -3231,8 +3228,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -3419,8 +3416,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -3613,8 +3610,8 @@ importers: specifier: workspace:* version: link:../../../.. svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/test/fixtures/server-islands/ssr: dependencies: @@ -3625,8 +3622,8 @@ importers: specifier: workspace:* version: link:../../../.. svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/test/fixtures/set-html: dependencies: @@ -3694,8 +3691,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/test/fixtures/slots-vue: dependencies: @@ -4019,8 +4016,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 packages/astro/test/fixtures/tailwindcss: dependencies: @@ -4142,8 +4139,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^4.2.19 - version: 4.2.19 + specifier: ^5.1.9 + version: 5.1.9 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -5163,18 +5160,6 @@ importers: specifier: ^5.4.10 version: 5.4.10(@types/node@18.19.50)(sass@1.80.4) - packages/integrations/svelte/test/fixtures/svelte-component: - dependencies: - '@astrojs/svelte': - specifier: workspace:* - version: link:../../.. - astro: - specifier: workspace:* - version: link:../../../../../astro - svelte: - specifier: ^5.1.9 - version: 5.1.9 - packages/integrations/tailwind: dependencies: autoprefixer: @@ -7610,9 +7595,6 @@ packages: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} - 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==} @@ -9411,9 +9393,6 @@ packages: perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} - periscopic@3.1.0: - resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} - picocolors@1.1.0: resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} @@ -10238,10 +10217,6 @@ packages: 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.19: - resolution: {integrity: sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==} - engines: {node: '>=16'} - svelte@5.1.9: resolution: {integrity: sha512-nzq+PPKGS2PoEWDjAcXSrKSbXmmmOAxd6dAz1IhRusUpVkFS6DMELWPyBPGwu6TpO/gsgtFXwX0M4+pAR5gzKw==} engines: {node: '>=18'} @@ -13261,14 +13236,6 @@ snapshots: clsx@2.1.1: {} - code-red@1.0.4: - dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 - '@types/estree': 1.0.6 - acorn: 8.14.0 - estree-walker: 3.0.3 - periscopic: 3.1.0 - collapse-white-space@2.1.0: {} color-convert@2.0.1: @@ -15340,12 +15307,6 @@ snapshots: perfect-debounce@1.0.0: {} - periscopic@3.1.0: - dependencies: - '@types/estree': 1.0.6 - estree-walker: 3.0.3 - is-reference: 3.0.2 - picocolors@1.1.0: {} picomatch@2.3.1: {} @@ -16346,23 +16307,6 @@ snapshots: svelte: 5.1.9 typescript: 5.6.3 - svelte@4.2.19: - dependencies: - '@ampproject/remapping': 2.3.0 - '@jridgewell/sourcemap-codec': 1.5.0 - '@jridgewell/trace-mapping': 0.3.25 - '@types/estree': 1.0.6 - acorn: 8.14.0 - aria-query: 5.3.2 - 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.12 - periscopic: 3.1.0 - svelte@5.1.9: dependencies: '@ampproject/remapping': 2.3.0 From 1bab62d73e0730051aea1f7e78f6b0baabb7f3a2 Mon Sep 17 00:00:00 2001 From: Jacob Jenkins Date: Fri, 1 Nov 2024 17:28:05 +0000 Subject: [PATCH 03/15] Put typeof back in --- .../test/fixtures/fetch/src/components/SvelteComponent.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/test/fixtures/fetch/src/components/SvelteComponent.svelte b/packages/astro/test/fixtures/fetch/src/components/SvelteComponent.svelte index 472f48b7c56f..49f32acbb3d1 100644 --- a/packages/astro/test/fixtures/fetch/src/components/SvelteComponent.svelte +++ b/packages/astro/test/fixtures/fetch/src/components/SvelteComponent.svelte @@ -1 +1 @@ - +{ typeof fetch } From 65bf03b80784af44564e7bac0366888e95aa5fa5 Mon Sep 17 00:00:00 2001 From: bluwy Date: Fri, 8 Nov 2024 22:11:29 +0800 Subject: [PATCH 04/15] Reduce diff --- .../test/fixtures/astro-markdown/package.json | 12 ++--- .../astro/test/fixtures/postcss/package.json | 34 +++++++------- .../test/fixtures/slots-svelte/package.json | 18 +++---- .../fixtures/svelte-component/package.json | 16 +++---- packages/integrations/svelte/src/index.ts | 47 +++++++------------ 5 files changed, 58 insertions(+), 69 deletions(-) diff --git a/packages/astro/test/fixtures/astro-markdown/package.json b/packages/astro/test/fixtures/astro-markdown/package.json index d108a77cdb2f..9fe9dae0124d 100644 --- a/packages/astro/test/fixtures/astro-markdown/package.json +++ b/packages/astro/test/fixtures/astro-markdown/package.json @@ -1,8 +1,8 @@ { - "name": "@test/astro-markdown", - "version": "0.0.0", - "private": true, - "dependencies": { - "astro": "workspace:*" - } + "name": "@test/astro-markdown", + "version": "0.0.0", + "private": true, + "dependencies": { + "astro": "workspace:*" + } } diff --git a/packages/astro/test/fixtures/postcss/package.json b/packages/astro/test/fixtures/postcss/package.json index 71f62e27bdfc..a3388487d1b8 100644 --- a/packages/astro/test/fixtures/postcss/package.json +++ b/packages/astro/test/fixtures/postcss/package.json @@ -1,19 +1,19 @@ { - "name": "@test/postcss", - "version": "0.0.0", - "private": true, - "dependencies": { - "@astrojs/solid-js": "workspace:*", - "@astrojs/svelte": "workspace:*", - "@astrojs/vue": "workspace:*", - "astro": "workspace:*", - "autoprefixer": "^10.4.20", - "postcss": "^8.4.47", - "solid-js": "^1.9.3", - "svelte": "^5.1.9", - "vue": "^3.5.12" - }, - "devDependencies": { - "postcss-preset-env": "^10.0.9" - } + "name": "@test/postcss", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/solid-js": "workspace:*", + "@astrojs/svelte": "workspace:*", + "@astrojs/vue": "workspace:*", + "astro": "workspace:*", + "autoprefixer": "^10.4.20", + "postcss": "^8.4.47", + "solid-js": "^1.9.3", + "svelte": "^5.1.9", + "vue": "^3.5.12" + }, + "devDependencies": { + "postcss-preset-env": "^10.0.9" + } } diff --git a/packages/astro/test/fixtures/slots-svelte/package.json b/packages/astro/test/fixtures/slots-svelte/package.json index b7c946744ce8..cab8256442f8 100644 --- a/packages/astro/test/fixtures/slots-svelte/package.json +++ b/packages/astro/test/fixtures/slots-svelte/package.json @@ -1,11 +1,11 @@ { - "name": "@test/slots-svelte", - "version": "0.0.0", - "private": true, - "dependencies": { - "@astrojs/mdx": "workspace:*", - "@astrojs/svelte": "workspace:*", - "astro": "workspace:*", - "svelte": "^5.1.9" - } + "name": "@test/slots-svelte", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/mdx": "workspace:*", + "@astrojs/svelte": "workspace:*", + "astro": "workspace:*", + "svelte": "^5.1.9" + } } diff --git a/packages/astro/test/fixtures/svelte-component/package.json b/packages/astro/test/fixtures/svelte-component/package.json index e404ba86ac50..e4058953760f 100644 --- a/packages/astro/test/fixtures/svelte-component/package.json +++ b/packages/astro/test/fixtures/svelte-component/package.json @@ -1,10 +1,10 @@ { - "name": "@test/svelte-component", - "version": "0.0.0", - "private": true, - "dependencies": { - "@astrojs/svelte": "workspace:*", - "astro": "workspace:*", - "svelte": "^5.1.9" - } + "name": "@test/svelte-component", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/svelte": "workspace:*", + "astro": "workspace:*", + "svelte": "^5.1.9" + } } diff --git a/packages/integrations/svelte/src/index.ts b/packages/integrations/svelte/src/index.ts index 84126877efd3..0e5c958e8977 100644 --- a/packages/integrations/svelte/src/index.ts +++ b/packages/integrations/svelte/src/index.ts @@ -1,30 +1,26 @@ -import { fileURLToPath } from "node:url"; -import type { Options } from "@sveltejs/vite-plugin-svelte"; -import { svelte, vitePreprocess } from "@sveltejs/vite-plugin-svelte"; -import type { AstroIntegration, AstroRenderer, ContainerRenderer } from "astro"; -import type { UserConfig } from "vite"; +import { fileURLToPath } from 'node:url'; +import type { Options } from '@sveltejs/vite-plugin-svelte'; +import { svelte, vitePreprocess } from '@sveltejs/vite-plugin-svelte'; +import type { AstroIntegration, AstroRenderer, ContainerRenderer } from 'astro'; +import type { UserConfig } from 'vite'; function getRenderer(): AstroRenderer { return { - name: "@astrojs/svelte", - clientEntrypoint: "@astrojs/svelte/client.js", - serverEntrypoint: "@astrojs/svelte/server.js", + name: '@astrojs/svelte', + clientEntrypoint: '@astrojs/svelte/client.js', + serverEntrypoint: '@astrojs/svelte/server.js', }; } export function getContainerRenderer(): ContainerRenderer { return { - name: "@astrojs/svelte", - serverEntrypoint: "@astrojs/svelte/server.js", + name: '@astrojs/svelte', + serverEntrypoint: '@astrojs/svelte/server.js', }; } async function svelteConfigHasPreprocess(root: URL) { - const svelteConfigFiles = [ - "./svelte.config.js", - "./svelte.config.cjs", - "./svelte.config.mjs", - ]; + const svelteConfigFiles = ['./svelte.config.js', './svelte.config.cjs', './svelte.config.mjs']; for (const file of svelteConfigFiles) { const filePath = fileURLToPath(new URL(file, root)); try { @@ -60,7 +56,7 @@ async function getViteConfiguration({ if (!options) { resolvedOptions = defaultOptions; - } else if (typeof options === "function") { + } else if (typeof options === 'function') { resolvedOptions = options(defaultOptions); } else { resolvedOptions = { @@ -80,32 +76,25 @@ async function getViteConfiguration({ return { optimizeDeps: { - include: ["@astrojs/svelte/client.js"], - exclude: ["@astrojs/svelte/server.js"], + include: ['@astrojs/svelte/client.js'], + exclude: ['@astrojs/svelte/server.js'], }, plugins: [svelte(resolvedOptions)], }; } type OptionsCallback = (defaultOptions: Options) => Options; -export default function ( - options?: Options | OptionsCallback, -): AstroIntegration { +export default function (options?: Options | OptionsCallback): AstroIntegration { return { - name: "@astrojs/svelte", + name: '@astrojs/svelte', hooks: { // Anything that gets returned here is merged into Astro Config - "astro:config:setup": async ({ - command, - updateConfig, - addRenderer, - config, - }) => { + 'astro:config:setup': async ({ command, updateConfig, addRenderer, config }) => { addRenderer(getRenderer()); updateConfig({ vite: await getViteConfiguration({ options, - isDev: command === "dev", + isDev: command === 'dev', root: config.root, }), }); From c4699227f07ac6eda9ac1a4c8d29ffae6bda32f7 Mon Sep 17 00:00:00 2001 From: bluwy Date: Fri, 8 Nov 2024 22:16:45 +0800 Subject: [PATCH 05/15] Update Svelte to latest --- examples/framework-multiple/package.json | 2 +- examples/framework-svelte/package.json | 2 +- examples/ssr/package.json | 2 +- .../e2e/fixtures/client-only/package.json | 2 +- .../astro/e2e/fixtures/errors/package.json | 2 +- .../fixtures/multiple-frameworks/package.json | 2 +- .../fixtures/nested-in-preact/package.json | 2 +- .../e2e/fixtures/nested-in-react/package.json | 2 +- .../e2e/fixtures/nested-in-solid/package.json | 2 +- .../fixtures/nested-in-svelte/package.json | 2 +- .../e2e/fixtures/nested-in-vue/package.json | 2 +- .../fixtures/nested-recursive/package.json | 2 +- .../fixtures/svelte-component/package.json | 2 +- .../fixtures/view-transitions/package.json | 2 +- .../astro/test/fixtures/0-css/package.json | 2 +- .../alias-tsconfig-baseurl-only/package.json | 2 +- .../test/fixtures/alias-tsconfig/package.json | 2 +- .../astro/test/fixtures/alias/package.json | 2 +- .../test/fixtures/astro-children/package.json | 2 +- .../fixtures/astro-client-only/package.json | 2 +- .../test/fixtures/astro-dynamic/package.json | 2 +- .../fixtures/astro-slots-nested/package.json | 2 +- .../fixtures/component-library/package.json | 2 +- .../css-dangling-references/package.json | 2 +- .../astro/test/fixtures/fetch/package.json | 2 +- packages/astro/test/fixtures/jsx/package.json | 2 +- .../astro/test/fixtures/postcss/package.json | 2 +- .../server-islands/hybrid/package.json | 2 +- .../fixtures/server-islands/ssr/package.json | 2 +- .../test/fixtures/slots-svelte/package.json | 2 +- .../fixtures/svelte-component/package.json | 2 +- .../vue-with-multi-renderer/package.json | 2 +- packages/integrations/svelte/package.json | 4 +- pnpm-lock.yaml | 158 +++++++++--------- 34 files changed, 113 insertions(+), 113 deletions(-) diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index bbb639e4b255..792516a9ac5e 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -23,7 +23,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 3ca2e9b0148b..eb821093370d 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -13,6 +13,6 @@ "dependencies": { "@astrojs/svelte": "^5.7.3", "astro": "^4.16.10", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index 860006a822b7..c0db362e1a73 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -15,6 +15,6 @@ "@astrojs/node": "^8.3.4", "@astrojs/svelte": "^5.7.3", "astro": "^4.16.10", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/e2e/fixtures/client-only/package.json b/packages/astro/e2e/fixtures/client-only/package.json index 08260e3a8384..c79d6403c753 100644 --- a/packages/astro/e2e/fixtures/client-only/package.json +++ b/packages/astro/e2e/fixtures/client-only/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/errors/package.json b/packages/astro/e2e/fixtures/errors/package.json index 1617d29c53d5..2c70de764332 100644 --- a/packages/astro/e2e/fixtures/errors/package.json +++ b/packages/astro/e2e/fixtures/errors/package.json @@ -14,7 +14,7 @@ "react-dom": "^18.3.1", "sass": "^1.80.6", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/multiple-frameworks/package.json b/packages/astro/e2e/fixtures/multiple-frameworks/package.json index c658256432fa..0d4ca5b86c77 100644 --- a/packages/astro/e2e/fixtures/multiple-frameworks/package.json +++ b/packages/astro/e2e/fixtures/multiple-frameworks/package.json @@ -18,7 +18,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/nested-in-preact/package.json b/packages/astro/e2e/fixtures/nested-in-preact/package.json index b59ed2574722..c206626babc0 100644 --- a/packages/astro/e2e/fixtures/nested-in-preact/package.json +++ b/packages/astro/e2e/fixtures/nested-in-preact/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/nested-in-react/package.json b/packages/astro/e2e/fixtures/nested-in-react/package.json index 426ab2eb45e8..ba8e51959770 100644 --- a/packages/astro/e2e/fixtures/nested-in-react/package.json +++ b/packages/astro/e2e/fixtures/nested-in-react/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/nested-in-solid/package.json b/packages/astro/e2e/fixtures/nested-in-solid/package.json index d75153ef7f27..ba731dfa18bf 100644 --- a/packages/astro/e2e/fixtures/nested-in-solid/package.json +++ b/packages/astro/e2e/fixtures/nested-in-solid/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/nested-in-svelte/package.json b/packages/astro/e2e/fixtures/nested-in-svelte/package.json index c65bd8a170a7..70bded6a182d 100644 --- a/packages/astro/e2e/fixtures/nested-in-svelte/package.json +++ b/packages/astro/e2e/fixtures/nested-in-svelte/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/nested-in-vue/package.json b/packages/astro/e2e/fixtures/nested-in-vue/package.json index 8c0294bbfbe7..e749f8e64153 100644 --- a/packages/astro/e2e/fixtures/nested-in-vue/package.json +++ b/packages/astro/e2e/fixtures/nested-in-vue/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/e2e/fixtures/nested-recursive/package.json b/packages/astro/e2e/fixtures/nested-recursive/package.json index 60f915912c63..edf31ec38ee0 100644 --- a/packages/astro/e2e/fixtures/nested-recursive/package.json +++ b/packages/astro/e2e/fixtures/nested-recursive/package.json @@ -15,7 +15,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" }, "scripts": { diff --git a/packages/astro/e2e/fixtures/svelte-component/package.json b/packages/astro/e2e/fixtures/svelte-component/package.json index 8e0070443f99..e241f3511a0d 100644 --- a/packages/astro/e2e/fixtures/svelte-component/package.json +++ b/packages/astro/e2e/fixtures/svelte-component/package.json @@ -6,6 +6,6 @@ "@astrojs/mdx": "workspace:*", "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/e2e/fixtures/view-transitions/package.json b/packages/astro/e2e/fixtures/view-transitions/package.json index ce1f77512f6e..b84932f959d2 100644 --- a/packages/astro/e2e/fixtures/view-transitions/package.json +++ b/packages/astro/e2e/fixtures/view-transitions/package.json @@ -12,7 +12,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/test/fixtures/0-css/package.json b/packages/astro/test/fixtures/0-css/package.json index 010aa3dbf01d..cba62b04fce0 100644 --- a/packages/astro/test/fixtures/0-css/package.json +++ b/packages/astro/test/fixtures/0-css/package.json @@ -9,7 +9,7 @@ "astro": "workspace:*", "react": "^18.3.1", "react-dom": "^18.3.1", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/package.json b/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/package.json index 00fe64e7d187..dc3e0e67ef4b 100644 --- a/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/package.json +++ b/packages/astro/test/fixtures/alias-tsconfig-baseurl-only/package.json @@ -5,6 +5,6 @@ "dependencies": { "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/test/fixtures/alias-tsconfig/package.json b/packages/astro/test/fixtures/alias-tsconfig/package.json index e40ba8b102cc..1a812108551c 100644 --- a/packages/astro/test/fixtures/alias-tsconfig/package.json +++ b/packages/astro/test/fixtures/alias-tsconfig/package.json @@ -6,6 +6,6 @@ "@astrojs/svelte": "workspace:*", "@test/namespace-package": "workspace:*", "astro": "workspace:*", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/test/fixtures/alias/package.json b/packages/astro/test/fixtures/alias/package.json index e4b965e782e1..8df1bf6657d1 100644 --- a/packages/astro/test/fixtures/alias/package.json +++ b/packages/astro/test/fixtures/alias/package.json @@ -5,6 +5,6 @@ "dependencies": { "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/test/fixtures/astro-children/package.json b/packages/astro/test/fixtures/astro-children/package.json index 11e987db4f2a..4848860c1777 100644 --- a/packages/astro/test/fixtures/astro-children/package.json +++ b/packages/astro/test/fixtures/astro-children/package.json @@ -8,7 +8,7 @@ "@astrojs/vue": "workspace:*", "astro": "workspace:*", "preact": "^10.24.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/test/fixtures/astro-client-only/package.json b/packages/astro/test/fixtures/astro-client-only/package.json index 50f2eeee0e80..359b19c732c5 100644 --- a/packages/astro/test/fixtures/astro-client-only/package.json +++ b/packages/astro/test/fixtures/astro-client-only/package.json @@ -9,6 +9,6 @@ "astro": "workspace:*", "react": "^18.3.1", "react-dom": "^18.3.1", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/test/fixtures/astro-dynamic/package.json b/packages/astro/test/fixtures/astro-dynamic/package.json index 45dd66908a9c..992042490606 100644 --- a/packages/astro/test/fixtures/astro-dynamic/package.json +++ b/packages/astro/test/fixtures/astro-dynamic/package.json @@ -8,6 +8,6 @@ "astro": "workspace:*", "react": "^18.3.1", "react-dom": "^18.3.1", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/test/fixtures/astro-slots-nested/package.json b/packages/astro/test/fixtures/astro-slots-nested/package.json index 24d97a2e2207..821d6b8398c9 100644 --- a/packages/astro/test/fixtures/astro-slots-nested/package.json +++ b/packages/astro/test/fixtures/astro-slots-nested/package.json @@ -13,7 +13,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/test/fixtures/component-library/package.json b/packages/astro/test/fixtures/component-library/package.json index 33e22db04fef..3dc6e598e313 100644 --- a/packages/astro/test/fixtures/component-library/package.json +++ b/packages/astro/test/fixtures/component-library/package.json @@ -11,6 +11,6 @@ "preact": "^10.24.3", "react": "^18.3.1", "react-dom": "^18.3.1", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/test/fixtures/css-dangling-references/package.json b/packages/astro/test/fixtures/css-dangling-references/package.json index c7232eb81963..9178a46939a6 100644 --- a/packages/astro/test/fixtures/css-dangling-references/package.json +++ b/packages/astro/test/fixtures/css-dangling-references/package.json @@ -5,6 +5,6 @@ "dependencies": { "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } \ No newline at end of file diff --git a/packages/astro/test/fixtures/fetch/package.json b/packages/astro/test/fixtures/fetch/package.json index ba0de568f1d2..0ce84dd36970 100644 --- a/packages/astro/test/fixtures/fetch/package.json +++ b/packages/astro/test/fixtures/fetch/package.json @@ -8,7 +8,7 @@ "@astrojs/vue": "workspace:*", "astro": "workspace:*", "preact": "^10.24.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/test/fixtures/jsx/package.json b/packages/astro/test/fixtures/jsx/package.json index d272c88f3b39..dba9473da607 100644 --- a/packages/astro/test/fixtures/jsx/package.json +++ b/packages/astro/test/fixtures/jsx/package.json @@ -16,7 +16,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/astro/test/fixtures/postcss/package.json b/packages/astro/test/fixtures/postcss/package.json index a3388487d1b8..31cb1a58097f 100644 --- a/packages/astro/test/fixtures/postcss/package.json +++ b/packages/astro/test/fixtures/postcss/package.json @@ -10,7 +10,7 @@ "autoprefixer": "^10.4.20", "postcss": "^8.4.47", "solid-js": "^1.9.3", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" }, "devDependencies": { diff --git a/packages/astro/test/fixtures/server-islands/hybrid/package.json b/packages/astro/test/fixtures/server-islands/hybrid/package.json index 8c6ff34a503f..7faaf9a8a24c 100644 --- a/packages/astro/test/fixtures/server-islands/hybrid/package.json +++ b/packages/astro/test/fixtures/server-islands/hybrid/package.json @@ -5,6 +5,6 @@ "dependencies": { "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/test/fixtures/server-islands/ssr/package.json b/packages/astro/test/fixtures/server-islands/ssr/package.json index 71f912398631..9cc1cfe98496 100644 --- a/packages/astro/test/fixtures/server-islands/ssr/package.json +++ b/packages/astro/test/fixtures/server-islands/ssr/package.json @@ -5,6 +5,6 @@ "dependencies": { "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/test/fixtures/slots-svelte/package.json b/packages/astro/test/fixtures/slots-svelte/package.json index cab8256442f8..f7691a3a7a39 100644 --- a/packages/astro/test/fixtures/slots-svelte/package.json +++ b/packages/astro/test/fixtures/slots-svelte/package.json @@ -6,6 +6,6 @@ "@astrojs/mdx": "workspace:*", "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/test/fixtures/svelte-component/package.json b/packages/astro/test/fixtures/svelte-component/package.json index e4058953760f..1893fdab8375 100644 --- a/packages/astro/test/fixtures/svelte-component/package.json +++ b/packages/astro/test/fixtures/svelte-component/package.json @@ -5,6 +5,6 @@ "dependencies": { "@astrojs/svelte": "workspace:*", "astro": "workspace:*", - "svelte": "^5.1.9" + "svelte": "^5.1.12" } } diff --git a/packages/astro/test/fixtures/vue-with-multi-renderer/package.json b/packages/astro/test/fixtures/vue-with-multi-renderer/package.json index d4e9f2f7f57a..b82f1d7f8dfb 100644 --- a/packages/astro/test/fixtures/vue-with-multi-renderer/package.json +++ b/packages/astro/test/fixtures/vue-with-multi-renderer/package.json @@ -6,7 +6,7 @@ "@astrojs/svelte": "workspace:*", "@astrojs/vue": "workspace:*", "astro": "workspace:*", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vue": "^3.5.12" } } diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index 35ce02a51d0f..640a3ef9812c 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -48,12 +48,12 @@ "devDependencies": { "astro": "workspace:*", "astro-scripts": "workspace:*", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "vite": "^5.4.10" }, "peerDependencies": { "astro": "^4.0.0", - "svelte": "^5.1.9", + "svelte": "^5.1.12", "typescript": "^5.3.3" }, "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d7c85056b49b..ff76bb1a109d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -257,8 +257,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -320,8 +320,8 @@ importers: specifier: ^4.16.10 version: link:../../packages/astro svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 examples/framework-vue: dependencies: @@ -374,8 +374,8 @@ importers: specifier: ^4.16.10 version: link:../../packages/astro svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 examples/starlog: dependencies: @@ -934,8 +934,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1058,8 +1058,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1127,8 +1127,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1186,8 +1186,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1226,8 +1226,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1266,8 +1266,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1306,8 +1306,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1346,8 +1346,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1386,8 +1386,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1582,8 +1582,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/e2e/fixtures/tailwindcss: dependencies: @@ -1648,8 +1648,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1786,8 +1786,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1807,8 +1807,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/test/fixtures/alias-tsconfig: dependencies: @@ -1822,8 +1822,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/test/fixtures/alias-tsconfig-baseurl-only: dependencies: @@ -1834,8 +1834,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/test/fixtures/alias-tsconfig/deps/namespace-package: {} @@ -1959,8 +1959,8 @@ importers: specifier: ^10.24.3 version: 10.24.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -1992,8 +1992,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/test/fixtures/astro-client-only/pkg: {} @@ -2084,8 +2084,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/test/fixtures/astro-env: dependencies: @@ -2411,8 +2411,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -2495,8 +2495,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/test/fixtures/component-library-shared: dependencies: @@ -2798,8 +2798,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/test/fixtures/css-import-as-inline: dependencies: @@ -3050,8 +3050,8 @@ importers: specifier: ^10.24.3 version: 10.24.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -3254,8 +3254,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -3442,8 +3442,8 @@ importers: specifier: ^1.9.3 version: 1.9.3 svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -3636,8 +3636,8 @@ importers: specifier: workspace:* version: link:../../../.. svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/test/fixtures/server-islands/ssr: dependencies: @@ -3648,8 +3648,8 @@ importers: specifier: workspace:* version: link:../../../.. svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/test/fixtures/set-html: dependencies: @@ -3717,8 +3717,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/test/fixtures/slots-vue: dependencies: @@ -4042,8 +4042,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 packages/astro/test/fixtures/tailwindcss: dependencies: @@ -4165,8 +4165,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -5165,10 +5165,10 @@ importers: dependencies: '@sveltejs/vite-plugin-svelte': specifier: ^4.0.0 - version: 4.0.0(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6)) + version: 4.0.0(svelte@5.1.12)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6)) svelte2tsx: specifier: ^0.7.22 - version: 0.7.22(svelte@5.1.9)(typescript@5.6.3) + version: 0.7.22(svelte@5.1.12)(typescript@5.6.3) devDependencies: astro: specifier: workspace:* @@ -5177,8 +5177,8 @@ importers: specifier: workspace:* version: link:../../../scripts svelte: - specifier: ^5.1.9 - version: 5.1.9 + specifier: ^5.1.12 + version: 5.1.12 vite: specifier: ^5.4.10 version: 5.4.10(@types/node@18.19.50)(sass@1.80.6) @@ -10291,8 +10291,8 @@ packages: svelte: ^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0 typescript: ^4.9.4 || ^5.0.0 - svelte@5.1.9: - resolution: {integrity: sha512-nzq+PPKGS2PoEWDjAcXSrKSbXmmmOAxd6dAz1IhRusUpVkFS6DMELWPyBPGwu6TpO/gsgtFXwX0M4+pAR5gzKw==} + svelte@5.1.12: + resolution: {integrity: sha512-U9BwbSybb9QAKAHg4hl61hVBk97U2QjUKmZa5++QEGoi6Nml6x6cC9KmNT1XObGawToN3DdLpdCs/Z5Yl5IXjQ==} engines: {node: '>=18'} svg-tags@1.0.0: @@ -12463,23 +12463,23 @@ snapshots: dependencies: solid-js: 1.9.3 - '@sveltejs/vite-plugin-svelte-inspector@3.0.1(@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6)))(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6))': + '@sveltejs/vite-plugin-svelte-inspector@3.0.1(@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.12)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6)))(svelte@5.1.12)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6))': dependencies: - '@sveltejs/vite-plugin-svelte': 4.0.0(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6)) + '@sveltejs/vite-plugin-svelte': 4.0.0(svelte@5.1.12)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6)) debug: 4.3.7 - svelte: 5.1.9 + svelte: 5.1.12 vite: 5.4.10(@types/node@18.19.50)(sass@1.80.6) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6))': + '@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.12)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 3.0.1(@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6)))(svelte@5.1.9)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6)) + '@sveltejs/vite-plugin-svelte-inspector': 3.0.1(@sveltejs/vite-plugin-svelte@4.0.0(svelte@5.1.12)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6)))(svelte@5.1.12)(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6)) debug: 4.3.7 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.12 - svelte: 5.1.9 + svelte: 5.1.12 vite: 5.4.10(@types/node@18.19.50)(sass@1.80.6) vitefu: 1.0.3(vite@5.4.10(@types/node@18.19.50)(sass@1.80.6)) transitivePeerDependencies: @@ -16430,14 +16430,14 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte2tsx@0.7.22(svelte@5.1.9)(typescript@5.6.3): + svelte2tsx@0.7.22(svelte@5.1.12)(typescript@5.6.3): dependencies: dedent-js: 1.0.1 pascal-case: 3.1.2 - svelte: 5.1.9 + svelte: 5.1.12 typescript: 5.6.3 - svelte@5.1.9: + svelte@5.1.12: dependencies: '@ampproject/remapping': 2.3.0 '@jridgewell/sourcemap-codec': 1.5.0 From f160aaa5f52b0972ee102a39655823eca22ff8da Mon Sep 17 00:00:00 2001 From: bluwy Date: Fri, 8 Nov 2024 22:35:11 +0800 Subject: [PATCH 06/15] Use snippets --- .../src/components/svelte/SvelteCounter.svelte | 9 ++++++++- .../framework-svelte/src/components/Counter.svelte | 9 ++++++++- examples/ssr/src/components/AddToCart.svelte | 2 +- examples/ssr/src/components/Cart.svelte | 2 +- .../src/components/svelte/SvelteCounter.svelte | 8 ++++---- .../src/components/svelte/SvelteCounter.svelte | 4 ++-- .../src/components/svelte/SvelteCounter.svelte | 4 ++-- .../src/components/svelte/SvelteCounter.svelte | 4 ++-- .../src/components/svelte/SvelteCounter.svelte | 4 ++-- .../src/components/svelte/SvelteCounter.svelte | 4 ++-- .../src/components/svelte/SvelteCounter.svelte | 4 ++-- .../src/components/svelte/SvelteCounter.svelte | 4 ++-- .../svelte-component/src/components/Counter.svelte | 12 ++++++++++-- .../svelte-component/src/components/Stuff.svelte | 4 ++-- .../src/components/SvelteCounter.svelte | 4 ++-- .../astro-children/src/components/Component.svelte | 6 +++++- .../src/components/SvelteCounter.svelte | 3 ++- .../fixtures/component-library-shared/Counter.svelte | 3 ++- 18 files changed, 59 insertions(+), 31 deletions(-) diff --git a/examples/framework-multiple/src/components/svelte/SvelteCounter.svelte b/examples/framework-multiple/src/components/svelte/SvelteCounter.svelte index b27452352f7a..cdf04030e149 100644 --- a/examples/framework-multiple/src/components/svelte/SvelteCounter.svelte +++ b/examples/framework-multiple/src/components/svelte/SvelteCounter.svelte @@ -2,6 +2,13 @@ A counter written with Svelte -->
- +
{ count }
- +
- + {@render children?.()}
diff --git a/packages/astro/e2e/fixtures/multiple-frameworks/src/components/svelte/SvelteCounter.svelte b/packages/astro/e2e/fixtures/multiple-frameworks/src/components/svelte/SvelteCounter.svelte index 954a62f45cdb..1a60e238dc24 100644 --- a/packages/astro/e2e/fixtures/multiple-frameworks/src/components/svelte/SvelteCounter.svelte +++ b/packages/astro/e2e/fixtures/multiple-frameworks/src/components/svelte/SvelteCounter.svelte @@ -1,6 +1,6 @@ -
Slot goes here:
+
Slot goes here:{@render children()}
diff --git a/packages/astro/e2e/fixtures/view-transitions/src/components/SvelteCounter.svelte b/packages/astro/e2e/fixtures/view-transitions/src/components/SvelteCounter.svelte index 15bf1c72486c..1e8717cff55d 100644 --- a/packages/astro/e2e/fixtures/view-transitions/src/components/SvelteCounter.svelte +++ b/packages/astro/e2e/fixtures/view-transitions/src/components/SvelteCounter.svelte @@ -1,5 +1,5 @@ +
- + {@render children()}
diff --git a/packages/astro/test/fixtures/astro-dynamic/src/components/SvelteCounter.svelte b/packages/astro/test/fixtures/astro-dynamic/src/components/SvelteCounter.svelte index 9b9241da0f02..e3c50944bebe 100644 --- a/packages/astro/test/fixtures/astro-dynamic/src/components/SvelteCounter.svelte +++ b/packages/astro/test/fixtures/astro-dynamic/src/components/SvelteCounter.svelte @@ -1,5 +1,6 @@ -
Slot goes here:{@render children()}
+
Slot goes here:{@render children?.()}
diff --git a/packages/astro/e2e/fixtures/view-transitions/src/components/SvelteCounter.svelte b/packages/astro/e2e/fixtures/view-transitions/src/components/SvelteCounter.svelte index 1e8717cff55d..5fa67040d23d 100644 --- a/packages/astro/e2e/fixtures/view-transitions/src/components/SvelteCounter.svelte +++ b/packages/astro/e2e/fixtures/view-transitions/src/components/SvelteCounter.svelte @@ -17,7 +17,7 @@
- {@render children()} + {@render children?.()}