@rspack-canary/core 1.7.1-canary-b9e2cc88-20260102173700 → 1.7.1-canary-5eaa0135-20260103025009

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,11 +1,13 @@
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';
4
5
  export interface ModuleFederationPluginOptions extends Omit<ModuleFederationPluginV1Options, 'enhanced'> {
5
6
  runtimePlugins?: RuntimePlugins;
6
7
  implementation?: string;
7
8
  shareStrategy?: 'version-first' | 'loaded-first';
8
9
  manifest?: boolean | Omit<ModuleFederationManifestPluginOptions, 'remoteAliasMap' | 'globalName' | 'name' | 'exposes' | 'shared'>;
10
+ experiments?: ModuleFederationRuntimeExperimentsOptions;
9
11
  }
10
12
  export type RuntimePlugins = string[] | [string, Record<string, unknown>][];
11
13
  export declare class ModuleFederationPlugin {
@@ -1,5 +1,9 @@
1
+ export interface ModuleFederationRuntimeExperimentsOptions {
2
+ asyncStartup?: boolean;
3
+ }
1
4
  export interface ModuleFederationRuntimeOptions {
2
5
  entryRuntime?: string;
6
+ experiments?: ModuleFederationRuntimeExperimentsOptions;
3
7
  }
4
8
  export declare const ModuleFederationRuntimePlugin: {
5
9
  new (options?: ModuleFederationRuntimeOptions | undefined): {
package/dist/index.js CHANGED
@@ -5844,7 +5844,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5844
5844
  }, applyExperimentsDefaults = (experiments, { development })=>{
5845
5845
  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);
5846
5846
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
5847
- 'object' == typeof rspackFuture && (D(rspackFuture, 'bundlerInfo', {}), 'object' == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, 'version', "1.7.1-canary-b9e2cc88-20260102173700"), D(rspackFuture.bundlerInfo, 'bundler', 'rspack'), D(rspackFuture.bundlerInfo, 'force', !library)));
5847
+ 'object' == typeof rspackFuture && (D(rspackFuture, 'bundlerInfo', {}), 'object' == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, 'version', "1.7.1-canary-5eaa0135-20260103025009"), D(rspackFuture.bundlerInfo, 'bundler', 'rspack'), D(rspackFuture.bundlerInfo, 'force', !library)));
5848
5848
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyCssGeneratorOptionsDefaults = (generatorOptions, { targetProperties })=>{
5849
5849
  D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0);
5850
5850
  }, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, deferImport })=>{
@@ -7623,7 +7623,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7623
7623
  });
7624
7624
  }
7625
7625
  }
7626
- let CORE_VERSION = "1.7.1-canary-b9e2cc88-20260102173700", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7626
+ let CORE_VERSION = "1.7.1-canary-5eaa0135-20260103025009", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7627
7627
 
7628
7628
  Help:
