@module-federation/sdk 0.0.0-next-20240309014600 → 0.0.0-next-20240311023539

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
@@ -523,10 +523,11 @@ function generateSnapshotFromManifest(manifest) {
523
523
  };
524
524
  })
525
525
  };
526
- if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchInterface) {
527
- var prefetchInterface = manifest.metaData.prefetchInterface;
526
+ if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchEntry) {
527
+ var _manifest_metaData_prefetchEntry = manifest.metaData.prefetchEntry, path = _manifest_metaData_prefetchEntry.path, name = _manifest_metaData_prefetchEntry.name, type = _manifest_metaData_prefetchEntry.type;
528
528
  basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), {
529
- prefetchInterface: prefetchInterface
529
+ prefetchEntry: simpleJoinRemoteEntry(path, name),
530
+ prefetchEntryType: type
530
531
  });
531
532
  }
532
533
  if ("publicPath" in manifest.metaData) {
@@ -1121,7 +1122,9 @@ function createScriptNode(url, cb, attrs, createScriptHook) {
1121
1122
  urlDirname = urlObj.pathname.split("/").slice(0, -1).join("/");
1122
1123
  filename = path.basename(urlObj.pathname);
1123
1124
  try {
1124
- script = new vm.Script("(function(exports, module, require, __dirname, __filename) {".concat(data, "\n})"), filename);
1125
+ script = new vm.Script("(function(exports, module, require, __dirname, __filename) {".concat(data, "\n})"), {
1126
+ filename: filename
1127
+ });
1125
1128
  script.runInThisContext()(scriptContext.exports, scriptContext.module, eval("require"), urlDirname, filename);
1126
1129
  exportedInterface = scriptContext.module.exports || scriptContext.exports;
1127
1130
  if (attrs && exportedInterface && attrs["globalName"]) {
package/dist/index.esm.js CHANGED
@@ -519,10 +519,11 @@ function generateSnapshotFromManifest(manifest) {
519
519
  };
520
520
  })
521
521
  };
522
- if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchInterface) {
523
- var prefetchInterface = manifest.metaData.prefetchInterface;
522
+ if ((_manifest_metaData = manifest.metaData) === null || _manifest_metaData === void 0 ? void 0 : _manifest_metaData.prefetchEntry) {
523
+ var _manifest_metaData_prefetchEntry = manifest.metaData.prefetchEntry, path = _manifest_metaData_prefetchEntry.path, name = _manifest_metaData_prefetchEntry.name, type = _manifest_metaData_prefetchEntry.type;
524
524
  basicRemoteSnapshot = _object_spread_props(_object_spread({}, basicRemoteSnapshot), {
525
- prefetchInterface: prefetchInterface
525
+ prefetchEntry: simpleJoinRemoteEntry(path, name),
526
+ prefetchEntryType: type
526
527
  });
527
528
  }
528
529
  if ("publicPath" in manifest.metaData) {
@@ -1117,7 +1118,9 @@ function createScriptNode(url, cb, attrs, createScriptHook) {
1117
1118
  urlDirname = urlObj.pathname.split("/").slice(0, -1).join("/");
1118
1119
  filename = path.basename(urlObj.pathname);
1119
1120
  try {
1120
- script = new vm.Script("(function(exports, module, require, __dirname, __filename) {".concat(data, "\n})"), filename);
1121
+ script = new vm.Script("(function(exports, module, require, __dirname, __filename) {".concat(data, "\n})"), {
1122
+ filename: filename
1123
+ });
1121
1124
  script.runInThisContext()(scriptContext.exports, scriptContext.module, eval("require"), urlDirname, filename);
1122
1125
  exportedInterface = scriptContext.module.exports || scriptContext.exports;
1123
1126
  if (attrs && exportedInterface && attrs["globalName"]) {
@@ -27,7 +27,8 @@ export interface BasicProviderModuleInfo extends BasicModuleInfo {
27
27
  modulePath?: string;
28
28
  assets: StatsAssets;
29
29
  }>;
30
- prefetchInterface?: boolean;
30
+ prefetchEntry?: string;
31
+ prefetchEntryType?: RemoteEntryType;
31
32
  }
32
33
  interface BasicProviderModuleInfoWithPublicPath extends BasicProviderModuleInfo {
33
34
  publicPath: string;
@@ -15,7 +15,6 @@ export interface BasicStatsMetaData {
15
15
  buildInfo: StatsBuildInfo;
16
16
  remoteEntry: ResourceInfo;
17
17
  prefetchEntry?: ResourceInfo;
18
- prefetchInterface?: boolean;
19
18
  types: Omit<ResourceInfo, 'type'>;
20
19
  type: string;
21
20
  pluginVersion: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.0.0-next-20240309014600",
3
+ "version": "0.0.0-next-20240311023539",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [