@module-federation/sdk 0.0.0-next-20240911083839 → 0.0.0-next-20240911090730

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.
package/dist/index.cjs.js CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var polyfills = require('./polyfills.cjs.js');
6
-
7
5
  const FederationModuleManifest = 'federation-manifest.json';
8
6
  const MANIFEST_EXT = '.json';
9
7
  const BROWSER_LOG_KEY = 'FEDERATION_DEBUG';
@@ -33,13 +31,6 @@ const MFModuleType = {
33
31
  const MODULE_DEVTOOL_IDENTIFIER = '__MF_DEVTOOLS_MODULE_INFO__';
34
32
  const ENCODE_NAME_PREFIX = 'ENCODE_NAME_PREFIX';
35
33
  const TEMP_DIR = '.federation';
36
- const MFPrefetchCommon = {
37
- identifier: 'MFDataPrefetch',
38
- globalKey: '__PREFETCH__',
39
- library: 'mf-data-prefetch',
40
- exportsKey: '__PREFETCH_EXPORTS__',
41
- fileName: 'bootstrap.js'
42
- };
43
34
 
44
35
  var ContainerPlugin = /*#__PURE__*/Object.freeze({
45
36
  __proto__: null
@@ -257,6 +248,17 @@ function safeToString(info) {
257
248
  }
258
249
  }
259
250
 
251
+ function _extends() {
252
+ _extends = Object.assign || function assign(target) {
253
+ for(var i = 1; i < arguments.length; i++){
254
+ var source = arguments[i];
255
+ for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
256
+ }
257
+ return target;
258
+ };
259
+ return _extends.apply(this, arguments);
260
+ }
261
+
260
262
  const simpleJoinRemoteEntry = (rPath, rName)=>{
261
263
  if (!rPath) {
262
264
  return rName;
@@ -360,23 +362,23 @@ function generateSnapshotFromManifest(manifest, options = {}) {
360
362
  };
361
363
  if ((_manifest_metaData = manifest.metaData) == null ? void 0 : _manifest_metaData.prefetchInterface) {
362
364
  const prefetchInterface = manifest.metaData.prefetchInterface;
363
- basicRemoteSnapshot = polyfills._extends({}, basicRemoteSnapshot, {
365
+ basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, {
364
366
  prefetchInterface
365
367
  });
366
368
  }
367
369
  if ((_manifest_metaData1 = manifest.metaData) == null ? void 0 : _manifest_metaData1.prefetchEntry) {
368
370
  const { path, name, type } = manifest.metaData.prefetchEntry;
369
- basicRemoteSnapshot = polyfills._extends({}, basicRemoteSnapshot, {
371
+ basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, {
370
372
  prefetchEntry: simpleJoinRemoteEntry(path, name),
371
373
  prefetchEntryType: type
372
374
  });
373
375
  }
374
376
  if ('publicPath' in manifest.metaData) {
375
- remoteSnapshot = polyfills._extends({}, basicRemoteSnapshot, {
377
+ remoteSnapshot = _extends({}, basicRemoteSnapshot, {
376
378
  publicPath: getPublicPath()
377
379
  });
378
380
  } else {
379
- remoteSnapshot = polyfills._extends({}, basicRemoteSnapshot, {
381
+ remoteSnapshot = _extends({}, basicRemoteSnapshot, {
380
382
  getPublicPath: getPublicPath()
381
383
  });
382
384
  }
@@ -569,7 +571,7 @@ function loadScript(url, info) {
569
571
  const { script, needAttach } = createScript({
570
572
  url,
571
573
  cb: resolve,
572
- attrs: polyfills._extends({
574
+ attrs: _extends({
573
575
  fetchpriority: 'high'
574
576
  }, attrs),
575
577
  createScriptHook,
@@ -705,7 +707,7 @@ function normalizeOptions(enableDefault, defaultOptions, key) {
705
707
  return defaultOptions;
706
708
  }
707
709
  if (options && typeof options === 'object') {
708
- return polyfills._extends({}, defaultOptions, options);
710
+ return _extends({}, defaultOptions, options);
709
711
  }
710
712
  throw new Error(`Unexpected type for \`${key}\`, expect boolean/undefined/object, got: ${typeof options}`);
711
713
  };
@@ -719,7 +721,6 @@ exports.FederationModuleManifest = FederationModuleManifest;
719
721
  exports.Logger = Logger;
720
722
  exports.MANIFEST_EXT = MANIFEST_EXT;
721
723
  exports.MFModuleType = MFModuleType;
722
- exports.MFPrefetchCommon = MFPrefetchCommon;
723
724
  exports.MODULE_DEVTOOL_IDENTIFIER = MODULE_DEVTOOL_IDENTIFIER;
724
725
  exports.ManifestFileName = ManifestFileName;
725
726
  exports.NameTransformMap = NameTransformMap;
package/dist/index.esm.js CHANGED
@@ -1,5 +1,3 @@
1
- import { _ as _extends } from './polyfills.esm.js';
2
-
3
1
  const FederationModuleManifest = 'federation-manifest.json';
4
2
  const MANIFEST_EXT = '.json';
5
3
  const BROWSER_LOG_KEY = 'FEDERATION_DEBUG';
@@ -29,13 +27,6 @@ const MFModuleType = {
29
27
  const MODULE_DEVTOOL_IDENTIFIER = '__MF_DEVTOOLS_MODULE_INFO__';
30
28
  const ENCODE_NAME_PREFIX = 'ENCODE_NAME_PREFIX';
31
29
  const TEMP_DIR = '.federation';
32
- const MFPrefetchCommon = {
33
- identifier: 'MFDataPrefetch',
34
- globalKey: '__PREFETCH__',
35
- library: 'mf-data-prefetch',
36
- exportsKey: '__PREFETCH_EXPORTS__',
37
- fileName: 'bootstrap.js'
38
- };
39
30
 
40
31
  var ContainerPlugin = /*#__PURE__*/Object.freeze({
41
32
  __proto__: null
@@ -253,6 +244,17 @@ function safeToString(info) {
253
244
  }
254
245
  }
255
246
 
247
+ function _extends() {
248
+ _extends = Object.assign || function assign(target) {
249
+ for(var i = 1; i < arguments.length; i++){
250
+ var source = arguments[i];
251
+ for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
252
+ }
253
+ return target;
254
+ };
255
+ return _extends.apply(this, arguments);
256
+ }
257
+
256
258
  const simpleJoinRemoteEntry = (rPath, rName)=>{
257
259
  if (!rPath) {
258
260
  return rName;
@@ -707,4 +709,4 @@ function normalizeOptions(enableDefault, defaultOptions, key) {
707
709
  };
708
710
  }
709
711
 
710
- export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, ENCODE_NAME_PREFIX, EncodedNameTransformMap, FederationModuleManifest, Logger, MANIFEST_EXT, MFModuleType, MFPrefetchCommon, MODULE_DEVTOOL_IDENTIFIER, ManifestFileName, NameTransformMap, NameTransformSymbol, SEPARATOR, StatsFileName, TEMP_DIR, assert, composeKeyWithSeparator, ContainerPlugin as containerPlugin, ContainerReferencePlugin as containerReferencePlugin, createLink, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getProcessEnv, getResourceUrl, inferAutoPublicPath, isBrowserEnv, isDebugMode, isManifestProvider, isStaticResourcesEqual, loadScript, loadScriptNode, logger, ModuleFederationPlugin as moduleFederationPlugin, normalizeOptions, parseEntry, safeToString, safeWrapper, SharePlugin as sharePlugin, simpleJoinRemoteEntry, warn };
712
+ export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, ENCODE_NAME_PREFIX, EncodedNameTransformMap, FederationModuleManifest, Logger, MANIFEST_EXT, MFModuleType, MODULE_DEVTOOL_IDENTIFIER, ManifestFileName, NameTransformMap, NameTransformSymbol, SEPARATOR, StatsFileName, TEMP_DIR, assert, composeKeyWithSeparator, ContainerPlugin as containerPlugin, ContainerReferencePlugin as containerReferencePlugin, createLink, createScript, createScriptNode, decodeName, encodeName, error, generateExposeFilename, generateShareFilename, generateSnapshotFromManifest, getProcessEnv, getResourceUrl, inferAutoPublicPath, isBrowserEnv, isDebugMode, isManifestProvider, isStaticResourcesEqual, loadScript, loadScriptNode, logger, ModuleFederationPlugin as moduleFederationPlugin, normalizeOptions, parseEntry, safeToString, safeWrapper, SharePlugin as sharePlugin, simpleJoinRemoteEntry, warn };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.6.1",
3
+ "version": "0.6.0",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [
@@ -23,10 +23,3 @@ export declare const MFModuleType: {
23
23
  export declare const MODULE_DEVTOOL_IDENTIFIER = "__MF_DEVTOOLS_MODULE_INFO__";
24
24
  export declare const ENCODE_NAME_PREFIX = "ENCODE_NAME_PREFIX";
25
25
  export declare const TEMP_DIR = ".federation";
26
- export declare const MFPrefetchCommon: {
27
- identifier: string;
28
- globalKey: string;
29
- library: string;
30
- exportsKey: string;
31
- fileName: string;
32
- };
@@ -40,7 +40,7 @@ export type UmdNamedDefine = boolean;
40
40
  /**
41
41
  * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
42
42
  */
43
- export type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'script' | 'node-commonjs';
43
+ export type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'script' | 'module-import' | 'node-commonjs';
44
44
  /**
45
45
  * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
46
46
  */
@@ -65,10 +65,6 @@ export type Shared = (SharedItem | SharedObject)[] | SharedObject;
65
65
  * A module that should be shared in the share scope.
66
66
  */
67
67
  export type SharedItem = string;
68
- /**
69
- * Enable Data Prefetch
70
- */
71
- export type DataPrefetch = boolean;
72
68
  export interface AdditionalDataOptions {
73
69
  stats: Stats;
74
70
  manifest?: Manifest;
@@ -178,11 +174,7 @@ export interface ModuleFederationPluginOptions {
178
174
  dev?: boolean | PluginDevOptions;
179
175
  dts?: boolean | PluginDtsOptions;
180
176
  async?: boolean | AsyncBoundaryOptions;
181
- dataPrefetch?: DataPrefetch;
182
177
  virtualRuntimeEntry?: boolean;
183
- experiments?: {
184
- federationRuntime?: false | 'hoisted';
185
- };
186
178
  }
187
179
  /**
188
180
  * Modules that should be exposed by this container. Property names are used as public paths.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.0.0-next-20240911083839",
3
+ "version": "0.0.0-next-20240911090730",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- function _extends() {
4
- _extends = Object.assign || function assign(target) {
5
- for(var i = 1; i < arguments.length; i++){
6
- var source = arguments[i];
7
- for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
8
- }
9
- return target;
10
- };
11
- return _extends.apply(this, arguments);
12
- }
13
-
14
- exports._extends = _extends;
@@ -1,12 +0,0 @@
1
- function _extends() {
2
- _extends = Object.assign || function assign(target) {
3
- for(var i = 1; i < arguments.length; i++){
4
- var source = arguments[i];
5
- for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
6
- }
7
- return target;
8
- };
9
- return _extends.apply(this, arguments);
10
- }
11
-
12
- export { _extends as _ };