@module-federation/webpack-bundler-runtime 0.0.0-next-20240626050252 → 0.0.0-next-20240701101956

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.
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var index = require('./index.cjs.js');
6
6
  require('@module-federation/runtime');
7
- require('./constant.cjs.js');
8
7
  require('@module-federation/sdk');
8
+ require('./constant.cjs.js');
9
9
 
10
10
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
11
11
  try {
@@ -1,7 +1,7 @@
1
1
  import federation from './index.esm.js';
2
2
  import '@module-federation/runtime';
3
- import './constant.esm.js';
4
3
  import '@module-federation/sdk';
4
+ import './constant.esm.js';
5
5
 
6
6
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
7
7
  try {
package/dist/index.cjs.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var runtime = require('@module-federation/runtime');
4
- var constant = require('./constant.cjs.js');
5
4
  var sdk = require('@module-federation/sdk');
5
+ var constant = require('./constant.cjs.js');
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -109,7 +109,9 @@ function remotes(options) {
109
109
  onError(error);
110
110
  }
111
111
  };
112
- var useRuntimeLoad = remoteInfos.length === 1 && constant.FEDERATION_SUPPORTED_TYPES.includes(remoteInfos[0].externalType) && remoteInfos[0].name;
112
+ var useRuntimeLoad = remoteInfos.length === 1 && [
113
+ 'script'
114
+ ].includes(remoteInfos[0].externalType) && remoteInfos[0].name;
113
115
  if (useRuntimeLoad) {
114
116
  handleFunction(onRemoteLoaded, data[2], 0, 0, onFactory, 1);
115
117
  } else {
@@ -308,6 +310,11 @@ function initContainerEntry(options) {
308
310
  webpackRequire.federation.attachShareScopeMap(webpackRequire);
309
311
  }
310
312
  // @ts-ignore
313
+ if (typeof webpackRequire.federation.prefetch === 'function') {
314
+ // @ts-ignore
315
+ webpackRequire.federation.prefetch();
316
+ }
317
+ // @ts-ignore
311
318
  return webpackRequire.I(name, initScope);
312
319
  }
313
320
 
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as runtime from '@module-federation/runtime';
2
- import { FEDERATION_SUPPORTED_TYPES } from './constant.esm.js';
3
2
  import { decodeName, ENCODE_NAME_PREFIX } from '@module-federation/sdk';
3
+ import { FEDERATION_SUPPORTED_TYPES } from './constant.esm.js';
4
4
 
5
5
  function attachShareScopeMap(webpackRequire) {
6
6
  if (!webpackRequire.S || webpackRequire.federation.hasAttachShareScopeMap || !webpackRequire.federation.instance || !webpackRequire.federation.instance.shareScopeMap) {
@@ -87,7 +87,9 @@ function remotes(options) {
87
87
  onError(error);
88
88
  }
89
89
  };
90
- var useRuntimeLoad = remoteInfos.length === 1 && FEDERATION_SUPPORTED_TYPES.includes(remoteInfos[0].externalType) && remoteInfos[0].name;
90
+ var useRuntimeLoad = remoteInfos.length === 1 && [
91
+ 'script'
92
+ ].includes(remoteInfos[0].externalType) && remoteInfos[0].name;
91
93
  if (useRuntimeLoad) {
92
94
  handleFunction(onRemoteLoaded, data[2], 0, 0, onFactory, 1);
93
95
  } else {
@@ -286,6 +288,11 @@ function initContainerEntry(options) {
286
288
  webpackRequire.federation.attachShareScopeMap(webpackRequire);
287
289
  }
288
290
  // @ts-ignore
291
+ if (typeof webpackRequire.federation.prefetch === 'function') {
292
+ // @ts-ignore
293
+ webpackRequire.federation.prefetch();
294
+ }
295
+ // @ts-ignore
289
296
  return webpackRequire.I(name, initScope);
290
297
  }
291
298
 
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "@module-federation/webpack-bundler-runtime",
4
- "version": "0.2.1",
4
+ "version": "0.2.3",
5
5
  "license": "MIT",
6
6
  "description": "Module Federation Runtime for webpack",
7
7
  "keywords": [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "@module-federation/webpack-bundler-runtime",
4
- "version": "0.0.0-next-20240626050252",
4
+ "version": "0.0.0-next-20240701101956",
5
5
  "license": "MIT",
6
6
  "description": "Module Federation Runtime for webpack",
7
7
  "keywords": [
@@ -20,8 +20,8 @@
20
20
  "module": "./dist/index.esm.js",
21
21
  "types": "./dist/index.cjs.d.ts",
22
22
  "dependencies": {
23
- "@module-federation/runtime": "0.0.0-next-20240626050252",
24
- "@module-federation/sdk": "0.0.0-next-20240626050252"
23
+ "@module-federation/runtime": "0.0.0-next-20240701101956",
24
+ "@module-federation/sdk": "0.0.0-next-20240701101956"
25
25
  },
26
26
  "exports": {
27
27
  ".": {
@@ -49,6 +49,6 @@
49
49
  }
50
50
  },
51
51
  "devDependencies": {
52
- "@module-federation/runtime": "0.0.0-next-20240626050252"
52
+ "@module-federation/runtime": "0.0.0-next-20240701101956"
53
53
  }
54
54
  }