@next-core/runtime 1.58.3 → 1.58.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internal/Router.js +6 -0
- package/dist/cjs/internal/Router.js.map +1 -1
- package/dist/cjs/isNetworkError.js +12 -0
- package/dist/cjs/isNetworkError.js.map +1 -0
- package/dist/cjs/shouldReloadForError.js +26 -0
- package/dist/cjs/shouldReloadForError.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/Router.js +6 -0
- package/dist/esm/internal/Router.js.map +1 -1
- package/dist/esm/isNetworkError.js +6 -0
- package/dist/esm/isNetworkError.js.map +1 -0
- package/dist/esm/shouldReloadForError.js +19 -0
- package/dist/esm/shouldReloadForError.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/isNetworkError.d.ts +1 -0
- package/dist/types/shouldReloadForError.d.ts +2 -0
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -296,4 +296,28 @@ Object.keys(_ModalStack).forEach(function (key) {
|
|
|
296
296
|
}
|
|
297
297
|
});
|
|
298
298
|
});
|
|
299
|
+
var _isNetworkError = require("./isNetworkError.js");
|
|
300
|
+
Object.keys(_isNetworkError).forEach(function (key) {
|
|
301
|
+
if (key === "default" || key === "__esModule") return;
|
|
302
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
303
|
+
if (key in exports && exports[key] === _isNetworkError[key]) return;
|
|
304
|
+
Object.defineProperty(exports, key, {
|
|
305
|
+
enumerable: true,
|
|
306
|
+
get: function () {
|
|
307
|
+
return _isNetworkError[key];
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
var _shouldReloadForError = require("./shouldReloadForError.js");
|
|
312
|
+
Object.keys(_shouldReloadForError).forEach(function (key) {
|
|
313
|
+
if (key === "default" || key === "__esModule") return;
|
|
314
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
315
|
+
if (key in exports && exports[key] === _shouldReloadForError[key]) return;
|
|
316
|
+
Object.defineProperty(exports, key, {
|
|
317
|
+
enumerable: true,
|
|
318
|
+
get: function () {
|
|
319
|
+
return _shouldReloadForError[key];
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
});
|
|
299
323
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_auth","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_CustomEditors","_CustomProcessors","_CustomTemplates","_fetchByProvider","_getBasePath","_getPageInfo","_handleHttpError","_history","_createRoot","_getRealValue","_Runtime","__secret_internals","_interopRequireWildcard","_test_only","_themeAndMode","_checkIf","_WidgetFunctions","_WidgetI18n","_StoryboardFunctionRegistry","_matchPath","_Notification","_Dialog","_getV2RuntimeFromDll","_setUIVersion","_ModalStack"],"sources":["../../src/index.ts"],"sourcesContent":["export * from \"./auth.js\";\nexport * from \"./CustomEditors.js\";\nexport * from \"./CustomProcessors.js\";\nexport * from \"./CustomTemplates.js\";\nexport * from \"./fetchByProvider.js\";\nexport * from \"./getBasePath.js\";\nexport * from \"./getPageInfo.js\";\nexport * from \"./handleHttpError.js\";\nexport * from \"./history.js\";\nexport * from \"./createRoot.js\";\nexport * from \"./getRealValue.js\";\nexport {\n createRuntime,\n getRuntime,\n type RuntimeOptions,\n type RuntimeHooks,\n type RuntimeHooksMenuHelpers,\n type ImagesFactory,\n type PageViewInfo,\n} from \"./internal/Runtime.js\";\nimport * as __secret_internals from \"./internal/secret_internals.js\";\nexport { __secret_internals };\nexport { __test_only } from \"./internal/test_only.js\";\nexport {\n getCssPropertyValue,\n getCurrentTheme,\n getCurrentMode,\n batchSetAppsLocalTheme,\n applyTheme,\n} from \"./themeAndMode.js\";\nexport {\n checkIfOfComputed,\n checkIfByTransform,\n} from \"./internal/compute/checkIf.js\";\nexport { registerWidgetFunctions } from \"./internal/compute/WidgetFunctions.js\";\nexport { registerWidgetI18n } from \"./internal/compute/WidgetI18n.js\";\nexport { StoryboardFunctionRegistryFactory } from \"./StoryboardFunctionRegistry.js\";\nexport { matchPath, type MatchOptions } from \"./internal/matchPath.js\";\nexport { Notification, type NotificationOptions } from \"./Notification.js\";\nexport { Dialog, type DialogOptions } from \"./Dialog.js\";\nexport * from \"./getV2RuntimeFromDll.js\";\nexport { setUIVersion } from \"./setUIVersion.js\";\nexport * from \"./ModalStack.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,cAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,cAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GA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,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAA+B,oBAAA,CAAA/B,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAuB,oBAAA,CAAA/B,GAAA;IAAA;EAAA;AAAA;AACA,IAAAgC,aAAA,GAAApC,OAAA;AACA,IAAAqC,WAAA,GAAArC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAmC,WAAA,EAAAlC,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAiC,WAAA,CAAAjC,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAyB,WAAA,CAAAjC,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_auth","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_CustomEditors","_CustomProcessors","_CustomTemplates","_fetchByProvider","_getBasePath","_getPageInfo","_handleHttpError","_history","_createRoot","_getRealValue","_Runtime","__secret_internals","_interopRequireWildcard","_test_only","_themeAndMode","_checkIf","_WidgetFunctions","_WidgetI18n","_StoryboardFunctionRegistry","_matchPath","_Notification","_Dialog","_getV2RuntimeFromDll","_setUIVersion","_ModalStack","_isNetworkError","_shouldReloadForError"],"sources":["../../src/index.ts"],"sourcesContent":["export * from \"./auth.js\";\nexport * from \"./CustomEditors.js\";\nexport * from \"./CustomProcessors.js\";\nexport * from \"./CustomTemplates.js\";\nexport * from \"./fetchByProvider.js\";\nexport * from \"./getBasePath.js\";\nexport * from \"./getPageInfo.js\";\nexport * from \"./handleHttpError.js\";\nexport * from \"./history.js\";\nexport * from \"./createRoot.js\";\nexport * from \"./getRealValue.js\";\nexport {\n createRuntime,\n getRuntime,\n type RuntimeOptions,\n type RuntimeHooks,\n type RuntimeHooksMenuHelpers,\n type ImagesFactory,\n type PageViewInfo,\n} from \"./internal/Runtime.js\";\nimport * as __secret_internals from \"./internal/secret_internals.js\";\nexport { __secret_internals };\nexport { __test_only } from \"./internal/test_only.js\";\nexport {\n getCssPropertyValue,\n getCurrentTheme,\n getCurrentMode,\n batchSetAppsLocalTheme,\n applyTheme,\n} from \"./themeAndMode.js\";\nexport {\n checkIfOfComputed,\n checkIfByTransform,\n} from \"./internal/compute/checkIf.js\";\nexport { registerWidgetFunctions } from \"./internal/compute/WidgetFunctions.js\";\nexport { registerWidgetI18n } from \"./internal/compute/WidgetI18n.js\";\nexport { StoryboardFunctionRegistryFactory } from \"./StoryboardFunctionRegistry.js\";\nexport { matchPath, type MatchOptions } from \"./internal/matchPath.js\";\nexport { Notification, type NotificationOptions } from \"./Notification.js\";\nexport { Dialog, type DialogOptions } from \"./Dialog.js\";\nexport * from \"./getV2RuntimeFromDll.js\";\nexport { setUIVersion } from \"./setUIVersion.js\";\nexport * from \"./ModalStack.js\";\nexport * from \"./isNetworkError.js\";\nexport * from \"./shouldReloadForError.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,C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AA;IAAA;EAAA;AAAA;AACA,IAAAkC,eAAA,GAAAtC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAoC,eAAA,EAAAnC,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAkC,eAAA,CAAAlC,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAA0B,eAAA,CAAAlC,GAAA;IAAA;EAAA;AAAA;AACA,IAAAmC,qBAAA,GAAAvC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAqC,qBAAA,EAAApC,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAmC,qBAAA,CAAAnC,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAA2B,qBAAA,CAAAnC,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -39,6 +39,7 @@ var _setAppVariable = require("../setAppVariable.js");
|
|
|
39
39
|
var _setWatermark = require("../setWatermark.js");
|
|
40
40
|
var _routeMatchedMap = require("./routeMatchedMap.js");
|
|
41
41
|
var _ErrorNode = require("./ErrorNode.js");
|
|
42
|
+
var _shouldReloadForError = require("../shouldReloadForError.js");
|
|
42
43
|
var _storyboards = /*#__PURE__*/new WeakMap();
|
|
43
44
|
var _rendering = /*#__PURE__*/new WeakMap();
|
|
44
45
|
var _nextRender = /*#__PURE__*/new WeakMap();
|
|
@@ -360,6 +361,10 @@ async function _render(location, isBootstrap) {
|
|
|
360
361
|
if (isCurrentBootstrap) {
|
|
361
362
|
throw error;
|
|
362
363
|
}
|
|
364
|
+
if (!isReCatch && (0, _shouldReloadForError.shouldReloadForError)(error)) {
|
|
365
|
+
window.location.reload();
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
363
368
|
return {
|
|
364
369
|
failed: true,
|
|
365
370
|
output: {
|
|
@@ -425,6 +430,7 @@ async function _render(location, isBootstrap) {
|
|
|
425
430
|
output
|
|
426
431
|
} = result);
|
|
427
432
|
}
|
|
433
|
+
(0, _shouldReloadForError.resetReloadForError)();
|
|
428
434
|
renderRoot.child = output.node;
|
|
429
435
|
(0, _classPrivateFieldSet2.default)(_bootstrapFailed, this, false);
|
|
430
436
|
cleanUpPreviousRender();
|
|
@@ -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","_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","renderId","uniqueId","resetAllComputedMarks","clearResolveCache","hooks","flowApi","clearCollectWidgetContract","finishPageView","pageView","create","app","currentAppId","id","BOOTSTRAP_UNION_FILE","setAppVariable","appId","version","currentVersion","fulfilStoryboard","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","item","dispatchOnUnmount","dispose","clear","messageDispatcher","reset","dispatchEvent","CustomEvent","setTheme","getLocalAppsTheme","theme","setMode","_hooks$checkInstalled","_hooks$auth","_hooks$checkPermissio","_storyboard$meta","_hooks$flowApi2","_storyboard$meta2","checkInstalledApps","preCheckInstalledApps","_internalApiGetAppInBootstrapData","routeHelper","bailout","output","unauthenticated","redirect","path","mergeMenus","menuRequests","menuConfs","Promise","all","mergeMenuConfs","returnNode","isCurrentBootstrap","isReCatch","isUnauthenticatedError","NO_AUTH_GUARD","HttpAbortError","noAuthGuardLoginPath","getMiscSettings","failed","node","ErrorNode","blockingList","rendererContext","RendererContext","runtimeContext","query","URLSearchParams","sys","auth","getAuth","getPageInfo","settings","brand","getBrandSettings","ctxStore","DataStore","pendingPermissionsPreCheck","checkPermissions","preCheckPermissions","tplStateStoreMap","Map","formStateStoreMap","registerCustomTemplates","registerStoryboardFunctions","meta","functions","collectContract","contracts","stores","clearMatchedRoutes","rootMenuRequestNode","renderRoutes","insertPreviewRoutes","routes","getDataStores","postAsyncRender","child","menuRequestNode","setInitialMenuRequestNode","getMenuRequests","result","route","type","dispatchBeforePageLoad","applyTheme","applyMode","setUIVersion","uiVersion","mountTree","scrollTo","dispatchPageLoad","dispatchAnchorLoad","dispatchOnMount","initializeScrollIntoView","initializeMediaChange","initializeMessageDispatcher","store","mountAsyncData","pageTitle","title","isLoggedIn","PageNotFoundError","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} 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, PageNotFoundError } from \"./ErrorNode.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?: {\n breadcrumb?: BreadcrumbItemConf[];\n };\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 {\n currentApp: this.#currentApp,\n previousApp: this.#previousApp,\n };\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({\n location,\n prevLocation,\n action,\n }).catch(handleHttpError);\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 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?.({\n status: \"redirected\",\n });\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\", {\n detail: {\n previousApp,\n currentApp,\n },\n })\n );\n }\n };\n\n setTheme(\n (currentApp &&\n (getLocalAppsTheme()[currentApp.id] || currentApp.theme)) ||\n \"light\"\n );\n setMode(\"default\");\n\n if (currentApp) {\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 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: {\n brand: getRuntime().getBrandSettings(),\n },\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 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 PageNotFoundError(currentApp ? \"page not found\" : \"app not found\"),\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: \"not-found\" });\n devtoolsHookEmit(\"rendered\");\n }\n}\n\nfunction mergeMenuConfs(menuConfs: StaticMenuConf[]) {\n const navConfig = {\n breadcrumb: [] as BreadcrumbItemConf[],\n };\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;AAOA,IAAAa,QAAA,GAA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,IAAI,GAAG,MAAM,IAAAC,oBAAS,EAC1B,IAAI6D,4BAAiB,CAACpN,UAAU,GAAG,gBAAgB,GAAG,eAAe,CAAC,EACtEmG,UAAU,EACV,IACF,CAAC;EACDA,UAAU,CAACwF,KAAK,GAAGrC,IAAI;EAEvB,IAAAiD,gBAAS,EAACpG,UAAU,CAAC;;EAErB;EACAnH,MAAM,CAACwN,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;EACrBlI,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAG;IAAEqB,MAAM,EAAE;EAAY,CAAC,CAAC;EACzC,IAAAnC,0BAAgB,EAAC,UAAU,CAAC;AAC9B;AAGF,SAASoF,cAAcA,CAACH,SAA2B,EAAE;EACnD,MAAM4E,SAAS,GAAG;IAChBC,UAAU,EAAE;EACd,CAAC;EACD,KAAK,MAAMC,QAAQ,IAAI9E,SAAS,EAAE;IAChC,MAAM;MAAE6E;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","_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","renderId","uniqueId","resetAllComputedMarks","clearResolveCache","hooks","flowApi","clearCollectWidgetContract","finishPageView","pageView","create","app","currentAppId","id","BOOTSTRAP_UNION_FILE","setAppVariable","appId","version","currentVersion","fulfilStoryboard","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","item","dispatchOnUnmount","dispose","clear","messageDispatcher","reset","dispatchEvent","CustomEvent","setTheme","getLocalAppsTheme","theme","setMode","_hooks$checkInstalled","_hooks$auth","_hooks$checkPermissio","_storyboard$meta","_hooks$flowApi2","_storyboard$meta2","checkInstalledApps","preCheckInstalledApps","_internalApiGetAppInBootstrapData","routeHelper","bailout","output","unauthenticated","redirect","path","mergeMenus","menuRequests","menuConfs","Promise","all","mergeMenuConfs","returnNode","isCurrentBootstrap","isReCatch","isUnauthenticatedError","NO_AUTH_GUARD","HttpAbortError","noAuthGuardLoginPath","getMiscSettings","shouldReloadForError","failed","node","ErrorNode","blockingList","rendererContext","RendererContext","runtimeContext","query","URLSearchParams","sys","auth","getAuth","getPageInfo","settings","brand","getBrandSettings","ctxStore","DataStore","pendingPermissionsPreCheck","checkPermissions","preCheckPermissions","tplStateStoreMap","Map","formStateStoreMap","registerCustomTemplates","registerStoryboardFunctions","meta","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","PageNotFoundError","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} 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, PageNotFoundError } from \"./ErrorNode.js\";\nimport {\n resetReloadForError,\n shouldReloadForError,\n} from \"../shouldReloadForError.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?: {\n breadcrumb?: BreadcrumbItemConf[];\n };\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 {\n currentApp: this.#currentApp,\n previousApp: this.#previousApp,\n };\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({\n location,\n prevLocation,\n action,\n }).catch(handleHttpError);\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 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?.({\n status: \"redirected\",\n });\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\", {\n detail: {\n previousApp,\n currentApp,\n },\n })\n );\n }\n };\n\n setTheme(\n (currentApp &&\n (getLocalAppsTheme()[currentApp.id] || currentApp.theme)) ||\n \"light\"\n );\n setMode(\"default\");\n\n if (currentApp) {\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: {\n brand: getRuntime().getBrandSettings(),\n },\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 PageNotFoundError(currentApp ? \"page not found\" : \"app not found\"),\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: \"not-found\" });\n devtoolsHookEmit(\"rendered\");\n }\n}\n\nfunction mergeMenuConfs(menuConfs: StaticMenuConf[]) {\n const navConfig = {\n breadcrumb: [] as BreadcrumbItemConf[],\n };\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,G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;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":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isNetworkError = isNetworkError;
|
|
7
|
+
var _http = require("@next-core/http");
|
|
8
|
+
var _loader = require("@next-core/loader");
|
|
9
|
+
function isNetworkError(error) {
|
|
10
|
+
return !!error && (error instanceof _loader.BrickLoadError || error instanceof _http.HttpFetchError || error instanceof Error && error.name === "ChunkLoadError" || error instanceof Event && error.type === "error" && error.target instanceof HTMLScriptElement);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=isNetworkError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isNetworkError.js","names":["_http","require","_loader","isNetworkError","error","BrickLoadError","HttpFetchError","Error","name","Event","type","target","HTMLScriptElement"],"sources":["../../src/isNetworkError.ts"],"sourcesContent":["import { HttpFetchError } from \"@next-core/http\";\nimport { BrickLoadError } from \"@next-core/loader\";\n\nexport function isNetworkError(error: unknown): boolean {\n return (\n !!error &&\n (error instanceof BrickLoadError ||\n error instanceof HttpFetchError ||\n (error instanceof Error && error.name === \"ChunkLoadError\") ||\n (error instanceof Event &&\n error.type === \"error\" &&\n error.target instanceof HTMLScriptElement))\n );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEO,SAASE,cAAcA,CAACC,KAAc,EAAW;EACtD,OACE,CAAC,CAACA,KAAK,KACNA,KAAK,YAAYC,sBAAc,IAC9BD,KAAK,YAAYE,oBAAc,IAC9BF,KAAK,YAAYG,KAAK,IAAIH,KAAK,CAACI,IAAI,KAAK,gBAAiB,IAC1DJ,KAAK,YAAYK,KAAK,IACrBL,KAAK,CAACM,IAAI,KAAK,OAAO,IACtBN,KAAK,CAACO,MAAM,YAAYC,iBAAkB,CAAC;AAEnD","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.resetReloadForError = resetReloadForError;
|
|
7
|
+
exports.shouldReloadForError = shouldReloadForError;
|
|
8
|
+
var _isNetworkError = require("./isNetworkError.js");
|
|
9
|
+
const STORAGE_KEY = "reload-for-error-count";
|
|
10
|
+
const MAX_RELOAD_COUNT = 2;
|
|
11
|
+
function shouldReloadForError(error) {
|
|
12
|
+
if (/upchat/i.test(navigator.userAgent) && (0, _isNetworkError.isNetworkError)(error)) {
|
|
13
|
+
var _sessionStorage$getIt;
|
|
14
|
+
const count = +((_sessionStorage$getIt = sessionStorage.getItem(STORAGE_KEY)) !== null && _sessionStorage$getIt !== void 0 ? _sessionStorage$getIt : 0);
|
|
15
|
+
if (count < MAX_RELOAD_COUNT) {
|
|
16
|
+
sessionStorage.setItem(STORAGE_KEY, String(count + 1));
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
resetReloadForError();
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
function resetReloadForError() {
|
|
24
|
+
sessionStorage.removeItem(STORAGE_KEY);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=shouldReloadForError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shouldReloadForError.js","names":["_isNetworkError","require","STORAGE_KEY","MAX_RELOAD_COUNT","shouldReloadForError","error","test","navigator","userAgent","isNetworkError","_sessionStorage$getIt","count","sessionStorage","getItem","setItem","String","resetReloadForError","removeItem"],"sources":["../../src/shouldReloadForError.ts"],"sourcesContent":["import { isNetworkError } from \"./isNetworkError.js\";\n\nconst STORAGE_KEY = \"reload-for-error-count\";\nconst MAX_RELOAD_COUNT = 2;\n\nexport function shouldReloadForError(error: unknown): boolean {\n if (/upchat/i.test(navigator.userAgent) && isNetworkError(error)) {\n const count = +(sessionStorage.getItem(STORAGE_KEY) ?? 0);\n if (count < MAX_RELOAD_COUNT) {\n sessionStorage.setItem(STORAGE_KEY, String(count + 1));\n return true;\n }\n resetReloadForError();\n }\n return false;\n}\n\nexport function resetReloadForError() {\n sessionStorage.removeItem(STORAGE_KEY);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAEA,MAAMC,WAAW,GAAG,wBAAwB;AAC5C,MAAMC,gBAAgB,GAAG,CAAC;AAEnB,SAASC,oBAAoBA,CAACC,KAAc,EAAW;EAC5D,IAAI,SAAS,CAACC,IAAI,CAACC,SAAS,CAACC,SAAS,CAAC,IAAI,IAAAC,8BAAc,EAACJ,KAAK,CAAC,EAAE;IAAA,IAAAK,qBAAA;IAChE,MAAMC,KAAK,GAAG,GAAAD,qBAAA,GAAEE,cAAc,CAACC,OAAO,CAACX,WAAW,CAAC,cAAAQ,qBAAA,cAAAA,qBAAA,GAAI,CAAC,CAAC;IACzD,IAAIC,KAAK,GAAGR,gBAAgB,EAAE;MAC5BS,cAAc,CAACE,OAAO,CAACZ,WAAW,EAAEa,MAAM,CAACJ,KAAK,GAAG,CAAC,CAAC,CAAC;MACtD,OAAO,IAAI;IACb;IACAK,mBAAmB,CAAC,CAAC;EACvB;EACA,OAAO,KAAK;AACd;AAEO,SAASA,mBAAmBA,CAAA,EAAG;EACpCJ,cAAc,CAACK,UAAU,CAACf,WAAW,CAAC;AACxC","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
|
@@ -24,4 +24,6 @@ export { Dialog } from "./Dialog.js";
|
|
|
24
24
|
export * from "./getV2RuntimeFromDll.js";
|
|
25
25
|
export { setUIVersion } from "./setUIVersion.js";
|
|
26
26
|
export * from "./ModalStack.js";
|
|
27
|
+
export * from "./isNetworkError.js";
|
|
28
|
+
export * from "./shouldReloadForError.js";
|
|
27
29
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["createRuntime","getRuntime","__secret_internals","__test_only","getCssPropertyValue","getCurrentTheme","getCurrentMode","batchSetAppsLocalTheme","applyTheme","checkIfOfComputed","checkIfByTransform","registerWidgetFunctions","registerWidgetI18n","StoryboardFunctionRegistryFactory","matchPath","Notification","Dialog","setUIVersion"],"sources":["../../src/index.ts"],"sourcesContent":["export * from \"./auth.js\";\nexport * from \"./CustomEditors.js\";\nexport * from \"./CustomProcessors.js\";\nexport * from \"./CustomTemplates.js\";\nexport * from \"./fetchByProvider.js\";\nexport * from \"./getBasePath.js\";\nexport * from \"./getPageInfo.js\";\nexport * from \"./handleHttpError.js\";\nexport * from \"./history.js\";\nexport * from \"./createRoot.js\";\nexport * from \"./getRealValue.js\";\nexport {\n createRuntime,\n getRuntime,\n type RuntimeOptions,\n type RuntimeHooks,\n type RuntimeHooksMenuHelpers,\n type ImagesFactory,\n type PageViewInfo,\n} from \"./internal/Runtime.js\";\nimport * as __secret_internals from \"./internal/secret_internals.js\";\nexport { __secret_internals };\nexport { __test_only } from \"./internal/test_only.js\";\nexport {\n getCssPropertyValue,\n getCurrentTheme,\n getCurrentMode,\n batchSetAppsLocalTheme,\n applyTheme,\n} from \"./themeAndMode.js\";\nexport {\n checkIfOfComputed,\n checkIfByTransform,\n} from \"./internal/compute/checkIf.js\";\nexport { registerWidgetFunctions } from \"./internal/compute/WidgetFunctions.js\";\nexport { registerWidgetI18n } from \"./internal/compute/WidgetI18n.js\";\nexport { StoryboardFunctionRegistryFactory } from \"./StoryboardFunctionRegistry.js\";\nexport { matchPath, type MatchOptions } from \"./internal/matchPath.js\";\nexport { Notification, type NotificationOptions } from \"./Notification.js\";\nexport { Dialog, type DialogOptions } from \"./Dialog.js\";\nexport * from \"./getV2RuntimeFromDll.js\";\nexport { setUIVersion } from \"./setUIVersion.js\";\nexport * from \"./ModalStack.js\";\n"],"mappings":"AAAA,cAAc,WAAW;AACzB,cAAc,oBAAoB;AAClC,cAAc,uBAAuB;AACrC,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC,cAAc,sBAAsB;AACpC,cAAc,cAAc;AAC5B,cAAc,iBAAiB;AAC/B,cAAc,mBAAmB;AACjC,SACEA,aAAa,EACbC,UAAU,QAML,uBAAuB;AAC9B,OAAO,KAAKC,kBAAkB,MAAM,gCAAgC;AACpE,SAASA,kBAAkB;AAC3B,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SACEC,mBAAmB,EACnBC,eAAe,EACfC,cAAc,EACdC,sBAAsB,EACtBC,UAAU,QACL,mBAAmB;AAC1B,SACEC,iBAAiB,EACjBC,kBAAkB,QACb,+BAA+B;AACtC,SAASC,uBAAuB,QAAQ,uCAAuC;AAC/E,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,iCAAiC,QAAQ,iCAAiC;AACnF,SAASC,SAAS,QAA2B,yBAAyB;AACtE,SAASC,YAAY,QAAkC,mBAAmB;AAC1E,SAASC,MAAM,QAA4B,aAAa;AACxD,cAAc,0BAA0B;AACxC,SAASC,YAAY,QAAQ,mBAAmB;AAChD,cAAc,iBAAiB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["createRuntime","getRuntime","__secret_internals","__test_only","getCssPropertyValue","getCurrentTheme","getCurrentMode","batchSetAppsLocalTheme","applyTheme","checkIfOfComputed","checkIfByTransform","registerWidgetFunctions","registerWidgetI18n","StoryboardFunctionRegistryFactory","matchPath","Notification","Dialog","setUIVersion"],"sources":["../../src/index.ts"],"sourcesContent":["export * from \"./auth.js\";\nexport * from \"./CustomEditors.js\";\nexport * from \"./CustomProcessors.js\";\nexport * from \"./CustomTemplates.js\";\nexport * from \"./fetchByProvider.js\";\nexport * from \"./getBasePath.js\";\nexport * from \"./getPageInfo.js\";\nexport * from \"./handleHttpError.js\";\nexport * from \"./history.js\";\nexport * from \"./createRoot.js\";\nexport * from \"./getRealValue.js\";\nexport {\n createRuntime,\n getRuntime,\n type RuntimeOptions,\n type RuntimeHooks,\n type RuntimeHooksMenuHelpers,\n type ImagesFactory,\n type PageViewInfo,\n} from \"./internal/Runtime.js\";\nimport * as __secret_internals from \"./internal/secret_internals.js\";\nexport { __secret_internals };\nexport { __test_only } from \"./internal/test_only.js\";\nexport {\n getCssPropertyValue,\n getCurrentTheme,\n getCurrentMode,\n batchSetAppsLocalTheme,\n applyTheme,\n} from \"./themeAndMode.js\";\nexport {\n checkIfOfComputed,\n checkIfByTransform,\n} from \"./internal/compute/checkIf.js\";\nexport { registerWidgetFunctions } from \"./internal/compute/WidgetFunctions.js\";\nexport { registerWidgetI18n } from \"./internal/compute/WidgetI18n.js\";\nexport { StoryboardFunctionRegistryFactory } from \"./StoryboardFunctionRegistry.js\";\nexport { matchPath, type MatchOptions } from \"./internal/matchPath.js\";\nexport { Notification, type NotificationOptions } from \"./Notification.js\";\nexport { Dialog, type DialogOptions } from \"./Dialog.js\";\nexport * from \"./getV2RuntimeFromDll.js\";\nexport { setUIVersion } from \"./setUIVersion.js\";\nexport * from \"./ModalStack.js\";\nexport * from \"./isNetworkError.js\";\nexport * from \"./shouldReloadForError.js\";\n"],"mappings":"AAAA,cAAc,WAAW;AACzB,cAAc,oBAAoB;AAClC,cAAc,uBAAuB;AACrC,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC,cAAc,sBAAsB;AACpC,cAAc,cAAc;AAC5B,cAAc,iBAAiB;AAC/B,cAAc,mBAAmB;AACjC,SACEA,aAAa,EACbC,UAAU,QAML,uBAAuB;AAC9B,OAAO,KAAKC,kBAAkB,MAAM,gCAAgC;AACpE,SAASA,kBAAkB;AAC3B,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SACEC,mBAAmB,EACnBC,eAAe,EACfC,cAAc,EACdC,sBAAsB,EACtBC,UAAU,QACL,mBAAmB;AAC1B,SACEC,iBAAiB,EACjBC,kBAAkB,QACb,+BAA+B;AACtC,SAASC,uBAAuB,QAAQ,uCAAuC;AAC/E,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,iCAAiC,QAAQ,iCAAiC;AACnF,SAASC,SAAS,QAA2B,yBAAyB;AACtE,SAASC,YAAY,QAAkC,mBAAmB;AAC1E,SAASC,MAAM,QAA4B,aAAa;AACxD,cAAc,0BAA0B;AACxC,SAASC,YAAY,QAAQ,mBAAmB;AAChD,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,2BAA2B","ignoreList":[]}
|
|
@@ -32,6 +32,7 @@ import { setAppVariable } from "../setAppVariable.js";
|
|
|
32
32
|
import { setWatermark } from "../setWatermark.js";
|
|
33
33
|
import { clearMatchedRoutes } from "./routeMatchedMap.js";
|
|
34
34
|
import { ErrorNode, PageNotFoundError } from "./ErrorNode.js";
|
|
35
|
+
import { resetReloadForError, shouldReloadForError } from "../shouldReloadForError.js";
|
|
35
36
|
var _storyboards = /*#__PURE__*/new WeakMap();
|
|
36
37
|
var _rendering = /*#__PURE__*/new WeakMap();
|
|
37
38
|
var _nextRender = /*#__PURE__*/new WeakMap();
|
|
@@ -353,6 +354,10 @@ async function _render(location, isBootstrap) {
|
|
|
353
354
|
if (isCurrentBootstrap) {
|
|
354
355
|
throw error;
|
|
355
356
|
}
|
|
357
|
+
if (!isReCatch && shouldReloadForError(error)) {
|
|
358
|
+
window.location.reload();
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
356
361
|
return {
|
|
357
362
|
failed: true,
|
|
358
363
|
output: {
|
|
@@ -418,6 +423,7 @@ async function _render(location, isBootstrap) {
|
|
|
418
423
|
output
|
|
419
424
|
} = result);
|
|
420
425
|
}
|
|
426
|
+
resetReloadForError();
|
|
421
427
|
renderRoot.child = output.node;
|
|
422
428
|
_classPrivateFieldSet(_bootstrapFailed, this, false);
|
|
423
429
|
cleanUpPreviousRender();
|
|
@@ -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","_internalApiGetAppInBootstrapData","getRuntime","hooks","getPageInfo","resetAllComputedMarks","handleHttpError","isUnauthenticatedError","abortPendingRequest","initAbortController","setLoginStateCookie","registerCustomTemplates","fulfilStoryboard","RenderTag","insertPreviewRoutes","devtoolsHookEmit","setUIVersion","setAppVariable","setWatermark","clearMatchedRoutes","ErrorNode","PageNotFoundError","_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","renderId","flowApi","clearCollectWidgetContract","finishPageView","pageView","create","app","currentAppId","id","BOOTSTRAP_UNION_FILE","appId","version","currentVersion","appChanged","flags","getFeatureFlags","prevRendererContext","redirectTo","status","add","redirectToLogin","main","document","querySelector","portal","renderRoot","tag","ROOT","container","createPortal","cleanUpPreviousRender","_hooks$messageDispatc","item","dispatchOnUnmount","dispose","clear","messageDispatcher","reset","dispatchEvent","CustomEvent","theme","_hooks$checkInstalled","_hooks$auth","_hooks$checkPermissio","_storyboard$meta","_hooks$flowApi2","_storyboard$meta2","checkInstalledApps","preCheckInstalledApps","routeHelper","bailout","output","unauthenticated","redirect","path","mergeMenus","menuRequests","menuConfs","Promise","all","mergeMenuConfs","returnNode","isCurrentBootstrap","isReCatch","NO_AUTH_GUARD","noAuthGuardLoginPath","getMiscSettings","failed","node","blockingList","rendererContext","runtimeContext","query","URLSearchParams","sys","auth","getAuth","settings","brand","getBrandSettings","ctxStore","pendingPermissionsPreCheck","checkPermissions","preCheckPermissions","tplStateStoreMap","Map","formStateStoreMap","meta","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} 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, PageNotFoundError } from \"./ErrorNode.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?: {\n breadcrumb?: BreadcrumbItemConf[];\n };\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 {\n currentApp: this.#currentApp,\n previousApp: this.#previousApp,\n };\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({\n location,\n prevLocation,\n action,\n }).catch(handleHttpError);\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 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?.({\n status: \"redirected\",\n });\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\", {\n detail: {\n previousApp,\n currentApp,\n },\n })\n );\n }\n };\n\n setTheme(\n (currentApp &&\n (getLocalAppsTheme()[currentApp.id] || currentApp.theme)) ||\n \"light\"\n );\n setMode(\"default\");\n\n if (currentApp) {\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 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: {\n brand: getRuntime().getBrandSettings(),\n },\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 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 PageNotFoundError(currentApp ? \"page not found\" : \"app not found\"),\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: \"not-found\" });\n devtoolsHookEmit(\"rendered\");\n }\n}\n\nfunction mergeMenuConfs(menuConfs: StaticMenuConf[]) {\n const navConfig = {\n breadcrumb: [] as BreadcrumbItemConf[],\n };\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,SAASC,eAAe,QAAqB,sBAAsB;AACnE,SACEC,SAAS,EACTC,UAAU,EACVC,iBAAiB,EACjBC,OAAO,EACPC,QAAQ,QACH,oBAAoB;AAC3B,SACEC,iCAAiC,EACjCC,UAAU,EACVC,KAAK,QACA,cAAc;AACrB,SAASC,WAAW,QAAQ,mBAAmB;AAM/C,SAASC,qBAAqB,QAAQ,6BAA6B;AACnE,SAASC,eAAe,EAAEC,sBAAsB,QAAQ,uBAAuB;AAC/E,SAASC,mBAAmB,EAAEC,mBAAmB,QAAQ,sBAAsB;AAC/E,SAASC,mBAAmB,QAAQ,2BAA2B;AAC/D,SAASC,uBAAuB,QAAQ,8BAA8B;AACtE,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,SAAS,QAAQ,YAAY;AACtC,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,gBAAgB,QAAQ,eAAe;AAChD,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,cAAc,QAAQ,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E2D;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","_internalApiGetAppInBootstrapData","getRuntime","hooks","getPageInfo","resetAllComputedMarks","handleHttpError","isUnauthenticatedError","abortPendingRequest","initAbortController","setLoginStateCookie","registerCustomTemplates","fulfilStoryboard","RenderTag","insertPreviewRoutes","devtoolsHookEmit","setUIVersion","setAppVariable","setWatermark","clearMatchedRoutes","ErrorNode","PageNotFoundError","resetReloadForError","shouldReloadForError","_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","renderId","flowApi","clearCollectWidgetContract","finishPageView","pageView","create","app","currentAppId","id","BOOTSTRAP_UNION_FILE","appId","version","currentVersion","appChanged","flags","getFeatureFlags","prevRendererContext","redirectTo","status","add","redirectToLogin","main","document","querySelector","portal","renderRoot","tag","ROOT","container","createPortal","cleanUpPreviousRender","_hooks$messageDispatc","item","dispatchOnUnmount","dispose","clear","messageDispatcher","reset","dispatchEvent","CustomEvent","theme","_hooks$checkInstalled","_hooks$auth","_hooks$checkPermissio","_storyboard$meta","_hooks$flowApi2","_storyboard$meta2","checkInstalledApps","preCheckInstalledApps","routeHelper","bailout","output","unauthenticated","redirect","path","mergeMenus","menuRequests","menuConfs","Promise","all","mergeMenuConfs","returnNode","isCurrentBootstrap","isReCatch","NO_AUTH_GUARD","noAuthGuardLoginPath","getMiscSettings","failed","node","blockingList","rendererContext","runtimeContext","query","URLSearchParams","sys","auth","getAuth","settings","brand","getBrandSettings","ctxStore","pendingPermissionsPreCheck","checkPermissions","preCheckPermissions","tplStateStoreMap","Map","formStateStoreMap","meta","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} 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, PageNotFoundError } from \"./ErrorNode.js\";\nimport {\n resetReloadForError,\n shouldReloadForError,\n} from \"../shouldReloadForError.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?: {\n breadcrumb?: BreadcrumbItemConf[];\n };\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 {\n currentApp: this.#currentApp,\n previousApp: this.#previousApp,\n };\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({\n location,\n prevLocation,\n action,\n }).catch(handleHttpError);\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 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?.({\n status: \"redirected\",\n });\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\", {\n detail: {\n previousApp,\n currentApp,\n },\n })\n );\n }\n };\n\n setTheme(\n (currentApp &&\n (getLocalAppsTheme()[currentApp.id] || currentApp.theme)) ||\n \"light\"\n );\n setMode(\"default\");\n\n if (currentApp) {\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: {\n brand: getRuntime().getBrandSettings(),\n },\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 PageNotFoundError(currentApp ? \"page not found\" : \"app not found\"),\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: \"not-found\" });\n devtoolsHookEmit(\"rendered\");\n }\n}\n\nfunction mergeMenuConfs(menuConfs: StaticMenuConf[]) {\n const navConfig = {\n breadcrumb: [] as BreadcrumbItemConf[],\n };\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,SAASC,eAAe,QAAqB,sBAAsB;AACnE,SACEC,SAAS,EACTC,UAAU,EACVC,iBAAiB,EACjBC,OAAO,EACPC,QAAQ,QACH,oBAAoB;AAC3B,SACEC,iCAAiC,EACjCC,UAAU,EACVC,KAAK,QACA,cAAc;AACrB,SAASC,WAAW,QAAQ,mBAAmB;AAM/C,SAASC,qBAAqB,QAAQ,6BAA6B;AACnE,SAASC,eAAe,EAAEC,sBAAsB,QAAQ,uBAAuB;AAC/E,SAASC,mBAAmB,EAAEC,mBAAmB,QAAQ,sBAAsB;AAC/E,SAASC,mBAAmB,QAAQ,2BAA2B;AAC/D,SAASC,uBAAuB,QAAQ,8BAA8B;AACt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IAAI;EAEvBrM,SAAS,CAAC0J,UAAU,CAAC;;EAErB;EACAjG,MAAM,CAAC+K,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;EACrBpG,cAAc,aAAdA,cAAc,eAAdA,cAAc,CAAG;IAAEe,MAAM,EAAE;EAAY,CAAC,CAAC;EACzC1H,gBAAgB,CAAC,UAAU,CAAC;AAC9B;AAGF,SAASoK,cAAcA,CAACH,SAA2B,EAAE;EACnD,MAAM0D,SAAS,GAAG;IAChBC,UAAU,EAAE;EACd,CAAC;EACD,KAAK,MAAMC,QAAQ,IAAI5D,SAAS,EAAE;IAChC,MAAM;MAAE2D;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":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HttpFetchError } from "@next-core/http";
|
|
2
|
+
import { BrickLoadError } from "@next-core/loader";
|
|
3
|
+
export function isNetworkError(error) {
|
|
4
|
+
return !!error && (error instanceof BrickLoadError || error instanceof HttpFetchError || error instanceof Error && error.name === "ChunkLoadError" || error instanceof Event && error.type === "error" && error.target instanceof HTMLScriptElement);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=isNetworkError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isNetworkError.js","names":["HttpFetchError","BrickLoadError","isNetworkError","error","Error","name","Event","type","target","HTMLScriptElement"],"sources":["../../src/isNetworkError.ts"],"sourcesContent":["import { HttpFetchError } from \"@next-core/http\";\nimport { BrickLoadError } from \"@next-core/loader\";\n\nexport function isNetworkError(error: unknown): boolean {\n return (\n !!error &&\n (error instanceof BrickLoadError ||\n error instanceof HttpFetchError ||\n (error instanceof Error && error.name === \"ChunkLoadError\") ||\n (error instanceof Event &&\n error.type === \"error\" &&\n error.target instanceof HTMLScriptElement))\n );\n}\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,iBAAiB;AAChD,SAASC,cAAc,QAAQ,mBAAmB;AAElD,OAAO,SAASC,cAAcA,CAACC,KAAc,EAAW;EACtD,OACE,CAAC,CAACA,KAAK,KACNA,KAAK,YAAYF,cAAc,IAC9BE,KAAK,YAAYH,cAAc,IAC9BG,KAAK,YAAYC,KAAK,IAAID,KAAK,CAACE,IAAI,KAAK,gBAAiB,IAC1DF,KAAK,YAAYG,KAAK,IACrBH,KAAK,CAACI,IAAI,KAAK,OAAO,IACtBJ,KAAK,CAACK,MAAM,YAAYC,iBAAkB,CAAC;AAEnD","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isNetworkError } from "./isNetworkError.js";
|
|
2
|
+
const STORAGE_KEY = "reload-for-error-count";
|
|
3
|
+
const MAX_RELOAD_COUNT = 2;
|
|
4
|
+
export function shouldReloadForError(error) {
|
|
5
|
+
if (/upchat/i.test(navigator.userAgent) && isNetworkError(error)) {
|
|
6
|
+
var _sessionStorage$getIt;
|
|
7
|
+
const count = +((_sessionStorage$getIt = sessionStorage.getItem(STORAGE_KEY)) !== null && _sessionStorage$getIt !== void 0 ? _sessionStorage$getIt : 0);
|
|
8
|
+
if (count < MAX_RELOAD_COUNT) {
|
|
9
|
+
sessionStorage.setItem(STORAGE_KEY, String(count + 1));
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
resetReloadForError();
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
export function resetReloadForError() {
|
|
17
|
+
sessionStorage.removeItem(STORAGE_KEY);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=shouldReloadForError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shouldReloadForError.js","names":["isNetworkError","STORAGE_KEY","MAX_RELOAD_COUNT","shouldReloadForError","error","test","navigator","userAgent","_sessionStorage$getIt","count","sessionStorage","getItem","setItem","String","resetReloadForError","removeItem"],"sources":["../../src/shouldReloadForError.ts"],"sourcesContent":["import { isNetworkError } from \"./isNetworkError.js\";\n\nconst STORAGE_KEY = \"reload-for-error-count\";\nconst MAX_RELOAD_COUNT = 2;\n\nexport function shouldReloadForError(error: unknown): boolean {\n if (/upchat/i.test(navigator.userAgent) && isNetworkError(error)) {\n const count = +(sessionStorage.getItem(STORAGE_KEY) ?? 0);\n if (count < MAX_RELOAD_COUNT) {\n sessionStorage.setItem(STORAGE_KEY, String(count + 1));\n return true;\n }\n resetReloadForError();\n }\n return false;\n}\n\nexport function resetReloadForError() {\n sessionStorage.removeItem(STORAGE_KEY);\n}\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,qBAAqB;AAEpD,MAAMC,WAAW,GAAG,wBAAwB;AAC5C,MAAMC,gBAAgB,GAAG,CAAC;AAE1B,OAAO,SAASC,oBAAoBA,CAACC,KAAc,EAAW;EAC5D,IAAI,SAAS,CAACC,IAAI,CAACC,SAAS,CAACC,SAAS,CAAC,IAAIP,cAAc,CAACI,KAAK,CAAC,EAAE;IAAA,IAAAI,qBAAA;IAChE,MAAMC,KAAK,GAAG,GAAAD,qBAAA,GAAEE,cAAc,CAACC,OAAO,CAACV,WAAW,CAAC,cAAAO,qBAAA,cAAAA,qBAAA,GAAI,CAAC,CAAC;IACzD,IAAIC,KAAK,GAAGP,gBAAgB,EAAE;MAC5BQ,cAAc,CAACE,OAAO,CAACX,WAAW,EAAEY,MAAM,CAACJ,KAAK,GAAG,CAAC,CAAC,CAAC;MACtD,OAAO,IAAI;IACb;IACAK,mBAAmB,CAAC,CAAC;EACvB;EACA,OAAO,KAAK;AACd;AAEA,OAAO,SAASA,mBAAmBA,CAAA,EAAG;EACpCJ,cAAc,CAACK,UAAU,CAACd,WAAW,CAAC;AACxC","ignoreList":[]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -24,3 +24,5 @@ export { Dialog, type DialogOptions } from "./Dialog.js";
|
|
|
24
24
|
export * from "./getV2RuntimeFromDll.js";
|
|
25
25
|
export { setUIVersion } from "./setUIVersion.js";
|
|
26
26
|
export * from "./ModalStack.js";
|
|
27
|
+
export * from "./isNetworkError.js";
|
|
28
|
+
export * from "./shouldReloadForError.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isNetworkError(error: unknown): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/runtime",
|
|
3
|
-
"version": "1.58.
|
|
3
|
+
"version": "1.58.4",
|
|
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.21",
|
|
68
68
|
"@next-core/test-next": "^1.1.7"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "feb95796f5382da9f7a6b5b46a674ed3d646c01c"
|
|
71
71
|
}
|