diff --git a/package-lock.json b/package-lock.json
index 30d400ea9..93cdce861 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -70,7 +70,7 @@
"npm-run-all": "4.1.5",
"prettier": "3.3.3",
"proxyquire": "2.1.3",
- "svelte": "^4.2.19",
+ "svelte": "5.1.9",
"symlink-dir": "6.0.2",
"typescript": "5.6.3",
"upem": "9.0.4",
@@ -1213,9 +1213,9 @@
}
},
"node_modules/@types/estree": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
- "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz",
+ "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==",
"dev": true,
"license": "MIT"
},
@@ -1578,6 +1578,16 @@
"node": ">=0.4.0"
}
},
+ "node_modules/acorn-typescript": {
+ "version": "1.4.13",
+ "resolved": "https://registry.npmjs.org/acorn-typescript/-/acorn-typescript-1.4.13.tgz",
+ "integrity": "sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "acorn": ">=8.9.0"
+ }
+ },
"node_modules/acorn-walk": {
"version": "8.3.4",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz",
@@ -1690,13 +1700,13 @@
"license": "Python-2.0"
},
"node_modules/aria-query": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
- "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz",
+ "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==",
"dev": true,
"license": "Apache-2.0",
- "dependencies": {
- "dequal": "^2.0.3"
+ "engines": {
+ "node": ">= 0.4"
}
},
"node_modules/array-buffer-byte-length": {
@@ -2281,30 +2291,6 @@
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
- "node_modules/code-red": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz",
- "integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@jridgewell/sourcemap-codec": "^1.4.15",
- "@types/estree": "^1.0.1",
- "acorn": "^8.10.0",
- "estree-walker": "^3.0.3",
- "periscopic": "^3.1.0"
- }
- },
- "node_modules/code-red/node_modules/estree-walker": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
- "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/estree": "^1.0.0"
- }
- },
"node_modules/coffeescript": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-2.7.0.tgz",
@@ -2395,20 +2381,6 @@
"node": ">= 8"
}
},
- "node_modules/css-tree": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",
- "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "mdn-data": "2.0.30",
- "source-map-js": "^1.0.1"
- },
- "engines": {
- "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0"
- }
- },
"node_modules/data-view-buffer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz",
@@ -2544,16 +2516,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/dequal": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
- "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/diff": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz",
@@ -3546,6 +3508,13 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/esm-env": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.1.4.tgz",
+ "integrity": "sha512-oO82nKPHKkzIj/hbtuDYy/JHqBHFlMIW36SDiPCVsj87ntDLcWN+sJ1erdVryd4NxODacFTsdrIE3b7IamqbOg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/espree": {
"version": "9.6.1",
"resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
@@ -3577,6 +3546,17 @@
"node": ">=0.10"
}
},
+ "node_modules/esrap": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/esrap/-/esrap-1.2.2.tgz",
+ "integrity": "sha512-F2pSJklxx1BlQIQgooczXCPHmcWpn6EsP5oo73LQfonG9fIlIENQ8vMmfGXeojP9MrkzUNAfyU5vdFlR9shHAw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.4.15",
+ "@types/estree": "^1.0.1"
+ }
+ },
"node_modules/esrecurse": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
@@ -5415,13 +5395,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/mdn-data": {
- "version": "2.0.30",
- "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
- "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",
- "dev": true,
- "license": "CC0-1.0"
- },
"node_modules/memoize": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/memoize/-/memoize-10.0.0.tgz",
@@ -6314,28 +6287,6 @@
"dev": true,
"license": "ISC"
},
- "node_modules/periscopic": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/periscopic/-/periscopic-3.1.0.tgz",
- "integrity": "sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/estree": "^1.0.0",
- "estree-walker": "^3.0.0",
- "is-reference": "^3.0.0"
- }
- },
- "node_modules/periscopic/node_modules/estree-walker": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
- "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/estree": "^1.0.0"
- }
- },
"node_modules/picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
@@ -7513,39 +7464,28 @@
}
},
"node_modules/svelte": {
- "version": "4.2.19",
- "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.19.tgz",
- "integrity": "sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@ampproject/remapping": "^2.2.1",
- "@jridgewell/sourcemap-codec": "^1.4.15",
- "@jridgewell/trace-mapping": "^0.3.18",
- "@types/estree": "^1.0.1",
- "acorn": "^8.9.0",
- "aria-query": "^5.3.0",
- "axobject-query": "^4.0.0",
- "code-red": "^1.0.3",
- "css-tree": "^2.3.1",
- "estree-walker": "^3.0.3",
- "is-reference": "^3.0.1",
+ "version": "5.1.9",
+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.1.9.tgz",
+ "integrity": "sha512-nzq+PPKGS2PoEWDjAcXSrKSbXmmmOAxd6dAz1IhRusUpVkFS6DMELWPyBPGwu6TpO/gsgtFXwX0M4+pAR5gzKw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@ampproject/remapping": "^2.3.0",
+ "@jridgewell/sourcemap-codec": "^1.5.0",
+ "@types/estree": "^1.0.5",
+ "acorn": "^8.12.1",
+ "acorn-typescript": "^1.4.13",
+ "aria-query": "^5.3.1",
+ "axobject-query": "^4.1.0",
+ "esm-env": "^1.0.0",
+ "esrap": "^1.2.2",
+ "is-reference": "^3.0.2",
"locate-character": "^3.0.0",
- "magic-string": "^0.30.4",
- "periscopic": "^3.1.0"
+ "magic-string": "^0.30.11",
+ "zimmerframe": "^1.1.2"
},
"engines": {
- "node": ">=16"
- }
- },
- "node_modules/svelte/node_modules/estree-walker": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
- "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/estree": "^1.0.0"
+ "node": ">=18"
}
},
"node_modules/symlink-dir": {
@@ -8384,6 +8324,13 @@
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
+ },
+ "node_modules/zimmerframe": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz",
+ "integrity": "sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==",
+ "dev": true,
+ "license": "MIT"
}
}
}
diff --git a/package.json b/package.json
index 7c551870a..81b1c7a45 100644
--- a/package.json
+++ b/package.json
@@ -258,7 +258,7 @@
"npm-run-all": "4.1.5",
"prettier": "3.3.3",
"proxyquire": "2.1.3",
- "svelte": "^4.2.19",
+ "svelte": "5.1.9",
"symlink-dir": "6.0.2",
"typescript": "5.6.3",
"upem": "9.0.4",
@@ -287,11 +287,6 @@
"package": "rechoir",
"policy": "wanted",
"because": "we want to keep rechoir ~similar to what webpack-cli uses (which is ^0.8.0 since 2022-11-15). See https://github.com/webpack/webpack-cli/blame/master/packages/webpack-cli/package.json"
- },
- {
- "package": "svelte",
- "policy": "wanted",
- "because": "upgrading to supporting svelte 5 will require a non-trivial amount of labour (which we are going to invest, but not right now)"
}
]
},
@@ -303,7 +298,7 @@
"coffee-script": ">=1.0.0 <2.0.0",
"coffeescript": ">=1.0.0 <3.0.0",
"livescript": ">=1.0.0 <2.0.0",
- "svelte": ">=3.0.0 <5.0.0",
+ "svelte": ">=3.0.0 <6.0.0",
"swc": ">=1.0.0 <2.0.0",
"typescript": ">=2.0.0 <6.0.0",
"vue-template-compiler": ">=2.0.0 <3.0.0",
diff --git a/src/extract/transpile/svelte-wrap.mjs b/src/extract/transpile/svelte-wrap.mjs
index 022046e3c..83e11dbf2 100644
--- a/src/extract/transpile/svelte-wrap.mjs
+++ b/src/extract/transpile/svelte-wrap.mjs
@@ -14,7 +14,7 @@ function getTranspiler(pTranspilerWrapper) {
pTranspilerWrapper,
pTranspilerOptions,
);
- return compile(lPreProcessedSource).js.code;
+ return compile(lPreProcessedSource, {}).js.code;
};
}
diff --git a/src/meta.cjs b/src/meta.cjs
index 63f9c1b3a..e184fbcd1 100644
--- a/src/meta.cjs
+++ b/src/meta.cjs
@@ -10,7 +10,7 @@ module.exports = {
"coffee-script": ">=1.0.0 <2.0.0",
coffeescript: ">=1.0.0 <3.0.0",
livescript: ">=1.0.0 <2.0.0",
- svelte: ">=3.0.0 <5.0.0",
+ svelte: ">=3.0.0 <6.0.0",
swc: ">=1.0.0 <2.0.0",
typescript: ">=2.0.0 <6.0.0",
"vue-template-compiler": ">=2.0.0 <3.0.0",
diff --git a/test/extract/transpile/__fixtures__/svelte-too.js b/test/extract/transpile/__fixtures__/svelte-too.js
index ad617a349..9cc142842 100644
--- a/test/extract/transpile/__fixtures__/svelte-too.js
+++ b/test/extract/transpile/__fixtures__/svelte-too.js
@@ -1,105 +1,34 @@
-/* generated by Svelte v4.2.19 */
-import {
- SvelteComponent,
- append,
- create_component,
- destroy_component,
- detach,
- element,
- init,
- insert,
- mount_component,
- safe_not_equal,
- space,
- transition_in,
- transition_out,
-} from "svelte/internal";
-
import "svelte/internal/disclose-version";
+import * as $ from "svelte/internal/client";
import "./page.css";
import Header from "./Header.svelte";
-function create_fragment(ctx) {
- let article;
- let header;
- let t0;
- let section;
- let current;
+var root = $.template(
+ `Pages in Storybook