7629
7629
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -8946,7 +8946,7 @@ Help:
8946
8946
  obj.children = this.stats.map((stat, idx)=>{
8947
8947
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8948
8948
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8949
- }), childOptions.version && (obj.rspackVersion = "1.7.1-canary-b9e2cc88-20260102173700", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
8949
+ }), childOptions.version && (obj.rspackVersion = "1.7.1-canary-5eaa0135-20260103025009", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
8950
8950
  let mapError = (j, obj)=>({
8951
8951
  ...obj,
8952
8952
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -9856,7 +9856,7 @@ Help:
9856
9856
  object.hash = context.getStatsCompilation(compilation).hash;
9857
9857
  },
9858
9858
  version: (object)=>{
9859
- object.version = "5.75.0", object.rspackVersion = "1.7.1-canary-b9e2cc88-20260102173700";
9859
+ object.version = "5.75.0", object.rspackVersion = "1.7.1-canary-5eaa0135-20260103025009";
9860
9860
  },
9861
9861
  env: (object, _compilation, _context, { _env })=>{
9862
9862
  object.env = _env;
@@ -12050,12 +12050,16 @@ Help:
12050
12050
  };
12051
12051
  }
12052
12052
  raw(compiler) {
12053
- let { remoteType, remotes } = this._options, remoteExternals = {};
12053
+ let { remoteType, remotes } = this._options, remoteExternals = {}, importExternals = {};
12054
12054
  for (let [key, config] of remotes){
12055
12055
  let i = 0;
12056
- for (let external of config.external)!external.startsWith('internal ') && (remoteExternals[`webpack/container/reference/${key}${i ? `/fallback-${i}` : ''}`] = external, i++);
12056
+ for (let external of config.external){
12057
+ if (external.startsWith('internal ')) continue;
12058
+ let request = `webpack/container/reference/${key}${i ? `/fallback-${i}` : ''}`;
12059
+ ('module' === remoteType || 'module-import' === remoteType) && external.startsWith('.') ? importExternals[request] = external : remoteExternals[request] = external, i++;
12060
+ }
12057
12061
  }
12058
- new ExternalsPlugin(remoteType, remoteExternals, !0).apply(compiler), new ShareRuntimePlugin(this._options.enhanced).apply(compiler);
12062
+ 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);
12059
12063
  let rawOptions = {
12060
12064
  remoteType: this._options.remoteType,
12061
12065
  remotes: this._options.remotes.map(([key, r])=>({
@@ -12075,7 +12079,7 @@ Help:
12075
12079
  let _options = JSON.stringify(options || {});
12076
12080
  return binding_default().transform(source, _options);
12077
12081
  }
12078
- let exports_rspackVersion = "1.7.1-canary-b9e2cc88-20260102173700", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
12082
+ let exports_rspackVersion = "1.7.1-canary-5eaa0135-20260103025009", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
12079
12083
  getNormalizedRspackOptions: getNormalizedRspackOptions,
12080
12084
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
12081
12085
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -12136,34 +12140,49 @@ Help:
12136
12140
  bundlerRuntime: bundlerRuntimePath,
12137
12141
  runtime: runtimePath
12138
12142
  });
12139
- if (compiler.options.resolve.alias = {
12143
+ compiler.options.resolve.alias = {
12140
12144
  '@module-federation/runtime-tools': paths.runtimeTools,
12141
12145
  '@module-federation/runtime': paths.runtime,
12142
12146
  ...compiler.options.resolve.alias
12143
- }, new ModuleFederationRuntimePlugin({
12144
- entryRuntime: function(paths, options, compiler) {
12145
- let runtimePlugins = options.runtimePlugins ?? [], remoteInfos = getRemoteInfos(options), runtimePluginImports = [], runtimePluginVars = [];
12146
- for(let i = 0; i < runtimePlugins.length; i++){
12147
- 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;
12148
- runtimePluginImports.push(`import ${runtimePluginVar} from ${JSON.stringify(pluginPath)}`);
12149
- let paramsCode = void 0 === pluginParams ? 'undefined' : JSON.stringify(pluginParams);
12150
- runtimePluginVars.push(`${runtimePluginVar}(${paramsCode})`);
12151
- }
12152
- let content = [
12153
- `import __module_federation_bundler_runtime__ from ${JSON.stringify(paths.bundlerRuntime)}`,
12154
- ...runtimePluginImports,
12155
- `const __module_federation_runtime_plugins__ = [${runtimePluginVars.join(', ')}]`,
12156
- `const __module_federation_remote_infos__ = ${JSON.stringify(remoteInfos)}`,
12157
- `const __module_federation_container_name__ = ${JSON.stringify(options.name ?? compiler.options.output.uniqueName)}`,
12158
- `const __module_federation_share_strategy__ = ${JSON.stringify(options.shareStrategy ?? 'version-first')}`,
12159
- compiler.webpack.Template.getFunctionContent(__webpack_require__("./moduleFederationDefaultRuntime.js"))
12160
- ].join(';');
12161
- return `@module-federation/runtime/rspack.js!=!data:text/javascript,${content}`;
12162
- }(paths, this._options, compiler)
12163
- }).apply(compiler), new webpack.container.ModuleFederationPluginV1({
12164
- ...this._options,
12147
+ };
12148
+ let entryRuntime = function(paths, options, compiler) {
12149
+ let runtimePlugins = options.runtimePlugins ?? [], remoteInfos = getRemoteInfos(options), runtimePluginImports = [], runtimePluginVars = [];
12150
+ for(let i = 0; i < runtimePlugins.length; i++){
12151
+ 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;
12152
+ runtimePluginImports.push(`import ${runtimePluginVar} from ${JSON.stringify(pluginPath)}`);
12153
+ let paramsCode = void 0 === pluginParams ? 'undefined' : JSON.stringify(pluginParams);
12154
+ runtimePluginVars.push(`${runtimePluginVar}(${paramsCode})`);
12155
+ }
12156
+ let content = [
12157
+ `import __module_federation_bundler_runtime__ from ${JSON.stringify(paths.bundlerRuntime)}`,
12158
+ ...runtimePluginImports,
12159
+ `const __module_federation_runtime_plugins__ = [${runtimePluginVars.join(', ')}]`,
12160
+ `const __module_federation_remote_infos__ = ${JSON.stringify(remoteInfos)}`,
12161
+ `const __module_federation_container_name__ = ${JSON.stringify(options.name ?? compiler.options.output.uniqueName)}`,
12162
+ `const __module_federation_share_strategy__ = ${JSON.stringify(options.shareStrategy ?? 'version-first')}`,
12163
+ compiler.webpack.Template.getFunctionContent(__webpack_require__("./moduleFederationDefaultRuntime.js"))
12164
+ ].join(';');
12165
+ return `@module-federation/runtime/rspack.js!=!data:text/javascript,${content}`;
12166
+ }(paths, this._options, compiler);
12167
+ new ModuleFederationRuntimePlugin({
12168
+ entryRuntime,
12169
+ experiments: {
12170
+ asyncStartup: this._options.experiments?.asyncStartup ?? !1
12171
+ }
12172
+ }).apply(compiler);
12173
+ let v1Options = {
12174
+ name: this._options.name,
12175
+ exposes: this._options.exposes,
12176
+ filename: this._options.filename,
12177
+ library: this._options.library,
12178
+ remoteType: this._options.remoteType,
12179
+ remotes: this._options.remotes,
12180
+ runtime: this._options.runtime,
12181
+ shareScope: this._options.shareScope,
12182
+ shared: this._options.shared,
12165
12183
  enhanced: !0
12166
- }).apply(compiler), this._options.manifest) {
12184
+ };
12185
+ if (new webpack.container.ModuleFederationPluginV1(v1Options).apply(compiler), this._options.manifest) {
12167
12186
  let manifestOptions = !0 === this._options.manifest ? {} : {
12168
12187
  ...this._options.manifest
12169
12188
  }, 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.1-canary-b9e2cc88-20260102173700",
3
+ "version": "1.7.1-canary-5eaa0135-20260103025009",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -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.1-canary-b9e2cc88-20260102173700"
61
+ "@rspack/binding": "npm:@rspack-canary/binding@1.7.1-canary-5eaa0135-20260103025009"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@swc/helpers": ">=0.5.1"