@rspack-canary/core 1.7.3-canary-8f09f616-20260116215247 → 1.7.3-canary-2f0bc179-20260118174706

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,13 +1,11 @@
1
1
  import type { Compiler } from '../Compiler';
2
2
  import { type ModuleFederationManifestPluginOptions } from './ModuleFederationManifestPlugin';
3
3
  import type { ModuleFederationPluginV1Options } from './ModuleFederationPluginV1';
4
- import { type ModuleFederationRuntimeExperimentsOptions } from './ModuleFederationRuntimePlugin';
5
4
  export interface ModuleFederationPluginOptions extends Omit<ModuleFederationPluginV1Options, 'enhanced'> {
6
5
  runtimePlugins?: RuntimePlugins;
7
6
  implementation?: string;
8
7
  shareStrategy?: 'version-first' | 'loaded-first';
9
8
  manifest?: boolean | Omit<ModuleFederationManifestPluginOptions, 'remoteAliasMap' | 'globalName' | 'name' | 'exposes' | 'shared'>;
10
- experiments?: ModuleFederationRuntimeExperimentsOptions;
11
9
  }
12
10
  export type RuntimePlugins = string[] | [string, Record<string, unknown>][];
13
11
  export declare class ModuleFederationPlugin {
@@ -1,10 +1,5 @@
1
- export interface ModuleFederationRuntimeExperimentsOptions {
2
- asyncStartup?: boolean;
3
- }
4
1
  export interface ModuleFederationRuntimeOptions {
5
2
  entryRuntime?: string;
6
- experiments?: ModuleFederationRuntimeExperimentsOptions;
7
- asyncStartup?: boolean;
8
3
  }
9
4
  export declare const ModuleFederationRuntimePlugin: {
10
5
  new (options?: ModuleFederationRuntimeOptions | undefined): {
package/dist/index.js CHANGED
@@ -5882,7 +5882,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5882
5882
  }, applyExperimentsDefaults = (experiments, { development })=>{
5883
5883
  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, 'topLevelAwait', !0), D(experiments, 'deferImport', !1), 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', !1), 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, 'parallelLoader', !1), D(experiments, 'useInputFileSystem', !1), D(experiments, 'inlineConst', !0), D(experiments, 'inlineEnum', !1), D(experiments, 'typeReexportsPresence', !1), D(experiments, 'lazyBarrel', !0);
5884
5884
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
5885
- 'object' == typeof rspackFuture && (D(rspackFuture, 'bundlerInfo', {}), 'object' == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, 'version', "1.7.3-canary-8f09f616-20260116215247"), D(rspackFuture.bundlerInfo, 'bundler', 'rspack'), D(rspackFuture.bundlerInfo, 'force', !library)));
5885
+ 'object' == typeof rspackFuture && (D(rspackFuture, 'bundlerInfo', {}), 'object' == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, 'version', "1.7.3-canary-2f0bc179-20260118174706"), D(rspackFuture.bundlerInfo, 'bundler', 'rspack'), D(rspackFuture.bundlerInfo, 'force', !library)));
5886
5886
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyCssGeneratorOptionsDefaults = (generatorOptions, { targetProperties })=>{
5887
5887
  D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0);
5888
5888
  }, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, deferImport })=>{
@@ -7450,7 +7450,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7450
7450
  obj.children = this.stats.map((stat, idx)=>{
7451
7451
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
7452
7452
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
7453
- }), childOptions.version && (obj.rspackVersion = "1.7.3-canary-8f09f616-20260116215247", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
7453
+ }), childOptions.version && (obj.rspackVersion = "1.7.3-canary-2f0bc179-20260118174706", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
7454
7454
  let mapError = (j, obj)=>({
7455
7455
  ...obj,
7456
7456
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -8706,7 +8706,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
8706
8706
  object.hash = context.getStatsCompilation(compilation).hash;
8707
8707
  },
8708
8708
  version: (object)=>{
8709
- object.version = "5.75.0", object.rspackVersion = "1.7.3-canary-8f09f616-20260116215247";
8709
+ object.version = "5.75.0", object.rspackVersion = "1.7.3-canary-2f0bc179-20260118174706";
8710
8710
  },
8711
8711
  env: (object, _compilation, _context, { _env })=>{
8712
8712
  object.env = _env;
@@ -10431,7 +10431,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
10431
10431
  });
10432
10432
  }
10433
10433
  }
10434
- let CORE_VERSION = "1.7.3-canary-8f09f616-20260116215247", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10434
+ let CORE_VERSION = "1.7.3-canary-2f0bc179-20260118174706", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10435
10435
 
