diff --git a/examples/browser-cli/src/cli.ts b/examples/browser-cli/src/cli.ts index 4d27f979..4eae9232 100644 --- a/examples/browser-cli/src/cli.ts +++ b/examples/browser-cli/src/cli.ts @@ -7,7 +7,8 @@ import { createServer, parseAstAsync, } from "vite"; -import type { FetchFunction, ModuleRunner } from "vite/module-runner"; +import type { ModuleRunner } from "vite/module-runner"; +import { vitePluginFetchModuleServer } from "../../web-worker/src/lib/fetch-module-server"; const headless = !process.env["CLI_HEADED"]; const extension = process.env["CLI_EXTENSION"] ?? "tsx"; @@ -185,25 +186,4 @@ function vitePluginBrowserRunner(): Plugin { }; } -// https://github.com/vitejs/vite/discussions/18191 -function vitePluginFetchModuleServer(): Plugin { - return { - name: vitePluginFetchModuleServer.name, - configureServer(server) { - server.middlewares.use(async (req, res, next) => { - const url = new URL(req.url ?? "/", "https://any.local"); - if (url.pathname === "/@vite/fetchModule") { - const [name, ...args] = JSON.parse(url.searchParams.get("payload")!); - const result = await server.environments[name]!.fetchModule( - ...(args as Parameters), - ); - res.end(JSON.stringify(result)); - return; - } - next(); - }); - }, - }; -} - main(); diff --git a/examples/browser-cli/src/runner.ts b/examples/browser-cli/src/runner.ts index 18501e76..332a3ed3 100644 --- a/examples/browser-cli/src/runner.ts +++ b/examples/browser-cli/src/runner.ts @@ -1,8 +1,5 @@ -import { - ESModulesEvaluator, - type FetchFunction, - ModuleRunner, -} from "vite/module-runner"; +import { ESModulesEvaluator, ModuleRunner } from "vite/module-runner"; +import { fetchClientFetchModule } from "../../web-worker/src/lib/fetch-module-client"; export async function start(options: { root: string }) { const runner = new ModuleRunner( @@ -10,7 +7,7 @@ export async function start(options: { root: string }) { root: options.root, sourcemapInterceptor: false, transport: { - fetchModule: fetchModuleFetchClient("custom"), + invoke: fetchClientFetchModule("custom"), }, hmr: false, }, @@ -19,15 +16,3 @@ export async function start(options: { root: string }) { return runner; } - -// https://github.com/vitejs/vite/discussions/18191 -function fetchModuleFetchClient(environmentName: string): FetchFunction { - return async (...args) => { - const payload = JSON.stringify([environmentName, ...args]); - const response = await fetch( - "/@vite/fetchModule?" + new URLSearchParams({ payload }), - ); - const result = response.json(); - return result as any; - }; -} diff --git a/examples/child-process/src/lib/vite/bridge-client.js b/examples/child-process/src/lib/vite/bridge-client.js index 85079d1e..50021e87 100644 --- a/examples/child-process/src/lib/vite/bridge-client.js +++ b/examples/child-process/src/lib/vite/bridge-client.js @@ -1,34 +1,19 @@ // @ts-check -import assert from "node:assert"; import { ESModulesEvaluator, ModuleRunner } from "vite/module-runner"; +import { createSSEClientTransport } from "./sse-client.ts"; /** * @param {import("./types").BridgeClientOptions} options */ export function createBridgeClient(options) { - /** - * @param {string} method - * @param {...any} args - * @returns {Promise} - */ - async function rpc(method, ...args) { - const response = await fetch(options.bridgeUrl + "/rpc", { - method: "POST", - body: JSON.stringify({ method, args, key: options.key }), - }); - assert(response.ok); - const result = response.json(); - return result; - } - const runner = new ModuleRunner( { root: options.root, sourcemapInterceptor: "prepareStackTrace", - transport: { - fetchModule: (...args) => rpc("fetchModule", ...args), - }, + transport: createSSEClientTransport( + options.bridgeUrl + "/sse?" + new URLSearchParams({ key: options.key }), + ), hmr: false, }, new ESModulesEvaluator(), @@ -56,5 +41,5 @@ export function createBridgeClient(options) { } } - return { runner, rpc, handler }; + return { runner, handler }; } diff --git a/examples/child-process/src/lib/vite/environment.ts b/examples/child-process/src/lib/vite/environment.ts index 2324801f..764d64e2 100644 --- a/examples/child-process/src/lib/vite/environment.ts +++ b/examples/child-process/src/lib/vite/environment.ts @@ -6,6 +6,7 @@ import readline from "node:readline"; import { Readable } from "node:stream"; import { webToNodeHandler } from "@hiogawa/utils-node"; import { DevEnvironment, type DevEnvironmentOptions } from "vite"; +import { createSSEServerTransport } from "./sse-server"; import type { BridgeClientOptions } from "./types"; // TODO @@ -23,23 +24,24 @@ export class ChildProcessFetchDevEnvironment extends DevEnvironment { }): NonNullable { return (name, config) => { const command = [ - options.runtime === "node" ? ["node"] : [], + options.runtime === "node" ? ["node", "--import", "tsx/esm"] : [], options.runtime === "bun" ? ["bun", "run"] : [], options.conditions ? ["--conditions", ...options.conditions] : [], join(import.meta.dirname, `./runtime/${options.runtime}.js`), ].flat(); - return new ChildProcessFetchDevEnvironment({ command }, name, config, { - // TODO - hot: false, - }); + return new ChildProcessFetchDevEnvironment({ command }, name, config); }; } constructor( public extraOptions: { command: string[] }, - ...args: ConstructorParameters + name: ConstructorParameters[0], + config: ConstructorParameters[1], ) { - super(...args); + super(name, config, { + hot: false, + transport: createSSEServerTransport(), + }); } override init: DevEnvironment["init"] = async (...args) => { @@ -49,18 +51,11 @@ export class ChildProcessFetchDevEnvironment extends DevEnvironment { const key = Math.random().toString(36).slice(2); const listener = webToNodeHandler(async (request) => { - const url = new URL(request.url); - // TODO: other than json? - if (url.pathname === "/rpc") { - const { method, args, key: reqKey } = await request.json(); - if (reqKey !== key) { - return Response.json({ message: "invalid key" }, { status: 400 }); - } - assert(method in this); - const result = await (this as any)[method]!(...args); - return Response.json(result); + const reqKey = new URL(request.url).searchParams.get("key"); + if (reqKey !== key) { + return Response.json({ message: "invalid key" }, { status: 400 }); } - return undefined; + return this.hot.api.handler(request); }); const bridge = http.createServer((req, res) => { diff --git a/examples/child-process/src/lib/vite/sse-client.ts b/examples/child-process/src/lib/vite/sse-client.ts new file mode 100644 index 00000000..403f2912 --- /dev/null +++ b/examples/child-process/src/lib/vite/sse-client.ts @@ -0,0 +1,92 @@ +import assert from "node:assert"; +import type { ModuleRunnerTransport } from "vite/module-runner"; + +export function createSSEClientTransport(url: string): ModuleRunnerTransport { + let sseClient: SSEClient; + + return { + async connect(handlers) { + sseClient = await createSSEClient(url, handlers); + }, + async send(payload) { + assert(sseClient); + sseClient.send(payload); + }, + timeout: 2000, + }; +} + +type SSEClient = Awaited>; + +async function createSSEClient( + url: string, + handlers: { + onMessage: (payload: any) => void; + onDisconnection: () => void; + }, +) { + const response = await fetch(url); + assert(response.ok); + const clientId = response.headers.get("x-client-id"); + assert(clientId); + assert(response.body); + response.body + .pipeThrough(new TextDecoderStream()) + .pipeThrough(splitTransform("\n\n")) + .pipeTo( + new WritableStream({ + write(chunk) { + // console.log("[client.response]", chunk); + if (chunk.startsWith("data: ")) { + const payload = JSON.parse(chunk.slice("data: ".length)); + handlers.onMessage(payload); + } + }, + abort(e) { + console.log("[client.abort]", e); + }, + close() { + console.log("[client.close]"); + handlers.onDisconnection(); + }, + }), + ) + .catch((e) => { + console.log("[client.pipeTo.catch]", e); + }); + + return { + send: async (payload: unknown) => { + const response = await fetch(url, { + method: "POST", + body: JSON.stringify(payload), + headers: { + "x-client-id": clientId, + }, + }); + assert(response.ok); + const result = await response.json(); + return result; + }, + }; +} + +export function splitTransform(sep: string): TransformStream { + let pending = ""; + return new TransformStream({ + transform(chunk, controller) { + while (true) { + const i = chunk.indexOf(sep); + if (i >= 0) { + pending += chunk.slice(0, i); + controller.enqueue(pending); + pending = ""; + chunk = chunk.slice(i + sep.length); + continue; + } + pending += chunk; + break; + } + }, + }); +} diff --git a/examples/child-process/src/lib/vite/sse-server.ts b/examples/child-process/src/lib/vite/sse-server.ts new file mode 100644 index 00000000..9b650482 --- /dev/null +++ b/examples/child-process/src/lib/vite/sse-server.ts @@ -0,0 +1,119 @@ +import assert from "node:assert"; +import type { HotChannel, HotChannelListener, HotPayload } from "vite"; + +export function createSSEServerTransport(): HotChannel { + interface SSEClientProxy { + send(payload: HotPayload): void; + close(): void; + } + + const clientMap = new Map(); + const listenerManager = createListenerManager(); + + async function handler(request: Request): Promise { + const url = new URL(request.url); + if (url.pathname === "/sse") { + // handle `send` + const senderId = request.headers.get("x-client-id"); + if (senderId) { + const client = clientMap.get(senderId); + assert(client); + const payload = await request.json(); + listenerManager.dispatch(payload, client); + return Response.json({ ok: true }); + } + // otherwise handle `connect` + let controller: ReadableStreamDefaultController; + const stream = new ReadableStream({ + start: (controller_) => { + controller = controller_; + controller.enqueue(`:ping\n\n`); + }, + cancel() { + clientMap.delete(clientId); + }, + }); + const pingInterval = setInterval(() => { + controller.enqueue(`:ping\n\n`); + }, 10_000); + const clientId = Math.random().toString(36).slice(2); + const client: SSEClientProxy = { + send(payload) { + controller.enqueue(`data: ${JSON.stringify(payload)}\n\n`); + }, + close() { + clearInterval(pingInterval); + controller.close(); + }, + }; + clientMap.set(clientId, client); + return new Response(stream, { + headers: { + "x-client-id": clientId, + "content-type": "text/event-stream", + "cache-control": "no-cache", + connection: "keep-alive", + }, + }); + } + return undefined; + } + + const channel: HotChannel = { + listen() {}, + close() { + for (const client of clientMap.values()) { + client.close(); + } + }, + on: listenerManager.on, + off: listenerManager.off, + send: (payload) => { + for (const client of clientMap.values()) { + client.send(payload); + } + }, + // expose SSE handler via hot.api + api: { + type: "sse", + handler, + }, + }; + + return channel; +} + +// wrapper to simplify listener management +function createListenerManager(): Pick & { + dispatch: ( + payload: HotPayload, + client: { send: (payload: HotPayload) => void }, + ) => void; +} { + const listerMap: Record> = {}; + const getListerMap = (e: string) => (listerMap[e] ??= new Set()); + + return { + on(event: string, listener: HotChannelListener) { + // console.log("[channel.on]", event, listener); + if (event === "connection") { + return; + } + getListerMap(event).add(listener); + }, + off(event, listener: any) { + // console.log("[channel.off]", event, listener); + if (event === "connection") { + return; + } + getListerMap(event).delete(listener); + }, + dispatch(payload, client) { + if (payload.type === "custom") { + for (const lister of getListerMap(payload.event)) { + lister(payload.data, client); + } + } + }, + }; +} diff --git a/examples/child-process/tsconfig.json b/examples/child-process/tsconfig.json index 982e8b6e..a14d58e7 100644 --- a/examples/child-process/tsconfig.json +++ b/examples/child-process/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@tsconfig/strictest/tsconfig.json", "include": ["src", "e2e", "*.ts"], "compilerOptions": { + "allowImportingTsExtensions": true, "exactOptionalPropertyTypes": false, "verbatimModuleSyntax": true, "noEmit": true, diff --git a/examples/web-worker-rsc/src/lib/fetch-module-client.ts b/examples/web-worker-rsc/src/lib/fetch-module-client.ts deleted file mode 100644 index 157c65d3..00000000 --- a/examples/web-worker-rsc/src/lib/fetch-module-client.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FetchFunction } from "vite"; - -export function fetchClientFetchModule(environmentName: string): FetchFunction { - return async (...args) => { - const payload = JSON.stringify([environmentName, ...args]); - const response = await fetch( - "/@vite/fetchModule?" + new URLSearchParams({ payload }), - ); - const result = response.json(); - return result as any; - }; -} diff --git a/examples/web-worker-rsc/src/lib/fetch-module-server.ts b/examples/web-worker-rsc/src/lib/fetch-module-server.ts deleted file mode 100644 index c9f83f74..00000000 --- a/examples/web-worker-rsc/src/lib/fetch-module-server.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { FetchFunction, Plugin } from "vite"; - -export function vitePluginFetchModuleServer(): Plugin { - return { - name: vitePluginFetchModuleServer.name, - configureServer(server) { - server.middlewares.use(async (req, res, next) => { - const url = new URL(req.url ?? "/", "https://any.local"); - if (url.pathname === "/@vite/fetchModule") { - const [name, ...args] = JSON.parse(url.searchParams.get("payload")!); - const result = await server.environments[name]!.fetchModule( - ...(args as Parameters), - ); - res.end(JSON.stringify(result)); - return; - } - next(); - }); - }, - }; -} diff --git a/examples/web-worker-rsc/src/lib/runner.ts b/examples/web-worker-rsc/src/lib/runner.ts index 93209025..5edf5a9c 100644 --- a/examples/web-worker-rsc/src/lib/runner.ts +++ b/examples/web-worker-rsc/src/lib/runner.ts @@ -1,5 +1,5 @@ import { ESModulesEvaluator, ModuleRunner } from "vite/module-runner"; -import { fetchClientFetchModule } from "./fetch-module-client"; +import { fetchClientFetchModule } from "../../../web-worker/src/lib/fetch-module-client"; export function createFetchRunner(options: { root: string; @@ -10,7 +10,7 @@ export function createFetchRunner(options: { root: options.root, sourcemapInterceptor: false, transport: { - fetchModule: fetchClientFetchModule(options.environmentName), + invoke: fetchClientFetchModule(options.environmentName), }, hmr: false, }, diff --git a/examples/web-worker-rsc/vite.config.ts b/examples/web-worker-rsc/vite.config.ts index 843f51c4..de09a4f5 100644 --- a/examples/web-worker-rsc/vite.config.ts +++ b/examples/web-worker-rsc/vite.config.ts @@ -1,7 +1,7 @@ import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; +import { vitePluginFetchModuleServer } from "../web-worker/src/lib/fetch-module-server"; import { vitePluginWorkerEnvironment } from "../web-worker/vite.config"; -import { vitePluginFetchModuleServer } from "./src/lib/fetch-module-server"; export default defineConfig((_env) => ({ clearScreen: false, diff --git a/examples/web-worker/src/lib/fetch-module-client.ts b/examples/web-worker/src/lib/fetch-module-client.ts index 157c65d3..d9c5b378 100644 --- a/examples/web-worker/src/lib/fetch-module-client.ts +++ b/examples/web-worker/src/lib/fetch-module-client.ts @@ -1,10 +1,12 @@ -import type { FetchFunction } from "vite"; +import type { ModuleRunnerTransport } from "vite/module-runner"; -export function fetchClientFetchModule(environmentName: string): FetchFunction { - return async (...args) => { - const payload = JSON.stringify([environmentName, ...args]); +export function fetchClientFetchModule( + environmentName: string, +): ModuleRunnerTransport["invoke"] { + return async (payload) => { + const data = JSON.stringify([environmentName, payload]); const response = await fetch( - "/@vite/fetchModule?" + new URLSearchParams({ payload }), + "/@vite/invoke?" + new URLSearchParams({ data }), ); const result = response.json(); return result as any; diff --git a/examples/web-worker/src/lib/fetch-module-server.ts b/examples/web-worker/src/lib/fetch-module-server.ts index c9f83f74..c2e97aa7 100644 --- a/examples/web-worker/src/lib/fetch-module-server.ts +++ b/examples/web-worker/src/lib/fetch-module-server.ts @@ -1,4 +1,4 @@ -import type { FetchFunction, Plugin } from "vite"; +import { type Plugin } from "vite"; export function vitePluginFetchModuleServer(): Plugin { return { @@ -6,11 +6,10 @@ export function vitePluginFetchModuleServer(): Plugin { configureServer(server) { server.middlewares.use(async (req, res, next) => { const url = new URL(req.url ?? "/", "https://any.local"); - if (url.pathname === "/@vite/fetchModule") { - const [name, ...args] = JSON.parse(url.searchParams.get("payload")!); - const result = await server.environments[name]!.fetchModule( - ...(args as Parameters), - ); + if (url.pathname === "/@vite/invoke") { + const [name, payload] = JSON.parse(url.searchParams.get("data")!); + const devEnv = server.environments[name]!; + const result = await devEnv.hot.handleInvoke(payload); res.end(JSON.stringify(result)); return; } diff --git a/examples/web-worker/src/lib/runner.ts b/examples/web-worker/src/lib/runner.ts index 93209025..0181f1f2 100644 --- a/examples/web-worker/src/lib/runner.ts +++ b/examples/web-worker/src/lib/runner.ts @@ -10,7 +10,7 @@ export function createFetchRunner(options: { root: options.root, sourcemapInterceptor: false, transport: { - fetchModule: fetchClientFetchModule(options.environmentName), + invoke: fetchClientFetchModule(options.environmentName), }, hmr: false, }, diff --git a/package.json b/package.json index 4bdf9b64..f5272ef5 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "tsup": "^8.1.2", "tsx": "^4.16.2", "typescript": "^5.5.3", - "vite": "https://pkg.pr.new/vite@d002e7d", + "vite": "6.0.0-beta.9", "vitest": "^2.0.3", "wrangler": "^3.79.0" }, diff --git a/packages/workerd/src/plugin.ts b/packages/workerd/src/plugin.ts index d2c7451e..f488933d 100644 --- a/packages/workerd/src/plugin.ts +++ b/packages/workerd/src/plugin.ts @@ -123,19 +123,14 @@ export async function createWorkerdDevEnvironment( }, unsafeEvalBinding: "__viteUnsafeEval", serviceBindings: { - __viteFetchModule: async (request) => { - const args = await request.json(); - try { - const result = await devEnv.fetchModule(...(args as [any, any])); - return MiniflareResponse.json(result); - } catch (error) { - console.error("[fetchModule]", args, error); - throw error; - } + __viteInvoke: async (request) => { + const payload = (await request.json()) as HotPayload; + const result = await devEnv.hot.handleInvoke(payload); + return MiniflareResponse.json(result); }, __viteRunnerSend: async (request) => { const payload = (await request.json()) as HotPayload; - hotListener.dispatch(payload); + hotListener.dispatch(payload, { send: runnerObject.__viteServerSend }); return MiniflareResponse.json(null); }, }, @@ -179,15 +174,12 @@ export async function createWorkerdDevEnvironment( // hmr channel const hotListener = createHotListenerManager(); - const hot: HotChannel = { + const transport: HotChannel = { listen: () => {}, close: () => {}, on: hotListener.on, off: hotListener.off, - send(...args: any[]) { - const payload = normalizeServerSendPayload(...args); - runnerObject.__viteServerSend(payload); - }, + send: runnerObject.__viteServerSend, }; // TODO: move initialization code to `init`? @@ -199,7 +191,10 @@ export async function createWorkerdDevEnvironment( } } - const devEnv = new WorkerdDevEnvironmentImpl(name, config, { hot }); + const devEnv = new WorkerdDevEnvironmentImpl(name, config, { + transport, + hot: true, + }); // custom environment api const api: WorkerdDevApi = { @@ -231,7 +226,10 @@ export async function createWorkerdDevEnvironment( // wrapper to simplify listener management function createHotListenerManager(): Pick & { - dispatch: (payload: HotPayload) => void; + dispatch: ( + payload: HotPayload, + client: { send: (payload: HotPayload) => void }, + ) => void; } { const listerMap: Record> = {}; const getListerMap = (e: string) => (listerMap[e] ??= new Set()); @@ -243,26 +241,12 @@ function createHotListenerManager(): Pick & { off(event, listener: any) { getListerMap(event).delete(listener); }, - dispatch(payload) { + dispatch(payload, client) { if (payload.type === "custom") { for (const lister of getListerMap(payload.event)) { - lister(payload.data); + lister(payload.data, client); } } }, }; } - -function normalizeServerSendPayload(...args: any[]) { - let payload: HotPayload; - if (typeof args[0] === "string") { - payload = { - type: "custom", - event: args[0], - data: args[1], - }; - } else { - payload = args[0]; - } - return payload; -} diff --git a/packages/workerd/src/shared.ts b/packages/workerd/src/shared.ts index 158f5da0..4da27414 100644 --- a/packages/workerd/src/shared.ts +++ b/packages/workerd/src/shared.ts @@ -7,7 +7,7 @@ export type RunnerEnv = { __viteUnsafeEval: { eval: (code: string, filename?: string) => any; }; - __viteFetchModule: { + __viteInvoke: { fetch: (request: Request) => Promise; }; __viteRunnerSend: { diff --git a/packages/workerd/src/worker.ts b/packages/workerd/src/worker.ts index a0bce2fb..81a21fb1 100644 --- a/packages/workerd/src/worker.ts +++ b/packages/workerd/src/worker.ts @@ -58,28 +58,25 @@ export class RunnerObject extends DurableObject implements RunnerRpc { root: env.__viteRoot, sourcemapInterceptor: "prepareStackTrace", transport: { - fetchModule: async (...args) => { - const response = await env.__viteFetchModule.fetch( - requestJson(args), - ); + invoke: async (payload) => { + // we still need to implement fetchModule on top of service binding + // since websocket and rpc have tighter payload size limit + // (for example, rpc 1MB is not enough for large pre-bundled deps with source map) + const response = await env.__viteInvoke.fetch(requestJson(payload)); tinyassert(response.ok); return response.json(); }, - }, - hmr: { - connection: { - isReady: () => true, - onUpdate: (callback) => { - this.#viteServerSendHandler = callback; - }, - send: async (payload) => { - const response = await env.__viteRunnerSend.fetch( - requestJson(payload), - ); - tinyassert(response.ok); - }, + connect: async (handlers) => { + this.#viteServerSendHandler = handlers.onMessage; + }, + send: async (payload) => { + const response = await env.__viteRunnerSend.fetch( + requestJson(payload), + ); + tinyassert(response.ok); }, }, + hmr: true, }, { runInlinedModule: async (context, transformed) => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1c4e7e7d..713b40a0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: - vite: https://pkg.pr.new/vite@d002e7d + vite: 6.0.0-beta.9 importers: @@ -22,7 +22,7 @@ importers: version: 0.0.2 '@hiogawa/vite-plugin-ssr-middleware': specifier: ^0.0.3 - version: 0.0.3(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) + version: 0.0.3(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) '@playwright/test': specifier: ^1.45.2 version: 1.45.2 @@ -40,7 +40,7 @@ importers: version: 18.3.0 '@vitejs/plugin-react': specifier: ^4.3.1 - version: 4.3.1(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) + version: 4.3.1(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) esbuild: specifier: ^0.23.0 version: 0.23.0 @@ -69,8 +69,8 @@ importers: specifier: ^5.5.3 version: 5.5.3 vite: - specifier: https://pkg.pr.new/vite@d002e7d - version: https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) + specifier: 6.0.0-beta.9 + version: 6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) vitest: specifier: ^2.0.3 version: 2.0.3(@types/node@20.14.11)(happy-dom@14.12.3)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) @@ -105,7 +105,7 @@ importers: version: 0.30.10 unocss: specifier: 0.61.5 - version: 0.61.5(postcss@8.4.47)(rollup@4.23.0)(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) + version: 0.61.5(postcss@8.4.47)(rollup@4.23.0)(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) examples/react-ssr: devDependencies: @@ -139,7 +139,7 @@ importers: version: link:../../packages/workerd '@vitejs/plugin-vue': specifier: ^5.0.5 - version: 5.0.5(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))(vue@3.4.32(typescript@5.5.3)) + version: 5.0.5(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))(vue@3.4.32(typescript@5.5.3)) vue-tsc: specifier: ^2.0.26 version: 2.0.26(typescript@5.5.3) @@ -164,7 +164,7 @@ importers: version: link:../../packages/workerd '@vitejs/plugin-vue': specifier: ^5.0.5 - version: 5.0.5(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))(vue@3.4.32(typescript@5.5.3)) + version: 5.0.5(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))(vue@3.4.32(typescript@5.5.3)) vue-tsc: specifier: ^2.0.26 version: 2.0.26(typescript@5.5.3) @@ -186,8 +186,8 @@ importers: packages/ssr-middleware: dependencies: vite: - specifier: https://pkg.pr.new/vite@d002e7d - version: https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) + specifier: 6.0.0-beta.9 + version: 6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) packages/workerd: devDependencies: @@ -198,8 +198,8 @@ importers: specifier: ^3.20240925.0 version: 3.20240925.0 vite: - specifier: https://pkg.pr.new/vite@d002e7d - version: https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) + specifier: 6.0.0-beta.9 + version: 6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) wrangler: specifier: ^3.79.0 version: 3.79.0(@cloudflare/workers-types@4.20240925.0) @@ -1058,9 +1058,8 @@ packages: '@hiogawa/vite-plugin-ssr-middleware@0.0.3': resolution: {integrity: sha512-84bzaAuImty4s4vHjOk5MQMzmDs0W0GP43fOTFhsBfj/MSJCNJ68elmPNZWs57WkIEzcdB4haY/P8Nf4ZGH8Qw==} - version: 0.0.3 peerDependencies: - vite: https://pkg.pr.new/vite@d002e7d + vite: 6.0.0-beta.9 '@iconify/types@2.0.0': resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} @@ -1345,9 +1344,8 @@ packages: '@unocss/astro@0.61.5': resolution: {integrity: sha512-keyh6/EsPMBEiLguaOsh47UcMkWCGT0rW3KV5aYRUfYXlgccSzDd4SLmTNsdlGXIso2XCl/14BJQuwjP0UEU0Q==} - version: 0.61.5 peerDependencies: - vite: https://pkg.pr.new/vite@d002e7d + vite: 6.0.0-beta.9 peerDependenciesMeta: vite: optional: true @@ -1427,23 +1425,20 @@ packages: '@unocss/vite@0.61.5': resolution: {integrity: sha512-+U5Ey5Z2csjLy7zcaDCtUqs08+ugRK87UWGm65W8yMAGW7me72f36QR8IHJUTqlVVEdhbJVIAy+yNFjGHYffjA==} - version: 0.61.5 peerDependencies: - vite: https://pkg.pr.new/vite@d002e7d + vite: 6.0.0-beta.9 '@vitejs/plugin-react@4.3.1': resolution: {integrity: sha512-m/V2syj5CuVnaxcUJOQRel/Wr31FFXRFlnOoq1TVtkCxsY5veGMTEmpWHndrhB2U8ScHtCQB1e+4hWYExQc6Lg==} - version: 4.3.1 engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - vite: https://pkg.pr.new/vite@d002e7d + vite: 6.0.0-beta.9 '@vitejs/plugin-vue@5.0.5': resolution: {integrity: sha512-LOjm7XeIimLBZyzinBQ6OSm3UBCNVCpLkxGC0oWmm2YPzVZoxMsdvNVimLTBzpAnR9hl/yn1SHGuRfe6/Td9rQ==} - version: 5.0.5 engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: - vite: https://pkg.pr.new/vite@d002e7d + vite: 6.0.0-beta.9 vue: ^3.2.25 '@vitest/expect@2.0.3': @@ -2669,11 +2664,10 @@ packages: unocss@0.61.5: resolution: {integrity: sha512-BScwlqXW9KHQLKIKtXmwWmMb4Ihoryb7uIgmS+HSqmCN58eqNA73vAo3cZ97xtO+RFdauqgGKP5wD6ShQUvqnQ==} - version: 0.61.5 engines: {node: '>=14'} peerDependencies: '@unocss/webpack': 0.61.5 - vite: https://pkg.pr.new/vite@d002e7d + vite: 6.0.0-beta.9 peerDependenciesMeta: '@unocss/webpack': optional: true @@ -2694,9 +2688,8 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true - vite@https://pkg.pr.new/vite@d002e7d: - resolution: {tarball: https://pkg.pr.new/vite@d002e7d} - version: 6.0.0-beta.7 + vite@6.0.0-beta.9: + resolution: {integrity: sha512-gMaa1/cnKw4xCv1QmPcBInF8D1I17a0/+kUDWuPLGm0ZuupFW2YKUU91DQFc4WwgvvEKFd+kNHin9+qlX0SeqQ==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -3503,9 +3496,9 @@ snapshots: '@hiogawa/utils@1.7.0': {} - '@hiogawa/vite-plugin-ssr-middleware@0.0.3(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))': + '@hiogawa/vite-plugin-ssr-middleware@0.0.3(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))': dependencies: - vite: https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) + vite: 6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) '@iconify/types@2.0.0': {} @@ -3752,13 +3745,13 @@ snapshots: dependencies: '@types/node': 20.14.11 - '@unocss/astro@0.61.5(rollup@4.23.0)(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))': + '@unocss/astro@0.61.5(rollup@4.23.0)(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))': dependencies: '@unocss/core': 0.61.5 '@unocss/reset': 0.61.5 - '@unocss/vite': 0.61.5(rollup@4.23.0)(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) + '@unocss/vite': 0.61.5(rollup@4.23.0)(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) optionalDependencies: - vite: https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) + vite: 6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) transitivePeerDependencies: - rollup @@ -3889,7 +3882,7 @@ snapshots: dependencies: '@unocss/core': 0.61.5 - '@unocss/vite@0.61.5(rollup@4.23.0)(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))': + '@unocss/vite@0.61.5(rollup@4.23.0)(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))': dependencies: '@ampproject/remapping': 2.3.0 '@rollup/pluginutils': 5.1.0(rollup@4.23.0) @@ -3901,24 +3894,24 @@ snapshots: chokidar: 3.6.0 fast-glob: 3.3.2 magic-string: 0.30.10 - vite: https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) + vite: 6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) transitivePeerDependencies: - rollup - '@vitejs/plugin-react@4.3.1(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))': + '@vitejs/plugin-react@4.3.1(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))': dependencies: '@babel/core': 7.24.9 '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.24.9) '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.24.9) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) + vite: 6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue@5.0.5(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))(vue@3.4.32(typescript@5.5.3))': + '@vitejs/plugin-vue@5.0.5(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2))(vue@3.4.32(typescript@5.5.3))': dependencies: - vite: https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) + vite: 6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) vue: 3.4.32(typescript@5.5.3) '@vitest/expect@2.0.3': @@ -5216,9 +5209,9 @@ snapshots: pathe: 1.1.2 ufo: 1.5.4 - unocss@0.61.5(postcss@8.4.47)(rollup@4.23.0)(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)): + unocss@0.61.5(postcss@8.4.47)(rollup@4.23.0)(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)): dependencies: - '@unocss/astro': 0.61.5(rollup@4.23.0)(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) + '@unocss/astro': 0.61.5(rollup@4.23.0)(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) '@unocss/cli': 0.61.5(rollup@4.23.0) '@unocss/core': 0.61.5 '@unocss/extractor-arbitrary-variants': 0.61.5 @@ -5237,9 +5230,9 @@ snapshots: '@unocss/transformer-compile-class': 0.61.5 '@unocss/transformer-directives': 0.61.5 '@unocss/transformer-variant-group': 0.61.5 - '@unocss/vite': 0.61.5(rollup@4.23.0)(vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) + '@unocss/vite': 0.61.5(rollup@4.23.0)(vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2)) optionalDependencies: - vite: https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) + vite: 6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) transitivePeerDependencies: - postcss - rollup @@ -5261,7 +5254,7 @@ snapshots: debug: 4.3.5 pathe: 1.1.2 tinyrainbow: 1.2.0 - vite: https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) + vite: 6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) transitivePeerDependencies: - '@types/node' - jiti @@ -5276,7 +5269,7 @@ snapshots: - tsx - yaml - vite@https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2): + vite@6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2): dependencies: esbuild: 0.24.0 postcss: 8.4.47 @@ -5305,7 +5298,7 @@ snapshots: tinybench: 2.8.0 tinypool: 1.0.0 tinyrainbow: 1.2.0 - vite: https://pkg.pr.new/vite@d002e7d(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) + vite: 6.0.0-beta.9(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) vite-node: 2.0.3(@types/node@20.14.11)(jiti@1.21.6)(terser@5.31.3)(tsx@4.16.2) why-is-node-running: 2.3.0 optionalDependencies: diff --git a/vite-6.0.0-beta.5.tgz b/vite-6.0.0-beta.5.tgz new file mode 100644 index 00000000..a44728d7 Binary files /dev/null and b/vite-6.0.0-beta.5.tgz differ