@module-federation/sdk 0.0.0-next-20240723033044 → 0.0.0-next-20240723095610

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
@@ -30,7 +30,6 @@ const MFModuleType = {
30
30
  };
31
31
  const MODULE_DEVTOOL_IDENTIFIER = '__MF_DEVTOOLS_MODULE_INFO__';
32
32
  const ENCODE_NAME_PREFIX = 'ENCODE_NAME_PREFIX';
33
- const TEMP_DIR = '.federation';
34
33
 
35
34
  var ContainerPlugin = /*#__PURE__*/Object.freeze({
36
35
  __proto__: null
@@ -337,7 +336,7 @@ function generateSnapshotFromManifest(manifest, options = {}) {
337
336
  // overrides will override dependencies
338
337
  matchedVersion: overridesKeys.includes(key) ? overrides[key] : remotes[key]
339
338
  });
340
- const { remoteEntry: { path: remoteEntryPath, name: remoteEntryName, type: remoteEntryType }, types: remoteTypes, buildInfo: { buildVersion }, globalName, ssrRemoteEntry } = manifest.metaData;
339
+ const { remoteEntry: { path: remoteEntryPath, name: remoteEntryName, type: remoteEntryType }, types: remoteTypes, buildInfo: { buildVersion }, globalName } = manifest.metaData;
341
340
  const { exposes } = manifest;
342
341
  let basicRemoteSnapshot = {
343
342
  version: version ? version : '',
@@ -382,11 +381,6 @@ function generateSnapshotFromManifest(manifest, options = {}) {
382
381
  getPublicPath: getPublicPath()
383
382
  });
384
383
  }
385
- if (ssrRemoteEntry) {
386
- const fullSSRRemoteEntry = simpleJoinRemoteEntry(ssrRemoteEntry.path, ssrRemoteEntry.name);
387
- remoteSnapshot.ssrRemoteEntry = fullSSRRemoteEntry;
388
- remoteSnapshot.ssrRemoteEntryType = 'commonjs-module';
389
- }
390
384
  return remoteSnapshot;
391
385
  }
392
386
  function isManifestProvider(moduleInfo) {
@@ -658,7 +652,7 @@ function createScriptNode(url, cb, attrs, createScriptHook) {
658
652
  }
659
653
  cb(undefined, exportedInterface);
660
654
  } catch (e) {
661
- cb(e instanceof Error ? e : new Error(`Script execution error: ${e}`));
655
+ cb(new Error(`Script execution error: ${e}`));
662
656
  }
663
657
  };
664
658
  getFetch().then((f)=>handleScriptFetch(f, urlObj)).catch((err)=>{
@@ -716,7 +710,6 @@ exports.NameTransformMap = NameTransformMap;
716
710
  exports.NameTransformSymbol = NameTransformSymbol;
717
711
  exports.SEPARATOR = SEPARATOR;
718
712
  exports.StatsFileName = StatsFileName;
719
- exports.TEMP_DIR = TEMP_DIR;
720
713
  exports.assert = assert;
721
714
  exports.composeKeyWithSeparator = composeKeyWithSeparator;
722
715
  exports.containerPlugin = ContainerPlugin;
package/dist/index.esm.js CHANGED
@@ -26,7 +26,6 @@ const MFModuleType = {
26
26
  };
27
27
  const MODULE_DEVTOOL_IDENTIFIER = '__MF_DEVTOOLS_MODULE_INFO__';
28
28
  const ENCODE_NAME_PREFIX = 'ENCODE_NAME_PREFIX';
29
- const TEMP_DIR = '.federation';
30
29
 
31
30
  var ContainerPlugin = /*#__PURE__*/Object.freeze({
32
31
  __proto__: null
@@ -333,7 +332,7 @@ function generateSnapshotFromManifest(manifest, options = {}) {
333
332
  // overrides will override dependencies
334
333
  matchedVersion: overridesKeys.includes(key) ? overrides[key] : remotes[key]
335
334
  });
336
- const { remoteEntry: { path: remoteEntryPath, name: remoteEntryName, type: remoteEntryType }, types: remoteTypes, buildInfo: { buildVersion }, globalName, ssrRemoteEntry } = manifest.metaData;
335
+ const { remoteEntry: { path: remoteEntryPath, name: remoteEntryName, type: remoteEntryType }, types: remoteTypes, buildInfo: { buildVersion }, globalName } = manifest.metaData;
337
336
  const { exposes } = manifest;
338
337
  let basicRemoteSnapshot = {
339
338
  version: version ? version : '',
@@ -378,11 +377,6 @@ function generateSnapshotFromManifest(manifest, options = {}) {
378
377
  getPublicPath: getPublicPath()
379
378
  });
380
379
  }
381
- if (ssrRemoteEntry) {
382
- const fullSSRRemoteEntry = simpleJoinRemoteEntry(ssrRemoteEntry.path, ssrRemoteEntry.name);
383
- remoteSnapshot.ssrRemoteEntry = fullSSRRemoteEntry;
384
- remoteSnapshot.ssrRemoteEntryType = 'commonjs-module';
385
- }
386
380
  return remoteSnapshot;
387
381
  }
388
382
  function isManifestProvider(moduleInfo) {
@@ -654,7 +648,7 @@ function createScriptNode(url, cb, attrs, createScriptHook) {
654
648
  }
655
649
  cb(undefined, exportedInterface);
656
650
  } catch (e) {
657
- cb(e instanceof Error ? e : new Error(`Script execution error: ${e}`));
651
+ cb(new Error(`Script execution error: ${e}`));
658
652
  }
659
653
  };
