Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
65ca241
chore: add vite8 overrides
dominikg Jan 21, 2026
1b7404b
chore: update local vite version to v7, use override to ensure worksp…
dominikg Jan 26, 2026
a14cdf6
fix: update baseline vite version to actual minimum and disable lib c…
dominikg Jan 26, 2026
9fd05df
revert to main
dominikg Jan 26, 2026
6580571
use overrides for text matrix and define version in extra catalogs
dominikg Jan 26, 2026
05baea8
fix: remove Y flag and add vite to failure name
dominikg Jan 26, 2026
ae7d6d1
fix yq syntax, githubt uses yqgo https://mikefarah.gitbook.io/yq
dominikg Jan 26, 2026
5588e6f
fix pnpm install
dominikg Jan 26, 2026
3496c21
fix: remove accidentally commited overrides
dominikg Jan 26, 2026
3815483
lets see if these change make vite5 tests pass
dominikg Jan 26, 2026
f294dc0
more stable local testing
dominikg Jan 27, 2026
367d88a
fix: introduce per server file state util in test app and use it to e…
dominikg Jan 27, 2026
1e6e37d
fix: account for build using _ instead of + in +server.js files
dominikg Jan 27, 2026
710e60a
remove debug code and format
dominikg Jan 27, 2026
59922ca
fix: override vite and vps for node18
dominikg Jan 28, 2026
d15c494
fix: move cross-browser tests to node24, skip enhanced-img test on no…
dominikg Jan 28, 2026
53f748a
fix: don't call build on playwright webServer when using node18, we s…
dominikg Jan 28, 2026
dbe2945
format
dominikg Jan 28, 2026
8be7f02
fix: ignore failing testcase for vite5+node18 combo
dominikg Jan 28, 2026
4b5500f
chore: fix sync-all
dominikg Jan 28, 2026
10bf2f4
fix: add missing sync calls to some test apps
dominikg Jan 28, 2026
46e0186
format, i really need some auto format on commit :/
dominikg Jan 28, 2026
d946e80
Merge branch 'main' into chore/test-matrix-vite
dominikg Feb 3, 2026
88c31a2
Merge branch 'main' into chore/test-matrix-vite
teemingc Feb 4, 2026
1afe3dc
fix: bump vite5 version for baseline test to avoid errors in testsuite
dominikg Feb 4, 2026
f5c5de8
Apply suggestions from code review
dominikg Feb 4, 2026
4c1dfbb
Merge branch 'main' into chore/test-matrix-vite
dominikg Feb 6, 2026
cc22b8b
refactor: allow defining retries and workers from env for local testing
dominikg Feb 6, 2026
07365e1
chore: format
dominikg Feb 6, 2026
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
37 changes: 30 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,26 @@ jobs:
- node-version: 18
os: ubuntu-latest
e2e-browser: 'chromium'
vite: 'baseline'
Copy link
Member Author

Choose a reason for hiding this comment

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

introduces a new matrix dimension called vite with 3 values

baseline: the lowest version of vite we support (peer range of sveltekit)
current: the version of vite currently in the lockfile
beta: the upcoming beta version of vite

- node-version: 20
os: ubuntu-latest
e2e-browser: 'chromium'
vite: 'current'
- node-version: 22
os: ubuntu-latest
e2e-browser: 'chromium'
vite: 'current'
- node-version: 24
os: ubuntu-latest
e2e-browser: 'chromium'
vite: 'current'
- node-version: 24
os: ubuntu-latest
e2e-browser: 'chromium'
vite: 'beta'
env:
KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
MATRIX_VITE: ${{matrix.vite}}
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v6
Expand All @@ -74,6 +83,13 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: setup overrides for matrix.vite
if: matrix.vite != 'current'
run: | # copies catalogs.vite-xxx to overrides in pnpm-workspace.yaml so the subsequent `pnpm install` enforces them
yq -i '.overrides =.catalogs."vite-${{matrix.vite}}"' pnpm-workspace.yaml
Copy link
Member Author

Choose a reason for hiding this comment

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

yq is available on github hosted runners (except windows) and allows in place editing of yaml

this code copies a block of catalogs.vite-baseline into overrides so tha the install that we run afterwards enforces these versions. see pnpm-workspace.yaml for details

