vite 6.3.5 → 7.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,88 @@
1
+ import { HotPayload } from "../../types/hmrPayload.js";
2
+
3
+ //#region src/shared/invokeMethods.d.ts
4
+ interface FetchFunctionOptions {
5
+ cached?: boolean;
6
+ startOffset?: number;
7
+ }
8
+ type FetchResult = CachedFetchResult | ExternalFetchResult | ViteFetchResult;
9
+ interface CachedFetchResult {
10
+ /**
11
+ * If module cached in the runner, we can just confirm
12
+ * it wasn't invalidated on the server side.
13
+ */
14
+ cache: true;
15
+ }
16
+ interface ExternalFetchResult {
17
+ /**
18
+ * The path to the externalized module starting with file://,
19
+ * by default this will be imported via a dynamic "import"
20
+ * instead of being transformed by vite and loaded with vite runner
21
+ */
22
+ externalize: string;
23
+ /**
24
+ * Type of the module. Will be used to determine if import statement is correct.
25
+ * For example, if Vite needs to throw an error if variable is not actually exported
26
+ */
27
+ type: 'module' | 'commonjs' | 'builtin' | 'network';
28
+ }
29
+ interface ViteFetchResult {
30
+ /**
31
+ * Code that will be evaluated by vite runner
32
+ * by default this will be wrapped in an async function
33
+ */
34
+ code: string;
35
+ /**
36
+ * File path of the module on disk.
37
+ * This will be resolved as import.meta.url/filename
38
+ * Will be equal to `null` for virtual modules
39
+ */
40
+ file: string | null;
41
+ /**
42
+ * Module ID in the server module graph.
43
+ */
44
+ id: string;
45
+ /**
46
+ * Module URL used in the import.
47
+ */
48
+ url: string;
49
+ /**
50
+ * Invalidate module on the client side.
51
+ */
52
+ invalidate: boolean;
53
+ }
54
+ type InvokeMethods = {
55
+ fetchModule: (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
56
+ }; //#endregion
57
+ //#region src/shared/moduleRunnerTransport.d.ts
58
+ type ModuleRunnerTransportHandlers = {
59
+ onMessage: (data: HotPayload) => void;
60
+ onDisconnection: () => void;
61
+ };
62
+ /**
63
+ * "send and connect" or "invoke" must be implemented
64
+ */
65
+ interface ModuleRunnerTransport {
66
+ connect?(handlers: ModuleRunnerTransportHandlers): Promise<void> | void;
67
+ disconnect?(): Promise<void> | void;
68
+ send?(data: HotPayload): Promise<void> | void;
69
+ invoke?(data: HotPayload): Promise<{
70
+ result: any;
71
+ } | {
72
+ error: any;
73
+ }>;
74
+ timeout?: number;
75
+ }
76
+ interface NormalizedModuleRunnerTransport {
77
+ connect?(onMessage?: (data: HotPayload) => void): Promise<void> | void;
78
+ disconnect?(): Promise<void> | void;
79
+ send(data: HotPayload): Promise<void>;
80
+ invoke<T extends keyof InvokeMethods>(name: T, data: Parameters<InvokeMethods[T]>): Promise<ReturnType<Awaited<InvokeMethods[T]>>>;
81
+ }
82
+ declare const createWebSocketModuleRunnerTransport: (options: {
83
+ createConnection: () => WebSocket;
84
+ pingInterval?: number;
85
+ }) => Required<Pick<ModuleRunnerTransport, "connect" | "disconnect" | "send">>;
86
+
87
+ //#endregion
88
+ export { ExternalFetchResult, FetchFunctionOptions, FetchResult, ModuleRunnerTransport, ModuleRunnerTransportHandlers, NormalizedModuleRunnerTransport, ViteFetchResult, createWebSocketModuleRunnerTransport };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "6.3.5",
3
+ "version": "7.0.0-beta.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -19,11 +19,7 @@
19
19
  "main": "./dist/node/index.js",
20
20
  "types": "./dist/node/index.d.ts",
21
21
  "exports": {
22
- ".": {
23
- "module-sync": "./dist/node/index.js",
24
- "import": "./dist/node/index.js",
25
- "require": "./index.cjs"
26
- },
22
+ ".": "./dist/node/index.js",
27
23
  "./client": {
28
24
  "types": "./client.d.ts"
29
25
  },
@@ -58,7 +54,7 @@
58
54
  "types"
59
55
  ],
60
56
  "engines": {
61
- "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
57
+ "node": "^20.19.0 || >=22.12.0"
62
58
  },
63
59
  "repository": {
64
60
  "type": "git",
@@ -76,80 +72,82 @@
76
72
  "fdir": "^6.4.4",
77
73
  "picomatch": "^4.0.2",
78
74
  "postcss": "^8.5.3",
79
- "rollup": "^4.34.9",
80
- "tinyglobby": "^0.2.13"
75
+ "rollup": "^4.40.0",
76
+ "tinyglobby": "^0.2.14"
81
77
  },
82
78
  "optionalDependencies": {
83
79
  "fsevents": "~2.3.3"
84
80
  },
85
81
  "devDependencies": {
86
82
  "@ampproject/remapping": "^2.3.0",
87
- "@babel/parser": "^7.27.0",
83
+ "@babel/parser": "^7.27.2",
88
84
  "@jridgewell/trace-mapping": "^0.3.25",
85
+ "@oxc-project/runtime": "^0.70.0",
86
+ "@oxc-project/types": "^0.70.0",
89
87
  "@polka/compression": "^1.0.0-next.25",
90
88
  "@rollup/plugin-alias": "^5.1.1",
91
89
  "@rollup/plugin-commonjs": "^28.0.3",
92
90
  "@rollup/plugin-dynamic-import-vars": "2.1.4",
93
- "@rollup/plugin-json": "^6.1.0",
94
- "@rollup/plugin-node-resolve": "16.0.1",
95
91
  "@rollup/pluginutils": "^5.1.4",
96
92
  "@types/escape-html": "^1.0.4",
97
93
  "@types/pnpapi": "^0.0.5",
98
94
  "artichokie": "^0.3.1",
95
+ "baseline-browser-mapping": "^2.4.3",
99
96
  "cac": "^6.7.14",
100
97
  "chokidar": "^3.6.0",
101
98
  "connect": "^3.7.0",
102
99
  "convert-source-map": "^2.0.0",
103
100
  "cors": "^2.8.5",
104
101
  "cross-spawn": "^7.0.6",
105
- "debug": "^4.4.0",
102
+ "debug": "^4.4.1",
106
103
  "dep-types": "link:./src/types",
107
104
  "dotenv": "^16.5.0",
108
105
  "dotenv-expand": "^12.0.2",
109
- "es-module-lexer": "^1.6.0",
106
+ "es-module-lexer": "^1.7.0",
110
107
  "escape-html": "^1.0.3",
111
108
  "estree-walker": "^3.0.3",
112
109
  "etag": "^1.8.1",
110
+ "host-validation-middleware": "^0.1.1",
113
111
  "http-proxy": "^1.18.1",
114
112
  "launch-editor-middleware": "^2.10.0",
115
- "lightningcss": "^1.29.3",
113
+ "lightningcss": "^1.30.1",
116
114
  "magic-string": "^0.30.17",
117
115
  "mlly": "^1.7.4",
118
116
  "mrmime": "^2.0.1",
119
117
  "nanoid": "^5.1.5",
120
- "open": "^10.1.1",
121
- "parse5": "^7.2.1",
118
+ "open": "^10.1.2",
119
+ "parse5": "^7.3.0",
122
120
  "pathe": "^2.0.3",
123
121
  "periscopic": "^4.0.2",
124
122
  "picocolors": "^1.1.1",
125
123
  "postcss-import": "^16.1.0",
126
124
  "postcss-load-config": "^6.0.1",
127
125
  "postcss-modules": "^6.0.1",
126
+ "premove": "^4.0.0",
128
127
  "resolve.exports": "^2.0.3",
129
- "rollup-plugin-dts": "^6.2.1",
130
- "rollup-plugin-esbuild": "^6.2.1",
128
+ "rolldown": "^1.0.0-beta.9",
129
+ "rolldown-plugin-dts": "^0.13.3",
131
130
  "rollup-plugin-license": "^3.6.0",
132
- "sass": "^1.86.3",
133
- "sass-embedded": "^1.86.3",
131
+ "sass": "^1.89.0",
132
+ "sass-embedded": "^1.89.0",
134
133
  "sirv": "^3.0.1",
135
134
  "source-map-support": "^0.5.21",
136
135
  "strip-literal": "^3.0.0",
137
- "terser": "^5.39.0",
138
- "tsconfck": "^3.1.5",
139
- "tslib": "^2.8.1",
136
+ "terser": "^5.39.2",
137
+ "tsconfck": "^3.1.6",
140
138
  "types": "link:./types",
141
139
  "ufo": "^1.6.1",
142
- "ws": "^8.18.1"
140
+ "ws": "^8.18.2"
143
141
  },
144
142
  "peerDependencies": {
145
- "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
143
+ "@types/node": "^20.19.0 || >=22.12.0",
146
144
  "jiti": ">=1.21.0",
147
- "less": "*",
145
+ "less": "^4.0.0",
148
146
  "lightningcss": "^1.21.0",
149
- "sass": "*",
150
- "sass-embedded": "*",
151
- "stylus": "*",
152
- "sugarss": "*",
147
+ "sass": "^1.70.0",
148
+ "sass-embedded": "^1.70.0",
149
+ "stylus": ">=0.54.8",
150
+ "sugarss": "^5.0.0",
153
151
  "terser": "^5.16.0",
154
152
  "tsx": "^4.8.1",
155
153
  "yaml": "^2.4.2"
@@ -190,15 +188,15 @@
190
188
  }
191
189
  },