660
654
  getFetch().then((f)=>handleScriptFetch(f, urlObj)).catch((err)=>{
@@ -698,4 +692,4 @@ function normalizeOptions(enableDefault, defaultOptions, key) {
698
692
  };
699
693
  }
700
694
 
701
- 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, safeWrapper, SharePlugin as sharePlugin, simpleJoinRemoteEntry, warn };
695
+ export { BROWSER_LOG_KEY, BROWSER_LOG_VALUE, ENCODE_NAME_PREFIX, EncodedNameTransformMap, FederationModuleManifest, Logger, MANIFEST_EXT, MFModuleType, MODULE_DEVTOOL_IDENTIFIER, ManifestFileName, NameTransformMap, NameTransformSymbol, SEPARATOR, StatsFileName, 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, 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.2.8",
3
+ "version": "0.2.6",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [
@@ -22,4 +22,3 @@ export declare const MFModuleType: {
22
22
  };
23
23
  export declare const MODULE_DEVTOOL_IDENTIFIER = "__MF_DEVTOOLS_MODULE_INFO__";
24
24
  export declare const ENCODE_NAME_PREFIX = "ENCODE_NAME_PREFIX";
25
- export declare const TEMP_DIR = ".federation";
@@ -91,7 +91,6 @@ export interface DtsHostOptions {
91
91
  deleteTypesFolder?: boolean;
92
92
  maxRetries?: number;
93
93
  consumeAPITypes?: boolean;
94
- runtimePkgs?: string[];
95
94
  }
96
95
  export interface DtsRemoteOptions {
97
96
  tsConfigPath?: string;
@@ -113,10 +112,6 @@ export interface PluginDtsOptions {
113
112
  extraOptions?: Record<string, any>;
114
113
  implementation?: string;
115
114
  }
116
- export type AsyncBoundaryOptions = {
117
- eager?: RegExp | ((module: any) => boolean);
118
- excludeChunk?: (chunk: any) => boolean;
119
- };
120
115
  export interface ModuleFederationPluginOptions {
121
116
  /**
122
117
  * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
@@ -169,7 +164,6 @@ export interface ModuleFederationPluginOptions {
169
164
  manifest?: boolean | PluginManifestOptions;
170
165
  dev?: boolean | PluginDevOptions;
171
166
  dts?: boolean | PluginDtsOptions;
172
- async?: boolean | AsyncBoundaryOptions;
173
167
  }
174
168
  /**
175
169
  * Modules that should be exposed by this container. Property names are used as public paths.
@@ -23,8 +23,6 @@ interface BasicModuleInfo {
23
23
  export interface BasicProviderModuleInfo extends BasicModuleInfo {
24
24
  remoteEntry: string;
25
25
  remoteEntryType: RemoteEntryType;
26
- ssrRemoteEntry?: string;
27
- ssrRemoteEntryType?: RemoteEntryType;
28
26
  remoteManifest?: string;
29
27
  globalName: string;
30
28
  modules: Array<{
@@ -44,7 +42,6 @@ interface BasicProviderModuleInfoWithGetPublicPath extends BasicProviderModuleIn
44
42
  }
45
43
  export interface ManifestProvider {
46
44
  remoteEntry: string;
47
- ssrRemoteEntry?: string;
48
45
  version?: string;
49
46
  }
50
47
  export interface PureEntryProvider extends ManifestProvider {
@@ -1,6 +1,6 @@
1
1
  import type { RemoteWithEntry, RemoteWithVersion } from './common';
2
2
  export type RemoteEntryType = 'var' | 'module' | 'assign' | 'assign-properties' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | string;
3
- export interface ResourceInfo {
3
+ interface ResourceInfo {
4
4
  path: string;
5
5
  name: string;
6
6
  type: RemoteEntryType;
@@ -20,7 +20,6 @@ export interface BasicStatsMetaData {
20
20
  globalName: string;
21
21
  buildInfo: StatsBuildInfo;
22
22
  remoteEntry: ResourceInfo;
23
- ssrRemoteEntry?: ResourceInfo;
24
23
  prefetchInterface?: boolean;
25
24
  prefetchEntry?: ResourceInfo;
26
25
  types: MetaDataTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.0.0-next-20240723033044",
3
+ "version": "0.0.0-next-20240723095610",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [