@rspack-canary/browser 1.6.8-canary-dfa25db9-20251214173359 → 1.6.8-canary-02b3377e-20251215174244

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.
@@ -1,4 +1,12 @@
1
1
  import { type Compiler, MultiCompiler } from "../..";
2
2
  import type { MiddlewareHandler } from "../../config/devServer";
3
3
  export declare const LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-";
4
+ /**
5
+ * Create a middleware that handles lazy compilation requests from the client.
6
+ * This function returns an Express-style middleware that listens for
7
+ * requests triggered by lazy compilation in the dev server client,
8
+ * then invokes the Rspack compiler to compile modules on demand.
9
+ * Use this middleware when integrating lazy compilation into a
10
+ * custom development server instead of relying on the built-in server.
11
+ */
4
12
  export declare const lazyCompilationMiddleware: (compiler: Compiler | MultiCompiler) => MiddlewareHandler;
@@ -2333,7 +2333,18 @@ export type RspackOptions = {
2333
2333
  */
2334
2334
  loader?: Loader;
2335
2335
  /**
2336
- * Warnings to ignore during compilation.
2336
+ * Tells Rspack to suppress specific compilation warnings by matching their
2337
+ * message, module, or file, or by using a custom function.
2338
+ *
2339
+ * @example
2340
+ * ```js
2341
+ * export default {
2342
+ * ignoreWarnings: [
2343
+ * /warning from compiler/,
2344
+ * { file: /node_modules/ },
2345
+ * ],
2346
+ * };
2347
+ * ```
2337
2348
  */
2338
2349
  ignoreWarnings?: IgnoreWarnings;
2339
2350
  /**
package/dist/exports.d.ts CHANGED
@@ -68,6 +68,7 @@ interface Node {
68
68
  NodeTemplatePlugin: typeof NodeTemplatePlugin;
69
69
  NodeEnvironmentPlugin: typeof NodeEnvironmentPlugin;
70
70
  }
71
+ export { lazyCompilationMiddleware };
71
72
  export declare const node: Node;
72
73
  import { ElectronTargetPlugin } from "./builtin-plugin";
73
74
  interface Electron {
@@ -146,6 +147,9 @@ interface Experiments {
146
147
  RstestPlugin: typeof RstestPlugin;
147
148
  RslibPlugin: typeof RslibPlugin;
148
149
  SubresourceIntegrityPlugin: typeof SubresourceIntegrityPlugin;
150
+ /**
151
+ * @deprecated Use `rspack.lazyCompilationMiddleware` instead
152
+ */
149
153
  lazyCompilationMiddleware: typeof lazyCompilationMiddleware;
150
154
  swc: {
151
155
  transform: typeof transform;
package/dist/index.mjs CHANGED
@@ -50616,6 +50616,7 @@ __webpack_require__.d(exports_namespaceObject, {
50616
50616
  electron: ()=>electron,
50617
50617
  experiments: ()=>exports_experiments,
50618
50618
  javascript: ()=>javascript,
50619
+ lazyCompilationMiddleware: ()=>lazyCompilationMiddleware,
50619
50620
  library: ()=>exports_library,
50620
50621
  node: ()=>exports_node,
50621
50622
  optimize: ()=>optimize,
@@ -58191,7 +58192,7 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
58191
58192
  if ("object" == typeof rspackFuture) {
58192
58193
  D(rspackFuture, "bundlerInfo", {});
58193
58194
  if ("object" == typeof rspackFuture.bundlerInfo) {
58194
- D(rspackFuture.bundlerInfo, "version", "1.6.8-canary-dfa25db9-20251214173359");
58195
+ D(rspackFuture.bundlerInfo, "version", "1.6.8-canary-02b3377e-20251215174244");
58195
58196
  D(rspackFuture.bundlerInfo, "bundler", "rspack");
58196
58197
  D(rspackFuture.bundlerInfo, "force", !library);
58197
58198
  }
@@ -58877,20 +58878,24 @@ const A = (obj, prop, factory)=>{
58877
58878
  };
58878
58879
  const getPnpDefault = ()=>!!defaults_process.versions.pnp;
58879
58880
  var normalization_process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
58881
+ const normalizeIgnoreWarnings = (ignoreWarnings)=>{
58882
+ if (!ignoreWarnings) return;
58883
+ return ignoreWarnings.map((ignore)=>{
58884
+ if ("function" == typeof ignore) return ignore;
58885
+ const rule = ignore instanceof RegExp ? {
58886
+ message: ignore
58887
+ } : ignore;
58888
+ return (warning)=>{
58889
+ if (!rule.message && !rule.module && !rule.file) return false;
58890
+ if (rule.message && !rule.message.test(warning.message)) return false;
58891
+ if (rule.module && (!warning.module || !rule.module.test(warning.module.readableIdentifier()))) return false;
58892
+ if (rule.file && (!warning.file || !rule.file.test(warning.file))) return false;
58893
+ return true;
58894
+ };
58895
+ });
58896
+ };
58880
58897
  const getNormalizedRspackOptions = (config)=>({
58881
- ignoreWarnings: config.ignoreWarnings ? config.ignoreWarnings.map((ignore)=>{
58882
- if ("function" == typeof ignore) return ignore;
58883
- const i = ignore instanceof RegExp ? {
58884
- message: ignore
58885
- } : ignore;
58886
- return (warning)=>{
58887
- if (!i.message && !i.module && !i.file) return false;
58888
- if (i.message && !i.message.test(warning.message)) return false;
58889
- if (i.module && (!warning.module || !i.module.test(warning.module.readableIdentifier()))) return false;
58890
- if (i.file && (!warning.file || !i.file.test(warning.file))) return false;
58891
- return true;
58892
- };
58893
- }) : void 0,
58898
+ ignoreWarnings: normalizeIgnoreWarnings(config.ignoreWarnings),
58894
58899
  name: config.name,
58895
58900
  dependencies: config.dependencies,
58896
58901
  context: config.context,
@@ -62337,7 +62342,7 @@ class MultiStats {
62337
62342
  return obj;
62338
62343
  });
62339
62344
  if (childOptions.version) {
62340
- obj.rspackVersion = "1.6.8-canary-dfa25db9-20251214173359";
62345
+ obj.rspackVersion = "1.6.8-canary-02b3377e-20251215174244";
62341
62346
  obj.version = "5.75.0";
62342
62347
  }
62343
62348
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join("");
@@ -62909,7 +62914,13 @@ function IgnoreWarningsPlugin_define_property(obj, key, value) {
62909
62914
  class IgnoreWarningsPlugin {
62910
62915
  apply(compiler) {
62911
62916
  compiler.hooks.compilation.tap(this.name, (compilation)=>{
62912
- compilation.hooks.processWarnings.tap(this.name, (warnings)=>warnings.filter((warning)=>!this._ignorePattern.some((ignore)=>ignore(warning, compilation))));
62917
+ compilation.hooks.processWarnings.tap(this.name, (warnings)=>warnings.filter((warning)=>{
62918
+ const plainWarning = warning.message ? {
62919
+ ...warning,
62920
+ message: util_default().stripVTControlCharacters(warning.message)
62921
+ } : warning;
62922
+ return !this._ignorePattern.some((ignore)=>ignore(plainWarning, compilation));
62923
+ }));
62913
62924
  });
62914
62925
  }
62915
62926
  constructor(ignorePattern){
@@ -63647,7 +63658,7 @@ const SIMPLE_EXTRACTORS = {
63647
63658
  },
63648
63659
  version: (object)=>{
63649
63660
  object.version = "5.75.0";
63650
- object.rspackVersion = "1.6.8-canary-dfa25db9-20251214173359";
63661
+ object.rspackVersion = "1.6.8-canary-02b3377e-20251215174244";
63651
63662
  },
63652
63663
  env: (object, _compilation, _context, { _env })=>{
63653
63664
  object.env = _env;
@@ -66784,7 +66795,7 @@ function transformSync(source, options) {
66784
66795
  const _options = JSON.stringify(options || {});
66785
66796
  return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
66786
66797
  }
66787
- const exports_rspackVersion = "1.6.8-canary-dfa25db9-20251214173359";
66798
+ const exports_rspackVersion = "1.6.8-canary-02b3377e-20251215174244";
66788
66799
  const exports_version = "5.75.0";
66789
66800
  const exports_WebpackError = Error;
66790
66801
  const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
@@ -67195,4 +67206,4 @@ var __webpack_exports__EntryDependency = external_rspack_wasi_browser_js_.EntryD
67195
67206
  var __webpack_exports__ExternalModule = external_rspack_wasi_browser_js_.ExternalModule;
67196
67207
  var __webpack_exports__Module = external_rspack_wasi_browser_js_.Module;
67197
67208
  var __webpack_exports__NormalModule = external_rspack_wasi_browser_js_.NormalModule;
67198
- export { BannerPlugin, BrowserHttpImportEsmPlugin, BrowserRequirePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefinePlugin, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, lib_EntryOptionPlugin as EntryOptionPlugin, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, DefaultRuntimeGlobals as RuntimeGlobals, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, statsFactoryUtils_StatsErrorCode as StatsErrorCode, SwcJsMinimizerRspackPlugin, Template, ValidationError, WarnCaseSensitiveModulesPlugin, exports_WebpackError as WebpackError, RspackOptionsApply as WebpackOptionsApply, builtinMemFs, exports_config as config, container, electron, exports_experiments as experiments, javascript, exports_library as library, exports_node as node, optimize, src_rspack_0 as rspack, exports_rspackVersion as rspackVersion, sharing, sources, exports_util as util, exports_version as version, exports_wasm as wasm, web, webworker, __webpack_exports__AsyncDependenciesBlock as AsyncDependenciesBlock, __webpack_exports__ConcatenatedModule as ConcatenatedModule, __webpack_exports__ContextModule as ContextModule, __webpack_exports__Dependency as Dependency, __webpack_exports__EntryDependency as EntryDependency, __webpack_exports__ExternalModule as ExternalModule, __webpack_exports__Module as Module, __webpack_exports__NormalModule as NormalModule };
67209
+ export { BannerPlugin, BrowserHttpImportEsmPlugin, BrowserRequirePlugin, CircularDependencyRspackPlugin, Compilation, Compiler, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, DefinePlugin, DllPlugin, DllReferencePlugin, DynamicEntryPlugin, lib_EntryOptionPlugin as EntryOptionPlugin, EntryPlugin, EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, ExternalsPlugin, HotModuleReplacementPlugin, HtmlRspackPlugin, IgnorePlugin, LightningCssMinimizerRspackPlugin, LoaderOptionsPlugin, LoaderTargetPlugin, ModuleFilenameHelpers_namespaceObject as ModuleFilenameHelpers, MultiCompiler, MultiStats, NoEmitOnErrorsPlugin, NormalModuleReplacementPlugin, ProgressPlugin, ProvidePlugin, RspackOptionsApply, DefaultRuntimeGlobals as RuntimeGlobals, RuntimeModule, RuntimePlugin, SourceMapDevToolPlugin, Stats, statsFactoryUtils_StatsErrorCode as StatsErrorCode, SwcJsMinimizerRspackPlugin, Template, ValidationError, WarnCaseSensitiveModulesPlugin, exports_WebpackError as WebpackError, RspackOptionsApply as WebpackOptionsApply, builtinMemFs, exports_config as config, container, electron, exports_experiments as experiments, javascript, lazyCompilationMiddleware, exports_library as library, exports_node as node, optimize, src_rspack_0 as rspack, exports_rspackVersion as rspackVersion, sharing, sources, exports_util as util, exports_version as version, exports_wasm as wasm, web, webworker, __webpack_exports__AsyncDependenciesBlock as AsyncDependenciesBlock, __webpack_exports__ConcatenatedModule as ConcatenatedModule, __webpack_exports__ContextModule as ContextModule, __webpack_exports__Dependency as Dependency, __webpack_exports__EntryDependency as EntryDependency, __webpack_exports__ExternalModule as ExternalModule, __webpack_exports__Module as Module, __webpack_exports__NormalModule as NormalModule };
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/browser",
3
- "version": "1.6.8-canary-dfa25db9-20251214173359",
3
+ "version": "1.6.8-canary-02b3377e-20251215174244",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",