@module-federation/sdk 0.0.0-next-20240903075658 → 0.0.0-next-20240903212627

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,6 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _extends = require('@swc/helpers/_/_extends');
6
+
5
7
  const FederationModuleManifest = 'federation-manifest.json';
6
8
  const MANIFEST_EXT = '.json';
7
9
  const BROWSER_LOG_KEY = 'FEDERATION_DEBUG';
@@ -248,17 +250,6 @@ function safeToString(info) {
248
250
  }
249
251
  }
250
252
 
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
-
262
253
  const simpleJoinRemoteEntry = (rPath, rName)=>{
263
254
  if (!rPath) {
264
255
  return rName;
@@ -362,23 +353,23 @@ function generateSnapshotFromManifest(manifest, options = {}) {
362
353
  };
363
354
  if ((_manifest_metaData = manifest.metaData) == null ? void 0 : _manifest_metaData.prefetchInterface) {
364
355
  const prefetchInterface = manifest.metaData.prefetchInterface;
365
- basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, {
356
+ basicRemoteSnapshot = _extends._({}, basicRemoteSnapshot, {
366
357
  prefetchInterface
367
358
  });
368
359
  }
369
360
  if ((_manifest_metaData1 = manifest.metaData) == null ? void 0 : _manifest_metaData1.prefetchEntry) {
370
361
  const { path, name, type } = manifest.metaData.prefetchEntry;
371
- basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, {
362
+ basicRemoteSnapshot = _extends._({}, basicRemoteSnapshot, {
372
363
  prefetchEntry: simpleJoinRemoteEntry(path, name),
373
364
  prefetchEntryType: type
374
365
  });
375
366
  }
376
367
  if ('publicPath' in manifest.metaData) {
377
- remoteSnapshot = _extends({}, basicRemoteSnapshot, {
368
+ remoteSnapshot = _extends._({}, basicRemoteSnapshot, {
378
369
  publicPath: getPublicPath()
379
370
  });
380
371
  } else {
381
- remoteSnapshot = _extends({}, basicRemoteSnapshot, {
372
+ remoteSnapshot = _extends._({}, basicRemoteSnapshot, {
382
373
  getPublicPath: getPublicPath()
383
374
  });
384
375
  }
@@ -566,7 +557,7 @@ function loadScript(url, info) {
566
557
  const { script, needAttach } = createScript({
567
558
  url,
568
559
  cb: resolve,
569
- attrs: _extends({
560
+ attrs: _extends._({
570
561
  fetchpriority: 'high'
571
562
  }, attrs),
572
563
  createScriptHook,
@@ -702,7 +693,7 @@ function normalizeOptions(enableDefault, defaultOptions, key) {
702
693
  return defaultOptions;
703
694
  }
704
695
  if (options && typeof options === 'object') {
705
- return _extends({}, defaultOptions, options);
696
+ return _extends._({}, defaultOptions, options);
706
697
  }
707
698
  throw new Error(`Unexpected type for \`${key}\`, expect boolean/undefined/object, got: ${typeof options}`);
708
699
  };
package/dist/index.esm.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { _ } from '@swc/helpers/_/_extends';
2
+
1
3
  const FederationModuleManifest = 'federation-manifest.json';
2
4
  const MANIFEST_EXT = '.json';
3
5
  const BROWSER_LOG_KEY = 'FEDERATION_DEBUG';
@@ -244,17 +246,6 @@ function safeToString(info) {
244
246
  }
245
247
  }
246
248
 
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
-
258
249
  const simpleJoinRemoteEntry = (rPath, rName)=>{
259
250
  if (!rPath) {
260
251
  return rName;
@@ -358,23 +349,23 @@ function generateSnapshotFromManifest(manifest, options = {}) {
358
349
  };
359
350
  if ((_manifest_metaData = manifest.metaData) == null ? void 0 : _manifest_metaData.prefetchInterface) {
360
351
  const prefetchInterface = manifest.metaData.prefetchInterface;
361
- basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, {
352
+ basicRemoteSnapshot = _({}, basicRemoteSnapshot, {
362
353
  prefetchInterface
363
354
  });
364
355
  }
365
356
  if ((_manifest_metaData1 = manifest.metaData) == null ? void 0 : _manifest_metaData1.prefetchEntry) {
366
357
  const { path, name, type } = manifest.metaData.prefetchEntry;
367
- basicRemoteSnapshot = _extends({}, basicRemoteSnapshot, {
358
+ basicRemoteSnapshot = _({}, basicRemoteSnapshot, {
368
359
  prefetchEntry: simpleJoinRemoteEntry(path, name),
369
360
  prefetchEntryType: type
370
361
  });
371
362
  }
372
363
  if ('publicPath' in manifest.metaData) {
373
- remoteSnapshot = _extends({}, basicRemoteSnapshot, {
364
+ remoteSnapshot = _({}, basicRemoteSnapshot, {
374
365
  publicPath: getPublicPath()
375
366
  });
376
367
  } else {
377
- remoteSnapshot = _extends({}, basicRemoteSnapshot, {
368
+ remoteSnapshot = _({}, basicRemoteSnapshot, {
378
369
  getPublicPath: getPublicPath()
379
370
  });
380
371
  }
@@ -562,7 +553,7 @@ function loadScript(url, info) {
562
553
  const { script, needAttach } = createScript({
563
554
  url,
564
555
  cb: resolve,
565
- attrs: _extends({
556
+ attrs: _({
566
557
  fetchpriority: 'high'
567
558
  }, attrs),
568
559
  createScriptHook,
@@ -698,7 +689,7 @@ function normalizeOptions(enableDefault, defaultOptions, key) {
698
689
  return defaultOptions;
699
690
  }
700
691
  if (options && typeof options === 'object') {
701
- return _extends({}, defaultOptions, options);
692
+ return _({}, defaultOptions, options);
702
693
  }
703
694
  throw new Error(`Unexpected type for \`${key}\`, expect boolean/undefined/object, got: ${typeof options}`);
704
695
  };
@@ -175,6 +175,7 @@ export interface ModuleFederationPluginOptions {
175
175
  dts?: boolean | PluginDtsOptions;
176
176
  async?: boolean | AsyncBoundaryOptions;
177
177
  virtualRuntimeEntry?: boolean;
178
+ embedRuntime?: boolean;
178
179
  }
179
180
  /**
180
181
  * 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-20240903075658",
3
+ "version": "0.0.0-next-20240903212627",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [