@rspack/core 1.4.0 → 1.4.2

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
@@ -1,5 +1,5 @@
1
1
  <picture>
2
- <img alt="Rspack Banner" src="https://assets.rspack.dev/rspack/rspack-banner.png">
2
+ <img alt="Rspack Banner" src="https://assets.rspack.rs/rspack/rspack-banner.png">
3
3
  </picture>
4
4
 
5
5
  # @rspack/core
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Piscina: A fast, efficient Node.js Worker Thread Pool implementation
4
4
 
5
- Tinypool is a fork of piscina. What we try to achieve in this library, is to eliminate some dependencies and features that our target users don't need (currently, our main user will be Vitest). Tinypool's install size (38KB) can then be smaller than Piscina's install size (6MB). If you need features like [utilization](https://github.com/piscinajs/piscina#property-utilization-readonly) or OS-specific thread priority setting, [Piscina](https://github.com/piscinajs/piscina) is a better choice for you. We think that Piscina is an amazing library, and we may try to upstream some of the dependencies optimization in this fork.
5
+ Tinypool is a fork of piscina. What we try to achieve in this library, is to eliminate some dependencies and features that our target users don't need (currently, our main user will be Vitest). Tinypool's install size (38KB) can then be smaller than Piscina's install size (6MB when Tinypool was created, Piscina has since reduced it's size to ~800KB). If you need features like [utilization](https://github.com/piscinajs/piscina#property-utilization-readonly) or OS-specific thread priority setting, [Piscina](https://github.com/piscinajs/piscina) is a better choice for you. We think that Piscina is an amazing library, and we may try to upstream some of the dependencies optimization in this fork.
6
6
 
7
7
  - ✅ Smaller install size, 38KB
8
8
  - ✅ Minimal
@@ -20,6 +20,7 @@ parentPort.on("message", (message) => {
20
20
  if (filename !== null) await getHandler(filename, name);
21
21
  const readyMessage = { ready: true };
22
22
  parentPort.postMessage(readyMessage);
23
+ port.start();
23
24
  port.on("message", onMessage.bind(null, port, sharedBuffer));
24
25
  atomicsWaitLoop(port, sharedBuffer);
25
26
  })().catch(throwInNextTick);
@@ -141,7 +141,10 @@ var ProcessWorker = class {
141
141
  }
142
142
  postMessage(message, transferListItem) {
143
143
  transferListItem?.forEach((item) => {
144
- if (item instanceof MessagePort) this.port = item;
144
+ if (item instanceof MessagePort) {
145
+ this.port = item;
146
+ this.port.start();
147
+ }
145
148
  });
146
149
  if (this.port) this.port.on("message", (message$1) => this.send({
147
150
  ...message$1,
@@ -173,7 +176,7 @@ var ProcessWorker = class {
173
176
  }
174
177
  unref() {
175
178
  this.port?.unref();
176
- this.process.channel?.unref();
179
+ this.process.channel?.unref?.();
177
180
  if (hasUnref(this.process.stdout)) this.process.stdout.unref();
178
181
  if (hasUnref(this.process.stderr)) this.process.stderr.unref();
179
182
  return this.process.unref();
@@ -573,6 +576,7 @@ var ThreadPool = class {
573
576
  worker.postMessage(message, [port2]);
574
577
  worker.on("message", (message$1) => {
575
578
  if (message$1.ready === true) {
579
+ port1.start();
576
580
  if (workerInfo.currentUsage() === 0) workerInfo.unref();
577
581
  if (!workerInfo.isReady()) workerInfo.markAsReady();
578
582
  return;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tinypool",
3
3
  "type": "module",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "packageManager": "pnpm@9.0.6",
6
6
  "description": "A minimal and tiny Node.js Worker Thread Pool implementation, a fork of piscina, but with fewer features",
7
7
  "license": "MIT",
@@ -164,7 +164,7 @@ export declare class Compilation {
164
164
  finishModules: liteTapable.AsyncSeriesHook<[Iterable<Module>], void>;
165
165
  chunkHash: liteTapable.SyncHook<[Chunk, Hash], void>;
166
166
  chunkAsset: liteTapable.SyncHook<[Chunk, string], void>;
167
- processWarnings: liteTapable.SyncWaterfallHook<[Error[]]>;
167
+ processWarnings: liteTapable.SyncWaterfallHook<[WebpackError[]]>;
168
168
  succeedModule: liteTapable.SyncHook<[Module], void>;
169
169
  stillValidModule: liteTapable.SyncHook<[Module], void>;
170
170
  statsPreset: liteTapable.HookMap<liteTapable.SyncHook<[
@@ -9,7 +9,8 @@
9
9
  */
10
10
  import type { Compilation } from "../Compilation";
11
11
  import type { HttpUriPluginOptions } from "../builtin-plugin";
12
- import type { Amd, AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, JavascriptParserOptions, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, NoParseOption, Node, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from "./types";
12
+ import type WebpackError from "../lib/WebpackError";
13
+ import type { Amd, AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, NoParseOption, Node, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from "./types";
13
14
  export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized;
14
15
  export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
15
16
  export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
@@ -108,9 +109,10 @@ export interface ExperimentsNormalized {
108
109
  parallelLoader?: boolean;
109
110
  useInputFileSystem?: false | RegExp[];
110
111
  inlineConst?: boolean;
111
- typeReexportsPresence?: JavascriptParserOptions["typeReexportsPresence"];
112
+ inlineEnum?: boolean;
113
+ typeReexportsPresence?: boolean;
112
114
  }
113
- export type IgnoreWarningsNormalized = ((warning: Error, compilation: Compilation) => boolean)[];
115
+ export type IgnoreWarningsNormalized = ((warning: WebpackError, compilation: Compilation) => boolean)[];
114
116
  export type OptimizationRuntimeChunkNormalized = false | {
115
117
  name: string | ((entrypoint: {
116
118
  name: string;
@@ -6,6 +6,7 @@ import type { Module } from "../Module";
6
6
  import type ModuleGraph from "../ModuleGraph";
7
7
  import type { HttpUriPluginOptions } from "../builtin-plugin/HttpUriPlugin";
8
8
  import type { Chunk } from "../exports";
9
+ import type WebpackError from "../lib/WebpackError";
9
10
  import type { ResolveCallback } from "./adapterRuleUse";
10
11
  import type { DevServerOptions } from "./devServer";
11
12
  export type FilenameTemplate = string;
@@ -2037,15 +2038,20 @@ export type Experiments = {
2037
2038
  */
2038
2039
  useInputFileSystem?: UseInputFileSystem;
2039
2040
  /**
2040
- * Enable inline constants
2041
+ * Enable inline const feature
2041
2042
  * @default false
2042
2043
  */
2043
2044
  inlineConst?: boolean;
2044
2045
  /**
2045
- * Enable inline constants
2046
+ * Enable inline enum feature
2046
2047
  * @default false
2047
2048
  */
2048
- typeReexportsPresence?: JavascriptParserOptions["typeReexportsPresence"];
2049
+ inlineEnum?: boolean;
2050
+ /**
2051
+ * Enable type reexports presence feature
2052
+ * @default false
2053
+ */
2054
+ typeReexportsPresence?: boolean;
2049
2055
  };
2050
2056
  export type Watch = boolean;
2051
2057
  /** Options for watch mode. */
@@ -2082,9 +2088,22 @@ export interface DevServer extends DevServerOptions {
2082
2088
  }
2083
2089
  export type { Middleware as DevServerMiddleware } from "./devServer";
2084
2090
  /**
2085
- * An array of either regular expressions or functions that determine if a warning should be ignored.
2091
+ * Ignore specific warnings.
2086
2092
  */
2087
- export type IgnoreWarnings = (RegExp | ((error: Error, compilation: Compilation) => boolean))[];
2093
+ export type IgnoreWarnings = (RegExp | {
2094
+ /**
2095
+ * A RegExp to select the origin file for the warning.
2096
+ */
2097
+ file?: RegExp;
2098
+ /**
2099
+ * A RegExp to select the warning message.
2100
+ */
2101
+ message?: RegExp;
2102
+ /**
2103
+ * A RegExp to select the origin module for the warning.
2104
+ */
2105
+ module?: RegExp;
2106
+ } | ((warning: WebpackError, compilation: Compilation) => boolean))[];
2088
2107
  /**
2089
2108
  * Capture a "profile" of the application, including statistics and hints, which can then be dissected using the Analyze tool.
2090
2109
  * */
@@ -400,11 +400,8 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
400
400
  parallelLoader: z.ZodOptional<z.ZodBoolean>;
401
401
  useInputFileSystem: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodArray<z.ZodCustom<RegExp, RegExp>>]>>;
402
402
  inlineConst: z.ZodOptional<z.ZodBoolean>;
403
- typeReexportsPresence: z.ZodOptional<z.ZodEnum<{
404
- "no-tolerant": "no-tolerant";
405
- tolerant: "tolerant";
406
- "tolerant-no-check": "tolerant-no-check";
407
- }>>;
403
+ inlineEnum: z.ZodOptional<z.ZodBoolean>;
404
+ typeReexportsPresence: z.ZodOptional<z.ZodBoolean>;
408
405
  }, z.core.$strict>>;
409
406
  externals: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodCustom<RegExp, RegExp>]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString>]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>]>>]>, z.ZodCustom<(...args: unknown[]) => any, (...args: unknown[]) => any>]>>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodCustom<RegExp, RegExp>]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodString>]>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>]>>]>, z.ZodCustom<(...args: unknown[]) => any, (...args: unknown[]) => any>]>]>>;
410
407
  externalsType: z.ZodOptional<z.ZodEnum<{
@@ -476,7 +473,11 @@ export declare const getRspackOptionsSchema: () => z.ZodObject<{
476
473
  global: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"warn">]>>;
477
474
  }, z.core.$strict>]>>;
478
475
  loader: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
479
- ignoreWarnings: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodCustom<RegExp, RegExp>, z.ZodCustom<(...args: unknown[]) => any, (...args: unknown[]) => any>]>>>;
476
+ ignoreWarnings: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodCustom<RegExp, RegExp>, z.ZodCustom<(...args: unknown[]) => any, (...args: unknown[]) => any>]>, z.ZodObject<{
477
+ file: z.ZodOptional<z.ZodCustom<RegExp, RegExp>>;
478
+ message: z.ZodOptional<z.ZodCustom<RegExp, RegExp>>;
479
+ module: z.ZodOptional<z.ZodCustom<RegExp, RegExp>>;
480
+ }, z.core.$strip>]>>>;
480
481
  watchOptions: z.ZodOptional<z.ZodObject<{
481
482
  aggregateTimeout: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodLiteral<number>]>>;
482
483
  followSymlinks: z.ZodOptional<z.ZodBoolean>;
package/dist/index.js CHANGED
@@ -356,7 +356,7 @@ for(var __webpack_i__ in (()=>{
356
356
  Compiler: ()=>Compiler,
357
357
  wasm: ()=>exports_wasm
358
358
  });
359
- var RequestType, StatsErrorCode, _computedKey, Compilation_computedKey, _computedKey1, _computedKey2, ArrayQueue_computedKey, browserslistTargetHandler_namespaceObject = {};
359
+ var RequestType, StatsErrorCode, _computedKey, _computedKey1, _computedKey2, ArrayQueue_computedKey, browserslistTargetHandler_namespaceObject = {};
360
360
  __webpack_require__.r(browserslistTargetHandler_namespaceObject), __webpack_require__.d(browserslistTargetHandler_namespaceObject, {
361
361
  resolve: ()=>browserslistTargetHandler_resolve
362
362
  });
@@ -880,18 +880,22 @@ for(var __webpack_i__ in (()=>{
880
880
  }
881
881
  let external_node_util_namespaceObject = require("node:util");
882
882
  var external_node_util_default = __webpack_require__.n(external_node_util_namespaceObject);
883
- _computedKey = external_node_util_namespaceObject.inspect.custom;
884
- let WebpackError = class extends Error {
883
+ class WebpackError_WebpackError extends Error {
885
884
  loc;
886
885
  file;
887
886
  chunk;
888
887
  module;
889
888
  details;
890
889
  hideStack;
891
- [_computedKey]() {
890
+ }
891
+ Object.defineProperty(WebpackError_WebpackError.prototype, external_node_util_namespaceObject.inspect.custom, {
892
+ value: function() {
892
893
  return this.stack + (this.details ? `\n${this.details}` : "");
893
- }
894
- }, LogType = Object.freeze({
894
+ },
895
+ enumerable: !1,
896
+ configurable: !0
897
+ });
898
+ let WebpackError = WebpackError_WebpackError, LogType = Object.freeze({
895
899
  error: "error",
896
900
  warn: "warn",
897
901
  info: "info",
@@ -1574,7 +1578,7 @@ for(var __webpack_i__ in (()=>{
1574
1578
  let checkCompilation = (compilation)=>{
1575
1579
  if (!(compilation instanceof Compilation)) throw TypeError('The \'compilation\' argument must be an instance of Compilation. This usually occurs when multiple versions of "@rspack/core" are used, or when the code in "@rspack/core" is executed multiple times.');
1576
1580
  };
1577
- Compilation_computedKey = binding_.COMPILATION_HOOKS_MAP_SYMBOL;
1581
+ _computedKey = binding_.COMPILATION_HOOKS_MAP_SYMBOL;
1578
1582
  class Compilation {
1579
1583
  #inner;
1580
1584
  #shutdown;
@@ -1601,7 +1605,7 @@ for(var __webpack_i__ in (()=>{
1601
1605
  needAdditionalPass;
1602
1606
  #addIncludeDispatcher;
1603
1607
  #addEntryDispatcher;
1604
- [Compilation_computedKey];
1608
+ [_computedKey];
1605
1609
  constructor(compiler, inner){
1606
1610
  this.#inner = inner, this.#shutdown = !1;
1607
1611
  let processAssetsHook = new lite_tapable_namespaceObject.AsyncSeriesHook([
@@ -3148,6 +3152,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3148
3152
  }
3149
3153
  }
3150
3154
  class JavaScriptTracer {
3155
+ static state = "uninitialized";
3151
3156
  static startTime;
3152
3157
  static events;
3153
3158
  static layer;
@@ -3156,7 +3161,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3156
3161
  static counter = 10000;
3157
3162
  static async initJavaScriptTrace(layer, output) {
3158
3163
  let { Session } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "node:inspector"));
3159
- this.session = new Session(), this.layer = layer, this.output = output, this.events = [], this.startTime = process.hrtime.bigint();
3164
+ this.session = new Session(), this.layer = layer, this.output = output, this.events = [], this.state = "on", this.startTime = process.hrtime.bigint();
3160
3165
  }
3161
3166
  static uuid() {
3162
3167
  return this.counter++;
@@ -3165,7 +3170,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3165
3170
  this.layer && (this.session.connect(), this.session.post("Profiler.enable"), this.session.post("Profiler.start"));
3166
3171
  }
3167
3172
  static async cleanupJavaScriptTrace() {
3168
- if (!this.layer) return;
3173
+ if ("uninitialized" === this.state) throw Error("JavaScriptTracer is not initialized, please call initJavaScriptTrace first");
3174
+ if (!this.layer || "off" === this.state) return;
3169
3175
  let profileHandler = (err, param)=>{
3170
3176
  let cpu_profile;
3171
3177
  if (err ? console.error("Error stopping profiler:", err) : cpu_profile = param.profile, cpu_profile) {
@@ -3204,7 +3210,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3204
3210
  });
3205
3211
  }
3206
3212
  };
3207
- return new Promise((resolve, reject)=>{
3213
+ await new Promise((resolve, reject)=>{
3208
3214
  this.session.post("Profiler.stop", (err, params)=>{
3209
3215
  if (err) reject(err);
3210
3216
  else try {
@@ -3213,7 +3219,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3213
3219
  reject(err);
3214
3220
  }
3215
3221
  });
3216
- });
3222
+ }), this.state = "off";
3217
3223
  }
3218
3224
  static getTs() {
3219
3225
  return process.hrtime.bigint() - this.startTime;
@@ -8506,12 +8512,13 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8506
8512
  var hashFuncNames, source;
8507
8513
  if (tag.attributes && "integrity" in tag.attributes) return;
8508
8514
  let tagSrc = function(tag) {
8509
- if ([
8510
- "script",
8511
- "link"
8512
- ].includes(tag.tagName) && tag.attributes) {
8513
- if ("string" == typeof tag.attributes.href) return tag.attributes.href;
8514
- if ("string" == typeof tag.attributes.src) return tag.attributes.src;
8515
+ if (tag.attributes) {
8516
+ if ("script" === tag.tagName && "string" == typeof tag.attributes.src) return tag.attributes.src;
8517
+ if ("link" === tag.tagName && "string" == typeof tag.attributes.href) {
8518
+ let rel = tag.attributes.rel;
8519
+ if ("string" != typeof rel) return;
8520
+ return "stylesheet" === rel || "modulepreload" === rel || "preload" === rel && ("script" === tag.attributes.as || "style" === tag.attributes.as) ? tag.attributes.href : void 0;
8521
+ }
8515
8522
  }
8516
8523
  }(tag);
8517
8524
  if (!tagSrc) return;
@@ -9390,9 +9397,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9390
9397
  css: options.experiments.css,
9391
9398
  targetProperties,
9392
9399
  mode: options.mode,
9393
- uniqueName: options.output.uniqueName,
9394
- inlineConst: options.experiments.inlineConst,
9395
- typeReexportsPresence: options.experiments.typeReexportsPresence
9400
+ uniqueName: options.output.uniqueName
9396
9401
  }), applyOutputDefaults(options.output, {
9397
9402
  context: options.context,
9398
9403
  targetProperties,
@@ -9429,17 +9434,17 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9429
9434
  let tty = infrastructureLogging.stream.isTTY && "dumb" !== process.env.TERM;
9430
9435
  D(infrastructureLogging, "level", "info"), D(infrastructureLogging, "debug", !1), D(infrastructureLogging, "colors", tty), D(infrastructureLogging, "appendOnly", !tty);
9431
9436
  }, applyExperimentsDefaults = (experiments, { production, development })=>{
9432
- defaults_F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !0), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !0), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "typeReexportsPresence", "no-tolerant");
9437
+ defaults_F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !0), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !0), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1);
9433
9438
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
9434
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.0"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
9435
- }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyJavascriptParserOptionsDefaults = (parserOptions, inlineConst, typeReexportsPresence)=>{
9439
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.2"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
9440
+ }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyJavascriptParserOptionsDefaults = (parserOptions)=>{
9436
9441
  D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
9437
9442
  "..."
9438
- ]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", inlineConst), D(parserOptions, "typeReexportsPresence", typeReexportsPresence);
9443
+ ]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", !1), D(parserOptions, "typeReexportsPresence", "no-tolerant");
9439
9444
  }, applyJsonGeneratorOptionsDefaults = (generatorOptions)=>{
9440
9445
  D(generatorOptions, "JSONParse", !0);
9441
- }, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName, inlineConst, typeReexportsPresence })=>{
9442
- if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), applyJavascriptParserOptionsDefaults(module.parser.javascript, inlineConst, typeReexportsPresence), defaults_F(module.parser, JSON_MODULE_TYPE, ()=>({})), assertNotNill(module.parser[JSON_MODULE_TYPE]), D(module.parser[JSON_MODULE_TYPE], "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), defaults_F(module.generator, "json", ()=>({})), assertNotNill(module.generator.json), applyJsonGeneratorOptionsDefaults(module.generator.json), css) {
9446
+ }, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
9447
+ if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), applyJavascriptParserOptionsDefaults(module.parser.javascript), defaults_F(module.parser, JSON_MODULE_TYPE, ()=>({})), assertNotNill(module.parser[JSON_MODULE_TYPE]), D(module.parser[JSON_MODULE_TYPE], "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), defaults_F(module.generator, "json", ()=>({})), assertNotNill(module.generator.json), applyJsonGeneratorOptionsDefaults(module.generator.json), css) {
9443
9448
  defaults_F(module.parser, "css", ()=>({})), assertNotNill(module.parser.css), D(module.parser.css, "namedExports", !0), D(module.parser.css, "url", !0), defaults_F(module.parser, "css/auto", ()=>({})), assertNotNill(module.parser["css/auto"]), D(module.parser["css/auto"], "namedExports", !0), D(module.parser["css/auto"], "url", !0), defaults_F(module.parser, "css/module", ()=>({})), assertNotNill(module.parser["css/module"]), D(module.parser["css/module"], "namedExports", !0), D(module.parser["css/module"], "url", !0), defaults_F(module.generator, "css", ()=>({})), assertNotNill(module.generator.css), D(module.generator.css, "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator.css, "esModule", !0), defaults_F(module.generator, "css/auto", ()=>({})), assertNotNill(module.generator["css/auto"]), D(module.generator["css/auto"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/auto"], "exportsConvention", "as-is");
9444
9449
  let localIdentName = uniqueName && uniqueName.length > 0 ? "[uniqueName]-[id]-[local]" : "[id]-[local]";
9445
9450
  D(module.generator["css/auto"], "localIdentName", localIdentName), D(module.generator["css/auto"], "esModule", !0), defaults_F(module.generator, "css/module", ()=>({})), assertNotNill(module.generator["css/module"]), D(module.generator["css/module"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/module"], "exportsConvention", "as-is"), D(module.generator["css/module"], "localIdentName", localIdentName), D(module.generator["css/module"], "esModule", !0);
@@ -9854,7 +9859,13 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9854
9859
  }, getPnpDefault = ()=>!!process.versions.pnp, getNormalizedRspackOptions = (config)=>{
9855
9860
  let fn;
9856
9861
  return {
9857
- ignoreWarnings: void 0 !== config.ignoreWarnings ? config.ignoreWarnings.map((ignore)=>"function" == typeof ignore ? ignore : (warning)=>ignore.test(warning.message)) : void 0,
9862
+ ignoreWarnings: config.ignoreWarnings ? config.ignoreWarnings.map((ignore)=>{
9863
+ if ("function" == typeof ignore) return ignore;
9864
+ let i = ignore instanceof RegExp ? {
9865
+ message: ignore
9866
+ } : ignore;
9867
+ return (warning)=>(!!i.message || !!i.module || !!i.file) && (!i.message || !!i.message.test(warning.message)) && (!i.module || !!warning.module && !!i.module.test(warning.module.readableIdentifier())) && (!i.file || !!warning.file && !!i.file.test(warning.file));
9868
+ }) : void 0,
9858
9869
  name: config.name,
9859
9870
  dependencies: config.dependencies,
9860
9871
  context: config.context,
@@ -10331,7 +10342,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
10331
10342
  },
10332
10343
  arm: "gnueabihf"
10333
10344
  }
10334
- }, BINDING_VERSION = __webpack_require__("@rspack/binding/package.json").version, CORE_VERSION = "1.4.0", getAddonPlatformArchAbi = ()=>{
10345
+ }, BINDING_VERSION = __webpack_require__("@rspack/binding/package.json").version, CORE_VERSION = "1.4.2", getAddonPlatformArchAbi = ()=>{
10335
10346
  let { platform, arch } = process, binding = "";
10336
10347
  binding += platform;
10337
10348
  let abi = NodePlatformArchToAbi[platform][arch];
@@ -11630,7 +11641,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
11630
11641
  obj.children = this.stats.map((stat, idx)=>{
11631
11642
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
11632
11643
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
11633
- }), childOptions.version && (obj.rspackVersion = "1.4.0", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
11644
+ }), childOptions.version && (obj.rspackVersion = "1.4.2", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
11634
11645
  let mapError = (j, obj)=>({
11635
11646
  ...obj,
11636
11647
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -12533,7 +12544,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
12533
12544
  object.hash = context.getStatsCompilation(compilation).hash;
12534
12545
  },
12535
12546
  version: (object)=>{
12536
- object.version = "5.75.0", object.rspackVersion = "1.4.0";
12547
+ object.version = "5.75.0", object.rspackVersion = "1.4.2";
12537
12548
  },
12538
12549
  env: (object, _compilation, _context, { _env })=>{
12539
12550
  object.env = _env;
@@ -15563,14 +15574,19 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
15563
15574
  parallelLoader: schemas_boolean(),
15564
15575
  useInputFileSystem: useInputFileSystem,
15565
15576
  inlineConst: schemas_boolean(),
15566
- typeReexportsPresence: typeReexportsPresence
15577
+ inlineEnum: schemas_boolean(),
15578
+ typeReexportsPresence: schemas_boolean()
15567
15579
  }).partial(), watch = schemas_boolean(), watchOptions = strictObject({
15568
15580
  aggregateTimeout: numberOrInfinity,
15569
15581
  followSymlinks: schemas_boolean(),
15570
15582
  ignored: schemas_string().array().or(_instanceof(RegExp)).or(schemas_string()),
15571
15583
  poll: numberOrInfinity.or(schemas_boolean()),
15572
15584
  stdin: schemas_boolean()
15573
- }).partial(), devServer = custom(), ignoreWarnings = _instanceof(RegExp).or(anyFunction).array(), profile = schemas_boolean(), amd = literal(!1).or(record(schemas_string(), any())), bail = schemas_boolean(), performance = strictObject({
15585
+ }).partial(), devServer = custom(), ignoreWarnings = _instanceof(RegExp).or(anyFunction).or(schemas_object({
15586
+ file: _instanceof(RegExp).optional(),
15587
+ message: _instanceof(RegExp).optional(),
15588
+ module: _instanceof(RegExp).optional()
15589
+ })).array(), profile = schemas_boolean(), amd = literal(!1).or(record(schemas_string(), any())), bail = schemas_boolean(), performance = strictObject({
15574
15590
  assetFilter: anyFunction,
15575
15591
  hints: schemas_enum([
15576
15592
  "error",
@@ -16008,7 +16024,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
16008
16024
  let _options = JSON.stringify(options || {});
16009
16025
  return binding_default().transform(source, _options);
16010
16026
  }
16011
- let exports_rspackVersion = "1.4.0", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
16027
+ let exports_rspackVersion = "1.4.2", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
16012
16028
  getNormalizedRspackOptions: getNormalizedRspackOptions,
16013
16029
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
16014
16030
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -7,10 +7,9 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import { inspect } from "node:util";
10
+ import type { DependencyLocation } from "@rspack/binding";
11
11
  import type { Chunk } from "../Chunk";
12
12
  import type { Module } from "../Module";
13
- type DependencyLocation = any;
14
13
  export declare class WebpackError extends Error {
15
14
  loc?: DependencyLocation;
16
15
  file?: string;
@@ -18,6 +17,5 @@ export declare class WebpackError extends Error {
18
17
  module?: Module;
19
18
  details?: string;
20
19
  hideStack?: boolean;
21
- [inspect.custom](): string;
22
20
  }
23
21
  export default WebpackError;
@@ -13,17 +13,23 @@ export interface ChromeEvent {
13
13
  type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
14
14
  type PartialChromeEvent = MakeOptional<ChromeEvent, "ts" | "ph">;
15
15
  export declare class JavaScriptTracer {
16
+ static state: "uninitialized" | "on" | "off";
16
17
  static startTime: bigint;
17
18
  static events: ChromeEvent[];
18
19
  static layer: string;
19
20
  static output: string;
20
21
  static session: import("node:inspector").Session;
21
22
  private static counter;
23
+ /**
24
+ * only first call take effects, subsequent calls will be ignored
25
+ * @param layer tracing layer
26
+ * @param output tracing output file path
27
+ */
22
28
  static initJavaScriptTrace(layer: string, output: string): Promise<void>;
23
29
  static uuid(): number;
24
30
  static initCpuProfiler(): void;
25
31
  /**
26
- *
32
+ * only first call take effects, subsequent calls will be ignored
27
33
  * @param isEnd true means we are at the end of tracing,and can append ']' to close the json
28
34
  * @returns
29
35
  */
package/dist/worker.js CHANGED
@@ -184,19 +184,23 @@ var __webpack_modules__ = {
184
184
  j: ()=>createHash
185
185
  });
186
186
  let external_node_crypto_namespaceObject = require("node:crypto");
187
- var _computedKey, external_node_crypto_default = __webpack_require__.n(external_node_crypto_namespaceObject);
188
- _computedKey = __webpack_require__("node:util").inspect.custom;
189
- let lib_WebpackError = class extends Error {
187
+ var external_node_crypto_default = __webpack_require__.n(external_node_crypto_namespaceObject), external_node_util_ = __webpack_require__("node:util");
188
+ class WebpackError_WebpackError extends Error {
190
189
  loc;
191
190
  file;
192
191
  chunk;
193
192
  module;
194
193
  details;
195
194
  hideStack;
196
- [_computedKey]() {
195
+ }
196
+ Object.defineProperty(WebpackError_WebpackError.prototype, external_node_util_.inspect.custom, {
197
+ value: function() {
197
198
  return this.stack + (this.details ? `\n${this.details}` : "");
198
- }
199
- }, CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/;
199
+ },
200
+ enumerable: !1,
201
+ configurable: !0
202
+ });
203
+ let WebpackError = WebpackError_WebpackError, CURRENT_METHOD_REGEXP = /at ([a-zA-Z0-9_.]*)/;
200
204
  function createMessage(method) {
201
205
  return `Abstract method${method ? ` ${method}` : ""}. Must be overridden.`;
202
206
  }
@@ -207,7 +211,7 @@ var __webpack_modules__ = {
207
211
  this.message = match?.[1] ? createMessage(match[1]) : createMessage();
208
212
  }
209
213
  }
210
- class AbstractMethodError extends lib_WebpackError {
214
+ class AbstractMethodError extends WebpackError {
211
215
  constructor(){
212
216
  super(new Message().message), this.name = "AbstractMethodError";
213
217
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -57,7 +57,7 @@
57
57
  "dependencies": {
58
58
  "@module-federation/runtime-tools": "0.15.0",
59
59
  "@rspack/lite-tapable": "1.0.1",
60
- "@rspack/binding": "1.4.0"
60
+ "@rspack/binding": "1.4.2"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@swc/helpers": ">=0.5.1"