pnpm install --no-frozen-lockfile
git checkout pnpm-lock.yaml pnpm-workspace.yaml # revert changes to pnpm files to avoid cache key changes
pnpm --dir packages/kit ls vite
- run: pnpm playwright install ${{ matrix.e2e-browser }}
- run: pnpm run sync-all
- run: pnpm test:kit
Expand All @@ -90,7 +106,7 @@ jobs:
uses: actions/upload-artifact@v6
with:
retention-days: 3
name: test-failure-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}
name: test-failure-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}-vite-${{matrix.vite}}
path: test-results.tar.gz
test-kit-cross-browser:
runs-on: ${{ matrix.os }}
Expand All @@ -99,27 +115,27 @@ jobs:
fail-fast: false
matrix:
include:
- node-version: 18
- node-version: 24
Copy link
Member Author

Choose a reason for hiding this comment

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

node 18 caused build fails with newer versions of vite-plugin-svelte@6 that uses node:util styleText.

these tests are for browser behavior so i think its ok to update to 24 which should make them a bit more efficient (24 is faster than 18)
same goes for vite6

os: windows-latest
e2e-browser: 'chromium'
mode: 'dev'
- node-version: 18
- node-version: 24
os: ubuntu-latest
e2e-browser: 'firefox'
mode: 'dev'
- node-version: 18
- node-version: 24
os: macOS-latest
e2e-browser: 'webkit'
mode: 'dev'
- node-version: 18
- node-version: 24
os: windows-latest
e2e-browser: 'chromium'
mode: 'build'
- node-version: 18
- node-version: 24
os: ubuntu-latest
e2e-browser: 'firefox'
mode: 'build'
- node-version: 18
- node-version: 24
os: macOS-latest
e2e-browser: 'webkit'
mode: 'build'
Expand Down Expand Up @@ -235,6 +251,13 @@ jobs:
with:
deno-version: ^2.2.4
- run: pnpm install --frozen-lockfile
- name: setup overrides for matrix.node
if: matrix.node-version == 18
run: | # copies catalogs.node-xx to overrides in pnpm-workspace.yaml so the subsequent `pnpm install` enforces them
yq -i '.overrides =.catalogs."node-18"' pnpm-workspace.yaml
Copy link
Member Author

Choose a reason for hiding this comment

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

similar to vite-baseline we have to pick versions that support node18 here otherwise it can break.

pnpm install --no-frozen-lockfile
git checkout pnpm-lock.yaml pnpm-workspace.yaml # revert changes to pnpm files to avoid cache key changes
pnpm --dir packages/kit ls vite @sveltejs/vite-plugin-svelte
- run: pnpm playwright install chromium
- run: cd packages/kit && pnpm prepublishOnly
- run: pnpm run test:others
Expand Down
5 changes: 3 additions & 2 deletions packages/adapter-cloudflare/test/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { devices } from '@playwright/test';
import process from 'node:process';
import { number_from_env } from '../../../test-utils/index.js';