192
190
  "scripts": {
193
- "dev": "tsx scripts/dev.ts",
191
+ "dev": "premove dist && pnpm build-bundle -w",
194
192
  "build": "premove dist && pnpm build-bundle && pnpm build-types",
195
- "build-bundle": "rollup --config rollup.config.ts --configPlugin esbuild",
196
- "build-types": "pnpm build-types-temp && pnpm build-types-roll && pnpm build-types-check",
197
- "build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node/tsconfig.build.json",
198
- "build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin esbuild && premove temp",
193
+ "build-bundle": "rolldown --config rolldown.config.ts",
194
+ "build-types": "pnpm build-types-roll && pnpm build-types-check",
195
+ "build-types-roll": "rolldown --config rolldown.dts.config.ts",
199
196
  "build-types-check": "tsc --project tsconfig.check.json",
200
- "typecheck": "tsc --noEmit && tsc --noEmit -p src/node",
197
+ "typecheck": "tsc && tsc -p src/node",
201
198
  "lint": "eslint --cache --ext .ts src/**",
202
- "format": "prettier --write --cache --parser typescript \"src/**/*.ts\""
199
+ "format": "prettier --write --cache --parser typescript \"src/**/*.ts\"",
200
+ "generate-target": "tsx scripts/generateTarget.ts"
203
201
  }
