Skip to content

Commit 835841d

Browse files
committed
build(deps): upgrade vite to v6 and svelte plugin to v5 in examples
Update build dependencies across example projects to use latest versions: - Vite 5.x → 6.0.0 - @sveltejs/vite-plugin-svelte 4.x → 5.0.0 - Svelte 5.0.0 → 5.15.0 Also adapt to API changes: - Replace DestroyableIoInterface with IoInterface - Update import statements to use separate type imports - Add electronVersion configuration for electron-demo - Enable runes compiler option where needed
1 parent d183680 commit 835841d

File tree

12 files changed

+155
-190
lines changed

12 files changed

+155
-190
lines changed

examples/chrome-extension/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from "node:path"
22
import { crx } from "@crxjs/vite-plugin"
33
import react from "@vitejs/plugin-react"
4-
import { defineConfig } from "vite"
4+
import { defineConfig, type PluginOption } from "vite"
55
import zip from "vite-plugin-zip-pack"
66
import manifest from "./manifest.config.js"
77
import { name, version } from "./package.json"
@@ -16,7 +16,7 @@ export default defineConfig({
1616
react(),
1717
crx({ manifest }),
1818
zip({ outDir: "release", outFileName: `crx-${name}-${version}.zip` })
19-
],
19+
] as PluginOption[],
2020
server: {
2121
cors: {
2222
origin: [/chrome-extension:\/\//]

examples/electron-demo/electron-builder.json5

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
// @see - https://www.electron.build/configuration/configuration
2-
{
3-
"$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
4-
"appId": "YourAppID",
5-
"asar": true,
6-
"productName": "YourAppName",
1+
// @see - https://www.electron.build/configuration/configuration
2+
{
3+
"$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
4+
"appId": "YourAppID",
5+
"asar": true,
6+
"electronVersion": "40.1.0",
7+
"productName": "YourAppName",
78
"directories": {
89
"output": "release/${version}"
910
},

examples/iframe-worker-demo/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
"@playwright/test": "^1.45.3",
1919
"@sveltejs/adapter-auto": "^3.0.0",
2020
"@sveltejs/kit": "^2.0.0",
21-
"@sveltejs/vite-plugin-svelte": "^4.0.0",
21+
"@sveltejs/vite-plugin-svelte": "^5.0.0",
2222
"autoprefixer": "^10.4.20",
2323
"daisyui": "^4.12.14",
24-
"svelte": "^5.0.0",
24+
"svelte": "^5.15.0",
2525
"svelte-check": "^4.0.0",
2626
"tailwindcss": "^3.4.9",
2727
"typescript": "^5.0.0",
28-
"vite": "^5.0.3",
28+
"vite": "^6.0.0",
2929
"vitest": "^2.1.9"
3030
},
3131
"dependencies": {

examples/iframe-worker-demo/src/routes/+page.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<script lang="ts">
2-
import { apiImplementation, type API, type APINested } from "@kksh/demo-api"
3-
import { IframeParentIO, RPCChannel, type DestroyableIoInterface } from "kkrpc/browser"
2+
import { apiImplementation } from "@kksh/demo-api"
3+
import type { API, APINested } from "@kksh/demo-api"
4+
import { IframeParentIO, RPCChannel } from "kkrpc/browser"
5+
import type { IoInterface } from "kkrpc/browser"
46
import { onDestroy, onMount } from "svelte"
57
import { toast } from "svelte-sonner"
68
79
let iframeRef: HTMLIFrameElement
810
let io: IframeParentIO | undefined
9-
let rpc: RPCChannel<API, APINested, DestroyableIoInterface>
11+
let rpc: RPCChannel<API, APINested, IoInterface>
1012
1113
function onDestroyClicked(e: MouseEvent) {
1214
rpc.getIO().destroy()
@@ -18,7 +20,7 @@
1820
async function onIframeLoad() {
1921
if (!iframeRef.contentWindow) return
2022
io = new IframeParentIO(iframeRef.contentWindow)
21-
rpc = new RPCChannel<API, APINested, DestroyableIoInterface>(io, { expose: apiImplementation })
23+
rpc = new RPCChannel<API, APINested, IoInterface>(io, { expose: apiImplementation })
2224
}
2325
2426
function onMultiplyClicked(e: MouseEvent) {

examples/iframe-worker-demo/src/routes/iframe/+page.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<script lang="ts">
2-
import { apiImplementationNested, type API, type APINested } from "@kksh/demo-api"
3-
import { IframeChildIO, RPCChannel, type DestroyableIoInterface } from "kkrpc/browser"
2+
import { apiImplementationNested } from "@kksh/demo-api"
3+
import type { API, APINested } from "@kksh/demo-api"
4+
import { IframeChildIO, RPCChannel } from "kkrpc/browser"
5+
import type { IoInterface } from "kkrpc/browser"
46
import { onDestroy, onMount } from "svelte"
57
import { toast } from "svelte-sonner"
68
79
const io = new IframeChildIO(),
8-
rpc = new RPCChannel<APINested, API, DestroyableIoInterface>(io, {
10+
rpc = new RPCChannel<APINested, API, IoInterface>(io, {
911
expose: apiImplementationNested
1012
})
1113

examples/iframe-worker-demo/svelte.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ const config = {
66
// Consult https://svelte.dev/docs/kit/integrations
77
// for more information about preprocessors
88
preprocess: vitePreprocess(),
9-
109
kit: {
11-
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
10+
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
1211
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
13-
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
12+
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
1413
adapter: adapter()
1514
}
1615
}

examples/tauri-demo/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"devDependencies": {
3535
"@sveltejs/adapter-static": "^3.0.6",
3636
"@sveltejs/kit": "^2.8.1",
37-
"@sveltejs/vite-plugin-svelte": "^4.0.1",
37+
"@sveltejs/vite-plugin-svelte": "^5.0.0",
38+
"vite": "^6.0.0",
3839
"@tauri-apps/cli": "^2",
3940
"@types/bun": "^1.2.5",
4041
"@yao-pkg/pkg": "6.3.2",
@@ -46,7 +47,6 @@
4647
"tailwind-variants": "^1.0.0",
4748
"tailwindcss": "^3.4.17",
4849
"tailwindcss-animate": "^1.0.7",
49-
"typescript": "~5.6.2",
50-
"vite": "^5.4.11"
50+
"typescript": "~5.6.2"
5151
}
5252
}

examples/tauri-demo/src/routes/+layout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { ModeWatcher } from "mode-watcher"
66
import { toast, Toaster } from "svelte-sonner"
77
8-
let { children } = $props()
8+
export let children: any
99
</script>
1010

1111
<ModeWatcher />
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// Tauri doesn't have a Node.js server to do proper SSR
22
// so we will use adapter-static to prerender the app (SSG)
33
// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
4-
import adapter from "@sveltejs/adapter-static";
5-
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
4+
import adapter from "@sveltejs/adapter-static"
5+
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"
66

77
/** @type {import('@sveltejs/kit').Config} */
88
const config = {
9-
preprocess: vitePreprocess(),
10-
kit: {
11-
adapter: adapter(),
12-
},
13-
};
9+
preprocess: vitePreprocess(),
10+
kit: {
11+
adapter: adapter()
12+
}
13+
}
1414

15-
export default config;
15+
export default config

examples/transferable-browser/src/routes/+page.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts">
2-
import { RPCChannel, WorkerParentIO, type DestroyableIoInterface, transfer } from 'kkrpc/browser';
2+
import { RPCChannel, WorkerParentIO, transfer } from 'kkrpc/browser';
3+
import type { IoInterface } from 'kkrpc/browser';
34
import { onMount } from 'svelte';
45
import type { MainAPI, WorkerAPI, WorkerTransferReport } from '$lib/worker/contracts';
56
@@ -66,7 +67,7 @@
6667
type: 'module'
6768
});
6869
const io = new WorkerParentIO(worker);
69-
const rpc = new RPCChannel<MainAPI, WorkerAPI, DestroyableIoInterface>(io, {
70+
const rpc = new RPCChannel<MainAPI, WorkerAPI, IoInterface>(io, {
7071
expose: localAPI,
7172
enableTransfer: true
7273
});

0 commit comments

Comments
 (0)