/** @type {import('@playwright/test').PlaywrightTestConfig} */
export const config = {
Expand All @@ -10,7 +11,7 @@ export const config = {
command: process.env.DEV ? 'pnpm dev' : 'pnpm build && pnpm preview',
port: process.env.DEV ? 5173 : 8787
},
retries: process.env.CI ? 2 : 0,
retries: process.env.CI ? 2 : number_from_env('KIT_E2E_RETRIES', 0),
projects: [
{
name: 'chromium'
Expand All @@ -21,7 +22,7 @@ export const config = {
screenshot: 'only-on-failure',
trace: 'retain-on-failure'
},
workers: process.env.CI ? 2 : undefined,
workers: process.env.CI ? 2 : number_from_env('KIT_E2E_WORKERS', undefined),
reporter: 'list',
testDir: 'test',
testMatch: /(.+\.)?(test|spec)\.[jt]s/
Expand Down
5 changes: 3 additions & 2 deletions packages/adapter-netlify/test/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { devices } from '@playwright/test';
import process from 'node:process';
import { number_from_env } from '../../../test-utils/index.js';

/** @type {import('@playwright/test').PlaywrightTestConfig} */
export const config = {
Expand All @@ -10,7 +11,7 @@ export const config = {
command: 'pnpm build && pnpm preview',
port: 8888
},
retries: process.env.CI ? 2 : 0,
retries: process.env.CI ? 2 : number_from_env('KIT_E2E_RETRIES', 0),
projects: [
{
name: 'chromium'
Expand All @@ -21,7 +22,7 @@ export const config = {
screenshot: 'only-on-failure',
trace: 'retain-on-failure'
},
workers: process.env.CI ? 2 : undefined,
workers: process.env.CI ? 2 : number_from_env('KIT_E2E_WORKERS', undefined),
reporter: 'list',
testDir: 'test',
testMatch: /(.+\.)?(test|spec)\.[jt]s/
Expand Down
5 changes: 3 additions & 2 deletions packages/adapter-static/test/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { devices } from '@playwright/test';
import process from 'node:process';
import { number_from_env } from '../../../test-utils/index.js';

/** @type {import('@playwright/test').PlaywrightTestConfig} */
export const config = {
Expand All @@ -10,7 +11,7 @@ export const config = {
command: 'pnpm build && pnpm preview',
port: 5173
},
retries: process.env.CI ? 2 : 0,
retries: process.env.CI ? 2 : number_from_env('KIT_E2E_RETRIES', 0),
projects: [
{
name: 'chromium'
Expand All @@ -21,7 +22,7 @@ export const config = {
screenshot: 'only-on-failure',
trace: 'retain-on-failure'
},
workers: process.env.CI ? 2 : undefined,
workers: process.env.CI ? 2 : number_from_env('KIT_E2E_WORKERS', undefined),
reporter: 'list',
testDir: 'test',
testMatch: /(.+\.)?(test|spec)\.[jt]s/
Expand Down
5 changes: 4 additions & 1 deletion packages/enhanced-img/test/apps/basics/test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { expect, test } from '@playwright/test';

import process from 'node:process';
const is_node18 = process.versions.node.startsWith('18.');
// TODO: remove with SvelteKit 3
test.skip(is_node18, 'enhanced-img requires vite-plugin-svelte@6 which requires node20');
test('images are properly rendered', async ({ page }) => {
await page.goto('/');

Expand Down
18 changes: 12 additions & 6 deletions packages/enhanced-img/test/utils.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import { devices } from '@playwright/test';
import process from 'node:process';
import { number_from_env } from '../../../test-utils/index.js';

// TODO: remove with SvelteKit 3
const is_node18 = process.versions.node.startsWith('18.');
/** @type {import('@playwright/test').PlaywrightTestConfig} */
export const config = {
forbidOnly: !!process.env.CI,
// generous timeouts on CI
timeout: process.env.CI ? 45000 : 15000,
webServer: {
command: 'pnpm build && pnpm preview',
port: 4173
},
retries: process.env.CI ? 2 : 0,
webServer: is_node18
? undefined
: {
// do not try to build on node18
command: 'pnpm build && pnpm preview',
port: 4173
},
retries: process.env.CI ? 2 : number_from_env('KIT_E2E_RETRIES', 0),
projects: [
{
name: 'chromium'
Expand All @@ -21,7 +27,7 @@ export const config = {
screenshot: 'only-on-failure',
trace: 'retain-on-failure'
},
workers: process.env.CI ? 2 : undefined,
workers: process.env.CI ? 2 : number_from_env('KIT_E2E_WORKERS', undefined),
reporter: 'list',
testDir: 'test',
testMatch: /(.+\.)?(test|spec)\.[jt]s/
Expand Down
7 changes: 6 additions & 1 deletion packages/kit/src/core/sync/write_types/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { execSync } from 'node:child_process';
import fs from 'node:fs';
import path from 'node:path';
import process from 'node:process';
import { fileURLToPath } from 'node:url';
import { assert, expect, test } from 'vitest';
import { rimraf } from '../../../utils/filesystem.js';
Expand Down Expand Up @@ -43,7 +44,11 @@ test('Creates correct $types', { timeout: 60000 }, () => {
for (const dir of directories) {
run_test(dir);
try {
execSync('pnpm testtypes', { cwd: path.join(cwd, dir) });
// we skip lib check if MATRIX_VITE is set and not 'current' because overrides for vite can cause type mismatches
const skipLibCheck = process.env.MATRIX_VITE != null && process.env.MATRIX_VITE !== 'current';
execSync(`pnpm testtypes${skipLibCheck ? ' --skipLibCheck' : ''}`, {
cwd: path.join(cwd, dir)
});
} catch (e) {
console.error(/** @type {any} */ (e).stdout.toString());
throw new Error(`${dir} type tests failed`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { get_event } from './data.remote.js';
import { get_event } from './data.remote.ts';
Copy link
Member Author

Choose a reason for hiding this comment

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

concession change for vite5, it doesn't work with data.remote.js on node 18, allowing .ts import and changing the imported suffix works.

const event = await get_event();
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { get_message, set_message, resolve_deferreds } from './form.remote.js';
import { get_message, set_message, resolve_deferreds } from './form.remote.ts';
const { params } = $props();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { get, set } from './form.remote.js';
import { get, set } from './form.remote.ts';
import * as v from 'valibot';
const data = get();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { get_number, set_number } from './form.remote.js';
import { get_number, set_number } from './form.remote.ts';
import * as v from 'valibot';

const number = get_number();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { myform } from './form.remote.js';
import { myform } from './form.remote.ts';
</script>

<form {...myform}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { my_form } from './form.remote.js';
import { my_form } from './form.remote.ts';
</script>

<form {...my_form}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { register } from './form.remote.js';
import { register } from './form.remote.ts';
</script>

<form {...register}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { issue_path_form, my_form, my_form_2 } from './form.remote.js';
import { issue_path_form, my_form, my_form_2 } from './form.remote.ts';
import * as v from 'valibot';
const schema = v.object({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { values } from './value.remote.js';
import { values } from './value.remote.ts';
</script>

<h1>Remote Form Value Test</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { total } from './data.remote.js';
import { total } from './data.remote.ts';
</script>

<h1>{await total()}</h1>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { greeting } from './data.remote.js';
import { greeting } from './data.remote.ts';
</script>

<h1>{(await greeting()).bar()}</h1>
10 changes: 8 additions & 2 deletions packages/kit/test/apps/async/test/client.test.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import process from 'node:process';
import { expect } from '@playwright/test';
import { test } from '../../../utils.js';
const is_node18 = process.versions.node.startsWith('18.');
import { version as vite_version } from 'vite';
const is_vite5 = vite_version.startsWith('5.');

test.skip(({ javaScriptEnabled }) => !javaScriptEnabled);

test.describe('remote functions', () => {
test('preloading data works when the page component and server load both import a remote function', async ({
page
page,
clicknav
}) => {
test.skip(!process.env.DEV, 'remote functions are only analysed in dev mode');
// TODO: remove with SvelteKit 3
test.skip(is_node18 && is_vite5, 'vite5 in node18 fails to resolve remote function export');
await page.goto('/remote/dev');
await page.locator('a[href="/remote/dev/preload"]').hover();
await Promise.all([
page.waitForTimeout(100), // wait for preloading to start
page.waitForLoadState('networkidle') // wait for preloading to finish
]);
await page.click('a[href="/remote/dev/preload"]');
await clicknav('a[href="/remote/dev/preload"]', { waitForURL: '/remote/dev/preload' });
await expect(page.locator('p')).toHaveText('foobar');
});
});
Expand Down
3 changes: 2 additions & 1 deletion packages/kit/test/apps/async/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"checkJs": true,
"esModuleInterop": true,
"noEmit": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"allowImportingTsExtensions": true
},
"extends": "./.svelte-kit/tsconfig.json"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { increment } from './state';
import { increment } from '../../state.js';

export const load = () => {
return {
a: increment()
a: increment(import.meta.url)
};
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { increment } from './state';

import { increment } from '../../state.js';
export const load = () => {
return {
b: increment()
b: increment(import.meta.url)
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { reset_states } from '../../../state.js';
import { json } from '@sveltejs/kit';

export const POST = () => {
return json(reset_states(import.meta.url));
};

This file was deleted.

Loading
Loading