@module-federation/webpack-bundler-runtime 0.0.0-next-20240605083609 → 0.0.0-next-20240605092134

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.
@@ -2,29 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- function _define_property(obj, key, value) {
6
- if (key in obj) {
7
- Object.defineProperty(obj, key, {
8
- value: value,
9
- enumerable: true,
10
- configurable: true,
11
- writable: true
12
- });
13
- } else {
14
- obj[key] = value;
15
- }
16
- return obj;
17
- }
18
5
  var ENCODE_NAME_PREFIX = 'ENCODE_NAME_PREFIX';
19
- // TODO: support rspack
20
- var FEDERATION_SUPPORTED_TYPES_CJS = 'cjs:webpack';
21
- var FEDERATION_SUPPORTED_TYPES_CJS_MAP = _define_property({}, FEDERATION_SUPPORTED_TYPES_CJS, 'commonjs-module');
22
6
  var FEDERATION_SUPPORTED_TYPES = [
23
- 'script',
24
- FEDERATION_SUPPORTED_TYPES_CJS
7
+ 'script'
25
8
  ];
26
9
 
27
10
  exports.ENCODE_NAME_PREFIX = ENCODE_NAME_PREFIX;
28
11
  exports.FEDERATION_SUPPORTED_TYPES = FEDERATION_SUPPORTED_TYPES;
29
- exports.FEDERATION_SUPPORTED_TYPES_CJS = FEDERATION_SUPPORTED_TYPES_CJS;
30
- exports.FEDERATION_SUPPORTED_TYPES_CJS_MAP = FEDERATION_SUPPORTED_TYPES_CJS_MAP;
@@ -1,23 +1,6 @@
1
- function _define_property(obj, key, value) {
2
- if (key in obj) {
3
- Object.defineProperty(obj, key, {
4
- value: value,
5
- enumerable: true,
6
- configurable: true,
7
- writable: true
8
- });
9
- } else {
10
- obj[key] = value;
11
- }
12
- return obj;
13
- }
14
1
  var ENCODE_NAME_PREFIX = 'ENCODE_NAME_PREFIX';
15
- // TODO: support rspack
16
- var FEDERATION_SUPPORTED_TYPES_CJS = 'cjs:webpack';
17
- var FEDERATION_SUPPORTED_TYPES_CJS_MAP = _define_property({}, FEDERATION_SUPPORTED_TYPES_CJS, 'commonjs-module');
18
2
  var FEDERATION_SUPPORTED_TYPES = [
19
- 'script',
20
- FEDERATION_SUPPORTED_TYPES_CJS
3
+ 'script'
21
4
  ];
22
5
 
23
- export { ENCODE_NAME_PREFIX, FEDERATION_SUPPORTED_TYPES, FEDERATION_SUPPORTED_TYPES_CJS, FEDERATION_SUPPORTED_TYPES_CJS_MAP };
6
+ export { ENCODE_NAME_PREFIX, FEDERATION_SUPPORTED_TYPES };
package/dist/index.cjs.js CHANGED
@@ -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 {
@@ -301,7 +303,7 @@ function initContainerEntry(options) {
301
303
  name: webpackRequire.federation.initOptions.name,
302
304
  remotes: []
303
305
  }, remoteEntryInitOptions));
304
- federationInstance.initShareScopeMap(name, shareScope);
306
+ federationInstance.initShareScopeMap(name, shareScope, remoteEntryInitOptions === null || remoteEntryInitOptions === void 0 ? void 0 : remoteEntryInitOptions.shareScopeMap);
305
307
  if (webpackRequire.federation.attachShareScopeMap) {
306
308
  webpackRequire.federation.attachShareScopeMap(webpackRequire);
307
309
  }
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as runtime from '@module-federation/runtime';
2
2
  import { decodeName } from '@module-federation/sdk';
3
- import { FEDERATION_SUPPORTED_TYPES, ENCODE_NAME_PREFIX } from './constant.esm.js';
3
+ import { ENCODE_NAME_PREFIX, 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 {
@@ -279,7 +281,7 @@ function initContainerEntry(options) {
279
281
  name: webpackRequire.federation.initOptions.name,
280
282
  remotes: []
281
283
  }, remoteEntryInitOptions));
282
- federationInstance.initShareScopeMap(name, shareScope);
284
+ federationInstance.initShareScopeMap(name, shareScope, remoteEntryInitOptions === null || remoteEntryInitOptions === void 0 ? void 0 : remoteEntryInitOptions.shareScopeMap);
283
285
  if (webpackRequire.federation.attachShareScopeMap) {
284
286
  webpackRequire.federation.attachShareScopeMap(webpackRequire);
285
287
  }
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.1.15",
4
+ "version": "0.1.18",
5
5
  "license": "MIT",
6
6
  "description": "Module Federation Runtime for webpack",
7
7
  "keywords": [
@@ -1,6 +1,2 @@
1
1
  export declare const ENCODE_NAME_PREFIX = "ENCODE_NAME_PREFIX";
2
- export declare const FEDERATION_SUPPORTED_TYPES_CJS = "cjs:webpack";
3
- export declare const FEDERATION_SUPPORTED_TYPES_CJS_MAP: {
4
- "cjs:webpack": string;
5
- };
6
2
  export declare const FEDERATION_SUPPORTED_TYPES: string[];
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-20240605083609",
4
+ "version": "0.0.0-next-20240605092134",
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-20240605083609",
24
- "@module-federation/sdk": "0.0.0-next-20240605083609"
23
+ "@module-federation/runtime": "0.0.0-next-20240605092134",
24
+ "@module-federation/sdk": "0.0.0-next-20240605092134"
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-20240605083609"
52
+ "@module-federation/runtime": "0.0.0-next-20240605092134"
53
53
  }
54
54
  }