@module-federation/sdk 0.0.0-next-20240611032623 → 0.0.0-next-20240612203225

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
@@ -630,6 +630,10 @@ function _object_spread$1(target) {
630
630
  }
631
631
  return target;
632
632
  }
633
+ function _type_of$2(obj) {
634
+ "@swc/helpers - typeof";
635
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
636
+ }
633
637
  function _ts_generator$1(thisArg, body) {
634
638
  var f, y, t, g, _ = {
635
639
  label: 0,
@@ -798,7 +802,7 @@ function createScript(info) {
798
802
  var createScriptRes = info.createScriptHook(info.url);
799
803
  if (_instanceof(createScriptRes, HTMLScriptElement)) {
800
804
  script = createScriptRes;
801
- } else if (typeof createScriptRes === 'object') {
805
+ } else if ((typeof createScriptRes === "undefined" ? "undefined" : _type_of$2(createScriptRes)) === 'object') {
802
806
  if (createScriptRes.script) script = createScriptRes.script;
803
807
  if (createScriptRes.timeout) timeout = createScriptRes.timeout;
804
808
  }
@@ -996,6 +1000,10 @@ function _non_iterable_rest() {
996
1000
  function _sliced_to_array(arr, i) {
997
1001
  return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
998
1002
  }
1003
+ function _type_of$1(obj) {
1004
+ "@swc/helpers - typeof";
1005
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1006
+ }
999
1007
  function _unsupported_iterable_to_array(o, minLen) {
1000
1008
  if (!o) return;
1001
1009
  if (typeof o === "string") return _array_like_to_array(o, minLen);
@@ -1114,7 +1122,7 @@ function importNodeModule(name) {
1114
1122
  function createScriptNode(url, cb, attrs, createScriptHook) {
1115
1123
  if (createScriptHook) {
1116
1124
  var hookResult = createScriptHook(url);
1117
- if (hookResult && typeof hookResult === 'object' && 'url' in hookResult) {
1125
+ if (hookResult && (typeof hookResult === "undefined" ? "undefined" : _type_of$1(hookResult)) === 'object' && 'url' in hookResult) {
1118
1126
  url = hookResult.url;
1119
1127
  }
1120
1128
  }
@@ -1132,27 +1140,37 @@ function createScriptNode(url, cb, attrs, createScriptHook) {
1132
1140
  return _ts_generator(this, function(_state) {
1133
1141
  switch(_state.label){
1134
1142
  case 0:
1143
+ if (!(typeof globalThis['webpackChunkLoad'] !== 'undefined')) return [
1144
+ 3,
1145
+ 1
1146
+ ];
1147
+ //@ts-ignore
1148
+ return [
1149
+ 2,
1150
+ globalThis['webpackChunkLoad']
1151
+ ];
1152
+ case 1:
1135
1153
  if (!(typeof fetch === 'undefined')) return [
1136
1154
  3,
1137
- 2
1155
+ 3
1138
1156
  ];
1139
1157
  return [
1140
1158
  4,
1141
1159
  importNodeModule('node-fetch')
1142
1160
  ];
1143
- case 1:
1161
+ case 2:
1144
1162
  fetchModule = _state.sent();
1145
1163
  //@ts-ignore
1146
1164
  return [
1147
1165
  2,
1148
1166
  (fetchModule === null || fetchModule === void 0 ? void 0 : fetchModule.default) || fetchModule
1149
1167
  ];
1150
- case 2:
1168
+ case 3:
1151
1169
  return [
1152
1170
  2,
1153
1171
  fetch
1154
1172
  ];
1155
- case 3:
1173
+ case 4:
1156
1174
  return [
1157
1175
  2
1158
1176
  ];
@@ -1286,7 +1304,7 @@ function normalizeOptions(enableDefault, defaultOptions, key) {
1286
1304
  if (options === true) {
1287
1305
  return defaultOptions;
1288
1306
  }
1289
- if (options && typeof options === 'object') {
1307
+ if (options && (typeof options === "undefined" ? "undefined" : _type_of(options)) === 'object') {
1290
1308
  return _object_spread({}, defaultOptions, options);
1291
1309
  }
1292
1310
  throw new Error("Unexpected type for `".concat(key, "`, expect boolean/undefined/object, got: ").concat(typeof options === "undefined" ? "undefined" : _type_of(options)));
package/dist/index.esm.js CHANGED
@@ -626,6 +626,10 @@ function _object_spread$1(target) {
626
626
  }
627
627
  return target;
628
628
  }
629
+ function _type_of$2(obj) {
630
+ "@swc/helpers - typeof";
631
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
632
+ }
629
633
  function _ts_generator$1(thisArg, body) {
630
634
  var f, y, t, g, _ = {
631
635
  label: 0,
@@ -794,7 +798,7 @@ function createScript(info) {
794
798
  var createScriptRes = info.createScriptHook(info.url);
795
799
  if (_instanceof(createScriptRes, HTMLScriptElement)) {
796
800
  script = createScriptRes;
797
- } else if (typeof createScriptRes === 'object') {
801
+ } else if ((typeof createScriptRes === "undefined" ? "undefined" : _type_of$2(createScriptRes)) === 'object') {
798
802
  if (createScriptRes.script) script = createScriptRes.script;
799
803
  if (createScriptRes.timeout) timeout = createScriptRes.timeout;
800
804
  }
@@ -992,6 +996,10 @@ function _non_iterable_rest() {
992
996
  function _sliced_to_array(arr, i) {
993
997
  return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
994
998
  }
999
+ function _type_of$1(obj) {
1000
+ "@swc/helpers - typeof";
1001
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1002
+ }
995
1003
  function _unsupported_iterable_to_array(o, minLen) {
996
1004
  if (!o) return;
997
1005
  if (typeof o === "string") return _array_like_to_array(o, minLen);
@@ -1110,7 +1118,7 @@ function importNodeModule(name) {
1110
1118
  function createScriptNode(url, cb, attrs, createScriptHook) {
1111
1119
  if (createScriptHook) {
1112
1120
  var hookResult = createScriptHook(url);
1113
- if (hookResult && typeof hookResult === 'object' && 'url' in hookResult) {
1121
+ if (hookResult && (typeof hookResult === "undefined" ? "undefined" : _type_of$1(hookResult)) === 'object' && 'url' in hookResult) {
1114
1122
  url = hookResult.url;
1115
1123
  }
1116
1124
  }
@@ -1128,27 +1136,37 @@ function createScriptNode(url, cb, attrs, createScriptHook) {
1128
1136
  return _ts_generator(this, function(_state) {
1129
1137
  switch(_state.label){
1130
1138
  case 0:
1139
+ if (!(typeof globalThis['webpackChunkLoad'] !== 'undefined')) return [
1140
+ 3,
1141
+ 1
1142
+ ];
1143
+ //@ts-ignore
1144
+ return [
1145
+ 2,
1146
+ globalThis['webpackChunkLoad']
1147
+ ];
1148
+ case 1:
1131
1149
  if (!(typeof fetch === 'undefined')) return [
1132
1150
  3,
1133
- 2
1151
+ 3
1134
1152
  ];
1135
1153
  return [
1136
1154
  4,
1137
1155
  importNodeModule('node-fetch')
1138
1156
  ];
1139
- case 1:
1157
+ case 2:
1140
1158
  fetchModule = _state.sent();
1141
1159
  //@ts-ignore
1142
1160
  return [
1143
1161
  2,
1144
1162
  (fetchModule === null || fetchModule === void 0 ? void 0 : fetchModule.default) || fetchModule
1145
1163
  ];
1146
- case 2:
1164
+ case 3:
1147
1165
  return [
1148
1166
  2,
1149
1167
  fetch
1150
1168
  ];
1151
- case 3:
1169
+ case 4:
1152
1170
  return [
1153
1171
  2
1154
1172
  ];
@@ -1282,7 +1300,7 @@ function normalizeOptions(enableDefault, defaultOptions, key) {
1282
1300
  if (options === true) {
1283
1301
  return defaultOptions;
1284
1302
  }
1285
- if (options && typeof options === 'object') {
1303
+ if (options && (typeof options === "undefined" ? "undefined" : _type_of(options)) === 'object') {
1286
1304
  return _object_spread({}, defaultOptions, options);
1287
1305
  }
1288
1306
  throw new Error("Unexpected type for `".concat(key, "`, expect boolean/undefined/object, got: ").concat(typeof options === "undefined" ? "undefined" : _type_of(options)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.0.0-next-20240611032623",
3
+ "version": "0.0.0-next-20240612203225",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [