@next-core/runtime 1.72.2 → 1.72.3

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.
@@ -235,9 +235,8 @@ async function _preRender({
235
235
  return (0, _assertClassBrand2.default)(_Router_brand, this, _render).call(this, location, !prevLocation);
236
236
  }
237
237
  async function _render(location, isBootstrap) {
238
- var _hooks$auth, _hooks$auth$isBlocked, _hooks$flowApi, _hooks$pageView, _classPrivateFieldGet5, _storyboard$app;
238
+ var _hooks$flowApi, _hooks$pageView, _classPrivateFieldGet5, _storyboard$app, _hooks$auth, _hooks$auth$isBlocked;
239
239
  const renderId = (0, _classPrivateFieldSet2.default)(_renderId, this, (0, _lodash.uniqueId)("render-id-"));
240
- let blocked = _Runtime.hooks === null || _Runtime.hooks === void 0 || (_hooks$auth = _Runtime.hooks.auth) === null || _hooks$auth === void 0 || (_hooks$auth$isBlocked = _hooks$auth.isBlockedPath) === null || _hooks$auth$isBlocked === void 0 ? void 0 : _hooks$auth$isBlocked.call(_hooks$auth, location.pathname);
241
240
  (0, _markAsComputed.resetAllComputedMarks)();
242
241
  (0, _resolveData.clearResolveCache)();
243
242
  _Runtime.hooks === null || _Runtime.hooks === void 0 || (_hooks$flowApi = _Runtime.hooks.flowApi) === null || _hooks$flowApi === void 0 || _hooks$flowApi.clearCollectWidgetContract();
@@ -246,7 +245,7 @@ async function _render(location, isBootstrap) {
246
245
 
247
246
  // const renderStartTime = performance.now();
248
247
  const finishPageView = _Runtime.hooks === null || _Runtime.hooks === void 0 || (_hooks$pageView = _Runtime.hooks.pageView) === null || _hooks$pageView === void 0 ? void 0 : _hooks$pageView.create();
249
- const storyboard = blocked ? undefined : (0, _matchStoryboard.matchStoryboard)((0, _classPrivateFieldGet6.default)(_storyboards, this), location.pathname);
248
+ const storyboard = (0, _matchStoryboard.matchStoryboard)((0, _classPrivateFieldGet6.default)(_storyboards, this), location.pathname);
250
249
  const previousApp = (_classPrivateFieldGet5 = (0, _classPrivateFieldGet6.default)(_runtimeContext, this)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.app;
251
250
  const currentAppId = storyboard === null || storyboard === void 0 || (_storyboard$app = storyboard.app) === null || _storyboard$app === void 0 ? void 0 : _storyboard$app.id;
252
251
  // dynamically change the value of the APP variable, if it's union app
@@ -260,13 +259,27 @@ async function _render(location, isBootstrap) {
260
259
  await (0, _fulfilStoryboard.fulfilStoryboard)(storyboard);
261
260
  }
262
261
  const currentApp = (0, _classPrivateFieldSet2.default)(_currentApp, this, storyboard === null || storyboard === void 0 ? void 0 : storyboard.app);
262
+
263
+ // Set `Router::#currentApp` before calling `getFeatureFlags()`
264
+ // 必须在 currentApp 设置后调用,才能获取应用级的 feature flags
265
+ const flags = (0, _Runtime.getRuntime)().getFeatureFlags();
266
+ const blackListPreserveQueryFlag = flags["blacklist-preserve-query-string"];
267
+
268
+ // 第一次检查:全局黑名单
269
+ const pathToCheck = `${location.pathname}${blackListPreserveQueryFlag ? location.search : ""}`;
270
+ let blocked = _Runtime.hooks === null || _Runtime.hooks === void 0 || (_hooks$auth = _Runtime.hooks.auth) === null || _hooks$auth === void 0 || (_hooks$auth$isBlocked = _hooks$auth.isBlockedPath) === null || _hooks$auth$isBlocked === void 0 ? void 0 : _hooks$auth$isBlocked.call(_hooks$auth, pathToCheck);
263
271
  if (currentApp) {
264
272
  var _storyboard$meta, _storyboard$meta$forE, _hooks$auth3, _hooks$auth3$isBlocke;
265
273
  storyboard === null || storyboard === void 0 || (_storyboard$meta = storyboard.meta) === null || _storyboard$meta === void 0 || (_storyboard$meta = _storyboard$meta.blackList) === null || _storyboard$meta === void 0 || (_storyboard$meta$forE = _storyboard$meta.forEach) === null || _storyboard$meta$forE === void 0 || _storyboard$meta$forE.call(_storyboard$meta, item => {
266
274
  var _hooks$auth2, _hooks$auth2$addPathT;
267
275
  let path = item && (item.to || item.url);
268
276
  if (!path || typeof path !== "string") return;
269
- path = path.split("?")[0].replace(/\${\s*(?:(?:PATH|CTX)\.)?(\w+)\s*}/g, ":$1");
277
+
278
+ // 保留查询字符串(如果特性开关启用)
279
+ const pathParts = path.split("?");
280
+ const pathWithoutQuery = pathParts[0];
281
+ const queryString = blackListPreserveQueryFlag && pathParts[1] ? `?${pathParts[1]}` : "";
282
+ path = pathWithoutQuery.replace(/\${\s*(?:(?:PATH|CTX)\.)?(\w+)\s*}/g, ":$1") + queryString;
270
283
  if (item.to) {
271
284
  try {
272
285
  path = (0, _computeRealValue.computeRealValue)(path, {
@@ -281,7 +294,9 @@ async function _render(location, isBootstrap) {
281
294
  }
282
295
  path && path.startsWith("/") && (_Runtime.hooks === null || _Runtime.hooks === void 0 || (_hooks$auth2 = _Runtime.hooks.auth) === null || _hooks$auth2 === void 0 || (_hooks$auth2$addPathT = _hooks$auth2.addPathToBlackList) === null || _hooks$auth2$addPathT === void 0 ? void 0 : _hooks$auth2$addPathT.call(_hooks$auth2, path));
283
296
  });
284
- blocked = _Runtime.hooks === null || _Runtime.hooks === void 0 || (_hooks$auth3 = _Runtime.hooks.auth) === null || _hooks$auth3 === void 0 || (_hooks$auth3$isBlocke = _hooks$auth3.isBlockedPath) === null || _hooks$auth3$isBlocke === void 0 ? void 0 : _hooks$auth3$isBlocke.call(_hooks$auth3, location.pathname);
297
+
298
+ // 重新检查:全局黑名单 + 应用级黑名单
299
+ blocked = _Runtime.hooks === null || _Runtime.hooks === void 0 || (_hooks$auth3 = _Runtime.hooks.auth) === null || _hooks$auth3 === void 0 || (_hooks$auth3$isBlocke = _hooks$auth3.isBlockedPath) === null || _hooks$auth3$isBlocke === void 0 ? void 0 : _hooks$auth3$isBlocke.call(_hooks$auth3, pathToCheck);
285
300
  }
286
301
  (0, _setWatermark.setWatermark)();
287
302
 
@@ -293,9 +308,6 @@ async function _render(location, isBootstrap) {
293
308
  }
294
309
 
295
310
  // TODO: handle favicon
296
-
297
- // Set `Router::#currentApp` before calling `getFeatureFlags()`
298
- const flags = (0, _Runtime.getRuntime)().getFeatureFlags();
299
311
  const prevRendererContext = (0, _classPrivateFieldGet6.default)(_rendererContext, this);
300
312
  const redirectTo = (to, state) => {
301
313
  finishPageView === null || finishPageView === void 0 || finishPageView({
@@ -1 +1 @@
1
- {"version":3,"file":"Router.js","names":["_history2","require","_http","_cook","_lodash","_history3","_Renderer","_DataStore","_resolveData","_mount","_matchStoryboard","_StoryboardFunctions","_RendererContext","_themeAndMode","_Runtime","_getPageInfo","_markAsComputed","_handleHttpError","_abortController","_setLoginStateCookie","_registerCustomTemplates","_fulfilStoryboard","_enums","_insertPreviewRoutes","_devtools","_setUIVersion","_setAppVariable","_setWatermark","_routeMatchedMap","_ErrorNode","_shouldReloadForError","_computeRealValue","_storyboards","WeakMap","_rendering","_nextRender","_runtimeContext","_rendererContext","_rendererContextTrashCan","_redirectCount","_renderId","_currentApp","_previousApp","_navConfig","_bootstrapFailed","_Router_brand","WeakSet","Router","constructor","storyboards","_classPrivateMethodInitSpec2","default","_classPrivateFieldInitSpec2","Set","_classPrivateFieldSet2","history","getHistory","window","addEventListener","event","message","_assertClassBrand2","_getBlockMessageBeforePageLave","call","preventDefault","returnValue","block","location","action","getRenderId","_classPrivateFieldGet6","getRuntimeContext","getRecentApps","currentApp","previousApp","getNavConfig","bootstrap","initAbortController","nextPrevLocation","listen","prevLocation","_queuedRender","catch","handleHttpError","exports","detail","_classPrivateFieldGet2","previousMessage","getBlockMessage","dispatchBeforePageLeave","unblock","_safeRedirect","to","state","from","_this$redirectCount","_this$redirectCount2","pathname","search","hash","process","env","NODE_ENV","console","error","Error","replace","next","_preRender","nextRender","undefined","_prevLocation$state","_location$state","_location$state2","_classPrivateFieldGet4","ignoreRendering","omittedLocationProps","key","notify","locationsAreEqual","noIncremental","_classPrivateFieldGet3","didPerformIncrementalRender","abortPendingRequest","dispatchPageLeave","storyboard","matchStoryboard","isOutsideApp","reload","devtoolsHookEmit","_render","isBootstrap","_hooks$auth","_hooks$auth$isBlocked","_hooks$flowApi","_hooks$pageView","_classPrivateFieldGet5","_storyboard$app","renderId","uniqueId","blocked","hooks","auth","isBlockedPath","resetAllComputedMarks","clearResolveCache","flowApi","clearCollectWidgetContract","finishPageView","pageView","create","app","currentAppId","id","BOOTSTRAP_UNION_FILE","setAppVariable","appId","version","currentVersion","fulfilStoryboard","_storyboard$meta","_storyboard$meta$forE","_hooks$auth3","_hooks$auth3$isBlocke","meta","blackList","forEach","item","_hooks$auth2","_hooks$auth2$addPathT","path","url","split","computeRealValue","e","startsWith","addPathToBlackList","setWatermark","appChanged","clearExpressionASTCache","clearFunctionASTCache","flags","getRuntime","getFeatureFlags","prevRendererContext","redirectTo","status","add","redirectToLogin","setLoginStateCookie","main","document","querySelector","portal","renderRoot","tag","RenderTag","ROOT","container","createPortal","cleanUpPreviousRender","_hooks$messageDispatc","unmountTree","dispatchOnUnmount","dispose","clear","messageDispatcher","reset","dispatchEvent","CustomEvent","setTheme","getLocalAppsTheme","theme","setMode","setThemeVariant","getMiscSettings","globalThemeVariant","_hooks$checkInstalled","_hooks$auth4","_hooks$checkPermissio","_storyboard$meta2","_hooks$flowApi2","_storyboard$meta3","checkInstalledApps","preCheckInstalledApps","_internalApiGetAppInBootstrapData","routeHelper","bailout","output","unauthenticated","redirect","mergeMenus","menuRequests","menuConfs","Promise","all","mergeMenuConfs","returnNode","isCurrentBootstrap","isReCatch","isUnauthenticatedError","NO_AUTH_GUARD","HttpAbortError","noAuthGuardLoginPath","shouldReloadForError","failed","node","ErrorNode","blockingList","rendererContext","RendererContext","runtimeContext","query","URLSearchParams","sys","getAuth","getPageInfo","settings","brand","getBrandSettings","ctxStore","DataStore","pendingPermissionsPreCheck","checkPermissions","preCheckPermissions","tplStateStoreMap","Map","formStateStoreMap","registerCustomTemplates","registerStoryboardFunctions","functions","collectContract","contracts","stores","clearMatchedRoutes","rootMenuRequestNode","renderRoutes","insertPreviewRoutes","routes","getDataStores","postAsyncRender","child","menuRequestNode","setInitialMenuRequestNode","getMenuRequests","result","resetReloadForError","route","type","dispatchBeforePageLoad","applyTheme","applyMode","setUIVersion","uiVersion","mountTree","scrollTo","dispatchPageLoad","dispatchAnchorLoad","dispatchOnMount","initializeScrollIntoView","initializeMediaChange","initializeMessageDispatcher","store","mountAsyncData","pageTitle","title","isLoggedIn","PageError","navConfig","breadcrumb","menuConf","overwrite","items","push"],"sources":["../../../src/internal/Router.ts"],"sourcesContent":["import { Action, locationsAreEqual } from \"history\";\nimport type {\n BreadcrumbItemConf,\n MicroApp,\n StaticMenuConf,\n Storyboard,\n} from \"@next-core/types\";\nimport { HttpAbortError } from \"@next-core/http\";\nimport {\n clearExpressionASTCache,\n clearFunctionASTCache,\n} from \"@next-core/cook\";\nimport { uniqueId } from \"lodash\";\nimport { NextHistoryState, NextLocation, getHistory } from \"../history.js\";\nimport {\n RenderOutput,\n getDataStores,\n postAsyncRender,\n renderRoutes,\n} from \"./Renderer.js\";\nimport { DataStore } from \"./data/DataStore.js\";\nimport { clearResolveCache } from \"./data/resolveData.js\";\nimport { mountTree, unmountTree } from \"./mount.js\";\nimport { isOutsideApp, matchStoryboard } from \"./matchStoryboard.js\";\nimport { registerStoryboardFunctions } from \"./compute/StoryboardFunctions.js\";\nimport { RendererContext, RouteHelper } from \"./RendererContext.js\";\nimport {\n applyMode,\n applyTheme,\n getLocalAppsTheme,\n setMode,\n setTheme,\n setThemeVariant,\n} from \"../themeAndMode.js\";\nimport {\n _internalApiGetAppInBootstrapData,\n getRuntime,\n hooks,\n} from \"./Runtime.js\";\nimport { getPageInfo } from \"../getPageInfo.js\";\nimport type {\n MenuRequestNode,\n RenderRoot,\n RuntimeContext,\n} from \"./interfaces.js\";\nimport { resetAllComputedMarks } from \"./compute/markAsComputed.js\";\nimport { handleHttpError, isUnauthenticatedError } from \"../handleHttpError.js\";\nimport { abortPendingRequest, initAbortController } from \"./abortController.js\";\nimport { setLoginStateCookie } from \"../setLoginStateCookie.js\";\nimport { registerCustomTemplates } from \"./registerCustomTemplates.js\";\nimport { fulfilStoryboard } from \"./fulfilStoryboard.js\";\nimport { RenderTag } from \"./enums.js\";\nimport { insertPreviewRoutes } from \"./insertPreviewRoutes.js\";\nimport { devtoolsHookEmit } from \"./devtools.js\";\nimport { setUIVersion } from \"../setUIVersion.js\";\nimport { setAppVariable } from \"../setAppVariable.js\";\nimport { setWatermark } from \"../setWatermark.js\";\nimport { clearMatchedRoutes } from \"./routeMatchedMap.js\";\nimport { ErrorNode, PageError } from \"./ErrorNode.js\";\nimport {\n resetReloadForError,\n shouldReloadForError,\n} from \"../shouldReloadForError.js\";\nimport { computeRealValue } from \"./compute/computeRealValue.js\";\n\ntype RenderTask = InitialRenderTask | SubsequentRenderTask;\n\ninterface InitialRenderTask {\n location: NextLocation;\n prevLocation?: undefined;\n action?: undefined;\n}\n\ninterface SubsequentRenderTask {\n location: NextLocation;\n prevLocation: NextLocation;\n action: Action;\n}\n\nexport class Router {\n readonly #storyboards: Storyboard[];\n #rendering = false;\n #nextRender?: RenderTask;\n #runtimeContext?: RuntimeContext;\n #rendererContext?: RendererContext;\n #rendererContextTrashCan = new Set<RendererContext | undefined>();\n #redirectCount = 0;\n #renderId?: string;\n #currentApp?: MicroApp;\n #previousApp?: MicroApp;\n #navConfig?: { breadcrumb?: BreadcrumbItemConf[] };\n #bootstrapFailed = false;\n\n constructor(storyboards: Storyboard[]) {\n this.#storyboards = storyboards;\n\n const history = getHistory();\n window.addEventListener(\"beforeunload\", (event) => {\n const message = this.#getBlockMessageBeforePageLave({});\n // See examples in https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload\n if (message) {\n // Cancel the event\n // If you prevent default behavior in Mozilla Firefox prompt will always be shown\n event.preventDefault();\n // Chrome requires returnValue to be set\n event.returnValue = \"\";\n } else {\n // the absence of a returnValue property on the event will guarantee the browser unload happens\n delete event.returnValue;\n }\n });\n\n history.block((location, action) =>\n this.#getBlockMessageBeforePageLave({ location, action })\n );\n }\n\n getRenderId() {\n return this.#renderId;\n }\n\n // istanbul ignore next\n getRuntimeContext() {\n return this.#runtimeContext;\n }\n\n getRecentApps() {\n return { currentApp: this.#currentApp, previousApp: this.#previousApp };\n }\n\n getNavConfig() {\n return this.#navConfig;\n }\n\n #getBlockMessageBeforePageLave(detail: {\n location?: NextLocation;\n action?: Action;\n }): string | undefined {\n const history = getHistory();\n const previousMessage = history.getBlockMessage();\n this.#rendererContext?.dispatchBeforePageLeave(detail);\n const message = history.getBlockMessage();\n if (!previousMessage && message) {\n // Auto unblock only if new block was introduced by `onBeforePageLeave`.\n history.unblock();\n }\n return message;\n }\n\n #safeRedirect(\n to: string,\n state: NextHistoryState | undefined,\n from: NextLocation\n ): void {\n if (this.#redirectCount++ > 10) {\n const message = `Infinite redirect detected: from \"${from.pathname}${from.search}${from.hash}\" to \"${to}\"`;\n // istanbul ignore else: error cannot be caught in test\n if (process.env.NODE_ENV === \"test\") {\n // eslint-disable-next-line no-console\n console.error(message);\n return;\n } else {\n throw new Error(message);\n }\n }\n getHistory().replace(to, state);\n }\n\n bootstrap() {\n initAbortController();\n const history = getHistory();\n let nextPrevLocation = history.location;\n history.listen((location, action) => {\n const prevLocation = nextPrevLocation;\n nextPrevLocation = location;\n if (this.#rendering) {\n this.#nextRender = { location, prevLocation, action };\n } else {\n this.#queuedRender({ location, prevLocation, action }).catch(\n handleHttpError\n );\n }\n });\n return this.#queuedRender({ location: history.location });\n }\n\n async #queuedRender(next: RenderTask) {\n this.#rendering = true;\n try {\n await this.#preRender(next);\n } finally {\n this.#rendering = false;\n if (this.#nextRender) {\n const nextRender = this.#nextRender;\n this.#nextRender = undefined;\n await this.#queuedRender(nextRender);\n }\n }\n }\n\n async #preRender({ location, prevLocation, action }: RenderTask) {\n if (prevLocation) {\n let ignoreRendering: boolean | undefined;\n const omittedLocationProps: Partial<NextLocation> = {\n hash: undefined,\n state: undefined,\n };\n // Omit the \"key\" when checking whether locations are equal in certain situations.\n if (\n // When current location is triggered by browser action of hash link.\n location.key === undefined ||\n // When current location is triggered by browser action of non-push-or-replace,\n // such as goBack or goForward,\n (action === \"POP\" &&\n // and the previous location was triggered by hash link,\n (prevLocation.key === undefined ||\n // or the previous location specified notify false.\n prevLocation.state?.notify === false))\n ) {\n omittedLocationProps.key = undefined;\n }\n if (\n locationsAreEqual(\n { ...prevLocation, ...omittedLocationProps },\n { ...location, ...omittedLocationProps }\n ) ||\n (action !== \"POP\" && location.state?.notify === false)\n ) {\n // Ignore rendering if location not changed except hash, state and optional key.\n // Ignore rendering if notify is `false`.\n ignoreRendering = true;\n }\n\n // Note: dot not perform incremental render when bootstrap failed.\n if (\n !ignoreRendering &&\n !location.state?.noIncremental &&\n !this.#bootstrapFailed\n ) {\n ignoreRendering =\n await this.#rendererContext?.didPerformIncrementalRender(\n location,\n prevLocation\n );\n }\n\n if (ignoreRendering) {\n return;\n }\n\n abortPendingRequest();\n this.#rendererContext?.dispatchPageLeave();\n\n if (action === \"POP\") {\n const storyboard = matchStoryboard(\n this.#storyboards,\n location.pathname\n );\n // When a browser action of goBack or goForward is performing,\n // force reload when the target page is a page of an outside app.\n if (isOutsideApp(storyboard)) {\n window.location.reload();\n return;\n }\n }\n\n devtoolsHookEmit(\"locationChange\");\n }\n\n return this.#render(location, !prevLocation);\n }\n\n async #render(location: NextLocation, isBootstrap: boolean): Promise<void> {\n const renderId = (this.#renderId = uniqueId(\"render-id-\"));\n let blocked = hooks?.auth?.isBlockedPath?.(location.pathname);\n\n resetAllComputedMarks();\n clearResolveCache();\n hooks?.flowApi?.clearCollectWidgetContract();\n\n const history = getHistory();\n history.unblock();\n\n // const renderStartTime = performance.now();\n const finishPageView = hooks?.pageView?.create();\n\n const storyboard = blocked\n ? undefined\n : matchStoryboard(this.#storyboards, location.pathname);\n\n const previousApp = this.#runtimeContext?.app;\n const currentAppId = storyboard?.app?.id;\n // dynamically change the value of the APP variable, if it's union app\n if (\n window.BOOTSTRAP_UNION_FILE &&\n currentAppId &&\n currentAppId !== previousApp?.id\n ) {\n setAppVariable({\n appId: currentAppId,\n version: storyboard.app.currentVersion!,\n });\n }\n\n if (storyboard?.app) {\n await fulfilStoryboard(storyboard);\n }\n\n const currentApp = (this.#currentApp = storyboard?.app);\n\n if (currentApp) {\n storyboard?.meta?.blackList?.forEach?.((item) => {\n let path = item && (item.to || item.url);\n\n if (!path || typeof path !== \"string\") return;\n\n path = path\n .split(\"?\")[0]\n .replace(/\\${\\s*(?:(?:PATH|CTX)\\.)?(\\w+)\\s*}/g, \":$1\");\n\n if (item.to) {\n try {\n path = computeRealValue(path, {\n app: currentApp,\n } as RuntimeContext) as string;\n } catch (e) /* istanbul ignore next */ {\n // eslint-disable-next-line no-console\n console.error(e);\n }\n } else {\n path = path.replace(/^\\/next\\//, \"/\");\n }\n\n path && path.startsWith(\"/\") && hooks?.auth?.addPathToBlackList?.(path);\n });\n blocked = hooks?.auth?.isBlockedPath?.(location.pathname);\n }\n\n setWatermark();\n\n // Storyboard maybe re-assigned, e.g. when open launchpad.\n const appChanged =\n previousApp && currentApp\n ? previousApp.id !== currentApp.id\n : previousApp !== currentApp;\n\n clearExpressionASTCache();\n if (appChanged) {\n clearFunctionASTCache();\n }\n\n // TODO: handle favicon\n\n // Set `Router::#currentApp` before calling `getFeatureFlags()`\n const flags = getRuntime().getFeatureFlags();\n const prevRendererContext = this.#rendererContext;\n\n const redirectTo = (to: string, state?: NextHistoryState): void => {\n finishPageView?.({ status: \"redirected\" });\n this.#rendererContextTrashCan.add(prevRendererContext);\n this.#safeRedirect(to, state, location);\n };\n\n const redirectToLogin = (): void => {\n const to = flags[\"sso-enabled\"] ? \"/sso-auth/login\" : \"/auth/login\";\n setLoginStateCookie(location);\n redirectTo(to, { from: location });\n };\n\n const main = document.querySelector(\"#main-mount-point\") as HTMLElement;\n const portal = document.querySelector(\"#portal-mount-point\") as HTMLElement;\n\n const renderRoot: RenderRoot = {\n tag: RenderTag.ROOT,\n container: main,\n createPortal: portal,\n };\n\n const cleanUpPreviousRender = (): void => {\n unmountTree(main);\n unmountTree(portal);\n\n // Note: redirects can lead to multiple trash renderer contexts.\n this.#rendererContextTrashCan.add(prevRendererContext);\n for (const item of this.#rendererContextTrashCan) {\n if (item) {\n item.dispatchOnUnmount();\n item.dispose();\n }\n }\n this.#rendererContextTrashCan.clear();\n hooks?.messageDispatcher?.reset();\n\n if (appChanged) {\n this.#previousApp = previousApp;\n window.dispatchEvent(\n new CustomEvent(\"app.change\", { detail: { previousApp, currentApp } })\n );\n }\n };\n\n setTheme(\n (currentApp &&\n (getLocalAppsTheme()[currentApp.id] || currentApp.theme)) ||\n \"light\"\n );\n setMode(\"default\");\n setThemeVariant(getRuntime().getMiscSettings().globalThemeVariant);\n\n if (currentApp && !blocked) {\n hooks?.checkInstalledApps?.preCheckInstalledApps(\n storyboard,\n (appId) => !!_internalApiGetAppInBootstrapData(appId)\n );\n\n const routeHelper: RouteHelper = {\n bailout: (output) => {\n if (output.unauthenticated) {\n redirectToLogin();\n return true;\n }\n if (output.redirect) {\n redirectTo(output.redirect.path, output.redirect.state);\n return true;\n }\n // Reset redirect count if no redirect is set.\n this.#redirectCount = 0;\n },\n mergeMenus: async (menuRequests) => {\n const menuConfs = await Promise.all(menuRequests);\n this.#navConfig = mergeMenuConfs(menuConfs);\n window.dispatchEvent(\n new CustomEvent(\"navConfig.change\", { detail: this.#navConfig })\n );\n },\n catch: async (error, returnNode, isCurrentBootstrap, isReCatch) => {\n if (isUnauthenticatedError(error) && !window.NO_AUTH_GUARD) {\n redirectToLogin();\n return;\n } else if (error instanceof HttpAbortError) {\n this.#rendererContextTrashCan.add(prevRendererContext);\n return;\n } else {\n const noAuthGuardLoginPath =\n getRuntime().getMiscSettings().noAuthGuardLoginPath;\n if (isUnauthenticatedError(error) && noAuthGuardLoginPath) {\n redirectTo(noAuthGuardLoginPath as string, { from: location });\n return;\n }\n if (isCurrentBootstrap) {\n throw error;\n }\n if (!isReCatch && shouldReloadForError(error)) {\n window.location.reload();\n return;\n }\n return {\n failed: true,\n output: {\n node: await ErrorNode(error, returnNode, !isReCatch),\n blockingList: [],\n },\n };\n }\n },\n };\n\n const rendererContext = (this.#rendererContext = new RendererContext(\n \"page\",\n { routeHelper, renderId }\n ));\n\n const runtimeContext: RuntimeContext = (this.#runtimeContext = {\n app: currentApp,\n location,\n query: new URLSearchParams(location.search),\n flags,\n sys: {\n ...hooks?.auth?.getAuth(),\n ...getPageInfo(),\n settings: { brand: getRuntime().getBrandSettings() },\n },\n ctxStore: new DataStore(\"CTX\", undefined, rendererContext),\n pendingPermissionsPreCheck: [\n hooks?.checkPermissions?.preCheckPermissions(storyboard),\n ],\n tplStateStoreMap: new Map<string, DataStore<\"STATE\">>(),\n formStateStoreMap: new Map<string, DataStore<\"FORM_STATE\">>(),\n });\n\n this.#navConfig = undefined;\n\n registerCustomTemplates(storyboard);\n registerStoryboardFunctions(storyboard.meta?.functions, currentApp);\n hooks?.flowApi?.collectContract(storyboard.meta?.contracts);\n\n let failed = false;\n let output: RenderOutput;\n let stores: DataStore<\"CTX\" | \"STATE\" | \"FORM_STATE\">[] = [];\n\n try {\n clearMatchedRoutes();\n const rootMenuRequestNode: MenuRequestNode = {};\n output = await renderRoutes(\n renderRoot,\n insertPreviewRoutes(storyboard.routes),\n runtimeContext,\n rendererContext,\n [],\n rootMenuRequestNode\n );\n if (routeHelper.bailout(output)) {\n return;\n }\n\n stores = getDataStores(runtimeContext);\n\n await postAsyncRender(output, runtimeContext, stores);\n\n rootMenuRequestNode.child = output.menuRequestNode;\n rendererContext.setInitialMenuRequestNode(rootMenuRequestNode);\n await routeHelper.mergeMenus(rendererContext.getMenuRequests());\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Router failed:\", error);\n if (isBootstrap) {\n this.#bootstrapFailed = true;\n }\n const result = await routeHelper.catch(error, renderRoot, isBootstrap);\n if (!result) {\n return;\n }\n ({ failed, output } = result);\n }\n resetReloadForError();\n renderRoot.child = output.node;\n this.#bootstrapFailed = false;\n\n cleanUpPreviousRender();\n\n if ((output.route && output.route.type !== \"routes\") || failed) {\n if (!failed) {\n // There is a window to set theme and mode by `lifeCycle.onBeforePageLoad`.\n rendererContext.dispatchBeforePageLoad();\n }\n applyTheme();\n applyMode();\n\n setUIVersion(currentApp?.uiVersion);\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n // See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md\n window.scrollTo(0, 0);\n\n if (!failed) {\n rendererContext.dispatchPageLoad();\n rendererContext.dispatchAnchorLoad();\n rendererContext.dispatchOnMount();\n rendererContext.initializeScrollIntoView();\n rendererContext.initializeMediaChange();\n rendererContext.initializeMessageDispatcher();\n\n for (const store of stores) {\n store.mountAsyncData();\n }\n\n finishPageView?.({\n status: \"ok\",\n path: output.path,\n pageTitle: document.title,\n });\n } else {\n finishPageView?.({ status: \"failed\" });\n }\n devtoolsHookEmit(\"rendered\");\n\n return;\n }\n } else if (\n !window.NO_AUTH_GUARD &&\n hooks?.auth &&\n !hooks.auth.isLoggedIn()\n ) {\n // Todo(steve): refine after api-gateway supports fetching storyboards before logged in.\n // Redirect to login if no storyboard is matched.\n redirectToLogin();\n return;\n } else {\n cleanUpPreviousRender();\n }\n\n applyTheme();\n applyMode();\n\n const node = await ErrorNode(\n new PageError(\n blocked\n ? \"page blocked\"\n : currentApp\n ? \"page not found\"\n : \"app not found\"\n ),\n renderRoot,\n true\n );\n renderRoot.child = node;\n\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n window.scrollTo(0, 0);\n finishPageView?.({ status: blocked ? \"blocked\" : \"not-found\" });\n devtoolsHookEmit(\"rendered\");\n }\n}\n\nfunction mergeMenuConfs(menuConfs: StaticMenuConf[]) {\n const navConfig = { breadcrumb: [] as BreadcrumbItemConf[] };\n for (const menuConf of menuConfs) {\n const { breadcrumb } = menuConf;\n if (breadcrumb) {\n if (breadcrumb.overwrite) {\n navConfig.breadcrumb = breadcrumb.items;\n } else {\n navConfig.breadcrumb.push(...breadcrumb.items);\n }\n }\n }\n return navConfig;\n}\n"],"mappings":";;;;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AI,IACX,CAACD,cAAK,CAACC,IAAI,CAACoK,UAAU,CAAC,CAAC,EACxB;IACA;IACA;IACAtH,eAAe,CAAC,CAAC;IACjB;EACF,CAAC,MAAM;IACLY,qBAAqB,CAAC,CAAC;EACzB;EAEA,IAAA0F,wBAAU,EAAC,CAAC;EACZ,IAAAC,uBAAS,EAAC,CAAC;EAEX,MAAM7C,IAAI,GAAG,MAAM,IAAAC,oBAAS,EAC1B,IAAI4D,oBAAS,CACXvK,OAAO,GACH,cAAc,GACdnE,UAAU,GACR,gBAAgB,GAChB,eACR,CAAC,EACDyH,UAAU,EACV,IACF,CAAC;EACDA,UAAU,CAACuF,KAAK,GAAGnC,IAAI;EAEvB,IAAAgD,gBAAS,EAACpG,UAAU,CAAC;;EAErB;EACAzI,MAAM,CAAC8O,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;EACrBnJ,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAG;IAAEsC,MAAM,EAAE9C,OAAO,GAAG,SAAS,GAAG;EAAY,CAAC,CAAC;EAC/D,IAAAX,0BAAgB,EAAC,UAAU,CAAC;AAC9B;AAGF,SAAS2G,cAAcA,CAACH,SAA2B,EAAE;EACnD,MAAM2E,SAAS,GAAG;IAAEC,UAAU,EAAE;EAA2B,CAAC;EAC5D,KAAK,MAAMC,QAAQ,IAAI7E,SAAS,EAAE;IAChC,MAAM;MAAE4E;IAAW,CAAC,GAAGC,QAAQ;IAC/B,IAAID,UAAU,EAAE;MACd,IAAIA,UAAU,CAACE,SAAS,EAAE;QACxBH,SAAS,CAACC,UAAU,GAAGA,UAAU,CAACG,KAAK;MACzC,CAAC,MAAM;QACLJ,SAAS,CAACC,UAAU,CAACI,IAAI,CAAC,GAAGJ,UAAU,CAACG,KAAK,CAAC;MAChD;IACF;EACF;EACA,OAAOJ,SAAS;AAClB","ignoreList":[]}
1
+ {"version":3,"file":"Router.js","names":["_history2","require","_http","_cook","_lodash","_history3","_Renderer","_DataStore","_resolveData","_mount","_matchStoryboard","_StoryboardFunctions","_RendererContext","_themeAndMode","_Runtime","_getPageInfo","_markAsComputed","_handleHttpError","_abortController","_setLoginStateCookie","_registerCustomTemplates","_fulfilStoryboard","_enums","_insertPreviewRoutes","_devtools","_setUIVersion","_setAppVariable","_setWatermark","_routeMatchedMap","_ErrorNode","_shouldReloadForError","_computeRealValue","_storyboards","WeakMap","_rendering","_nextRender","_runtimeContext","_rendererContext","_rendererContextTrashCan","_redirectCount","_renderId","_currentApp","_previousApp","_navConfig","_bootstrapFailed","_Router_brand","WeakSet","Router","constructor","storyboards","_classPrivateMethodInitSpec2","default","_classPrivateFieldInitSpec2","Set","_classPrivateFieldSet2","history","getHistory","window","addEventListener","event","message","_assertClassBrand2","_getBlockMessageBeforePageLave","call","preventDefault","returnValue","block","location","action","getRenderId","_classPrivateFieldGet6","getRuntimeContext","getRecentApps","currentApp","previousApp","getNavConfig","bootstrap","initAbortController","nextPrevLocation","listen","prevLocation","_queuedRender","catch","handleHttpError","exports","detail","_classPrivateFieldGet2","previousMessage","getBlockMessage","dispatchBeforePageLeave","unblock","_safeRedirect","to","state","from","_this$redirectCount","_this$redirectCount2","pathname","search","hash","process","env","NODE_ENV","console","error","Error","replace","next","_preRender","nextRender","undefined","_prevLocation$state","_location$state","_location$state2","_classPrivateFieldGet4","ignoreRendering","omittedLocationProps","key","notify","locationsAreEqual","noIncremental","_classPrivateFieldGet3","didPerformIncrementalRender","abortPendingRequest","dispatchPageLeave","storyboard","matchStoryboard","isOutsideApp","reload","devtoolsHookEmit","_render","isBootstrap","_hooks$flowApi","_hooks$pageView","_classPrivateFieldGet5","_storyboard$app","_hooks$auth","_hooks$auth$isBlocked","renderId","uniqueId","resetAllComputedMarks","clearResolveCache","hooks","flowApi","clearCollectWidgetContract","finishPageView","pageView","create","app","currentAppId","id","BOOTSTRAP_UNION_FILE","setAppVariable","appId","version","currentVersion","fulfilStoryboard","flags","getRuntime","getFeatureFlags","blackListPreserveQueryFlag","pathToCheck","blocked","auth","isBlockedPath","_storyboard$meta","_storyboard$meta$forE","_hooks$auth3","_hooks$auth3$isBlocke","meta","blackList","forEach","item","_hooks$auth2","_hooks$auth2$addPathT","path","url","pathParts","split","pathWithoutQuery","queryString","computeRealValue","e","startsWith","addPathToBlackList","setWatermark","appChanged","clearExpressionASTCache","clearFunctionASTCache","prevRendererContext","redirectTo","status","add","redirectToLogin","setLoginStateCookie","main","document","querySelector","portal","renderRoot","tag","RenderTag","ROOT","container","createPortal","cleanUpPreviousRender","_hooks$messageDispatc","unmountTree","dispatchOnUnmount","dispose","clear","messageDispatcher","reset","dispatchEvent","CustomEvent","setTheme","getLocalAppsTheme","theme","setMode","setThemeVariant","getMiscSettings","globalThemeVariant","_hooks$checkInstalled","_hooks$auth4","_hooks$checkPermissio","_storyboard$meta2","_hooks$flowApi2","_storyboard$meta3","checkInstalledApps","preCheckInstalledApps","_internalApiGetAppInBootstrapData","routeHelper","bailout","output","unauthenticated","redirect","mergeMenus","menuRequests","menuConfs","Promise","all","mergeMenuConfs","returnNode","isCurrentBootstrap","isReCatch","isUnauthenticatedError","NO_AUTH_GUARD","HttpAbortError","noAuthGuardLoginPath","shouldReloadForError","failed","node","ErrorNode","blockingList","rendererContext","RendererContext","runtimeContext","query","URLSearchParams","sys","getAuth","getPageInfo","settings","brand","getBrandSettings","ctxStore","DataStore","pendingPermissionsPreCheck","checkPermissions","preCheckPermissions","tplStateStoreMap","Map","formStateStoreMap","registerCustomTemplates","registerStoryboardFunctions","functions","collectContract","contracts","stores","clearMatchedRoutes","rootMenuRequestNode","renderRoutes","insertPreviewRoutes","routes","getDataStores","postAsyncRender","child","menuRequestNode","setInitialMenuRequestNode","getMenuRequests","result","resetReloadForError","route","type","dispatchBeforePageLoad","applyTheme","applyMode","setUIVersion","uiVersion","mountTree","scrollTo","dispatchPageLoad","dispatchAnchorLoad","dispatchOnMount","initializeScrollIntoView","initializeMediaChange","initializeMessageDispatcher","store","mountAsyncData","pageTitle","title","isLoggedIn","PageError","navConfig","breadcrumb","menuConf","overwrite","items","push"],"sources":["../../../src/internal/Router.ts"],"sourcesContent":["import { Action, locationsAreEqual } from \"history\";\nimport type {\n BreadcrumbItemConf,\n MicroApp,\n StaticMenuConf,\n Storyboard,\n} from \"@next-core/types\";\nimport { HttpAbortError } from \"@next-core/http\";\nimport {\n clearExpressionASTCache,\n clearFunctionASTCache,\n} from \"@next-core/cook\";\nimport { uniqueId } from \"lodash\";\nimport { NextHistoryState, NextLocation, getHistory } from \"../history.js\";\nimport {\n RenderOutput,\n getDataStores,\n postAsyncRender,\n renderRoutes,\n} from \"./Renderer.js\";\nimport { DataStore } from \"./data/DataStore.js\";\nimport { clearResolveCache } from \"./data/resolveData.js\";\nimport { mountTree, unmountTree } from \"./mount.js\";\nimport { isOutsideApp, matchStoryboard } from \"./matchStoryboard.js\";\nimport { registerStoryboardFunctions } from \"./compute/StoryboardFunctions.js\";\nimport { RendererContext, RouteHelper } from \"./RendererContext.js\";\nimport {\n applyMode,\n applyTheme,\n getLocalAppsTheme,\n setMode,\n setTheme,\n setThemeVariant,\n} from \"../themeAndMode.js\";\nimport {\n _internalApiGetAppInBootstrapData,\n getRuntime,\n hooks,\n} from \"./Runtime.js\";\nimport { getPageInfo } from \"../getPageInfo.js\";\nimport type {\n MenuRequestNode,\n RenderRoot,\n RuntimeContext,\n} from \"./interfaces.js\";\nimport { resetAllComputedMarks } from \"./compute/markAsComputed.js\";\nimport { handleHttpError, isUnauthenticatedError } from \"../handleHttpError.js\";\nimport { abortPendingRequest, initAbortController } from \"./abortController.js\";\nimport { setLoginStateCookie } from \"../setLoginStateCookie.js\";\nimport { registerCustomTemplates } from \"./registerCustomTemplates.js\";\nimport { fulfilStoryboard } from \"./fulfilStoryboard.js\";\nimport { RenderTag } from \"./enums.js\";\nimport { insertPreviewRoutes } from \"./insertPreviewRoutes.js\";\nimport { devtoolsHookEmit } from \"./devtools.js\";\nimport { setUIVersion } from \"../setUIVersion.js\";\nimport { setAppVariable } from \"../setAppVariable.js\";\nimport { setWatermark } from \"../setWatermark.js\";\nimport { clearMatchedRoutes } from \"./routeMatchedMap.js\";\nimport { ErrorNode, PageError } from \"./ErrorNode.js\";\nimport {\n resetReloadForError,\n shouldReloadForError,\n} from \"../shouldReloadForError.js\";\nimport { computeRealValue } from \"./compute/computeRealValue.js\";\n\ntype RenderTask = InitialRenderTask | SubsequentRenderTask;\n\ninterface InitialRenderTask {\n location: NextLocation;\n prevLocation?: undefined;\n action?: undefined;\n}\n\ninterface SubsequentRenderTask {\n location: NextLocation;\n prevLocation: NextLocation;\n action: Action;\n}\n\nexport class Router {\n readonly #storyboards: Storyboard[];\n #rendering = false;\n #nextRender?: RenderTask;\n #runtimeContext?: RuntimeContext;\n #rendererContext?: RendererContext;\n #rendererContextTrashCan = new Set<RendererContext | undefined>();\n #redirectCount = 0;\n #renderId?: string;\n #currentApp?: MicroApp;\n #previousApp?: MicroApp;\n #navConfig?: { breadcrumb?: BreadcrumbItemConf[] };\n #bootstrapFailed = false;\n\n constructor(storyboards: Storyboard[]) {\n this.#storyboards = storyboards;\n\n const history = getHistory();\n window.addEventListener(\"beforeunload\", (event) => {\n const message = this.#getBlockMessageBeforePageLave({});\n // See examples in https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload\n if (message) {\n // Cancel the event\n // If you prevent default behavior in Mozilla Firefox prompt will always be shown\n event.preventDefault();\n // Chrome requires returnValue to be set\n event.returnValue = \"\";\n } else {\n // the absence of a returnValue property on the event will guarantee the browser unload happens\n delete event.returnValue;\n }\n });\n\n history.block((location, action) =>\n this.#getBlockMessageBeforePageLave({ location, action })\n );\n }\n\n getRenderId() {\n return this.#renderId;\n }\n\n // istanbul ignore next\n getRuntimeContext() {\n return this.#runtimeContext;\n }\n\n getRecentApps() {\n return { currentApp: this.#currentApp, previousApp: this.#previousApp };\n }\n\n getNavConfig() {\n return this.#navConfig;\n }\n\n #getBlockMessageBeforePageLave(detail: {\n location?: NextLocation;\n action?: Action;\n }): string | undefined {\n const history = getHistory();\n const previousMessage = history.getBlockMessage();\n this.#rendererContext?.dispatchBeforePageLeave(detail);\n const message = history.getBlockMessage();\n if (!previousMessage && message) {\n // Auto unblock only if new block was introduced by `onBeforePageLeave`.\n history.unblock();\n }\n return message;\n }\n\n #safeRedirect(\n to: string,\n state: NextHistoryState | undefined,\n from: NextLocation\n ): void {\n if (this.#redirectCount++ > 10) {\n const message = `Infinite redirect detected: from \"${from.pathname}${from.search}${from.hash}\" to \"${to}\"`;\n // istanbul ignore else: error cannot be caught in test\n if (process.env.NODE_ENV === \"test\") {\n // eslint-disable-next-line no-console\n console.error(message);\n return;\n } else {\n throw new Error(message);\n }\n }\n getHistory().replace(to, state);\n }\n\n bootstrap() {\n initAbortController();\n const history = getHistory();\n let nextPrevLocation = history.location;\n history.listen((location, action) => {\n const prevLocation = nextPrevLocation;\n nextPrevLocation = location;\n if (this.#rendering) {\n this.#nextRender = { location, prevLocation, action };\n } else {\n this.#queuedRender({ location, prevLocation, action }).catch(\n handleHttpError\n );\n }\n });\n return this.#queuedRender({ location: history.location });\n }\n\n async #queuedRender(next: RenderTask) {\n this.#rendering = true;\n try {\n await this.#preRender(next);\n } finally {\n this.#rendering = false;\n if (this.#nextRender) {\n const nextRender = this.#nextRender;\n this.#nextRender = undefined;\n await this.#queuedRender(nextRender);\n }\n }\n }\n\n async #preRender({ location, prevLocation, action }: RenderTask) {\n if (prevLocation) {\n let ignoreRendering: boolean | undefined;\n const omittedLocationProps: Partial<NextLocation> = {\n hash: undefined,\n state: undefined,\n };\n // Omit the \"key\" when checking whether locations are equal in certain situations.\n if (\n // When current location is triggered by browser action of hash link.\n location.key === undefined ||\n // When current location is triggered by browser action of non-push-or-replace,\n // such as goBack or goForward,\n (action === \"POP\" &&\n // and the previous location was triggered by hash link,\n (prevLocation.key === undefined ||\n // or the previous location specified notify false.\n prevLocation.state?.notify === false))\n ) {\n omittedLocationProps.key = undefined;\n }\n if (\n locationsAreEqual(\n { ...prevLocation, ...omittedLocationProps },\n { ...location, ...omittedLocationProps }\n ) ||\n (action !== \"POP\" && location.state?.notify === false)\n ) {\n // Ignore rendering if location not changed except hash, state and optional key.\n // Ignore rendering if notify is `false`.\n ignoreRendering = true;\n }\n\n // Note: dot not perform incremental render when bootstrap failed.\n if (\n !ignoreRendering &&\n !location.state?.noIncremental &&\n !this.#bootstrapFailed\n ) {\n ignoreRendering =\n await this.#rendererContext?.didPerformIncrementalRender(\n location,\n prevLocation\n );\n }\n\n if (ignoreRendering) {\n return;\n }\n\n abortPendingRequest();\n this.#rendererContext?.dispatchPageLeave();\n\n if (action === \"POP\") {\n const storyboard = matchStoryboard(\n this.#storyboards,\n location.pathname\n );\n // When a browser action of goBack or goForward is performing,\n // force reload when the target page is a page of an outside app.\n if (isOutsideApp(storyboard)) {\n window.location.reload();\n return;\n }\n }\n\n devtoolsHookEmit(\"locationChange\");\n }\n\n return this.#render(location, !prevLocation);\n }\n\n async #render(location: NextLocation, isBootstrap: boolean): Promise<void> {\n const renderId = (this.#renderId = uniqueId(\"render-id-\"));\n\n resetAllComputedMarks();\n clearResolveCache();\n hooks?.flowApi?.clearCollectWidgetContract();\n\n const history = getHistory();\n history.unblock();\n\n // const renderStartTime = performance.now();\n const finishPageView = hooks?.pageView?.create();\n\n const storyboard = matchStoryboard(this.#storyboards, location.pathname);\n\n const previousApp = this.#runtimeContext?.app;\n const currentAppId = storyboard?.app?.id;\n // dynamically change the value of the APP variable, if it's union app\n if (\n window.BOOTSTRAP_UNION_FILE &&\n currentAppId &&\n currentAppId !== previousApp?.id\n ) {\n setAppVariable({\n appId: currentAppId,\n version: storyboard.app.currentVersion!,\n });\n }\n\n if (storyboard?.app) {\n await fulfilStoryboard(storyboard);\n }\n\n const currentApp = (this.#currentApp = storyboard?.app);\n\n // Set `Router::#currentApp` before calling `getFeatureFlags()`\n // 必须在 currentApp 设置后调用,才能获取应用级的 feature flags\n const flags = getRuntime().getFeatureFlags();\n const blackListPreserveQueryFlag = flags[\"blacklist-preserve-query-string\"];\n\n // 第一次检查:全局黑名单\n const pathToCheck = `${location.pathname}${blackListPreserveQueryFlag ? location.search : \"\"}`;\n let blocked = hooks?.auth?.isBlockedPath?.(pathToCheck);\n\n if (currentApp) {\n storyboard?.meta?.blackList?.forEach?.((item) => {\n let path = item && (item.to || item.url);\n\n if (!path || typeof path !== \"string\") return;\n\n // 保留查询字符串(如果特性开关启用)\n const pathParts = path.split(\"?\");\n const pathWithoutQuery = pathParts[0];\n const queryString =\n blackListPreserveQueryFlag && pathParts[1] ? `?${pathParts[1]}` : \"\";\n\n path =\n pathWithoutQuery.replace(\n /\\${\\s*(?:(?:PATH|CTX)\\.)?(\\w+)\\s*}/g,\n \":$1\"\n ) + queryString;\n\n if (item.to) {\n try {\n path = computeRealValue(path, {\n app: currentApp,\n } as RuntimeContext) as string;\n } catch (e) /* istanbul ignore next */ {\n // eslint-disable-next-line no-console\n console.error(e);\n }\n } else {\n path = path.replace(/^\\/next\\//, \"/\");\n }\n\n path && path.startsWith(\"/\") && hooks?.auth?.addPathToBlackList?.(path);\n });\n\n // 重新检查:全局黑名单 + 应用级黑名单\n blocked = hooks?.auth?.isBlockedPath?.(pathToCheck);\n }\n\n setWatermark();\n\n // Storyboard maybe re-assigned, e.g. when open launchpad.\n const appChanged =\n previousApp && currentApp\n ? previousApp.id !== currentApp.id\n : previousApp !== currentApp;\n\n clearExpressionASTCache();\n if (appChanged) {\n clearFunctionASTCache();\n }\n\n // TODO: handle favicon\n const prevRendererContext = this.#rendererContext;\n\n const redirectTo = (to: string, state?: NextHistoryState): void => {\n finishPageView?.({ status: \"redirected\" });\n this.#rendererContextTrashCan.add(prevRendererContext);\n this.#safeRedirect(to, state, location);\n };\n\n const redirectToLogin = (): void => {\n const to = flags[\"sso-enabled\"] ? \"/sso-auth/login\" : \"/auth/login\";\n setLoginStateCookie(location);\n redirectTo(to, { from: location });\n };\n\n const main = document.querySelector(\"#main-mount-point\") as HTMLElement;\n const portal = document.querySelector(\"#portal-mount-point\") as HTMLElement;\n\n const renderRoot: RenderRoot = {\n tag: RenderTag.ROOT,\n container: main,\n createPortal: portal,\n };\n\n const cleanUpPreviousRender = (): void => {\n unmountTree(main);\n unmountTree(portal);\n\n // Note: redirects can lead to multiple trash renderer contexts.\n this.#rendererContextTrashCan.add(prevRendererContext);\n for (const item of this.#rendererContextTrashCan) {\n if (item) {\n item.dispatchOnUnmount();\n item.dispose();\n }\n }\n this.#rendererContextTrashCan.clear();\n hooks?.messageDispatcher?.reset();\n\n if (appChanged) {\n this.#previousApp = previousApp;\n window.dispatchEvent(\n new CustomEvent(\"app.change\", { detail: { previousApp, currentApp } })\n );\n }\n };\n\n setTheme(\n (currentApp &&\n (getLocalAppsTheme()[currentApp.id] || currentApp.theme)) ||\n \"light\"\n );\n setMode(\"default\");\n setThemeVariant(getRuntime().getMiscSettings().globalThemeVariant);\n\n if (currentApp && !blocked) {\n hooks?.checkInstalledApps?.preCheckInstalledApps(\n storyboard,\n (appId) => !!_internalApiGetAppInBootstrapData(appId)\n );\n\n const routeHelper: RouteHelper = {\n bailout: (output) => {\n if (output.unauthenticated) {\n redirectToLogin();\n return true;\n }\n if (output.redirect) {\n redirectTo(output.redirect.path, output.redirect.state);\n return true;\n }\n // Reset redirect count if no redirect is set.\n this.#redirectCount = 0;\n },\n mergeMenus: async (menuRequests) => {\n const menuConfs = await Promise.all(menuRequests);\n this.#navConfig = mergeMenuConfs(menuConfs);\n window.dispatchEvent(\n new CustomEvent(\"navConfig.change\", { detail: this.#navConfig })\n );\n },\n catch: async (error, returnNode, isCurrentBootstrap, isReCatch) => {\n if (isUnauthenticatedError(error) && !window.NO_AUTH_GUARD) {\n redirectToLogin();\n return;\n } else if (error instanceof HttpAbortError) {\n this.#rendererContextTrashCan.add(prevRendererContext);\n return;\n } else {\n const noAuthGuardLoginPath =\n getRuntime().getMiscSettings().noAuthGuardLoginPath;\n if (isUnauthenticatedError(error) && noAuthGuardLoginPath) {\n redirectTo(noAuthGuardLoginPath as string, { from: location });\n return;\n }\n if (isCurrentBootstrap) {\n throw error;\n }\n if (!isReCatch && shouldReloadForError(error)) {\n window.location.reload();\n return;\n }\n return {\n failed: true,\n output: {\n node: await ErrorNode(error, returnNode, !isReCatch),\n blockingList: [],\n },\n };\n }\n },\n };\n\n const rendererContext = (this.#rendererContext = new RendererContext(\n \"page\",\n { routeHelper, renderId }\n ));\n\n const runtimeContext: RuntimeContext = (this.#runtimeContext = {\n app: currentApp,\n location,\n query: new URLSearchParams(location.search),\n flags,\n sys: {\n ...hooks?.auth?.getAuth(),\n ...getPageInfo(),\n settings: { brand: getRuntime().getBrandSettings() },\n },\n ctxStore: new DataStore(\"CTX\", undefined, rendererContext),\n pendingPermissionsPreCheck: [\n hooks?.checkPermissions?.preCheckPermissions(storyboard),\n ],\n tplStateStoreMap: new Map<string, DataStore<\"STATE\">>(),\n formStateStoreMap: new Map<string, DataStore<\"FORM_STATE\">>(),\n });\n\n this.#navConfig = undefined;\n\n registerCustomTemplates(storyboard);\n registerStoryboardFunctions(storyboard.meta?.functions, currentApp);\n hooks?.flowApi?.collectContract(storyboard.meta?.contracts);\n\n let failed = false;\n let output: RenderOutput;\n let stores: DataStore<\"CTX\" | \"STATE\" | \"FORM_STATE\">[] = [];\n\n try {\n clearMatchedRoutes();\n const rootMenuRequestNode: MenuRequestNode = {};\n output = await renderRoutes(\n renderRoot,\n insertPreviewRoutes(storyboard.routes),\n runtimeContext,\n rendererContext,\n [],\n rootMenuRequestNode\n );\n if (routeHelper.bailout(output)) {\n return;\n }\n\n stores = getDataStores(runtimeContext);\n\n await postAsyncRender(output, runtimeContext, stores);\n\n rootMenuRequestNode.child = output.menuRequestNode;\n rendererContext.setInitialMenuRequestNode(rootMenuRequestNode);\n await routeHelper.mergeMenus(rendererContext.getMenuRequests());\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Router failed:\", error);\n if (isBootstrap) {\n this.#bootstrapFailed = true;\n }\n const result = await routeHelper.catch(error, renderRoot, isBootstrap);\n if (!result) {\n return;\n }\n ({ failed, output } = result);\n }\n resetReloadForError();\n renderRoot.child = output.node;\n this.#bootstrapFailed = false;\n\n cleanUpPreviousRender();\n\n if ((output.route && output.route.type !== \"routes\") || failed) {\n if (!failed) {\n // There is a window to set theme and mode by `lifeCycle.onBeforePageLoad`.\n rendererContext.dispatchBeforePageLoad();\n }\n applyTheme();\n applyMode();\n\n setUIVersion(currentApp?.uiVersion);\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n // See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md\n window.scrollTo(0, 0);\n\n if (!failed) {\n rendererContext.dispatchPageLoad();\n rendererContext.dispatchAnchorLoad();\n rendererContext.dispatchOnMount();\n rendererContext.initializeScrollIntoView();\n rendererContext.initializeMediaChange();\n rendererContext.initializeMessageDispatcher();\n\n for (const store of stores) {\n store.mountAsyncData();\n }\n\n finishPageView?.({\n status: \"ok\",\n path: output.path,\n pageTitle: document.title,\n });\n } else {\n finishPageView?.({ status: \"failed\" });\n }\n devtoolsHookEmit(\"rendered\");\n\n return;\n }\n } else if (\n !window.NO_AUTH_GUARD &&\n hooks?.auth &&\n !hooks.auth.isLoggedIn()\n ) {\n // Todo(steve): refine after api-gateway supports fetching storyboards before logged in.\n // Redirect to login if no storyboard is matched.\n redirectToLogin();\n return;\n } else {\n cleanUpPreviousRender();\n }\n\n applyTheme();\n applyMode();\n\n const node = await ErrorNode(\n new PageError(\n blocked\n ? \"page blocked\"\n : currentApp\n ? \"page not found\"\n : \"app not found\"\n ),\n renderRoot,\n true\n );\n renderRoot.child = node;\n\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n window.scrollTo(0, 0);\n finishPageView?.({ status: blocked ? \"blocked\" : \"not-found\" });\n devtoolsHookEmit(\"rendered\");\n }\n}\n\nfunction mergeMenuConfs(menuConfs: StaticMenuConf[]) {\n const navConfig = { breadcrumb: [] as BreadcrumbItemConf[] };\n for (const menuConf of menuConfs) {\n const { breadcrumb } = menuConf;\n if (breadcrumb) {\n if (breadcrumb.overwrite) {\n navConfig.breadcrumb = breadcrumb.items;\n } else {\n navConfig.breadcrumb.push(...breadcrumb.items);\n }\n }\n }\n return navConfig;\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAIA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAMA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,gBAAA,GAAAT,OAAA;AACA,IAAAU,oBAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AAQA,IAAAa,QAAA,GAAAb,OAAA;AAKA,IAAAc,YAAA,GAAAd,OAAA;AAMA,IAAAe,eAAA,GAAAf,OAAA;AACA,IAAAgB,gBAAA,GAAAhB,OAAA;AACA,IAAAiB,gBAAA,GAAAjB,OAAA;AACA,IAAAkB,oBAAA,GAAAlB,OAAA;AACA,IAAAmB,wBAAA,GAAAnB,OAAA;AACA,IAAAoB,iBAAA,GAAApB,OAAA;AACA,IAAAqB,MAAA,GAAArB,OAAA;AACA,IAAAsB,oBAAA,GAAAtB,OAAA;AACA,IAAAuB,SAAA,GAAAvB,OAAA;AACA,IAAAwB,aAAA,GAAAxB,OAAA;AACA,IAAAyB,eAAA,GAAAzB,OAAA;AACA,IAAA0B,aAAA,GAAA1B,OAAA;AACA,IAAA2B,gBAAA,GAAA3B,OAAA;AACA,IAAA4B,UAAA,GAAA5B,OAAA;AACA,IAAA6B,qBAAA,GAAA7B,OAAA;AAIA,IAAA8B,iBAAA,GAAA9B,OAAA;AAAiE,IAAA+B,YAAA,oBAAAC,OAAA;AAAA,I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,SAA2B,EAAE;EACnD,MAAM2E,SAAS,GAAG;IAAEC,UAAU,EAAE;EAA2B,CAAC;EAC5D,KAAK,MAAMC,QAAQ,IAAI7E,SAAS,EAAE;IAChC,MAAM;MAAE4E;IAAW,CAAC,GAAGC,QAAQ;IAC/B,IAAID,UAAU,EAAE;MACd,IAAIA,UAAU,CAACE,SAAS,EAAE;QACxBH,SAAS,CAACC,UAAU,GAAGA,UAAU,CAACG,KAAK;MACzC,CAAC,MAAM;QACLJ,SAAS,CAACC,UAAU,CAACI,IAAI,CAAC,GAAGJ,UAAU,CAACG,KAAK,CAAC;MAChD;IACF;EACF;EACA,OAAOJ,SAAS;AAClB","ignoreList":[]}
@@ -228,9 +228,8 @@ async function _preRender(_ref) {
228
228
  return _assertClassBrand(_Router_brand, this, _render).call(this, location, !prevLocation);
229
229
  }
230
230
  async function _render(location, isBootstrap) {
231
- var _hooks$auth, _hooks$auth$isBlocked, _hooks$flowApi, _hooks$pageView, _classPrivateFieldGet5, _storyboard$app;
231
+ var _hooks$flowApi, _hooks$pageView, _classPrivateFieldGet5, _storyboard$app, _hooks$auth, _hooks$auth$isBlocked;
232
232
  const renderId = _classPrivateFieldSet(_renderId, this, uniqueId("render-id-"));
233
- let blocked = hooks === null || hooks === void 0 || (_hooks$auth = hooks.auth) === null || _hooks$auth === void 0 || (_hooks$auth$isBlocked = _hooks$auth.isBlockedPath) === null || _hooks$auth$isBlocked === void 0 ? void 0 : _hooks$auth$isBlocked.call(_hooks$auth, location.pathname);
234
233
  resetAllComputedMarks();
235
234
  clearResolveCache();
236
235
  hooks === null || hooks === void 0 || (_hooks$flowApi = hooks.flowApi) === null || _hooks$flowApi === void 0 || _hooks$flowApi.clearCollectWidgetContract();
@@ -239,7 +238,7 @@ async function _render(location, isBootstrap) {
239
238
 
240
239
  // const renderStartTime = performance.now();
241
240
  const finishPageView = hooks === null || hooks === void 0 || (_hooks$pageView = hooks.pageView) === null || _hooks$pageView === void 0 ? void 0 : _hooks$pageView.create();
242
- const storyboard = blocked ? undefined : matchStoryboard(_classPrivateFieldGet(_storyboards, this), location.pathname);
241
+ const storyboard = matchStoryboard(_classPrivateFieldGet(_storyboards, this), location.pathname);
243
242
  const previousApp = (_classPrivateFieldGet5 = _classPrivateFieldGet(_runtimeContext, this)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.app;
244
243
  const currentAppId = storyboard === null || storyboard === void 0 || (_storyboard$app = storyboard.app) === null || _storyboard$app === void 0 ? void 0 : _storyboard$app.id;
245
244
  // dynamically change the value of the APP variable, if it's union app
@@ -253,13 +252,27 @@ async function _render(location, isBootstrap) {
253
252
  await fulfilStoryboard(storyboard);
254
253
  }
255
254
  const currentApp = _classPrivateFieldSet(_currentApp, this, storyboard === null || storyboard === void 0 ? void 0 : storyboard.app);
255
+
256
+ // Set `Router::#currentApp` before calling `getFeatureFlags()`
257
+ // 必须在 currentApp 设置后调用,才能获取应用级的 feature flags
258
+ const flags = getRuntime().getFeatureFlags();
259
+ const blackListPreserveQueryFlag = flags["blacklist-preserve-query-string"];
260
+
261
+ // 第一次检查:全局黑名单
262
+ const pathToCheck = `${location.pathname}${blackListPreserveQueryFlag ? location.search : ""}`;
263
+ let blocked = hooks === null || hooks === void 0 || (_hooks$auth = hooks.auth) === null || _hooks$auth === void 0 || (_hooks$auth$isBlocked = _hooks$auth.isBlockedPath) === null || _hooks$auth$isBlocked === void 0 ? void 0 : _hooks$auth$isBlocked.call(_hooks$auth, pathToCheck);
256
264
  if (currentApp) {
257
265
  var _storyboard$meta, _storyboard$meta$forE, _hooks$auth3, _hooks$auth3$isBlocke;
258
266
  storyboard === null || storyboard === void 0 || (_storyboard$meta = storyboard.meta) === null || _storyboard$meta === void 0 || (_storyboard$meta = _storyboard$meta.blackList) === null || _storyboard$meta === void 0 || (_storyboard$meta$forE = _storyboard$meta.forEach) === null || _storyboard$meta$forE === void 0 || _storyboard$meta$forE.call(_storyboard$meta, item => {
259
267
  var _hooks$auth2, _hooks$auth2$addPathT;
260
268
  let path = item && (item.to || item.url);
261
269
  if (!path || typeof path !== "string") return;
262
- path = path.split("?")[0].replace(/\${\s*(?:(?:PATH|CTX)\.)?(\w+)\s*}/g, ":$1");
270
+
271
+ // 保留查询字符串(如果特性开关启用)
272
+ const pathParts = path.split("?");
273
+ const pathWithoutQuery = pathParts[0];
274
+ const queryString = blackListPreserveQueryFlag && pathParts[1] ? `?${pathParts[1]}` : "";
275
+ path = pathWithoutQuery.replace(/\${\s*(?:(?:PATH|CTX)\.)?(\w+)\s*}/g, ":$1") + queryString;
263
276
  if (item.to) {
264
277
  try {
265
278
  path = computeRealValue(path, {
@@ -274,7 +287,9 @@ async function _render(location, isBootstrap) {
274
287
  }
275
288
  path && path.startsWith("/") && (hooks === null || hooks === void 0 || (_hooks$auth2 = hooks.auth) === null || _hooks$auth2 === void 0 || (_hooks$auth2$addPathT = _hooks$auth2.addPathToBlackList) === null || _hooks$auth2$addPathT === void 0 ? void 0 : _hooks$auth2$addPathT.call(_hooks$auth2, path));
276
289
  });
277
- blocked = hooks === null || hooks === void 0 || (_hooks$auth3 = hooks.auth) === null || _hooks$auth3 === void 0 || (_hooks$auth3$isBlocke = _hooks$auth3.isBlockedPath) === null || _hooks$auth3$isBlocke === void 0 ? void 0 : _hooks$auth3$isBlocke.call(_hooks$auth3, location.pathname);
290
+
291
+ // 重新检查:全局黑名单 + 应用级黑名单
292
+ blocked = hooks === null || hooks === void 0 || (_hooks$auth3 = hooks.auth) === null || _hooks$auth3 === void 0 || (_hooks$auth3$isBlocke = _hooks$auth3.isBlockedPath) === null || _hooks$auth3$isBlocke === void 0 ? void 0 : _hooks$auth3$isBlocke.call(_hooks$auth3, pathToCheck);
278
293
  }
279
294
  setWatermark();
280
295
 
@@ -286,9 +301,6 @@ async function _render(location, isBootstrap) {
286
301
  }
287
302
 
288
303
  // TODO: handle favicon
289
-
290
- // Set `Router::#currentApp` before calling `getFeatureFlags()`
291
- const flags = getRuntime().getFeatureFlags();
292
304
  const prevRendererContext = _classPrivateFieldGet(_rendererContext, this);
293
305
  const redirectTo = (to, state) => {
294
306
  finishPageView === null || finishPageView === void 0 || finishPageView({
@@ -1 +1 @@
1
- {"version":3,"file":"Router.js","names":["locationsAreEqual","HttpAbortError","clearExpressionASTCache","clearFunctionASTCache","uniqueId","getHistory","getDataStores","postAsyncRender","renderRoutes","DataStore","clearResolveCache","mountTree","unmountTree","isOutsideApp","matchStoryboard","registerStoryboardFunctions","RendererContext","applyMode","applyTheme","getLocalAppsTheme","setMode","setTheme","setThemeVariant","_internalApiGetAppInBootstrapData","getRuntime","hooks","getPageInfo","resetAllComputedMarks","handleHttpError","isUnauthenticatedError","abortPendingRequest","initAbortController","setLoginStateCookie","registerCustomTemplates","fulfilStoryboard","RenderTag","insertPreviewRoutes","devtoolsHookEmit","setUIVersion","setAppVariable","setWatermark","clearMatchedRoutes","ErrorNode","PageError","resetReloadForError","shouldReloadForError","computeRealValue","_storyboards","WeakMap","_rendering","_nextRender","_runtimeContext","_rendererContext","_rendererContextTrashCan","_redirectCount","_renderId","_currentApp","_previousApp","_navConfig","_bootstrapFailed","_Router_brand","WeakSet","Router","constructor","storyboards","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","Set","_classPrivateFieldSet","history","window","addEventListener","event","message","_assertClassBrand","_getBlockMessageBeforePageLave","call","preventDefault","returnValue","block","location","action","getRenderId","_classPrivateFieldGet","getRuntimeContext","getRecentApps","currentApp","previousApp","getNavConfig","bootstrap","nextPrevLocation","listen","prevLocation","_queuedRender","catch","detail","_classPrivateFieldGet2","previousMessage","getBlockMessage","dispatchBeforePageLeave","unblock","_safeRedirect","to","state","from","_this$redirectCount","_this$redirectCount2","pathname","search","hash","process","env","NODE_ENV","console","error","Error","replace","next","_preRender","nextRender","undefined","_ref","_prevLocation$state","_location$state","_location$state2","_classPrivateFieldGet4","ignoreRendering","omittedLocationProps","key","notify","noIncremental","_classPrivateFieldGet3","didPerformIncrementalRender","dispatchPageLeave","storyboard","reload","_render","isBootstrap","_hooks$auth","_hooks$auth$isBlocked","_hooks$flowApi","_hooks$pageView","_classPrivateFieldGet5","_storyboard$app","renderId","blocked","auth","isBlockedPath","flowApi","clearCollectWidgetContract","finishPageView","pageView","create","app","currentAppId","id","BOOTSTRAP_UNION_FILE","appId","version","currentVersion","_storyboard$meta","_storyboard$meta$forE","_hooks$auth3","_hooks$auth3$isBlocke","meta","blackList","forEach","item","_hooks$auth2","_hooks$auth2$addPathT","path","url","split","e","startsWith","addPathToBlackList","appChanged","flags","getFeatureFlags","prevRendererContext","redirectTo","status","add","redirectToLogin","main","document","querySelector","portal","renderRoot","tag","ROOT","container","createPortal","cleanUpPreviousRender","_hooks$messageDispatc","dispatchOnUnmount","dispose","clear","messageDispatcher","reset","dispatchEvent","CustomEvent","theme","getMiscSettings","globalThemeVariant","_hooks$checkInstalled","_hooks$auth4","_hooks$checkPermissio","_storyboard$meta2","_hooks$flowApi2","_storyboard$meta3","checkInstalledApps","preCheckInstalledApps","routeHelper","bailout","output","unauthenticated","redirect","mergeMenus","menuRequests","menuConfs","Promise","all","mergeMenuConfs","returnNode","isCurrentBootstrap","isReCatch","NO_AUTH_GUARD","noAuthGuardLoginPath","failed","node","blockingList","rendererContext","runtimeContext","query","URLSearchParams","sys","getAuth","settings","brand","getBrandSettings","ctxStore","pendingPermissionsPreCheck","checkPermissions","preCheckPermissions","tplStateStoreMap","Map","formStateStoreMap","functions","collectContract","contracts","stores","rootMenuRequestNode","routes","child","menuRequestNode","setInitialMenuRequestNode","getMenuRequests","result","route","type","dispatchBeforePageLoad","uiVersion","scrollTo","dispatchPageLoad","dispatchAnchorLoad","dispatchOnMount","initializeScrollIntoView","initializeMediaChange","initializeMessageDispatcher","store","mountAsyncData","pageTitle","title","isLoggedIn","navConfig","breadcrumb","menuConf","overwrite","items","push"],"sources":["../../../src/internal/Router.ts"],"sourcesContent":["import { Action, locationsAreEqual } from \"history\";\nimport type {\n BreadcrumbItemConf,\n MicroApp,\n StaticMenuConf,\n Storyboard,\n} from \"@next-core/types\";\nimport { HttpAbortError } from \"@next-core/http\";\nimport {\n clearExpressionASTCache,\n clearFunctionASTCache,\n} from \"@next-core/cook\";\nimport { uniqueId } from \"lodash\";\nimport { NextHistoryState, NextLocation, getHistory } from \"../history.js\";\nimport {\n RenderOutput,\n getDataStores,\n postAsyncRender,\n renderRoutes,\n} from \"./Renderer.js\";\nimport { DataStore } from \"./data/DataStore.js\";\nimport { clearResolveCache } from \"./data/resolveData.js\";\nimport { mountTree, unmountTree } from \"./mount.js\";\nimport { isOutsideApp, matchStoryboard } from \"./matchStoryboard.js\";\nimport { registerStoryboardFunctions } from \"./compute/StoryboardFunctions.js\";\nimport { RendererContext, RouteHelper } from \"./RendererContext.js\";\nimport {\n applyMode,\n applyTheme,\n getLocalAppsTheme,\n setMode,\n setTheme,\n setThemeVariant,\n} from \"../themeAndMode.js\";\nimport {\n _internalApiGetAppInBootstrapData,\n getRuntime,\n hooks,\n} from \"./Runtime.js\";\nimport { getPageInfo } from \"../getPageInfo.js\";\nimport type {\n MenuRequestNode,\n RenderRoot,\n RuntimeContext,\n} from \"./interfaces.js\";\nimport { resetAllComputedMarks } from \"./compute/markAsComputed.js\";\nimport { handleHttpError, isUnauthenticatedError } from \"../handleHttpError.js\";\nimport { abortPendingRequest, initAbortController } from \"./abortController.js\";\nimport { setLoginStateCookie } from \"../setLoginStateCookie.js\";\nimport { registerCustomTemplates } from \"./registerCustomTemplates.js\";\nimport { fulfilStoryboard } from \"./fulfilStoryboard.js\";\nimport { RenderTag } from \"./enums.js\";\nimport { insertPreviewRoutes } from \"./insertPreviewRoutes.js\";\nimport { devtoolsHookEmit } from \"./devtools.js\";\nimport { setUIVersion } from \"../setUIVersion.js\";\nimport { setAppVariable } from \"../setAppVariable.js\";\nimport { setWatermark } from \"../setWatermark.js\";\nimport { clearMatchedRoutes } from \"./routeMatchedMap.js\";\nimport { ErrorNode, PageError } from \"./ErrorNode.js\";\nimport {\n resetReloadForError,\n shouldReloadForError,\n} from \"../shouldReloadForError.js\";\nimport { computeRealValue } from \"./compute/computeRealValue.js\";\n\ntype RenderTask = InitialRenderTask | SubsequentRenderTask;\n\ninterface InitialRenderTask {\n location: NextLocation;\n prevLocation?: undefined;\n action?: undefined;\n}\n\ninterface SubsequentRenderTask {\n location: NextLocation;\n prevLocation: NextLocation;\n action: Action;\n}\n\nexport class Router {\n readonly #storyboards: Storyboard[];\n #rendering = false;\n #nextRender?: RenderTask;\n #runtimeContext?: RuntimeContext;\n #rendererContext?: RendererContext;\n #rendererContextTrashCan = new Set<RendererContext | undefined>();\n #redirectCount = 0;\n #renderId?: string;\n #currentApp?: MicroApp;\n #previousApp?: MicroApp;\n #navConfig?: { breadcrumb?: BreadcrumbItemConf[] };\n #bootstrapFailed = false;\n\n constructor(storyboards: Storyboard[]) {\n this.#storyboards = storyboards;\n\n const history = getHistory();\n window.addEventListener(\"beforeunload\", (event) => {\n const message = this.#getBlockMessageBeforePageLave({});\n // See examples in https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload\n if (message) {\n // Cancel the event\n // If you prevent default behavior in Mozilla Firefox prompt will always be shown\n event.preventDefault();\n // Chrome requires returnValue to be set\n event.returnValue = \"\";\n } else {\n // the absence of a returnValue property on the event will guarantee the browser unload happens\n delete event.returnValue;\n }\n });\n\n history.block((location, action) =>\n this.#getBlockMessageBeforePageLave({ location, action })\n );\n }\n\n getRenderId() {\n return this.#renderId;\n }\n\n // istanbul ignore next\n getRuntimeContext() {\n return this.#runtimeContext;\n }\n\n getRecentApps() {\n return { currentApp: this.#currentApp, previousApp: this.#previousApp };\n }\n\n getNavConfig() {\n return this.#navConfig;\n }\n\n #getBlockMessageBeforePageLave(detail: {\n location?: NextLocation;\n action?: Action;\n }): string | undefined {\n const history = getHistory();\n const previousMessage = history.getBlockMessage();\n this.#rendererContext?.dispatchBeforePageLeave(detail);\n const message = history.getBlockMessage();\n if (!previousMessage && message) {\n // Auto unblock only if new block was introduced by `onBeforePageLeave`.\n history.unblock();\n }\n return message;\n }\n\n #safeRedirect(\n to: string,\n state: NextHistoryState | undefined,\n from: NextLocation\n ): void {\n if (this.#redirectCount++ > 10) {\n const message = `Infinite redirect detected: from \"${from.pathname}${from.search}${from.hash}\" to \"${to}\"`;\n // istanbul ignore else: error cannot be caught in test\n if (process.env.NODE_ENV === \"test\") {\n // eslint-disable-next-line no-console\n console.error(message);\n return;\n } else {\n throw new Error(message);\n }\n }\n getHistory().replace(to, state);\n }\n\n bootstrap() {\n initAbortController();\n const history = getHistory();\n let nextPrevLocation = history.location;\n history.listen((location, action) => {\n const prevLocation = nextPrevLocation;\n nextPrevLocation = location;\n if (this.#rendering) {\n this.#nextRender = { location, prevLocation, action };\n } else {\n this.#queuedRender({ location, prevLocation, action }).catch(\n handleHttpError\n );\n }\n });\n return this.#queuedRender({ location: history.location });\n }\n\n async #queuedRender(next: RenderTask) {\n this.#rendering = true;\n try {\n await this.#preRender(next);\n } finally {\n this.#rendering = false;\n if (this.#nextRender) {\n const nextRender = this.#nextRender;\n this.#nextRender = undefined;\n await this.#queuedRender(nextRender);\n }\n }\n }\n\n async #preRender({ location, prevLocation, action }: RenderTask) {\n if (prevLocation) {\n let ignoreRendering: boolean | undefined;\n const omittedLocationProps: Partial<NextLocation> = {\n hash: undefined,\n state: undefined,\n };\n // Omit the \"key\" when checking whether locations are equal in certain situations.\n if (\n // When current location is triggered by browser action of hash link.\n location.key === undefined ||\n // When current location is triggered by browser action of non-push-or-replace,\n // such as goBack or goForward,\n (action === \"POP\" &&\n // and the previous location was triggered by hash link,\n (prevLocation.key === undefined ||\n // or the previous location specified notify false.\n prevLocation.state?.notify === false))\n ) {\n omittedLocationProps.key = undefined;\n }\n if (\n locationsAreEqual(\n { ...prevLocation, ...omittedLocationProps },\n { ...location, ...omittedLocationProps }\n ) ||\n (action !== \"POP\" && location.state?.notify === false)\n ) {\n // Ignore rendering if location not changed except hash, state and optional key.\n // Ignore rendering if notify is `false`.\n ignoreRendering = true;\n }\n\n // Note: dot not perform incremental render when bootstrap failed.\n if (\n !ignoreRendering &&\n !location.state?.noIncremental &&\n !this.#bootstrapFailed\n ) {\n ignoreRendering =\n await this.#rendererContext?.didPerformIncrementalRender(\n location,\n prevLocation\n );\n }\n\n if (ignoreRendering) {\n return;\n }\n\n abortPendingRequest();\n this.#rendererContext?.dispatchPageLeave();\n\n if (action === \"POP\") {\n const storyboard = matchStoryboard(\n this.#storyboards,\n location.pathname\n );\n // When a browser action of goBack or goForward is performing,\n // force reload when the target page is a page of an outside app.\n if (isOutsideApp(storyboard)) {\n window.location.reload();\n return;\n }\n }\n\n devtoolsHookEmit(\"locationChange\");\n }\n\n return this.#render(location, !prevLocation);\n }\n\n async #render(location: NextLocation, isBootstrap: boolean): Promise<void> {\n const renderId = (this.#renderId = uniqueId(\"render-id-\"));\n let blocked = hooks?.auth?.isBlockedPath?.(location.pathname);\n\n resetAllComputedMarks();\n clearResolveCache();\n hooks?.flowApi?.clearCollectWidgetContract();\n\n const history = getHistory();\n history.unblock();\n\n // const renderStartTime = performance.now();\n const finishPageView = hooks?.pageView?.create();\n\n const storyboard = blocked\n ? undefined\n : matchStoryboard(this.#storyboards, location.pathname);\n\n const previousApp = this.#runtimeContext?.app;\n const currentAppId = storyboard?.app?.id;\n // dynamically change the value of the APP variable, if it's union app\n if (\n window.BOOTSTRAP_UNION_FILE &&\n currentAppId &&\n currentAppId !== previousApp?.id\n ) {\n setAppVariable({\n appId: currentAppId,\n version: storyboard.app.currentVersion!,\n });\n }\n\n if (storyboard?.app) {\n await fulfilStoryboard(storyboard);\n }\n\n const currentApp = (this.#currentApp = storyboard?.app);\n\n if (currentApp) {\n storyboard?.meta?.blackList?.forEach?.((item) => {\n let path = item && (item.to || item.url);\n\n if (!path || typeof path !== \"string\") return;\n\n path = path\n .split(\"?\")[0]\n .replace(/\\${\\s*(?:(?:PATH|CTX)\\.)?(\\w+)\\s*}/g, \":$1\");\n\n if (item.to) {\n try {\n path = computeRealValue(path, {\n app: currentApp,\n } as RuntimeContext) as string;\n } catch (e) /* istanbul ignore next */ {\n // eslint-disable-next-line no-console\n console.error(e);\n }\n } else {\n path = path.replace(/^\\/next\\//, \"/\");\n }\n\n path && path.startsWith(\"/\") && hooks?.auth?.addPathToBlackList?.(path);\n });\n blocked = hooks?.auth?.isBlockedPath?.(location.pathname);\n }\n\n setWatermark();\n\n // Storyboard maybe re-assigned, e.g. when open launchpad.\n const appChanged =\n previousApp && currentApp\n ? previousApp.id !== currentApp.id\n : previousApp !== currentApp;\n\n clearExpressionASTCache();\n if (appChanged) {\n clearFunctionASTCache();\n }\n\n // TODO: handle favicon\n\n // Set `Router::#currentApp` before calling `getFeatureFlags()`\n const flags = getRuntime().getFeatureFlags();\n const prevRendererContext = this.#rendererContext;\n\n const redirectTo = (to: string, state?: NextHistoryState): void => {\n finishPageView?.({ status: \"redirected\" });\n this.#rendererContextTrashCan.add(prevRendererContext);\n this.#safeRedirect(to, state, location);\n };\n\n const redirectToLogin = (): void => {\n const to = flags[\"sso-enabled\"] ? \"/sso-auth/login\" : \"/auth/login\";\n setLoginStateCookie(location);\n redirectTo(to, { from: location });\n };\n\n const main = document.querySelector(\"#main-mount-point\") as HTMLElement;\n const portal = document.querySelector(\"#portal-mount-point\") as HTMLElement;\n\n const renderRoot: RenderRoot = {\n tag: RenderTag.ROOT,\n container: main,\n createPortal: portal,\n };\n\n const cleanUpPreviousRender = (): void => {\n unmountTree(main);\n unmountTree(portal);\n\n // Note: redirects can lead to multiple trash renderer contexts.\n this.#rendererContextTrashCan.add(prevRendererContext);\n for (const item of this.#rendererContextTrashCan) {\n if (item) {\n item.dispatchOnUnmount();\n item.dispose();\n }\n }\n this.#rendererContextTrashCan.clear();\n hooks?.messageDispatcher?.reset();\n\n if (appChanged) {\n this.#previousApp = previousApp;\n window.dispatchEvent(\n new CustomEvent(\"app.change\", { detail: { previousApp, currentApp } })\n );\n }\n };\n\n setTheme(\n (currentApp &&\n (getLocalAppsTheme()[currentApp.id] || currentApp.theme)) ||\n \"light\"\n );\n setMode(\"default\");\n setThemeVariant(getRuntime().getMiscSettings().globalThemeVariant);\n\n if (currentApp && !blocked) {\n hooks?.checkInstalledApps?.preCheckInstalledApps(\n storyboard,\n (appId) => !!_internalApiGetAppInBootstrapData(appId)\n );\n\n const routeHelper: RouteHelper = {\n bailout: (output) => {\n if (output.unauthenticated) {\n redirectToLogin();\n return true;\n }\n if (output.redirect) {\n redirectTo(output.redirect.path, output.redirect.state);\n return true;\n }\n // Reset redirect count if no redirect is set.\n this.#redirectCount = 0;\n },\n mergeMenus: async (menuRequests) => {\n const menuConfs = await Promise.all(menuRequests);\n this.#navConfig = mergeMenuConfs(menuConfs);\n window.dispatchEvent(\n new CustomEvent(\"navConfig.change\", { detail: this.#navConfig })\n );\n },\n catch: async (error, returnNode, isCurrentBootstrap, isReCatch) => {\n if (isUnauthenticatedError(error) && !window.NO_AUTH_GUARD) {\n redirectToLogin();\n return;\n } else if (error instanceof HttpAbortError) {\n this.#rendererContextTrashCan.add(prevRendererContext);\n return;\n } else {\n const noAuthGuardLoginPath =\n getRuntime().getMiscSettings().noAuthGuardLoginPath;\n if (isUnauthenticatedError(error) && noAuthGuardLoginPath) {\n redirectTo(noAuthGuardLoginPath as string, { from: location });\n return;\n }\n if (isCurrentBootstrap) {\n throw error;\n }\n if (!isReCatch && shouldReloadForError(error)) {\n window.location.reload();\n return;\n }\n return {\n failed: true,\n output: {\n node: await ErrorNode(error, returnNode, !isReCatch),\n blockingList: [],\n },\n };\n }\n },\n };\n\n const rendererContext = (this.#rendererContext = new RendererContext(\n \"page\",\n { routeHelper, renderId }\n ));\n\n const runtimeContext: RuntimeContext = (this.#runtimeContext = {\n app: currentApp,\n location,\n query: new URLSearchParams(location.search),\n flags,\n sys: {\n ...hooks?.auth?.getAuth(),\n ...getPageInfo(),\n settings: { brand: getRuntime().getBrandSettings() },\n },\n ctxStore: new DataStore(\"CTX\", undefined, rendererContext),\n pendingPermissionsPreCheck: [\n hooks?.checkPermissions?.preCheckPermissions(storyboard),\n ],\n tplStateStoreMap: new Map<string, DataStore<\"STATE\">>(),\n formStateStoreMap: new Map<string, DataStore<\"FORM_STATE\">>(),\n });\n\n this.#navConfig = undefined;\n\n registerCustomTemplates(storyboard);\n registerStoryboardFunctions(storyboard.meta?.functions, currentApp);\n hooks?.flowApi?.collectContract(storyboard.meta?.contracts);\n\n let failed = false;\n let output: RenderOutput;\n let stores: DataStore<\"CTX\" | \"STATE\" | \"FORM_STATE\">[] = [];\n\n try {\n clearMatchedRoutes();\n const rootMenuRequestNode: MenuRequestNode = {};\n output = await renderRoutes(\n renderRoot,\n insertPreviewRoutes(storyboard.routes),\n runtimeContext,\n rendererContext,\n [],\n rootMenuRequestNode\n );\n if (routeHelper.bailout(output)) {\n return;\n }\n\n stores = getDataStores(runtimeContext);\n\n await postAsyncRender(output, runtimeContext, stores);\n\n rootMenuRequestNode.child = output.menuRequestNode;\n rendererContext.setInitialMenuRequestNode(rootMenuRequestNode);\n await routeHelper.mergeMenus(rendererContext.getMenuRequests());\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Router failed:\", error);\n if (isBootstrap) {\n this.#bootstrapFailed = true;\n }\n const result = await routeHelper.catch(error, renderRoot, isBootstrap);\n if (!result) {\n return;\n }\n ({ failed, output } = result);\n }\n resetReloadForError();\n renderRoot.child = output.node;\n this.#bootstrapFailed = false;\n\n cleanUpPreviousRender();\n\n if ((output.route && output.route.type !== \"routes\") || failed) {\n if (!failed) {\n // There is a window to set theme and mode by `lifeCycle.onBeforePageLoad`.\n rendererContext.dispatchBeforePageLoad();\n }\n applyTheme();\n applyMode();\n\n setUIVersion(currentApp?.uiVersion);\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n // See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md\n window.scrollTo(0, 0);\n\n if (!failed) {\n rendererContext.dispatchPageLoad();\n rendererContext.dispatchAnchorLoad();\n rendererContext.dispatchOnMount();\n rendererContext.initializeScrollIntoView();\n rendererContext.initializeMediaChange();\n rendererContext.initializeMessageDispatcher();\n\n for (const store of stores) {\n store.mountAsyncData();\n }\n\n finishPageView?.({\n status: \"ok\",\n path: output.path,\n pageTitle: document.title,\n });\n } else {\n finishPageView?.({ status: \"failed\" });\n }\n devtoolsHookEmit(\"rendered\");\n\n return;\n }\n } else if (\n !window.NO_AUTH_GUARD &&\n hooks?.auth &&\n !hooks.auth.isLoggedIn()\n ) {\n // Todo(steve): refine after api-gateway supports fetching storyboards before logged in.\n // Redirect to login if no storyboard is matched.\n redirectToLogin();\n return;\n } else {\n cleanUpPreviousRender();\n }\n\n applyTheme();\n applyMode();\n\n const node = await ErrorNode(\n new PageError(\n blocked\n ? \"page blocked\"\n : currentApp\n ? \"page not found\"\n : \"app not found\"\n ),\n renderRoot,\n true\n );\n renderRoot.child = node;\n\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n window.scrollTo(0, 0);\n finishPageView?.({ status: blocked ? \"blocked\" : \"not-found\" });\n devtoolsHookEmit(\"rendered\");\n }\n}\n\nfunction mergeMenuConfs(menuConfs: StaticMenuConf[]) {\n const navConfig = { breadcrumb: [] as BreadcrumbItemConf[] };\n for (const menuConf of menuConfs) {\n const { breadcrumb } = menuConf;\n if (breadcrumb) {\n if (breadcrumb.overwrite) {\n navConfig.breadcrumb = breadcrumb.items;\n } else {\n navConfig.breadcrumb.push(...breadcrumb.items);\n }\n }\n }\n return navConfig;\n}\n"],"mappings":";;;;;AAAA,SAAiBA,iBAAiB,QAAQ,SAAS;AAOnD,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SACEC,uBAAuB,EACvBC,qBAAqB,QAChB,iBAAiB;AACxB,SAASC,QAAQ,QAAQ,QAAQ;AACjC,SAAyCC,UAAU,QAAQ,eAAe;AAC1E,SAEEC,aAAa,EACbC,eAAe,EACfC,YAAY,QACP,eAAe;AACtB,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,iBAAiB,QAA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,cAAc,GACd3D,UAAU,GACR,gBAAgB,GAChB,eACR,CAAC,EACDsG,UAAU,EACV,IACF,CAAC;EACDA,UAAU,CAACkE,KAAK,GAAGxB,IAAI;EAEvB3N,SAAS,CAACiL,UAAU,CAAC;;EAErB;EACAtH,MAAM,CAACiM,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;EACrBjH,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAG;IAAE+B,MAAM,EAAEpC,OAAO,GAAG,SAAS,GAAG;EAAY,CAAC,CAAC;EAC/D5G,gBAAgB,CAAC,UAAU,CAAC;AAC9B;AAGF,SAAS0L,cAAcA,CAACH,SAA2B,EAAE;EACnD,MAAMuD,SAAS,GAAG;IAAEC,UAAU,EAAE;EAA2B,CAAC;EAC5D,KAAK,MAAMC,QAAQ,IAAIzD,SAAS,EAAE;IAChC,MAAM;MAAEwD;IAAW,CAAC,GAAGC,QAAQ;IAC/B,IAAID,UAAU,EAAE;MACd,IAAIA,UAAU,CAACE,SAAS,EAAE;QACxBH,SAAS,CAACC,UAAU,GAAGA,UAAU,CAACG,KAAK;MACzC,CAAC,MAAM;QACLJ,SAAS,CAACC,UAAU,CAACI,IAAI,CAAC,GAAGJ,UAAU,CAACG,KAAK,CAAC;MAChD;IACF;EACF;EACA,OAAOJ,SAAS;AAClB","ignoreList":[]}
1
+ {"version":3,"file":"Router.js","names":["locationsAreEqual","HttpAbortError","clearExpressionASTCache","clearFunctionASTCache","uniqueId","getHistory","getDataStores","postAsyncRender","renderRoutes","DataStore","clearResolveCache","mountTree","unmountTree","isOutsideApp","matchStoryboard","registerStoryboardFunctions","RendererContext","applyMode","applyTheme","getLocalAppsTheme","setMode","setTheme","setThemeVariant","_internalApiGetAppInBootstrapData","getRuntime","hooks","getPageInfo","resetAllComputedMarks","handleHttpError","isUnauthenticatedError","abortPendingRequest","initAbortController","setLoginStateCookie","registerCustomTemplates","fulfilStoryboard","RenderTag","insertPreviewRoutes","devtoolsHookEmit","setUIVersion","setAppVariable","setWatermark","clearMatchedRoutes","ErrorNode","PageError","resetReloadForError","shouldReloadForError","computeRealValue","_storyboards","WeakMap","_rendering","_nextRender","_runtimeContext","_rendererContext","_rendererContextTrashCan","_redirectCount","_renderId","_currentApp","_previousApp","_navConfig","_bootstrapFailed","_Router_brand","WeakSet","Router","constructor","storyboards","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","Set","_classPrivateFieldSet","history","window","addEventListener","event","message","_assertClassBrand","_getBlockMessageBeforePageLave","call","preventDefault","returnValue","block","location","action","getRenderId","_classPrivateFieldGet","getRuntimeContext","getRecentApps","currentApp","previousApp","getNavConfig","bootstrap","nextPrevLocation","listen","prevLocation","_queuedRender","catch","detail","_classPrivateFieldGet2","previousMessage","getBlockMessage","dispatchBeforePageLeave","unblock","_safeRedirect","to","state","from","_this$redirectCount","_this$redirectCount2","pathname","search","hash","process","env","NODE_ENV","console","error","Error","replace","next","_preRender","nextRender","undefined","_ref","_prevLocation$state","_location$state","_location$state2","_classPrivateFieldGet4","ignoreRendering","omittedLocationProps","key","notify","noIncremental","_classPrivateFieldGet3","didPerformIncrementalRender","dispatchPageLeave","storyboard","reload","_render","isBootstrap","_hooks$flowApi","_hooks$pageView","_classPrivateFieldGet5","_storyboard$app","_hooks$auth","_hooks$auth$isBlocked","renderId","flowApi","clearCollectWidgetContract","finishPageView","pageView","create","app","currentAppId","id","BOOTSTRAP_UNION_FILE","appId","version","currentVersion","flags","getFeatureFlags","blackListPreserveQueryFlag","pathToCheck","blocked","auth","isBlockedPath","_storyboard$meta","_storyboard$meta$forE","_hooks$auth3","_hooks$auth3$isBlocke","meta","blackList","forEach","item","_hooks$auth2","_hooks$auth2$addPathT","path","url","pathParts","split","pathWithoutQuery","queryString","e","startsWith","addPathToBlackList","appChanged","prevRendererContext","redirectTo","status","add","redirectToLogin","main","document","querySelector","portal","renderRoot","tag","ROOT","container","createPortal","cleanUpPreviousRender","_hooks$messageDispatc","dispatchOnUnmount","dispose","clear","messageDispatcher","reset","dispatchEvent","CustomEvent","theme","getMiscSettings","globalThemeVariant","_hooks$checkInstalled","_hooks$auth4","_hooks$checkPermissio","_storyboard$meta2","_hooks$flowApi2","_storyboard$meta3","checkInstalledApps","preCheckInstalledApps","routeHelper","bailout","output","unauthenticated","redirect","mergeMenus","menuRequests","menuConfs","Promise","all","mergeMenuConfs","returnNode","isCurrentBootstrap","isReCatch","NO_AUTH_GUARD","noAuthGuardLoginPath","failed","node","blockingList","rendererContext","runtimeContext","query","URLSearchParams","sys","getAuth","settings","brand","getBrandSettings","ctxStore","pendingPermissionsPreCheck","checkPermissions","preCheckPermissions","tplStateStoreMap","Map","formStateStoreMap","functions","collectContract","contracts","stores","rootMenuRequestNode","routes","child","menuRequestNode","setInitialMenuRequestNode","getMenuRequests","result","route","type","dispatchBeforePageLoad","uiVersion","scrollTo","dispatchPageLoad","dispatchAnchorLoad","dispatchOnMount","initializeScrollIntoView","initializeMediaChange","initializeMessageDispatcher","store","mountAsyncData","pageTitle","title","isLoggedIn","navConfig","breadcrumb","menuConf","overwrite","items","push"],"sources":["../../../src/internal/Router.ts"],"sourcesContent":["import { Action, locationsAreEqual } from \"history\";\nimport type {\n BreadcrumbItemConf,\n MicroApp,\n StaticMenuConf,\n Storyboard,\n} from \"@next-core/types\";\nimport { HttpAbortError } from \"@next-core/http\";\nimport {\n clearExpressionASTCache,\n clearFunctionASTCache,\n} from \"@next-core/cook\";\nimport { uniqueId } from \"lodash\";\nimport { NextHistoryState, NextLocation, getHistory } from \"../history.js\";\nimport {\n RenderOutput,\n getDataStores,\n postAsyncRender,\n renderRoutes,\n} from \"./Renderer.js\";\nimport { DataStore } from \"./data/DataStore.js\";\nimport { clearResolveCache } from \"./data/resolveData.js\";\nimport { mountTree, unmountTree } from \"./mount.js\";\nimport { isOutsideApp, matchStoryboard } from \"./matchStoryboard.js\";\nimport { registerStoryboardFunctions } from \"./compute/StoryboardFunctions.js\";\nimport { RendererContext, RouteHelper } from \"./RendererContext.js\";\nimport {\n applyMode,\n applyTheme,\n getLocalAppsTheme,\n setMode,\n setTheme,\n setThemeVariant,\n} from \"../themeAndMode.js\";\nimport {\n _internalApiGetAppInBootstrapData,\n getRuntime,\n hooks,\n} from \"./Runtime.js\";\nimport { getPageInfo } from \"../getPageInfo.js\";\nimport type {\n MenuRequestNode,\n RenderRoot,\n RuntimeContext,\n} from \"./interfaces.js\";\nimport { resetAllComputedMarks } from \"./compute/markAsComputed.js\";\nimport { handleHttpError, isUnauthenticatedError } from \"../handleHttpError.js\";\nimport { abortPendingRequest, initAbortController } from \"./abortController.js\";\nimport { setLoginStateCookie } from \"../setLoginStateCookie.js\";\nimport { registerCustomTemplates } from \"./registerCustomTemplates.js\";\nimport { fulfilStoryboard } from \"./fulfilStoryboard.js\";\nimport { RenderTag } from \"./enums.js\";\nimport { insertPreviewRoutes } from \"./insertPreviewRoutes.js\";\nimport { devtoolsHookEmit } from \"./devtools.js\";\nimport { setUIVersion } from \"../setUIVersion.js\";\nimport { setAppVariable } from \"../setAppVariable.js\";\nimport { setWatermark } from \"../setWatermark.js\";\nimport { clearMatchedRoutes } from \"./routeMatchedMap.js\";\nimport { ErrorNode, PageError } from \"./ErrorNode.js\";\nimport {\n resetReloadForError,\n shouldReloadForError,\n} from \"../shouldReloadForError.js\";\nimport { computeRealValue } from \"./compute/computeRealValue.js\";\n\ntype RenderTask = InitialRenderTask | SubsequentRenderTask;\n\ninterface InitialRenderTask {\n location: NextLocation;\n prevLocation?: undefined;\n action?: undefined;\n}\n\ninterface SubsequentRenderTask {\n location: NextLocation;\n prevLocation: NextLocation;\n action: Action;\n}\n\nexport class Router {\n readonly #storyboards: Storyboard[];\n #rendering = false;\n #nextRender?: RenderTask;\n #runtimeContext?: RuntimeContext;\n #rendererContext?: RendererContext;\n #rendererContextTrashCan = new Set<RendererContext | undefined>();\n #redirectCount = 0;\n #renderId?: string;\n #currentApp?: MicroApp;\n #previousApp?: MicroApp;\n #navConfig?: { breadcrumb?: BreadcrumbItemConf[] };\n #bootstrapFailed = false;\n\n constructor(storyboards: Storyboard[]) {\n this.#storyboards = storyboards;\n\n const history = getHistory();\n window.addEventListener(\"beforeunload\", (event) => {\n const message = this.#getBlockMessageBeforePageLave({});\n // See examples in https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload\n if (message) {\n // Cancel the event\n // If you prevent default behavior in Mozilla Firefox prompt will always be shown\n event.preventDefault();\n // Chrome requires returnValue to be set\n event.returnValue = \"\";\n } else {\n // the absence of a returnValue property on the event will guarantee the browser unload happens\n delete event.returnValue;\n }\n });\n\n history.block((location, action) =>\n this.#getBlockMessageBeforePageLave({ location, action })\n );\n }\n\n getRenderId() {\n return this.#renderId;\n }\n\n // istanbul ignore next\n getRuntimeContext() {\n return this.#runtimeContext;\n }\n\n getRecentApps() {\n return { currentApp: this.#currentApp, previousApp: this.#previousApp };\n }\n\n getNavConfig() {\n return this.#navConfig;\n }\n\n #getBlockMessageBeforePageLave(detail: {\n location?: NextLocation;\n action?: Action;\n }): string | undefined {\n const history = getHistory();\n const previousMessage = history.getBlockMessage();\n this.#rendererContext?.dispatchBeforePageLeave(detail);\n const message = history.getBlockMessage();\n if (!previousMessage && message) {\n // Auto unblock only if new block was introduced by `onBeforePageLeave`.\n history.unblock();\n }\n return message;\n }\n\n #safeRedirect(\n to: string,\n state: NextHistoryState | undefined,\n from: NextLocation\n ): void {\n if (this.#redirectCount++ > 10) {\n const message = `Infinite redirect detected: from \"${from.pathname}${from.search}${from.hash}\" to \"${to}\"`;\n // istanbul ignore else: error cannot be caught in test\n if (process.env.NODE_ENV === \"test\") {\n // eslint-disable-next-line no-console\n console.error(message);\n return;\n } else {\n throw new Error(message);\n }\n }\n getHistory().replace(to, state);\n }\n\n bootstrap() {\n initAbortController();\n const history = getHistory();\n let nextPrevLocation = history.location;\n history.listen((location, action) => {\n const prevLocation = nextPrevLocation;\n nextPrevLocation = location;\n if (this.#rendering) {\n this.#nextRender = { location, prevLocation, action };\n } else {\n this.#queuedRender({ location, prevLocation, action }).catch(\n handleHttpError\n );\n }\n });\n return this.#queuedRender({ location: history.location });\n }\n\n async #queuedRender(next: RenderTask) {\n this.#rendering = true;\n try {\n await this.#preRender(next);\n } finally {\n this.#rendering = false;\n if (this.#nextRender) {\n const nextRender = this.#nextRender;\n this.#nextRender = undefined;\n await this.#queuedRender(nextRender);\n }\n }\n }\n\n async #preRender({ location, prevLocation, action }: RenderTask) {\n if (prevLocation) {\n let ignoreRendering: boolean | undefined;\n const omittedLocationProps: Partial<NextLocation> = {\n hash: undefined,\n state: undefined,\n };\n // Omit the \"key\" when checking whether locations are equal in certain situations.\n if (\n // When current location is triggered by browser action of hash link.\n location.key === undefined ||\n // When current location is triggered by browser action of non-push-or-replace,\n // such as goBack or goForward,\n (action === \"POP\" &&\n // and the previous location was triggered by hash link,\n (prevLocation.key === undefined ||\n // or the previous location specified notify false.\n prevLocation.state?.notify === false))\n ) {\n omittedLocationProps.key = undefined;\n }\n if (\n locationsAreEqual(\n { ...prevLocation, ...omittedLocationProps },\n { ...location, ...omittedLocationProps }\n ) ||\n (action !== \"POP\" && location.state?.notify === false)\n ) {\n // Ignore rendering if location not changed except hash, state and optional key.\n // Ignore rendering if notify is `false`.\n ignoreRendering = true;\n }\n\n // Note: dot not perform incremental render when bootstrap failed.\n if (\n !ignoreRendering &&\n !location.state?.noIncremental &&\n !this.#bootstrapFailed\n ) {\n ignoreRendering =\n await this.#rendererContext?.didPerformIncrementalRender(\n location,\n prevLocation\n );\n }\n\n if (ignoreRendering) {\n return;\n }\n\n abortPendingRequest();\n this.#rendererContext?.dispatchPageLeave();\n\n if (action === \"POP\") {\n const storyboard = matchStoryboard(\n this.#storyboards,\n location.pathname\n );\n // When a browser action of goBack or goForward is performing,\n // force reload when the target page is a page of an outside app.\n if (isOutsideApp(storyboard)) {\n window.location.reload();\n return;\n }\n }\n\n devtoolsHookEmit(\"locationChange\");\n }\n\n return this.#render(location, !prevLocation);\n }\n\n async #render(location: NextLocation, isBootstrap: boolean): Promise<void> {\n const renderId = (this.#renderId = uniqueId(\"render-id-\"));\n\n resetAllComputedMarks();\n clearResolveCache();\n hooks?.flowApi?.clearCollectWidgetContract();\n\n const history = getHistory();\n history.unblock();\n\n // const renderStartTime = performance.now();\n const finishPageView = hooks?.pageView?.create();\n\n const storyboard = matchStoryboard(this.#storyboards, location.pathname);\n\n const previousApp = this.#runtimeContext?.app;\n const currentAppId = storyboard?.app?.id;\n // dynamically change the value of the APP variable, if it's union app\n if (\n window.BOOTSTRAP_UNION_FILE &&\n currentAppId &&\n currentAppId !== previousApp?.id\n ) {\n setAppVariable({\n appId: currentAppId,\n version: storyboard.app.currentVersion!,\n });\n }\n\n if (storyboard?.app) {\n await fulfilStoryboard(storyboard);\n }\n\n const currentApp = (this.#currentApp = storyboard?.app);\n\n // Set `Router::#currentApp` before calling `getFeatureFlags()`\n // 必须在 currentApp 设置后调用,才能获取应用级的 feature flags\n const flags = getRuntime().getFeatureFlags();\n const blackListPreserveQueryFlag = flags[\"blacklist-preserve-query-string\"];\n\n // 第一次检查:全局黑名单\n const pathToCheck = `${location.pathname}${blackListPreserveQueryFlag ? location.search : \"\"}`;\n let blocked = hooks?.auth?.isBlockedPath?.(pathToCheck);\n\n if (currentApp) {\n storyboard?.meta?.blackList?.forEach?.((item) => {\n let path = item && (item.to || item.url);\n\n if (!path || typeof path !== \"string\") return;\n\n // 保留查询字符串(如果特性开关启用)\n const pathParts = path.split(\"?\");\n const pathWithoutQuery = pathParts[0];\n const queryString =\n blackListPreserveQueryFlag && pathParts[1] ? `?${pathParts[1]}` : \"\";\n\n path =\n pathWithoutQuery.replace(\n /\\${\\s*(?:(?:PATH|CTX)\\.)?(\\w+)\\s*}/g,\n \":$1\"\n ) + queryString;\n\n if (item.to) {\n try {\n path = computeRealValue(path, {\n app: currentApp,\n } as RuntimeContext) as string;\n } catch (e) /* istanbul ignore next */ {\n // eslint-disable-next-line no-console\n console.error(e);\n }\n } else {\n path = path.replace(/^\\/next\\//, \"/\");\n }\n\n path && path.startsWith(\"/\") && hooks?.auth?.addPathToBlackList?.(path);\n });\n\n // 重新检查:全局黑名单 + 应用级黑名单\n blocked = hooks?.auth?.isBlockedPath?.(pathToCheck);\n }\n\n setWatermark();\n\n // Storyboard maybe re-assigned, e.g. when open launchpad.\n const appChanged =\n previousApp && currentApp\n ? previousApp.id !== currentApp.id\n : previousApp !== currentApp;\n\n clearExpressionASTCache();\n if (appChanged) {\n clearFunctionASTCache();\n }\n\n // TODO: handle favicon\n const prevRendererContext = this.#rendererContext;\n\n const redirectTo = (to: string, state?: NextHistoryState): void => {\n finishPageView?.({ status: \"redirected\" });\n this.#rendererContextTrashCan.add(prevRendererContext);\n this.#safeRedirect(to, state, location);\n };\n\n const redirectToLogin = (): void => {\n const to = flags[\"sso-enabled\"] ? \"/sso-auth/login\" : \"/auth/login\";\n setLoginStateCookie(location);\n redirectTo(to, { from: location });\n };\n\n const main = document.querySelector(\"#main-mount-point\") as HTMLElement;\n const portal = document.querySelector(\"#portal-mount-point\") as HTMLElement;\n\n const renderRoot: RenderRoot = {\n tag: RenderTag.ROOT,\n container: main,\n createPortal: portal,\n };\n\n const cleanUpPreviousRender = (): void => {\n unmountTree(main);\n unmountTree(portal);\n\n // Note: redirects can lead to multiple trash renderer contexts.\n this.#rendererContextTrashCan.add(prevRendererContext);\n for (const item of this.#rendererContextTrashCan) {\n if (item) {\n item.dispatchOnUnmount();\n item.dispose();\n }\n }\n this.#rendererContextTrashCan.clear();\n hooks?.messageDispatcher?.reset();\n\n if (appChanged) {\n this.#previousApp = previousApp;\n window.dispatchEvent(\n new CustomEvent(\"app.change\", { detail: { previousApp, currentApp } })\n );\n }\n };\n\n setTheme(\n (currentApp &&\n (getLocalAppsTheme()[currentApp.id] || currentApp.theme)) ||\n \"light\"\n );\n setMode(\"default\");\n setThemeVariant(getRuntime().getMiscSettings().globalThemeVariant);\n\n if (currentApp && !blocked) {\n hooks?.checkInstalledApps?.preCheckInstalledApps(\n storyboard,\n (appId) => !!_internalApiGetAppInBootstrapData(appId)\n );\n\n const routeHelper: RouteHelper = {\n bailout: (output) => {\n if (output.unauthenticated) {\n redirectToLogin();\n return true;\n }\n if (output.redirect) {\n redirectTo(output.redirect.path, output.redirect.state);\n return true;\n }\n // Reset redirect count if no redirect is set.\n this.#redirectCount = 0;\n },\n mergeMenus: async (menuRequests) => {\n const menuConfs = await Promise.all(menuRequests);\n this.#navConfig = mergeMenuConfs(menuConfs);\n window.dispatchEvent(\n new CustomEvent(\"navConfig.change\", { detail: this.#navConfig })\n );\n },\n catch: async (error, returnNode, isCurrentBootstrap, isReCatch) => {\n if (isUnauthenticatedError(error) && !window.NO_AUTH_GUARD) {\n redirectToLogin();\n return;\n } else if (error instanceof HttpAbortError) {\n this.#rendererContextTrashCan.add(prevRendererContext);\n return;\n } else {\n const noAuthGuardLoginPath =\n getRuntime().getMiscSettings().noAuthGuardLoginPath;\n if (isUnauthenticatedError(error) && noAuthGuardLoginPath) {\n redirectTo(noAuthGuardLoginPath as string, { from: location });\n return;\n }\n if (isCurrentBootstrap) {\n throw error;\n }\n if (!isReCatch && shouldReloadForError(error)) {\n window.location.reload();\n return;\n }\n return {\n failed: true,\n output: {\n node: await ErrorNode(error, returnNode, !isReCatch),\n blockingList: [],\n },\n };\n }\n },\n };\n\n const rendererContext = (this.#rendererContext = new RendererContext(\n \"page\",\n { routeHelper, renderId }\n ));\n\n const runtimeContext: RuntimeContext = (this.#runtimeContext = {\n app: currentApp,\n location,\n query: new URLSearchParams(location.search),\n flags,\n sys: {\n ...hooks?.auth?.getAuth(),\n ...getPageInfo(),\n settings: { brand: getRuntime().getBrandSettings() },\n },\n ctxStore: new DataStore(\"CTX\", undefined, rendererContext),\n pendingPermissionsPreCheck: [\n hooks?.checkPermissions?.preCheckPermissions(storyboard),\n ],\n tplStateStoreMap: new Map<string, DataStore<\"STATE\">>(),\n formStateStoreMap: new Map<string, DataStore<\"FORM_STATE\">>(),\n });\n\n this.#navConfig = undefined;\n\n registerCustomTemplates(storyboard);\n registerStoryboardFunctions(storyboard.meta?.functions, currentApp);\n hooks?.flowApi?.collectContract(storyboard.meta?.contracts);\n\n let failed = false;\n let output: RenderOutput;\n let stores: DataStore<\"CTX\" | \"STATE\" | \"FORM_STATE\">[] = [];\n\n try {\n clearMatchedRoutes();\n const rootMenuRequestNode: MenuRequestNode = {};\n output = await renderRoutes(\n renderRoot,\n insertPreviewRoutes(storyboard.routes),\n runtimeContext,\n rendererContext,\n [],\n rootMenuRequestNode\n );\n if (routeHelper.bailout(output)) {\n return;\n }\n\n stores = getDataStores(runtimeContext);\n\n await postAsyncRender(output, runtimeContext, stores);\n\n rootMenuRequestNode.child = output.menuRequestNode;\n rendererContext.setInitialMenuRequestNode(rootMenuRequestNode);\n await routeHelper.mergeMenus(rendererContext.getMenuRequests());\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Router failed:\", error);\n if (isBootstrap) {\n this.#bootstrapFailed = true;\n }\n const result = await routeHelper.catch(error, renderRoot, isBootstrap);\n if (!result) {\n return;\n }\n ({ failed, output } = result);\n }\n resetReloadForError();\n renderRoot.child = output.node;\n this.#bootstrapFailed = false;\n\n cleanUpPreviousRender();\n\n if ((output.route && output.route.type !== \"routes\") || failed) {\n if (!failed) {\n // There is a window to set theme and mode by `lifeCycle.onBeforePageLoad`.\n rendererContext.dispatchBeforePageLoad();\n }\n applyTheme();\n applyMode();\n\n setUIVersion(currentApp?.uiVersion);\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n // See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md\n window.scrollTo(0, 0);\n\n if (!failed) {\n rendererContext.dispatchPageLoad();\n rendererContext.dispatchAnchorLoad();\n rendererContext.dispatchOnMount();\n rendererContext.initializeScrollIntoView();\n rendererContext.initializeMediaChange();\n rendererContext.initializeMessageDispatcher();\n\n for (const store of stores) {\n store.mountAsyncData();\n }\n\n finishPageView?.({\n status: \"ok\",\n path: output.path,\n pageTitle: document.title,\n });\n } else {\n finishPageView?.({ status: \"failed\" });\n }\n devtoolsHookEmit(\"rendered\");\n\n return;\n }\n } else if (\n !window.NO_AUTH_GUARD &&\n hooks?.auth &&\n !hooks.auth.isLoggedIn()\n ) {\n // Todo(steve): refine after api-gateway supports fetching storyboards before logged in.\n // Redirect to login if no storyboard is matched.\n redirectToLogin();\n return;\n } else {\n cleanUpPreviousRender();\n }\n\n applyTheme();\n applyMode();\n\n const node = await ErrorNode(\n new PageError(\n blocked\n ? \"page blocked\"\n : currentApp\n ? \"page not found\"\n : \"app not found\"\n ),\n renderRoot,\n true\n );\n renderRoot.child = node;\n\n mountTree(renderRoot);\n\n // Scroll to top after each rendering.\n window.scrollTo(0, 0);\n finishPageView?.({ status: blocked ? \"blocked\" : \"not-found\" });\n devtoolsHookEmit(\"rendered\");\n }\n}\n\nfunction mergeMenuConfs(menuConfs: StaticMenuConf[]) {\n const navConfig = { breadcrumb: [] as BreadcrumbItemConf[] };\n for (const menuConf of menuConfs) {\n const { breadcrumb } = menuConf;\n if (breadcrumb) {\n if (breadcrumb.overwrite) {\n navConfig.breadcrumb = breadcrumb.items;\n } else {\n navConfig.breadcrumb.push(...breadcrumb.items);\n }\n }\n }\n return navConfig;\n}\n"],"mappings":";;;;;AAAA,SAAiBA,iBAAiB,QAAQ,SAAS;AAOnD,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SACEC,uBAAuB,EACvBC,qBAAqB,QAChB,iBAAiB;AACxB,SAASC,QAAQ,QAAQ,QAAQ;AACjC,SAAyCC,UAAU,QAAQ,eAAe;AAC1E,SAEEC,aAAa,EACbC,eAAe,EACfC,YAAY,QACP,eAAe;AACtB,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,SAAS,EAAEC,WAAW,QAAQ,YAAY;AACnD,SAASC,YAAY,EAAEC,eAAe,QAAQ,sBAAsB;AACpE,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SA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jB;EACF,CAAC,MAAM;IACLU,qBAAqB,CAAC,CAAC;EACzB;EAEApL,UAAU,CAAC,CAAC;EACZD,SAAS,CAAC,CAAC;EAEX,MAAM0N,IAAI,GAAG,MAAMjM,SAAS,CAC1B,IAAIC,SAAS,CACXsH,OAAO,GACH,cAAc,GACd3E,UAAU,GACR,gBAAgB,GAChB,eACR,CAAC,EACD2G,UAAU,EACV,IACF,CAAC;EACDA,UAAU,CAACkE,KAAK,GAAGxB,IAAI;EAEvBhO,SAAS,CAACsL,UAAU,CAAC;;EAErB;EACA3H,MAAM,CAACsM,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;EACrBzH,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAG;IAAEuC,MAAM,EAAEzB,OAAO,GAAG,SAAS,GAAG;EAAY,CAAC,CAAC;EAC/D5H,gBAAgB,CAAC,UAAU,CAAC;AAC9B;AAGF,SAAS+L,cAAcA,CAACH,SAA2B,EAAE;EACnD,MAAMuD,SAAS,GAAG;IAAEC,UAAU,EAAE;EAA2B,CAAC;EAC5D,KAAK,MAAMC,QAAQ,IAAIzD,SAAS,EAAE;IAChC,MAAM;MAAEwD;IAAW,CAAC,GAAGC,QAAQ;IAC/B,IAAID,UAAU,EAAE;MACd,IAAIA,UAAU,CAACE,SAAS,EAAE;QACxBH,SAAS,CAACC,UAAU,GAAGA,UAAU,CAACG,KAAK;MACzC,CAAC,MAAM;QACLJ,SAAS,CAACC,UAAU,CAACI,IAAI,CAAC,GAAGJ,UAAU,CAACG,KAAK,CAAC;MAChD;IACF;EACF;EACA,OAAOJ,SAAS;AAClB","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-core/runtime",
3
- "version": "1.72.2",
3
+ "version": "1.72.3",
4
4
  "homepage": "https://github.com/easyops-cn/next-core/tree/v3/packages/runtime",
5
5
  "license": "GPL-3.0",
6
6
  "repository": {
@@ -67,5 +67,5 @@
67
67
  "@next-core/build-next-libs": "^1.0.25",
68
68
  "@next-core/test-next": "^2.0.1"
69
69
  },
70
- "gitHead": "8b56a7ae267ef34303a936bd380cec6568206854"
70
+ "gitHead": "9943d00dfa9228c45a10362013cfc10103f771a3"
71
71
  }