@depup/vite 8.2.2-depup.0 → 8.3.1-depup.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.
package/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/vite
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [vite](https://www.npmjs.com/package/vite) @ 8.2.2 |
17
- | Processed | 2026-08-23 |
16
+ | Original | [vite](https://www.npmjs.com/package/vite) @ 8.3.1 |
17
+ | Processed | 2026-09-27 |
18
18
  | Smoke test | failed |
19
19
  | Deps updated | 1 |
20
20
 
@@ -22,7 +22,7 @@ npm install @depup/vite
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
- | rolldown | ~1.2.4 | ^1.2.5 |
25
+ | rolldown | ~1.2.9 | ^1.2.11 |
26
26
 
27
27
  ---
28
28
 
package/bin/vite.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { performance } from 'node:perf_hooks'
3
2
  import module from 'node:module'
3
+ import { performance } from 'node:perf_hooks'
4
4
 
5
5
  if (!import.meta.url.includes('node_modules')) {
6
6
  if (!process.env.DEBUG_DISABLE_SOURCE_MAP) {
@@ -20,7 +20,9 @@ const debugIndex = process.argv.findIndex((arg) => /^(?:-d|--debug)$/.test(arg))
20
20
  const filterIndex = process.argv.findIndex((arg) =>
21
21
  /^(?:-f|--filter)$/.test(arg),
22
22
  )
23
- const profileIndex = process.argv.indexOf('--profile')
23
+ const profileIndex = process.argv.findIndex(
24
+ (arg) => arg === '--profile' || arg.startsWith('--profile='),
25
+ )
24
26
 
25
27
  if (debugIndex > 0) {
26
28
  let value = process.argv[debugIndex + 1]
@@ -63,10 +65,19 @@ function start() {
63
65
  }
64
66
 
65
67
  if (profileIndex > 0) {
66
- process.argv.splice(profileIndex, 1)
67
- const next = process.argv[profileIndex]
68
- if (next && next[0] !== '-') {
69
- process.argv.splice(profileIndex, 1)
68
+ const [profileArg] = process.argv.splice(profileIndex, 1)
69
+ // `--profile [name]` writes the profile to `<name>.cpuprofile`. The value is
70
+ // optional and consumed like cac does for other `[optional]` value flags.
71
+ let profileName = profileArg.slice('--profile='.length)
72
+ if (!profileName) {
73
+ const next = process.argv[profileIndex]
74
+ if (next && next[0] !== '-') {
75
+ process.argv.splice(profileIndex, 1)
76
+ profileName = next
77
+ }
78
+ }
79
+ if (profileName) {
80
+ global.__vite_profile_name = profileName
70
81
  }
71
82
  const inspector = await import('node:inspector').then((r) => r.default)
72
83
  const session = (global.__vite_profile_session = new inspector.Session())
package/changes.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "bumped": {
3
3
  "rolldown": {
4
- "from": "~1.2.4",
5
- "to": "^1.2.5"
4
+ "from": "~1.2.9",
5
+ "to": "^1.2.11"
6
6
  }
7
7
  },
8
- "timestamp": "2026-08-23T00:29:52.532Z",
8
+ "timestamp": "2026-09-27T01:04:47.478Z",
9
9
  "totalUpdated": 1
10
10
  }
@@ -8,7 +8,7 @@ let nanoid = (size = 21) => {
8
8
  return id;
9
9
  };
10
10
  //#endregion
11
- //#region ../../node_modules/.pnpm/rolldown@1.2.4/node_modules/rolldown/dist/experimental-runtime-base.mjs
11
+ //#region ../../node_modules/.pnpm/rolldown@1.2.9/node_modules/rolldown/dist/experimental-runtime-base.mjs
12
12
  var __create = Object.create;
13
13
  var __defProp = Object.defineProperty;
14
14
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -41,7 +41,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
41
41
  }) : target, mod));
42
42
  var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
43
43
  //#endregion
44
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/typeof.js
44
+ //#region \0@oxc-project+runtime@0.150.0/helpers/esm/typeof.js
45
45
  function _typeof(o) {
46
46
  "@babel/helpers - typeof";
47
47
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -51,7 +51,7 @@ function _typeof(o) {
51
51
  }, _typeof(o);
52
52
  }
53
53
  //#endregion
54
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/toPrimitive.js
54
+ //#region \0@oxc-project+runtime@0.150.0/helpers/esm/toPrimitive.js
55
55
  function toPrimitive(t, r) {
56
56
  if ("object" != _typeof(t) || !t) return t;
57
57
  var e = t[Symbol.toPrimitive];
@@ -63,13 +63,13 @@ function toPrimitive(t, r) {
63
63
  return ("string" === r ? String : Number)(t);
64
64
  }
65
65
  //#endregion
66
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/toPropertyKey.js
66
+ //#region \0@oxc-project+runtime@0.150.0/helpers/esm/toPropertyKey.js
67
67
  function toPropertyKey(t) {
68
68
  var i = toPrimitive(t, "string");
69
69
  return "symbol" == _typeof(i) ? i : i + "";
70
70
  }
71
71
  //#endregion
72
- //#region \0@oxc-project+runtime@0.144.0/helpers/esm/defineProperty.js
72
+ //#region \0@oxc-project+runtime@0.150.0/helpers/esm/defineProperty.js
73
73
  function _defineProperty(e, r, t) {
74
74
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
75
75
  value: t,
@@ -79,7 +79,7 @@ function _defineProperty(e, r, t) {
79
79
  }) : e[r] = t, e;
80
80
  }
81
81
  //#endregion
82
- //#region ../../node_modules/.pnpm/rolldown@1.2.4/node_modules/rolldown/dist/experimental-runtime.mjs
82
+ //#region ../../node_modules/.pnpm/rolldown@1.2.9/node_modules/rolldown/dist/experimental-runtime.mjs
83
83
  var Module = class {
84
84
  /**
85
85
  * @param {string} id
@@ -208,6 +208,12 @@ var DevRuntime = class {
208
208
  "hooks",
209
209
  null
210
210
  );
211
+ _defineProperty(
212
+ this,
213
+ /** @type {Map<string, Promise<any>>} */
214
+ "lazyRequests",
215
+ /* @__PURE__ */ new Map()
216
+ );
211
217
  _defineProperty(
212
218
  this,
213
219
  /** @internal */
@@ -287,9 +293,9 @@ var DevRuntime = class {
287
293
  }
288
294
  /**
289
295
  * @param {string} id
290
- * @param {{ exports: any }} exportsHolder
296
+ * @param {{ exports: any }} [exportsHolder]
291
297
  */
292
- registerModule(id, exportsHolder) {
298
+ registerModule(id, exportsHolder = { exports: {} }) {
293
299
  const module = new Module(id);
294
300
  module.exportsHolder = exportsHolder;
295
301
  this.moduleCache.set(id, module);
@@ -322,6 +328,7 @@ var DevRuntime = class {
322
328
  */
323
329
  removeModuleCache(id) {
324
330
  this.moduleCache.delete(id);
331
+ this.lazyRequests.delete(id);
325
332
  this.hooks?.onModuleCacheRemoval(id);
326
333
  }
327
334
  /**
@@ -348,6 +355,29 @@ var DevRuntime = class {
348
355
  }
349
356
  }
350
357
  /**
358
+ * The entry point for a lazy `import()`. `id` is the module the boundary stands for; the
359
+ * boundary's own id appears only inside `fetchChunk`'s URL.
360
+ *
361
+ * Nothing is registered under the boundary id, deliberately. A cache entry with no factory
362
+ * behind it reads as "executed" to the HMR boundary walk, and `applyUpdate` turns an
363
+ * updated-but-factory-less module into a full page reload.
364
+ *
365
+ * A rejection is memoized like any other outcome, matching `import()` of a module that
366
+ * threw. Retrying could not work anyway: a factory registers its module before running its
367
+ * body, so re-running `initModule` would return half-initialized exports as success.
368
+ *
369
+ * @param {string} id
370
+ * @param {() => Promise<unknown>} fetchChunk
371
+ * @returns {Promise<any>}
372
+ */
373
+ requestLazy(id, fetchChunk) {
374
+ const pending = this.lazyRequests.get(id);
375
+ if (pending) return pending;
376
+ const promise = this.moduleCache.has(id) || this.factories.has(id) ? Promise.resolve().then(() => this.initModule(id)) : Promise.resolve().then(fetchChunk).then(() => this.initModule(id));
377
+ this.lazyRequests.set(id, promise);
378
+ return promise;
379
+ }
380
+ /**
351
381
  * @param {string} moduleId
352
382
  */
353
383
  createModuleHotContext(moduleId) {
@@ -632,14 +662,14 @@ var BundledDevHMRClient = class extends HMRClient {
632
662
  if (importerIndex > -1) {
633
663
  const importChain = [
634
664
  importer,
635
- ...[...currentChain].reverse(),
665
+ ...currentChain.toReversed(),
636
666
  ...nodeChain.slice(importerIndex, -1).reverse()
637
667
  ];
638
668
  this.logger.debug(`circular imports detected: ${importChain.join(" -> ")}`);
639
669
  return true;
640
670
  }
641
671
  if (!currentChain.includes(importer)) {
642
- const result = this.isNodeWithinCircularImports(importer, nodeChain, currentChain.concat(importer), traversedModules);
672
+ const result = this.isNodeWithinCircularImports(importer, nodeChain, [...currentChain, importer], traversedModules);
643
673
  if (result) return result;
644
674
  }
645
675
  }
@@ -782,9 +812,33 @@ var BundledDevHMRContext = class extends HMRContext {
782
812
  };
783
813
  //#endregion
784
814
  //#region src/shared/constants.ts
815
+ /**
816
+ * Prefix for resolved Ids that are not valid browser import specifiers
817
+ */
818
+ const VALID_ID_PREFIX = `/@id/`;
819
+ /**
820
+ * Plugins that use 'virtual modules' (e.g. for helper functions), prefix the
821
+ * module ID with `\0`, a convention from the rollup ecosystem.
822
+ * This prevents other plugins from trying to process the id (like node resolution),
823
+ * and core features like sourcemaps can use this info to differentiate between
824
+ * virtual modules and regular files.
825
+ * `\0` is not a permitted char in import URLs so we have to replace them during
826
+ * import analysis. The id will be decoded back before entering the plugins pipeline.
827
+ * These encoded virtual ids are also prefixed by the VALID_ID_PREFIX, so virtual
828
+ * modules in the browser end up encoded as `/@id/__x00__{id}`
829
+ */
830
+ const NULL_BYTE_PLACEHOLDER = `__x00__`;
785
831
  let SOURCEMAPPING_URL = "sourceMa";
786
832
  SOURCEMAPPING_URL += "ppingURL";
787
833
  typeof process !== "undefined" && process.platform;
834
+ /**
835
+ * Prepend `/@id/` and replace null byte so the id is URL-safe.
836
+ * This is prepended to resolved ids that are not valid browser
837
+ * import specifiers by the importAnalysis plugin.
838
+ */
839
+ function wrapId(id) {
840
+ return id.startsWith(VALID_ID_PREFIX) ? id : VALID_ID_PREFIX + id.replace("\0", NULL_BYTE_PLACEHOLDER);
841
+ }
788
842
  (async function() {}).constructor;
789
843
  function promiseWithResolvers() {
790
844
  let resolve;
@@ -1002,39 +1056,6 @@ const createWebSocketModuleRunnerTransport = (options) => {
1002
1056
  };
1003
1057
  };
1004
1058
  //#endregion
1005
- //#region src/shared/hmrHandler.ts
1006
- function createHMRHandler(handler) {
1007
- const queue = new Queue();
1008
- return (payload) => queue.enqueue(() => handler(payload));
1009
- }
1010
- var Queue = class {
1011
- constructor() {
1012
- _defineProperty(this, "queue", []);
1013
- _defineProperty(this, "pending", false);
1014
- }
1015
- enqueue(promise) {
1016
- return new Promise((resolve, reject) => {
1017
- this.queue.push({
1018
- promise,
1019
- resolve,
1020
- reject
1021
- });
1022
- this.dequeue();
1023
- });
1024
- }
1025
- dequeue() {
1026
- if (this.pending) return false;
1027
- const item = this.queue.shift();
1028
- if (!item) return false;
1029
- this.pending = true;
1030
- item.promise().then(item.resolve).catch(item.reject).finally(() => {
1031
- this.pending = false;
1032
- this.dequeue();
1033
- });
1034
- return true;
1035
- }
1036
- };
1037
- //#endregion
1038
1059
  //#region src/shared/forwardConsole.ts
1039
1060
  function setupForwardConsoleHandler(transport, options, console = globalThis.console) {
1040
1061
  if (!options.enabled) return;
@@ -1163,6 +1184,39 @@ function stringifyConsoleArg(value) {
1163
1184
  }
1164
1185
  }
1165
1186
  //#endregion
1187
+ //#region src/shared/hmrHandler.ts
1188
+ function createHMRHandler(handler) {
1189
+ const queue = new Queue();
1190
+ return (payload) => queue.enqueue(() => handler(payload));
1191
+ }
1192
+ var Queue = class {
1193
+ constructor() {
1194
+ _defineProperty(this, "queue", []);
1195
+ _defineProperty(this, "pending", false);
1196
+ }
1197
+ enqueue(promise) {
1198
+ return new Promise((resolve, reject) => {
1199
+ this.queue.push({
1200
+ promise,
1201
+ resolve,
1202
+ reject
1203
+ });
1204
+ this.dequeue();
1205
+ });
1206
+ }
1207
+ dequeue() {
1208
+ if (this.pending) return false;
1209
+ const item = this.queue.shift();
1210
+ if (!item) return false;
1211
+ this.pending = true;
1212
+ item.promise().then(item.resolve).catch(item.reject).finally(() => {
1213
+ this.pending = false;
1214
+ this.dequeue();
1215
+ });
1216
+ return true;
1217
+ }
1218
+ };
1219
+ //#endregion
1166
1220
  //#region src/client/overlay.ts
1167
1221
  const hmrConfigName = __HMR_CONFIG_NAME__;
1168
1222
  const base$1 = __BASE__ || "/";
@@ -1480,14 +1534,18 @@ const debounceReload = (time) => {
1480
1534
  };
1481
1535
  };
1482
1536
  const pageReload = debounceReload(20);
1537
+ function wrapIdIfNeeded(id) {
1538
+ return id[0] === "." || id[0] === "/" ? id : wrapId(id);
1539
+ }
1483
1540
  const hmrClient = new HMRClient({
1484
1541
  error: (err) => console.error("[vite]", err),
1485
1542
  debug: (...msg) => console.debug("[vite]", ...msg)
1486
1543
  }, transport, async function importUpdatedModule({ acceptedPath, timestamp, explicitImportRequired, isWithinCircularImport }) {
1487
1544
  const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`);
1545
+ const browserPath = wrapIdIfNeeded(acceptedPathWithoutQuery);
1488
1546
  const importPromise = import(
1489
1547
  /* @vite-ignore */
1490
- base + acceptedPathWithoutQuery.slice(1) + `?${explicitImportRequired ? "import&" : ""}t=${timestamp}${query ? `&${query}` : ""}`
1548
+ base + browserPath.slice(1) + `?${explicitImportRequired ? "import&" : ""}t=${timestamp}${query ? `&${query}` : ""}`
1491
1549
  );
1492
1550
  if (isWithinCircularImport) importPromise.catch(() => {
1493
1551
  console.info(`[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. To debug and break the circular import, you can run \`vite --debug hmr\` to log the circular dependency path if a file change triggered it.`);
@@ -1796,6 +1854,13 @@ function injectQuery(url, queryToInject) {
1796
1854
  if (typeof DevRuntime !== "undefined") {
1797
1855
  var _ref;
1798
1856
  class ViteDevRuntime extends DevRuntime {
1857
+ payloadDelivered(filename) {
1858
+ transport.send({
1859
+ type: "custom",
1860
+ event: "vite:bundled-dev:payload-delivered",
1861
+ data: { filename }
1862
+ });
1863
+ }
1799
1864
  createModuleHotContext(moduleId) {
1800
1865
  const ctx = new BundledDevHMRContext(bundledDevHmrClient, moduleId);
1801
1866
  ctx._internal = {