10436
10436
  Help:
10437
10437
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -12200,16 +12200,12 @@ Help:
12200
12200
  };
12201
12201
  }
12202
12202
  raw(compiler) {
12203
- let { remoteType, remotes } = this._options, remoteExternals = {}, importExternals = {};
12203
+ let { remoteType, remotes } = this._options, remoteExternals = {};
12204
12204
  for (let [key, config] of remotes){
12205
12205
  let i = 0;
12206
- for (let external of config.external){
12207
- if (external.startsWith('internal ')) continue;
12208
- let request = `webpack/container/reference/${key}${i ? `/fallback-${i}` : ''}`;
12209
- ('module' === remoteType || 'module-import' === remoteType) && external.startsWith('.') ? importExternals[request] = external : remoteExternals[request] = external, i++;
12210
- }
12206
+ for (let external of config.external)!external.startsWith('internal ') && (remoteExternals[`webpack/container/reference/${key}${i ? `/fallback-${i}` : ''}`] = external, i++);
12211
12207
  }
12212
- new ExternalsPlugin(remoteType, remoteExternals, !0).apply(compiler), Object.keys(importExternals).length > 0 && new ExternalsPlugin('import', importExternals, !0).apply(compiler), new ShareRuntimePlugin(this._options.enhanced).apply(compiler);
12208
+ new ExternalsPlugin(remoteType, remoteExternals, !0).apply(compiler), new ShareRuntimePlugin(this._options.enhanced).apply(compiler);
12213
12209
  let rawOptions = {
12214
12210
  remoteType: this._options.remoteType,
12215
12211
  remotes: this._options.remotes.map(([key, r])=>({
@@ -12229,7 +12225,7 @@ Help:
12229
12225
  let _options = JSON.stringify(options || {});
12230
12226
  return binding_default().transform(source, _options);
12231
12227
  }
12232
- let exports_rspackVersion = "1.7.3-canary-8f09f616-20260116215247", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
12228
+ let exports_rspackVersion = "1.7.3-canary-2f0bc179-20260118174706", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
12233
12229
  getNormalizedRspackOptions: getNormalizedRspackOptions,
12234
12230
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
12235
12231
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -12290,49 +12286,34 @@ Help:
12290
12286
  bundlerRuntime: bundlerRuntimePath,
12291
12287
  runtime: runtimePath
12292
12288
  });
12293
- compiler.options.resolve.alias = {
12289
+ if (compiler.options.resolve.alias = {
12294
12290
  '@module-federation/runtime-tools': paths.runtimeTools,
12295
12291
  '@module-federation/runtime': paths.runtime,
12296
12292
  ...compiler.options.resolve.alias
12297
- };
12298
- let entryRuntime = function(paths, options, compiler) {
12299
- let runtimePlugins = options.runtimePlugins ?? [], remoteInfos = getRemoteInfos(options), runtimePluginImports = [], runtimePluginVars = [];
12300
- for(let i = 0; i < runtimePlugins.length; i++){
12301
- let runtimePluginVar = `__module_federation_runtime_plugin_${i}__`, pluginSpec = runtimePlugins[i], pluginPath = Array.isArray(pluginSpec) ? pluginSpec[0] : pluginSpec, pluginParams = Array.isArray(pluginSpec) ? pluginSpec[1] : void 0;
12302
- runtimePluginImports.push(`import ${runtimePluginVar} from ${JSON.stringify(pluginPath)}`);
12303
- let paramsCode = void 0 === pluginParams ? 'undefined' : JSON.stringify(pluginParams);
12304
- runtimePluginVars.push(`${runtimePluginVar}(${paramsCode})`);
12305
- }
12306
- let content = [
12307
- `import __module_federation_bundler_runtime__ from ${JSON.stringify(paths.bundlerRuntime)}`,
12308
- ...runtimePluginImports,
12309
- `const __module_federation_runtime_plugins__ = [${runtimePluginVars.join(', ')}]`,
12310
- `const __module_federation_remote_infos__ = ${JSON.stringify(remoteInfos)}`,
12311
- `const __module_federation_container_name__ = ${JSON.stringify(options.name ?? compiler.options.output.uniqueName)}`,
12312
- `const __module_federation_share_strategy__ = ${JSON.stringify(options.shareStrategy ?? 'version-first')}`,
12313
- compiler.webpack.Template.getFunctionContent(__webpack_require__("./moduleFederationDefaultRuntime.js"))
12314
- ].join(';');
12315
- return `@module-federation/runtime/rspack.js!=!data:text/javascript,${content}`;
12316
- }(paths, this._options, compiler), asyncStartup = this._options.experiments?.asyncStartup ?? !1;
12317
- new ModuleFederationRuntimePlugin({
12318
- entryRuntime,
12319
- experiments: {
12320
- asyncStartup
12321
- }
12322
- }).apply(compiler);
12323
- let v1Options = {
12324
- name: this._options.name,
12325
- exposes: this._options.exposes,
12326
- filename: this._options.filename,
12327
- library: this._options.library,
12328
- remoteType: this._options.remoteType,
12329
- remotes: this._options.remotes,
12330
- runtime: this._options.runtime,
12331
- shareScope: this._options.shareScope,
12332
- shared: this._options.shared,
12293
+ }, new ModuleFederationRuntimePlugin({
12294
+ entryRuntime: function(paths, options, compiler) {
12295
+ let runtimePlugins = options.runtimePlugins ?? [], remoteInfos = getRemoteInfos(options), runtimePluginImports = [], runtimePluginVars = [];
12296
+ for(let i = 0; i < runtimePlugins.length; i++){
12297
+ let runtimePluginVar = `__module_federation_runtime_plugin_${i}__`, pluginSpec = runtimePlugins[i], pluginPath = Array.isArray(pluginSpec) ? pluginSpec[0] : pluginSpec, pluginParams = Array.isArray(pluginSpec) ? pluginSpec[1] : void 0;
12298
+ runtimePluginImports.push(`import ${runtimePluginVar} from ${JSON.stringify(pluginPath)}`);
12299
+ let paramsCode = void 0 === pluginParams ? 'undefined' : JSON.stringify(pluginParams);
12300
+ runtimePluginVars.push(`${runtimePluginVar}(${paramsCode})`);
12301
+ }
12302
+ let content = [
12303
+ `import __module_federation_bundler_runtime__ from ${JSON.stringify(paths.bundlerRuntime)}`,
12304
+ ...runtimePluginImports,
12305
+ `const __module_federation_runtime_plugins__ = [${runtimePluginVars.join(', ')}]`,
12306
+ `const __module_federation_remote_infos__ = ${JSON.stringify(remoteInfos)}`,
12307
+ `const __module_federation_container_name__ = ${JSON.stringify(options.name ?? compiler.options.output.uniqueName)}`,
12308
+ `const __module_federation_share_strategy__ = ${JSON.stringify(options.shareStrategy ?? 'version-first')}`,
12309
+ compiler.webpack.Template.getFunctionContent(__webpack_require__("./moduleFederationDefaultRuntime.js"))
12310
+ ].join(';');
12311
+ return `@module-federation/runtime/rspack.js!=!data:text/javascript,${content}`;
12312
+ }(paths, this._options, compiler)
12313
+ }).apply(compiler), new webpack.container.ModuleFederationPluginV1({
12314
+ ...this._options,
12333
12315
  enhanced: !0
12334
- };
12335
- if (new webpack.container.ModuleFederationPluginV1(v1Options).apply(compiler), this._options.manifest) {
12316
+ }).apply(compiler), this._options.manifest) {
12336
12317
  let manifestOptions = !0 === this._options.manifest ? {} : {
12337
12318
  ...this._options.manifest
12338
12319
  }, containerName = manifestOptions.name ?? this._options.name, globalName = manifestOptions.globalName ?? function(library) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/core",
3
- "version": "1.7.3-canary-8f09f616-20260116215247",
3
+ "version": "1.7.3-canary-2f0bc179-20260118174706",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -47,7 +47,7 @@
47
47
  "browserslist-load-config": "^1.0.1",
48
48
  "enhanced-resolve": "5.18.4",
49
49
  "glob-to-regexp": "^0.4.1",
50
- "memfs": "4.51.1",
50
+ "memfs": "4.53.0",
51
51
  "prebundle": "^1.6.0",
52
52
  "tinypool": "^1.1.1",
53
53
  "tsx": "^4.21.0",
@@ -58,7 +58,7 @@
58
58
  "dependencies": {
59
59
  "@module-federation/runtime-tools": "0.22.0",
60
60
  "@rspack/lite-tapable": "1.1.0",
61
- "@rspack/binding": "npm:@rspack-canary/binding@1.7.3-canary-8f09f616-20260116215247"
61
+ "@rspack/binding": "npm:@rspack-canary/binding@1.7.3-canary-2f0bc179-20260118174706"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@swc/helpers": ">=0.5.1"