Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/friendly-queens-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"svelte": patch
---

chore: bump some devDependencies
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@sveltejs/eslint-config": "^8.3.3",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@types/node": "^20.11.5",
"@types/picomatch": "^4.0.2",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beats me why we suddenly need this to solve some typechecking errors, but that's the javascript ecosystem for you

"@vitest/coverage-v8": "^2.1.9",
"eslint": "^9.9.1",
"eslint-plugin-lube": "^0.4.3",
Expand Down
7 changes: 6 additions & 1 deletion packages/svelte/src/compiler/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,16 @@ export type DeclarationKind =
| 'var'
| 'let'
| 'const'
| 'using'
| 'await using'
| 'function'
| 'import'
| 'param'
| 'rest_param'
| 'synthetic';
| 'synthetic'
// TODO not yet implemented, but needed for TypeScript reasons
| 'using'
| 'await using';

export interface ExpressionMetadata {
/** All the bindings that are referenced eagerly (not inside functions) in this expression */
Expand Down
12 changes: 11 additions & 1 deletion packages/svelte/src/compiler/utils/builders.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,14 @@ export function prop(kind, key, value, computed = false) {
* @returns {ESTree.PropertyDefinition}
*/
export function prop_def(key, value, computed = false, is_static = false) {
return { type: 'PropertyDefinition', key, value, computed, static: is_static };
return {
type: 'PropertyDefinition',
decorators: [],
key,
value,
computed,
static: is_static
};
}

/**
Expand Down Expand Up @@ -565,6 +572,7 @@ function for_builder(init, test, update, body) {
export function method(kind, key, params, body, computed = false, is_static = false) {
return {
type: 'MethodDefinition',
decorators: [],
key,
kind,
value: function_builder(null, params, block(body)),
Expand Down Expand Up @@ -610,6 +618,7 @@ function if_builder(test, consequent, alternate) {
export function import_all(as, source) {
return {
type: 'ImportDeclaration',
attributes: [],
source: literal(source),
specifiers: [import_namespace(as)]
};
Expand All @@ -623,6 +632,7 @@ export function import_all(as, source) {
export function imports(parts, source) {
return {
type: 'ImportDeclaration',
attributes: [],
source: literal(source),
specifiers: parts.map((p) => ({
type: 'ImportSpecifier',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@
"kind": "let"
},
"specifiers": [],
"source": null
"source": null,
"attributes": []
}
],
"sourceType": "module"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"kind": "const"
},
"specifiers": [],
"source": null
"source": null,
"attributes": []
}
],
"sourceType": "module"
Expand Down
9 changes: 0 additions & 9 deletions playgrounds/sandbox/Wrapper.svelte

This file was deleted.

2 changes: 1 addition & 1 deletion playgrounds/sandbox/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<script type="module">
import { mount, hydrate, unmount } from 'svelte';
import App from '/Wrapper.svelte';
import App from '/src/App.svelte';

globalThis.delayed = (v, ms = 1000) => {
return new Promise((f) => {
Expand Down
8 changes: 5 additions & 3 deletions playgrounds/sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
"start": "node run.js"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.6",
"@sveltejs/vite-plugin-svelte": "^6.2.0",
"@types/node": "^24.5.2",
"polka": "^1.0.0-next.25",
"svelte": "workspace:*",
"tinyglobby": "^0.2.12",
"vite": "^5.4.20",
"vite-plugin-inspect": "^0.8.4"
"vite": "^7.1.5",
"vite-plugin-devtools-json": "^1.0.0",
"vite-plugin-inspect": "^11.3.3"
}
}
6 changes: 4 additions & 2 deletions playgrounds/sandbox/ssr-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import polka from 'polka';
import { createServer as createViteServer } from 'vite';
import { render } from 'svelte/server';
import './ssr-common.js';

const PORT = process.env.PORT || '5173';
Expand All @@ -23,8 +22,11 @@ polka()
.use(async (req, res) => {
const template = fs.readFileSync(path.resolve(__dirname, 'index.html'), 'utf-8');
const transformed_template = await vite.transformIndexHtml(req.url, template);

const { render } = await vite.ssrLoadModule('svelte/server');
const { default: App } = await vite.ssrLoadModule('/src/App.svelte');
const { head, body } = render(App);

const { head, body } = await render(App);

const html = transformed_template
.replace(`<!--ssr-head-->`, head)
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/sandbox/ssr-prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { render } from 'svelte/server';
import App from './src/App.svelte';
import './ssr-common.js';

const { head, body } = render(App);
const { head, body } = await render(App);

const rendered = fs
.readFileSync(path.resolve('./dist/client/index.html'), 'utf-8')
Expand Down
3 changes: 2 additions & 1 deletion playgrounds/sandbox/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { defineConfig } from 'vite';
import inspect from 'vite-plugin-inspect';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import devtools from 'vite-plugin-devtools-json';

export default defineConfig({
build: {
minify: false
},

plugins: [inspect(), svelte()],
plugins: [devtools(), inspect(), svelte()],

optimizeDeps: {
// svelte is a local workspace package, optimizing it would require dev server restarts with --force for every change
Expand Down
Loading
Loading