@rspack-canary/browser 1.7.0-canary-06f6b341-20251218173906 → 1.7.0-canary-9bcf957c-20251219051033

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.mjs CHANGED
@@ -58222,7 +58222,7 @@ const applybundlerInfoDefaults = (rspackFuture, library)=>{
58222
58222
  if ("object" == typeof rspackFuture) {
58223
58223
  D(rspackFuture, "bundlerInfo", {});
58224
58224
  if ("object" == typeof rspackFuture.bundlerInfo) {
58225
- D(rspackFuture.bundlerInfo, "version", "1.7.0-canary-06f6b341-20251218173906");
58225
+ D(rspackFuture.bundlerInfo, "version", "1.7.0-canary-9bcf957c-20251219051033");
58226
58226
  D(rspackFuture.bundlerInfo, "bundler", "rspack");
58227
58227
  D(rspackFuture.bundlerInfo, "force", !library);
58228
58228
  }
@@ -62382,7 +62382,7 @@ class MultiStats {
62382
62382
  return obj;
62383
62383
  });
62384
62384
  if (childOptions.version) {
62385
- obj.rspackVersion = "1.7.0-canary-06f6b341-20251218173906";
62385
+ obj.rspackVersion = "1.7.0-canary-9bcf957c-20251219051033";
62386
62386
  obj.version = "5.75.0";
62387
62387
  }
62388
62388
  if (childOptions.hash) obj.hash = obj.children.map((j)=>j.hash).join("");
@@ -63698,7 +63698,7 @@ const SIMPLE_EXTRACTORS = {
63698
63698
  },
63699
63699
  version: (object)=>{
63700
63700
  object.version = "5.75.0";
63701
- object.rspackVersion = "1.7.0-canary-06f6b341-20251218173906";
63701
+ object.rspackVersion = "1.7.0-canary-9bcf957c-20251219051033";
63702
63702
  },
63703
63703
  env: (object, _compilation, _context, { _env })=>{
63704
63704
  object.env = _env;
@@ -66266,13 +66266,26 @@ class ModuleFederationPlugin {
66266
66266
  ...compiler.options.resolve.alias
66267
66267
  };
66268
66268
  const entryRuntime = getDefaultEntryRuntime(paths, this._options, compiler);
66269
+ const runtimeExperiments = {
66270
+ asyncStartup: this._options.experiments?.asyncStartup ?? false
66271
+ };
66269
66272
  new ModuleFederationRuntimePlugin({
66270
- entryRuntime
66273
+ entryRuntime,
66274
+ experiments: runtimeExperiments
66271
66275
  }).apply(compiler);
66272
- new webpack.container.ModuleFederationPluginV1({
66273
- ...this._options,
66276
+ const v1Options = {
66277
+ name: this._options.name,
66278
+ exposes: this._options.exposes,
66279
+ filename: this._options.filename,
66280
+ library: this._options.library,
66281
+ remoteType: this._options.remoteType,
66282
+ remotes: this._options.remotes,
66283
+ runtime: this._options.runtime,
66284
+ shareScope: this._options.shareScope,
66285
+ shared: this._options.shared,
66274
66286
  enhanced: true
66275
- }).apply(compiler);
66287
+ };
66288
+ new webpack.container.ModuleFederationPluginV1(v1Options).apply(compiler);
66276
66289
  if (this._options.manifest) {
66277
66290
  const manifestOptions = true === this._options.manifest ? {} : {
66278
66291
  ...this._options.manifest
@@ -66732,14 +66745,19 @@ class ContainerReferencePlugin extends RspackBuiltinPlugin {
66732
66745
  raw(compiler) {
66733
66746
  const { remoteType, remotes } = this._options;
66734
66747
  const remoteExternals = {};
66748
+ const importExternals = {};
66735
66749
  for (const [key, config] of remotes){
66736
66750
  let i = 0;
66737
- for (const external of config.external)if (!external.startsWith("internal ")) {
66738
- remoteExternals[`webpack/container/reference/${key}${i ? `/fallback-${i}` : ""}`] = external;
66751
+ for (const external of config.external){
66752
+ if (external.startsWith("internal ")) continue;
66753
+ const request = `webpack/container/reference/${key}${i ? `/fallback-${i}` : ""}`;
66754
+ if (("module" === remoteType || "module-import" === remoteType) && external.startsWith(".")) importExternals[request] = external;
66755
+ else remoteExternals[request] = external;
66739
66756
  i++;
66740
66757
  }
66741
66758
  }
66742
66759
  new ExternalsPlugin(remoteType, remoteExternals, true).apply(compiler);
66760
+ if (Object.keys(importExternals).length > 0) new ExternalsPlugin("import", importExternals, true).apply(compiler);
66743
66761
  new ShareRuntimePlugin(this._options.enhanced).apply(compiler);
66744
66762
  const rawOptions = {
66745
66763
  remoteType: this._options.remoteType,
@@ -66835,7 +66853,7 @@ function transformSync(source, options) {
66835
66853
  const _options = JSON.stringify(options || {});
66836
66854
  return external_rspack_wasi_browser_js_["default"].transformSync(source, _options);
66837
66855
  }
66838
- const exports_rspackVersion = "1.7.0-canary-06f6b341-20251218173906";
66856
+ const exports_rspackVersion = "1.7.0-canary-9bcf957c-20251219051033";
66839
66857
  const exports_version = "5.75.0";
66840
66858
  const exports_WebpackError = Error;
66841
66859
  const sources = __webpack_require__("../../node_modules/.pnpm/webpack-sources@3.3.3_patch_hash=b2a26650f08a2359d0a3cd81fa6fa272aa7441a28dd7e601792da5ed5d2b4aee/node_modules/webpack-sources/lib/index.js");
@@ -2463,8 +2463,13 @@ export interface RawModuleFederationManifestPluginOptions {
2463
2463
  buildInfo?: RawStatsBuildInfo
2464
2464
  }
2465
2465
 
2466
+ export interface RawModuleFederationRuntimeExperimentsOptions {
2467
+ asyncStartup?: boolean
2468
+ }
2469
+
2466
2470
  export interface RawModuleFederationRuntimePluginOptions {
2467
2471
  entryRuntime?: string | undefined
2472
+ experiments?: RawModuleFederationRuntimeExperimentsOptions
2468
2473
  }
2469
2474
 
2470
2475
  export interface RawModuleFilenameTemplateFnCtx {
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/browser",
3
- "version": "1.7.0-canary-06f6b341-20251218173906",
3
+ "version": "1.7.0-canary-9bcf957c-20251219051033",
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.",