204
202
  }
@@ -14,25 +14,6 @@ import type Stylus from 'stylus'
14
14
  // https://github.com/type-challenges/type-challenges/issues/29285
15
15
  type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false
16
16
 
17
- type DartSassLegacyStringOptionsAsync = DartSass.LegacyStringOptions<'async'>
18
- type SassEmbeddedLegacyStringOptionsAsync =
19
- SassEmbedded.LegacyStringOptions<'async'>
20
- type SassLegacyStringOptionsAsync =
21
- IsAny<DartSassLegacyStringOptionsAsync> extends false
22
- ? DartSassLegacyStringOptionsAsync
23
- : SassEmbeddedLegacyStringOptionsAsync
24
-
25
- export type SassLegacyPreprocessBaseOptions = Omit<
26
- SassLegacyStringOptionsAsync,
27
- | 'data'
28
- | 'file'
29
- | 'outFile'
30
- | 'sourceMap'
31
- | 'omitSourceMapUrl'
32
- | 'sourceMapEmbed'
33
- | 'sourceMapRoot'
34
- >
35
-
36
17
  type DartSassStringOptionsAsync = DartSass.StringOptions<'async'>
37
18
  type SassEmbeddedStringOptionsAsync = SassEmbedded.StringOptions<'async'>
38
19
  type SassStringOptionsAsync =