@next-core/brick-kit 2.188.0 → 2.188.2

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.esm.js CHANGED
@@ -703,7 +703,7 @@ function imagesFactory(appId, isBuildPush, version) {
703
703
  return {
704
704
  get(name) {
705
705
  var getSuffix = () => {
706
- var suffix = window.APP_ROOT ? "".concat(window.APP_ROOT).concat(window.PUBLIC_DEPS ? "" : "-/") : "";
706
+ var suffix = window.APP_ROOT ? "".concat(window.APP_ROOT).concat(window.BOOTSTRAP_UNION_FILE && window.PUBLIC_DEPS ? "" : "-/") : "";
707
707
  if (!suffix.startsWith("/")) {
708
708
  suffix = getBasePath() + suffix;
709
709
  }
@@ -9028,9 +9028,22 @@ class Kernel {
9028
9028
  });
9029
9029
  })();
9030
9030
  }
9031
+ processPublicDepsPackages() {
9032
+ var brickPackages = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9033
+ var pubDeps = arguments.length > 1 ? arguments[1] : undefined;
9034
+ if (!(pubDeps !== null && pubDeps !== void 0 && pubDeps.length)) return brickPackages;
9035
+ var bricksMap = new Map();
9036
+
9037
+ // bootstrapData 数据和 pubDeps 中可能同时存在同一个包名,需要过滤去重, 以 pubDeps 中的包为准
9038
+ [...brickPackages, ...pubDeps].forEach(pkg => {
9039
+ var pkgName = pkg.filePath.split("/")[1];
9040
+ bricksMap.set(pkgName, pkg);
9041
+ });
9042
+ return Array.from(bricksMap.values());
9043
+ }
9031
9044
  getBrickPackages() {
9032
- var _this$bootstrapData, _this$bootstrapData$b, _window$PUBLIC_DEPS;
9033
- return (_this$bootstrapData = this.bootstrapData) === null || _this$bootstrapData === void 0 ? void 0 : (_this$bootstrapData$b = _this$bootstrapData.brickPackages) === null || _this$bootstrapData$b === void 0 ? void 0 : _this$bootstrapData$b.concat((_window$PUBLIC_DEPS = window.PUBLIC_DEPS) !== null && _window$PUBLIC_DEPS !== void 0 ? _window$PUBLIC_DEPS : []);
9045
+ var _this$bootstrapData;
9046
+ return this.processPublicDepsPackages((_this$bootstrapData = this.bootstrapData) === null || _this$bootstrapData === void 0 ? void 0 : _this$bootstrapData.brickPackages, window.PUBLIC_DEPS);
9034
9047
  }
9035
9048
  reloadMicroApps(params, interceptorParams) {
9036
9049
  // There is no need to reload standalone micro-apps.
@@ -9059,7 +9072,7 @@ class Kernel {
9059
9072
  $$fulfilling: null
9060
9073
  });
9061
9074
  if (window.BOOTSTRAP_UNION_FILE && !storyboard.$$fullMerged) {
9062
- var fullBootstrapPath = "".concat(window.APP_ROOT, "-/").concat(storyboard.bootstrapFile);
9075
+ var fullBootstrapPath = "".concat(window.APP_ROOT).concat(window.PUBLIC_DEPS ? "" : "-/").concat(storyboard.bootstrapFile);
9063
9076
  var {
9064
9077
  storyboards
9065
9078
  } = yield http.get(fullBootstrapPath);
@@ -9079,7 +9092,7 @@ class Kernel {
9079
9092
  var appRuntimeData;
9080
9093
  try {
9081
9094
  // Note: the request maybe have fired already during bootstrap.
9082
- appRuntimeData = yield safeGetRuntimeMicroAppStandalone(storyboard.app.id);
9095
+ appRuntimeData = yield safeGetRuntimeMicroAppStandalone(storyboard.app.id, storyboard.app.currentVersion);
9083
9096
  } catch (error) {
9084
9097
  // make it not crash when the backend service is not updated.
9085
9098
  // eslint-disable-next-line no-console