diff --git a/.changeset/khaki-dogs-knock.md b/.changeset/khaki-dogs-knock.md new file mode 100644 index 0000000..7eaa7a7 --- /dev/null +++ b/.changeset/khaki-dogs-knock.md @@ -0,0 +1,5 @@ +--- +"svelte-twc": patch +--- + +Bumpup svelte diff --git a/package.json b/package.json index f1dfbe0..05b495b 100644 --- a/package.json +++ b/package.json @@ -43,17 +43,17 @@ "esbuild": "^0.20.2", "prettier": "^3.1.1", "prettier-plugin-svelte": "^3.2.3", - "svelte": "5.0.0-next.238", + "svelte": "5.0.0-next.269", "tsx": "^4.7.2", "typescript": "^5.4.5", "vite": "^5.2.10" }, "peerDependencies": { - "svelte": ">=5.0.0-next.238", + "svelte": ">=5.0.0-next.269", "vite": ">=2.0.0" }, "files": [ "dist" ], - "packageManager": "pnpm@9.8.0+sha512.8e4c3550fb500e808dbc30bb0ce4dd1eb614e30b1c55245f211591ec2cdf9c611cabd34e1364b42f564bd54b3945ed0f49d61d1bbf2ec9bd74b866fcdc723276" + "packageManager": "pnpm@9.12.2+sha512.22721b3a11f81661ae1ec68ce1a7b879425a1ca5b991c975b074ac220b187ce56c708fe5db69f4c962c989452eee76c82877f4ee80f474cebd61ee13461b6228" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 47b0d53..a901199 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,10 +25,10 @@ importers: version: 3.2.5 prettier-plugin-svelte: specifier: ^3.2.3 - version: 3.2.3(prettier@3.2.5)(svelte@5.0.0-next.238) + version: 3.2.3(prettier@3.2.5)(svelte@5.0.0-next.269) svelte: - specifier: 5.0.0-next.238 - version: 5.0.0-next.238 + specifier: 5.0.0-next.269 + version: 5.0.0-next.269 tsx: specifier: ^4.7.2 version: 4.7.2 @@ -43,20 +43,20 @@ importers: dependencies: svelte-exmarkdown: specifier: ^3.0.3 - version: 3.0.3(svelte@5.0.0-next.238) + version: 3.0.3(svelte@5.0.0-next.269) devDependencies: '@playwright/test': specifier: ^1.43.1 version: 1.43.1 '@sveltejs/adapter-static': specifier: ^3.0.1 - version: 3.0.1(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7))) + version: 3.0.1(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7))) '@sveltejs/kit': specifier: ^2.5.7 - version: 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)) + version: 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)) '@sveltejs/vite-plugin-svelte': specifier: ^3.1.0 - version: 3.1.0(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)) + version: 3.1.0(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)) autoprefixer: specifier: ^10.4.19 version: 10.4.19(postcss@8.4.38) @@ -70,11 +70,11 @@ importers: specifier: ^7.0.0 version: 7.0.0 svelte: - specifier: 5.0.0-next.238 - version: 5.0.0-next.238 + specifier: 5.0.0-next.269 + version: 5.0.0-next.269 svelte-check: specifier: ^3.6.9 - version: 3.6.9(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.238) + version: 3.6.9(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.269) svelte-twc: specifier: workspace:* version: link:.. @@ -470,6 +470,9 @@ packages: '@jridgewell/sourcemap-codec@1.4.15': resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + '@jridgewell/sourcemap-codec@1.5.0': + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} @@ -659,8 +662,8 @@ packages: peerDependencies: acorn: '>=8.9.0' - acorn@8.11.3: - resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + acorn@8.13.0: + resolution: {integrity: sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==} engines: {node: '>=0.4.0'} hasBin: true @@ -701,8 +704,9 @@ packages: argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - aria-query@5.3.0: - resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} + aria-query@5.3.2: + resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} + engines: {node: '>= 0.4'} array-buffer-byte-length@1.0.1: resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} @@ -735,8 +739,9 @@ packages: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} - axobject-query@4.0.0: - resolution: {integrity: sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==} + axobject-query@4.1.0: + resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} + engines: {node: '>= 0.4'} bail@2.0.2: resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} @@ -1430,6 +1435,9 @@ packages: magic-string@0.30.10: resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} + magic-string@0.30.12: + resolution: {integrity: sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==} + map-obj@1.0.1: resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} engines: {node: '>=0.10.0'} @@ -2140,8 +2148,8 @@ packages: typescript: optional: true - svelte@5.0.0-next.238: - resolution: {integrity: sha512-fCPNBqQA/MYadkI58LOV3kpYHP5zOsMSjjPagc63Z5LXRkdZe/TKOJbVtLK9Gp4+Shf3qTaxBCp/BR1845Rd/A==} + svelte@5.0.0-next.269: + resolution: {integrity: sha512-TiC0JWP0OwPcJ+z6ysS9UsH6WDplJYsJR+y4ble9fmbW5OYFEQHJrIlktrO23O8p8EPU/olUpKdfIcugR++jbQ==} engines: {node: '>=18'} tailwindcss@3.4.3: @@ -2753,7 +2761,7 @@ snapshots: '@jridgewell/gen-mapping@0.3.5': dependencies: '@jridgewell/set-array': 1.2.1 - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 '@jridgewell/trace-mapping': 0.3.25 '@jridgewell/resolve-uri@3.1.2': {} @@ -2762,6 +2770,8 @@ snapshots: '@jridgewell/sourcemap-codec@1.4.15': {} + '@jridgewell/sourcemap-codec@1.5.0': {} + '@jridgewell/trace-mapping@0.3.25': dependencies: '@jridgewell/resolve-uri': 3.1.2 @@ -2852,13 +2862,13 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.16.4': optional: true - '@sveltejs/adapter-static@3.0.1(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)))': + '@sveltejs/adapter-static@3.0.1(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)))': dependencies: - '@sveltejs/kit': 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)) + '@sveltejs/kit': 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)) - '@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7))': + '@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.0(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)) + '@sveltejs/vite-plugin-svelte': 3.1.0(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)) '@types/cookie': 0.6.0 cookie: 0.6.0 devalue: 5.0.0 @@ -2870,28 +2880,28 @@ snapshots: sade: 1.8.1 set-cookie-parser: 2.6.0 sirv: 2.0.4 - svelte: 5.0.0-next.238 + svelte: 5.0.0-next.269 tiny-glob: 0.2.9 vite: 5.2.10(@types/node@20.12.7) - '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7))': + '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.0(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)) + '@sveltejs/vite-plugin-svelte': 3.1.0(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)) debug: 4.3.4 - svelte: 5.0.0-next.238 + svelte: 5.0.0-next.269 vite: 5.2.10(@types/node@20.12.7) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7))': + '@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.238)(vite@5.2.10(@types/node@20.12.7)) + '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)))(svelte@5.0.0-next.269)(vite@5.2.10(@types/node@20.12.7)) debug: 4.3.4 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.10 - svelte: 5.0.0-next.238 - svelte-hmr: 0.16.0(svelte@5.0.0-next.238) + svelte: 5.0.0-next.269 + svelte-hmr: 0.16.0(svelte@5.0.0-next.269) vite: 5.2.10(@types/node@20.12.7) vitefu: 0.2.5(vite@5.2.10(@types/node@20.12.7)) transitivePeerDependencies: @@ -2933,11 +2943,11 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - acorn-typescript@1.4.13(acorn@8.11.3): + acorn-typescript@1.4.13(acorn@8.13.0): dependencies: - acorn: 8.11.3 + acorn: 8.13.0 - acorn@8.11.3: {} + acorn@8.13.0: {} ansi-colors@4.1.3: {} @@ -2968,9 +2978,7 @@ snapshots: dependencies: sprintf-js: 1.0.3 - aria-query@5.3.0: - dependencies: - dequal: 2.0.3 + aria-query@5.3.2: {} array-buffer-byte-length@1.0.1: dependencies: @@ -3013,9 +3021,7 @@ snapshots: dependencies: possible-typed-array-names: 1.0.0 - axobject-query@4.0.0: - dependencies: - dequal: 2.0.3 + axobject-query@4.1.0: {} bail@2.0.2: {} @@ -3396,7 +3402,7 @@ snapshots: esrap@1.2.2: dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 '@types/estree': 1.0.5 extend@3.0.2: {} @@ -3787,6 +3793,10 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 + magic-string@0.30.12: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 + map-obj@1.0.1: {} map-obj@4.3.0: {} @@ -4316,10 +4326,10 @@ snapshots: path-exists: 4.0.0 which-pm: 2.0.0 - prettier-plugin-svelte@3.2.3(prettier@3.2.5)(svelte@5.0.0-next.238): + prettier-plugin-svelte@3.2.3(prettier@3.2.5)(svelte@5.0.0-next.269): dependencies: prettier: 3.2.5 - svelte: 5.0.0-next.238 + svelte: 5.0.0-next.269 prettier@2.8.8: {} @@ -4654,7 +4664,7 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-check@3.6.9(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.238): + svelte-check@3.6.9(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.269): dependencies: '@jridgewell/trace-mapping': 0.3.25 chokidar: 3.6.0 @@ -4662,8 +4672,8 @@ snapshots: import-fresh: 3.3.0 picocolors: 1.0.0 sade: 1.8.1 - svelte: 5.0.0-next.238 - svelte-preprocess: 5.1.4(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.238)(typescript@5.4.5) + svelte: 5.0.0-next.269 + svelte-preprocess: 5.1.4(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.269)(typescript@5.4.5) typescript: 5.4.5 transitivePeerDependencies: - '@babel/core' @@ -4676,47 +4686,47 @@ snapshots: - stylus - sugarss - svelte-exmarkdown@3.0.3(svelte@5.0.0-next.238): + svelte-exmarkdown@3.0.3(svelte@5.0.0-next.269): dependencies: remark-gfm: 4.0.0 remark-parse: 11.0.0 remark-rehype: 11.1.0 - svelte: 5.0.0-next.238 + svelte: 5.0.0-next.269 unified: 11.0.4 transitivePeerDependencies: - supports-color - svelte-hmr@0.16.0(svelte@5.0.0-next.238): + svelte-hmr@0.16.0(svelte@5.0.0-next.269): dependencies: - svelte: 5.0.0-next.238 + svelte: 5.0.0-next.269 - svelte-preprocess@5.1.4(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.238)(typescript@5.4.5): + svelte-preprocess@5.1.4(postcss-load-config@4.0.2(postcss@8.4.38))(postcss@8.4.38)(svelte@5.0.0-next.269)(typescript@5.4.5): dependencies: '@types/pug': 2.0.10 detect-indent: 6.1.0 magic-string: 0.30.10 sorcery: 0.11.0 strip-indent: 3.0.0 - svelte: 5.0.0-next.238 + svelte: 5.0.0-next.269 optionalDependencies: postcss: 8.4.38 postcss-load-config: 4.0.2(postcss@8.4.38) typescript: 5.4.5 - svelte@5.0.0-next.238: + svelte@5.0.0-next.269: dependencies: '@ampproject/remapping': 2.3.0 - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 '@types/estree': 1.0.5 - acorn: 8.11.3 - acorn-typescript: 1.4.13(acorn@8.11.3) - aria-query: 5.3.0 - axobject-query: 4.0.0 + acorn: 8.13.0 + acorn-typescript: 1.4.13(acorn@8.13.0) + aria-query: 5.3.2 + 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.10 + magic-string: 0.30.12 zimmerframe: 1.1.2 tailwindcss@3.4.3: diff --git a/site/package.json b/site/package.json index 222a251..d9a0d01 100644 --- a/site/package.json +++ b/site/package.json @@ -19,7 +19,7 @@ "highlight.js": "^11.9.0", "postcss": "^8.4.38", "rehype-highlight": "^7.0.0", - "svelte": "5.0.0-next.238", + "svelte": "5.0.0-next.269", "svelte-check": "^3.6.9", "svelte-twc": "workspace:*", "tailwindcss": "^3.4.3", diff --git a/src/internal/client.ts b/src/internal/client.ts index b2f5d14..43a27bd 100644 --- a/src/internal/client.ts +++ b/src/internal/client.ts @@ -21,7 +21,7 @@ return function TwcComponent($$anchor, $$props) { let attributes; var node = $.child(div); - $.snippet(node, () => $$props.children); + $.snippet(node, () => $$props.children ?? $.noop); $.reset(div); $.template_effect(() => attributes = $.set_attributes(div, attributes, { diff --git a/src/internal/server.ts b/src/internal/server.ts index f5d342f..44e8e64 100644 --- a/src/internal/server.ts +++ b/src/internal/server.ts @@ -6,7 +6,13 @@ const cls = String.raw({ raw: typeof strings === 'string' ? [strings] : strings return function TwcComponent($$payload, $$props) { $.push(); - let { children, class: className, ...props } = $$props; + let { + children, + class: className, + $$slots, + $$events, + ...props + } = $$props; $$payload.out += `<${el}${$.spread_attributes({ ...props, diff --git a/src/svelte-internal.d.ts b/src/svelte-internal.d.ts index 7507f11..3e2976e 100644 --- a/src/svelte-internal.d.ts +++ b/src/svelte-internal.d.ts @@ -11,9 +11,11 @@ declare module 'svelte/internal/*' { declare function snippet(...values: any[]): any; declare function append(...values: any[]): any; declare function reset(...values: any[]): any; + declare function noop(...values: any[]): any; export { append, child, + noop, pop, push, reset,