akanjs 2.2.4-rc.4 → 2.2.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/base/base.test.ts +135 -0
- package/base/base.ts +1 -1
- package/base/baseEnv.test.ts +146 -0
- package/base/primitiveRegistry.test.ts +127 -0
- package/base/primitiveRegistry.ts +10 -6
- package/base/symbols.test.ts +29 -0
- package/base/types.ts +4 -1
- package/base/utils.test.ts +30 -0
- package/build.ts +318 -0
- package/capacitor.base.config.test.ts +83 -0
- package/capacitor.base.config.ts +1 -1
- package/client/capacitor.ts +1 -1
- package/client/client.auth-storage.test.ts +210 -0
- package/client/client.decorators.test.ts +74 -0
- package/client/client.device.test.ts +181 -0
- package/client/client.page.test.tsx +175 -0
- package/client/client.pure.test.ts +146 -0
- package/client/client.router.test.ts +290 -0
- package/client/cookie.ts +4 -2
- package/client/createFont.ts +2 -2
- package/client/csrTypes.ts +8 -2
- package/client/makePageProto.tsx +10 -4
- package/client/router.ts +8 -3
- package/client/translator.ts +12 -4
- package/common/Logger.test.ts +45 -0
- package/common/Logger.ts +4 -1
- package/common/formatAndValidation.test.ts +61 -0
- package/common/formatNumber.ts +5 -2
- package/common/hmrPhase.ts +1 -1
- package/common/httpClient.test.ts +91 -0
- package/common/isValidDate.ts +3 -0
- package/common/objectPath.test.ts +108 -0
- package/common/routeConvention.test.ts +132 -0
- package/common/runtimeConfig.test.ts +84 -0
- package/constant/constant.test.ts +374 -0
- package/constant/fieldInfo.ts +3 -3
- package/constant/purify.ts +2 -1
- package/constant/types.ts +4 -0
- package/constant/via.ts +12 -6
- package/dictionary/dictionary.test.ts +352 -0
- package/document/databaseRegistry.ts +8 -0
- package/document/document.test.ts +698 -0
- package/document/into.ts +1 -0
- package/fetch/client/fetchClient.ts +6 -1
- package/fetch/client/httpClient.ts +2 -1
- package/fetch/fetch.test.ts +838 -0
- package/fetch/fetchType/appliedReturn.type.ts +1 -0
- package/fetch/fetchType/endpointFetch.type.ts +3 -0
- package/fetch/fetchType/sliceFetch.type.ts +8 -0
- package/fetch/requestStorage.ts +10 -2
- package/package.json +24 -67
- package/server/akanApp.test.ts +130 -0
- package/server/akanApp.ts +5 -2
- package/server/akanLib.ts +1 -0
- package/server/akanServer.test.ts +157 -0
- package/server/akanServer.ts +4 -3
- package/server/artifact/builderRpc.ts +2 -2
- package/server/artifact/ipcTypes.ts +4 -0
- package/server/artifact/routeClientCache.test.ts +265 -0
- package/server/artifact/routeSeedIndex.test.ts +56 -0
- package/server/artifact/routesManifest.test.ts +64 -0
- package/server/decorators.ts +1 -1
- package/server/di/diLifecycle.contract.test.ts +168 -0
- package/server/di/diLifecycle.ts +6 -3
- package/server/hmr/clientScript.ts +20 -2
- package/server/hmr/devHmrController.ts +4 -0
- package/server/logging/rotatingLogWriter.test.ts +119 -0
- package/server/processMetrics.test.ts +24 -0
- package/server/processMetricsCollector.ts +1 -1
- package/server/proxy/webProxyRunner.test.ts +66 -0
- package/server/resolver/database.resolver.ts +2 -2
- package/server/resolver/resolver.contract.fixture.ts +1 -0
- package/server/resolver/resolver.contract.test.ts +594 -0
- package/server/resolver/signal.resolver.ts +10 -2
- package/server/robots.test.ts +16 -0
- package/server/routeTree.test.tsx +198 -0
- package/server/routing/apiRouter.test.ts +136 -0
- package/server/routing/apiRouter.ts +4 -2
- package/server/rscClient.tsx +7 -1
- package/server/rscWorkerHost.ts +33 -11
- package/server/sitemap.test.ts +61 -0
- package/server/ssrFromRscRenderer.tsx +35 -3
- package/server/systemPages.test.tsx +93 -0
- package/server/types/react-server-dom-webpack.d.ts +7 -1
- package/server/vendor/react-dom-client.ts +1 -1
- package/server/vendor/react-dom.ts +3 -2
- package/server/vendor/react-jsx-dev-runtime.ts +1 -1
- package/server/vendor/react-jsx-runtime.ts +1 -1
- package/server/vendor/react-refresh-runtime.ts +2 -2
- package/server/vendor/react-server-dom-webpack-client-browser.ts +1 -1
- package/server/vendor/react.ts +9 -2
- package/server/vendor/scheduler.ts +3 -2
- package/server/webRouter.test.ts +49 -0
- package/server/webRouter.ts +3 -2
- package/service/adapt.ts +5 -1
- package/service/predefinedAdaptor/cache.adaptor.ts +2 -1
- package/service/predefinedAdaptor/compress.adaptor.test.ts +184 -0
- package/service/predefinedAdaptor/database.adaptor.ts +20 -8
- package/service/predefinedAdaptor/solidCache.adaptor.test.ts +107 -0
- package/service/predefinedAdaptor/solidSqlite.test.ts +457 -0
- package/service/predefinedAdaptor/solidSqlite.ts +2 -1
- package/service/predefinedAdaptor/websocket.adaptor.ts +15 -3
- package/service/serve.ts +7 -3
- package/service/service.test.ts +732 -0
- package/signal/base.signal.ts +1 -0
- package/signal/endpointInfo.ts +7 -0
- package/signal/intercept.ts +2 -0
- package/signal/middleware.ts +2 -1
- package/signal/serverSignal.ts +15 -1
- package/signal/signal.test.ts +892 -0
- package/signal/signalContext.ts +1 -1
- package/signal/signalRegistry.ts +5 -0
- package/signal/sliceInfo.ts +3 -0
- package/signal/trace.ts +11 -0
- package/signal/types.ts +11 -2
- package/store/action.ts +5 -3
- package/store/stateBuilder.test.ts +168 -0
- package/store/stateBuilder.ts +2 -0
- package/store/stateInfo.ts +2 -1
- package/store/store.test.ts +427 -0
- package/store/types.ts +1 -1
- package/test/playwright.config.base.ts +28 -5
- package/test/playwright.pageAgent.ts +1 -1
- package/test/sampleOf.ts +1 -1
- package/test/testServer.ts +1 -1
- package/tsconfig.json +5 -0
- package/ui/BottomSheet.tsx +1 -1
- package/ui/Clipboard.tsx +1 -1
- package/ui/Constant/schemaDoc.test.ts +113 -0
- package/ui/CsrImage.tsx +14 -3
- package/ui/Data/ListContainer.tsx +1 -1
- package/ui/Data/Pagination.tsx +1 -1
- package/ui/Data/QueryMaker.tsx +339 -0
- package/ui/Data/index.ts +1 -0
- package/ui/DatePicker.tsx +95 -1
- package/ui/Dialog/Modal.tsx +1 -1
- package/ui/DraggableList.tsx +5 -5
- package/ui/Field.tsx +3 -2
- package/ui/Image.tsx +3 -2
- package/ui/InfiniteScroll.test.tsx +155 -0
- package/ui/InfiniteScroll.tsx +1 -0
- package/ui/Input.tsx +8 -1
- package/ui/Layout/BottomTab.tsx +2 -2
- package/ui/Link/SsrLink.tsx +2 -1
- package/ui/Load/Page.tsx +1 -1
- package/ui/Load/PageCSR.tsx +1 -0
- package/ui/Load/Units.tsx +2 -1
- package/ui/Load/View.tsx +2 -1
- package/ui/Menu.tsx +8 -5
- package/ui/Model/EditModal.tsx +5 -2
- package/ui/Popconfirm.tsx +4 -2
- package/ui/ScreenNavigator.tsx +3 -2
- package/ui/Signal/Message.tsx +3 -2
- package/ui/Signal/PubSub.tsx +2 -0
- package/ui/Signal/Response.tsx +1 -1
- package/ui/Signal/WebSocket.tsx +11 -2
- package/ui/System/Client.tsx +41 -7
- package/ui/System/Common.test.ts +37 -0
- package/ui/System/Gtag.tsx +5 -2
- package/ui/System/Messages.tsx +2 -2
- package/ui/System/Reconnect.tsx +6 -5
- package/ui/System/Root.tsx +1 -0
- package/ui/System/SSR.tsx +7 -1
- package/ui/ToggleSelect.tsx +8 -3
- package/ui/Unauthorized.tsx +1 -1
- package/webkit/bootCsr.test.tsx +153 -0
- package/webkit/bootCsr.tsx +6 -3
- package/webkit/lazy.tsx +8 -1
- package/webkit/native.test.tsx +341 -0
- package/webkit/useCamera.tsx +1 -0
- package/webkit/useCodepush.tsx +9 -4
- package/webkit/useContact.tsx +1 -0
- package/webkit/useCsrValues.ts +10 -6
- package/webkit/useDebounce.ts +2 -2
- package/webkit/usePurchase.tsx +9 -5
- package/webkit/usePushNoti.tsx +1 -0
- package/webkit/webkit.test.tsx +531 -0
- package/types/base/base.d.ts +0 -53
- package/types/base/baseEnv.d.ts +0 -68
- package/types/base/index.d.ts +0 -6
- package/types/base/primitiveRegistry.d.ts +0 -134
- package/types/base/symbols.d.ts +0 -11
- package/types/base/types.d.ts +0 -68
- package/types/base/utils.d.ts +0 -4
- package/types/base.d.ts +0 -1
- package/types/capacitor.base.config.d.ts +0 -3
- package/types/client/capacitor.d.ts +0 -233
- package/types/client/clientRuntime.d.ts +0 -63
- package/types/client/cookie.d.ts +0 -33
- package/types/client/createFont.d.ts +0 -6
- package/types/client/csrTypes.d.ts +0 -262
- package/types/client/decorators.d.ts +0 -7
- package/types/client/device.d.ts +0 -41
- package/types/client/fetch.d.ts +0 -1
- package/types/client/index.d.ts +0 -14
- package/types/client/locale.d.ts +0 -5
- package/types/client/makePageProto.d.ts +0 -17002
- package/types/client/router.d.ts +0 -66
- package/types/client/rscNavigation.d.ts +0 -19
- package/types/client/storage.d.ts +0 -5
- package/types/client/translator.d.ts +0 -18
- package/types/client/types.d.ts +0 -145
- package/types/client/useClient.d.ts +0 -1
- package/types/client.d.ts +0 -1
- package/types/common/Logger.d.ts +0 -41
- package/types/common/applyMixins.d.ts +0 -3
- package/types/common/capitalize.d.ts +0 -2
- package/types/common/deepObjectify.d.ts +0 -4
- package/types/common/fileUpload.d.ts +0 -28
- package/types/common/formatNumber.d.ts +0 -1
- package/types/common/formatPhone.d.ts +0 -2
- package/types/common/getAllPropertyDescriptors.d.ts +0 -5
- package/types/common/hmrPhase.d.ts +0 -6
- package/types/common/httpClient.d.ts +0 -20
- package/types/common/index.d.ts +0 -29
- package/types/common/isDayjs.d.ts +0 -2
- package/types/common/isEmail.d.ts +0 -2
- package/types/common/isPhoneNumber.d.ts +0 -2
- package/types/common/isQueryEqual.d.ts +0 -1
- package/types/common/isValidDate.d.ts +0 -2
- package/types/common/jwtDecode.d.ts +0 -2
- package/types/common/localeConfig.d.ts +0 -11
- package/types/common/lowerlize.d.ts +0 -2
- package/types/common/mergeVersion.d.ts +0 -10
- package/types/common/objectify.d.ts +0 -1
- package/types/common/pathGet.d.ts +0 -1
- package/types/common/pathSet.d.ts +0 -3
- package/types/common/randomPick.d.ts +0 -1
- package/types/common/randomPicks.d.ts +0 -1
- package/types/common/routeConvention.d.ts +0 -35
- package/types/common/sleep.d.ts +0 -2
- package/types/common/splitVersion.d.ts +0 -11
- package/types/common/subRoute.d.ts +0 -7
- package/types/common/types.d.ts +0 -14
- package/types/common.d.ts +0 -1
- package/types/constant/constantRegistry.d.ts +0 -89
- package/types/constant/crystalize.d.ts +0 -4
- package/types/constant/deserialize.d.ts +0 -7
- package/types/constant/fieldInfo.d.ts +0 -153
- package/types/constant/getDefault.d.ts +0 -3
- package/types/constant/immerify.d.ts +0 -2
- package/types/constant/index.d.ts +0 -10
- package/types/constant/purify.d.ts +0 -12
- package/types/constant/serialize.d.ts +0 -11
- package/types/constant/types.d.ts +0 -77
- package/types/constant/via.d.ts +0 -52
- package/types/constant.d.ts +0 -1
- package/types/dictionary/base.dictionary.d.ts +0 -1
- package/types/dictionary/dictInfo.d.ts +0 -206
- package/types/dictionary/dictionary.d.ts +0 -11
- package/types/dictionary/index.d.ts +0 -4
- package/types/dictionary/locale.d.ts +0 -128
- package/types/dictionary/trans.d.ts +0 -82
- package/types/dictionary.d.ts +0 -1
- package/types/document/by.d.ts +0 -20
- package/types/document/dataLoader.d.ts +0 -36
- package/types/document/database.d.ts +0 -96
- package/types/document/databaseRegistry.d.ts +0 -36
- package/types/document/documentQuery.d.ts +0 -105
- package/types/document/documentSchema.d.ts +0 -33
- package/types/document/filterMeta.d.ts +0 -84
- package/types/document/index.d.ts +0 -11
- package/types/document/into.d.ts +0 -65
- package/types/document/loaderInfo.d.ts +0 -35
- package/types/document/schema.d.ts +0 -5
- package/types/document/types.d.ts +0 -36
- package/types/document.d.ts +0 -1
- package/types/fetch/client/fetchClient.d.ts +0 -78
- package/types/fetch/client/httpClient.d.ts +0 -39
- package/types/fetch/client/index.d.ts +0 -3
- package/types/fetch/client/wsClient.d.ts +0 -37
- package/types/fetch/client.d.ts +0 -1
- package/types/fetch/fetchType/appliedReturn.type.d.ts +0 -67
- package/types/fetch/fetchType/buildFetch.type.d.ts +0 -11
- package/types/fetch/fetchType/clientSignal.type.d.ts +0 -16
- package/types/fetch/fetchType/endpointFetch.type.d.ts +0 -29
- package/types/fetch/fetchType/index.d.ts +0 -5
- package/types/fetch/fetchType/sliceFetch.type.d.ts +0 -76
- package/types/fetch/fetchType.d.ts +0 -1
- package/types/fetch/index.d.ts +0 -4
- package/types/fetch/requestStorage.d.ts +0 -29
- package/types/fetch/serializer/fetch.serializer.d.ts +0 -14
- package/types/fetch/serializer/index.d.ts +0 -1
- package/types/fetch/serializer.d.ts +0 -1
- package/types/fetch/types.d.ts +0 -19
- package/types/fetch.d.ts +0 -1
- package/types/index.d.ts +0 -213
- package/types/server/akanApp.d.ts +0 -17
- package/types/server/akanAppHeaders.d.ts +0 -1
- package/types/server/akanLib.d.ts +0 -33
- package/types/server/akanOption.d.ts +0 -15
- package/types/server/akanServer.d.ts +0 -47
- package/types/server/artifact/builderRpc.d.ts +0 -42
- package/types/server/artifact/index.d.ts +0 -6
- package/types/server/artifact/ipcTypes.d.ts +0 -73
- package/types/server/artifact/manifestTypes.d.ts +0 -16
- package/types/server/artifact/routeClientCache.d.ts +0 -45
- package/types/server/artifact/routeSeedIndexStore.d.ts +0 -43
- package/types/server/artifact/routesManifestStore.d.ts +0 -16
- package/types/server/artifact.d.ts +0 -1
- package/types/server/decorators.d.ts +0 -6
- package/types/server/di/diLifecycle.d.ts +0 -45
- package/types/server/di/index.d.ts +0 -4
- package/types/server/di/predefinedAdaptor.d.ts +0 -33
- package/types/server/di/resolveAdaptorHierarchy.d.ts +0 -21
- package/types/server/di/resolveHierarchy.d.ts +0 -11
- package/types/server/di/resolveServiceHierarchy.d.ts +0 -13
- package/types/server/di/utils.d.ts +0 -14
- package/types/server/di.d.ts +0 -1
- package/types/server/hmr/changeBatch.d.ts +0 -13
- package/types/server/hmr/clientScript.d.ts +0 -1
- package/types/server/hmr/devHmrController.d.ts +0 -24
- package/types/server/hmr/index.d.ts +0 -4
- package/types/server/hmr/wsHub.d.ts +0 -45
- package/types/server/hmr.d.ts +0 -1
- package/types/server/imageOptimizer.d.ts +0 -12
- package/types/server/imageOptimizerError.d.ts +0 -4
- package/types/server/index.d.ts +0 -14
- package/types/server/lifecycle/shutdownManager.d.ts +0 -13
- package/types/server/logging/rotatingLogWriter.d.ts +0 -20
- package/types/server/processMetricsCollector.d.ts +0 -10
- package/types/server/proxy/akanResponse.d.ts +0 -7
- package/types/server/proxy/bunRequestFields.d.ts +0 -1
- package/types/server/proxy/hostBasePathWebProxy.d.ts +0 -6
- package/types/server/proxy/index.d.ts +0 -6
- package/types/server/proxy/localeWebProxy.d.ts +0 -5
- package/types/server/proxy/types.d.ts +0 -37
- package/types/server/proxy/webProxyRunner.d.ts +0 -7
- package/types/server/proxy.d.ts +0 -1
- package/types/server/resolver/database.resolver.d.ts +0 -6
- package/types/server/resolver/index.d.ts +0 -3
- package/types/server/resolver/service.resolver.d.ts +0 -7
- package/types/server/resolver/signal.resolver.d.ts +0 -29
- package/types/server/resolver.d.ts +0 -1
- package/types/server/robots.d.ts +0 -1
- package/types/server/routeElementComposer.d.ts +0 -41
- package/types/server/routeTreeBuilder.d.ts +0 -28
- package/types/server/routing/apiRouter.d.ts +0 -61
- package/types/server/rscClient.d.ts +0 -15
- package/types/server/rscWorker.d.ts +0 -3
- package/types/server/rscWorkerHost.d.ts +0 -83
- package/types/server/sitemap.d.ts +0 -13
- package/types/server/ssrFromRscRenderer.d.ts +0 -6
- package/types/server/ssrTypes.d.ts +0 -47
- package/types/server/systemPages.d.ts +0 -27
- package/types/server/types/react-server-dom-webpack.d.ts +0 -91
- package/types/server/types.d.ts +0 -67
- package/types/server/vendor/akanjs-base.d.ts +0 -1
- package/types/server/vendor/akanjs-common.d.ts +0 -1
- package/types/server/vendor/akanjs-constant.d.ts +0 -1
- package/types/server/vendor/akanjs-store.d.ts +0 -1
- package/types/server/vendor/react-dom-client.d.ts +0 -3
- package/types/server/vendor/react-dom.d.ts +0 -3
- package/types/server/vendor/react-jsx-dev-runtime.d.ts +0 -3
- package/types/server/vendor/react-jsx-runtime.d.ts +0 -3
- package/types/server/vendor/react-refresh-runtime.d.ts +0 -3
- package/types/server/vendor/react-server-dom-webpack-client-browser.d.ts +0 -3
- package/types/server/vendor/react.d.ts +0 -11
- package/types/server/vendor/scheduler.d.ts +0 -3
- package/types/server/webRouter.d.ts +0 -44
- package/types/server.d.ts +0 -1
- package/types/service/adapt.d.ts +0 -15
- package/types/service/base.service.d.ts +0 -18
- package/types/service/index.d.ts +0 -10
- package/types/service/injectInfo.d.ts +0 -102
- package/types/service/ipcTypes.d.ts +0 -194
- package/types/service/predefinedAdaptor/cache.adaptor.d.ts +0 -46
- package/types/service/predefinedAdaptor/compress.adaptor.d.ts +0 -22
- package/types/service/predefinedAdaptor/database.adaptor.d.ts +0 -329
- package/types/service/predefinedAdaptor/index.d.ts +0 -13
- package/types/service/predefinedAdaptor/logging.adaptor.d.ts +0 -20
- package/types/service/predefinedAdaptor/queue.adaptor.d.ts +0 -22
- package/types/service/predefinedAdaptor/role.adaptor.d.ts +0 -17
- package/types/service/predefinedAdaptor/schedule.adaptor.d.ts +0 -60
- package/types/service/predefinedAdaptor/solidCache.adaptor.d.ts +0 -25
- package/types/service/predefinedAdaptor/solidPubsub.adaptor.d.ts +0 -20
- package/types/service/predefinedAdaptor/solidQueue.adaptor.d.ts +0 -19
- package/types/service/predefinedAdaptor/solidSqlite.d.ts +0 -24
- package/types/service/predefinedAdaptor/sqlitePath.d.ts +0 -9
- package/types/service/predefinedAdaptor/storage.adaptor.d.ts +0 -80
- package/types/service/predefinedAdaptor/websocket.adaptor.d.ts +0 -49
- package/types/service/predefinedAdaptor.d.ts +0 -1
- package/types/service/serve.d.ts +0 -31
- package/types/service/serviceModule.d.ts +0 -50
- package/types/service/serviceRegistry.d.ts +0 -9
- package/types/service/types.d.ts +0 -55
- package/types/service.d.ts +0 -1
- package/types/signal/base.signal.d.ts +0 -41
- package/types/signal/endpoint.d.ts +0 -28
- package/types/signal/endpointInfo.d.ts +0 -77
- package/types/signal/exception.d.ts +0 -54786
- package/types/signal/guard.d.ts +0 -10
- package/types/signal/guards.d.ts +0 -10
- package/types/signal/index.d.ts +0 -19
- package/types/signal/intercept.d.ts +0 -17
- package/types/signal/internal.d.ts +0 -18
- package/types/signal/internalArg.d.ts +0 -31
- package/types/signal/internalInfo.d.ts +0 -45
- package/types/signal/middleware.d.ts +0 -51
- package/types/signal/serializer/fetch.serializer.d.ts +0 -14
- package/types/signal/serializer/index.d.ts +0 -1
- package/types/signal/serializer.d.ts +0 -1
- package/types/signal/serverSignal.d.ts +0 -36
- package/types/signal/signalContext.d.ts +0 -96
- package/types/signal/signalRegistry.d.ts +0 -49
- package/types/signal/slice.d.ts +0 -42
- package/types/signal/sliceInfo.d.ts +0 -51
- package/types/signal/trace.d.ts +0 -97
- package/types/signal/types.d.ts +0 -142
- package/types/signal.d.ts +0 -1
- package/types/store/action.d.ts +0 -145
- package/types/store/baseSt.d.ts +0 -412
- package/types/store/hooks.d.ts +0 -1
- package/types/store/index.d.ts +0 -8
- package/types/store/rootStore.d.ts +0 -22
- package/types/store/state.d.ts +0 -91
- package/types/store/stateBuilder.d.ts +0 -141
- package/types/store/stateInfo.d.ts +0 -23
- package/types/store/store.d.ts +0 -36
- package/types/store/storeInstance.d.ts +0 -38
- package/types/store/storeRegistry.d.ts +0 -13
- package/types/store/types.d.ts +0 -42
- package/types/store/withSelector.d.ts +0 -42
- package/types/store.d.ts +0 -1
- package/types/test/index.d.ts +0 -4
- package/types/test/playwright.config.base.d.ts +0 -9
- package/types/test/playwright.pageAgent.d.ts +0 -12
- package/types/test/sample.d.ts +0 -15
- package/types/test/sampleOf.d.ts +0 -5
- package/types/test/signalTest.preload.d.ts +0 -1
- package/types/test/signalTestRuntime.d.ts +0 -29
- package/types/test/testServer.d.ts +0 -26
- package/types/test.d.ts +0 -1
- package/types/ui/BottomSheet.d.ts +0 -13
- package/types/ui/Button.d.ts +0 -11
- package/types/ui/ClientSide.d.ts +0 -8
- package/types/ui/Clipboard.d.ts +0 -7
- package/types/ui/Constant/Doc.d.ts +0 -29
- package/types/ui/Constant/Mermaid.d.ts +0 -8
- package/types/ui/Constant/index.d.ts +0 -6
- package/types/ui/Constant/schemaDoc.d.ts +0 -84
- package/types/ui/Constant.d.ts +0 -1
- package/types/ui/Copy.d.ts +0 -10
- package/types/ui/CsrImage.d.ts +0 -18
- package/types/ui/Data/CardList.d.ts +0 -36
- package/types/ui/Data/Dashboard.d.ts +0 -11
- package/types/ui/Data/Insight.d.ts +0 -9
- package/types/ui/Data/Item.d.ts +0 -75
- package/types/ui/Data/ListContainer.d.ts +0 -49
- package/types/ui/Data/Pagination.d.ts +0 -9
- package/types/ui/Data/QueryMaker.d.ts +0 -8
- package/types/ui/Data/TableList.d.ts +0 -26
- package/types/ui/Data/index.d.ts +0 -9
- package/types/ui/Data/index_.d.ts +0 -8
- package/types/ui/Data.d.ts +0 -1
- package/types/ui/DatePicker.d.ts +0 -36
- package/types/ui/Dialog/Action.d.ts +0 -5
- package/types/ui/Dialog/Close.d.ts +0 -6
- package/types/ui/Dialog/Content.d.ts +0 -6
- package/types/ui/Dialog/Modal.d.ts +0 -9
- package/types/ui/Dialog/Provider.d.ts +0 -11
- package/types/ui/Dialog/Title.d.ts +0 -5
- package/types/ui/Dialog/Trigger.d.ts +0 -6
- package/types/ui/Dialog/context.d.ts +0 -10
- package/types/ui/Dialog/index.d.ts +0 -9
- package/types/ui/Dialog.d.ts +0 -1
- package/types/ui/DragAction.d.ts +0 -24
- package/types/ui/DraggableList.d.ts +0 -31
- package/types/ui/Dropdown.d.ts +0 -14
- package/types/ui/Empty.d.ts +0 -12
- package/types/ui/Field.d.ts +0 -411
- package/types/ui/FontFace.d.ts +0 -6
- package/types/ui/Image.d.ts +0 -49
- package/types/ui/InfiniteScroll.d.ts +0 -10
- package/types/ui/Input.d.ts +0 -95
- package/types/ui/KeyboardAvoiding.d.ts +0 -8
- package/types/ui/Layout/BottomAction.d.ts +0 -6
- package/types/ui/Layout/BottomInset.d.ts +0 -7
- package/types/ui/Layout/BottomTab.d.ts +0 -14
- package/types/ui/Layout/Header.d.ts +0 -8
- package/types/ui/Layout/LeftSider.d.ts +0 -9
- package/types/ui/Layout/Navbar.d.ts +0 -11
- package/types/ui/Layout/RightSider.d.ts +0 -10
- package/types/ui/Layout/Sider.d.ts +0 -7
- package/types/ui/Layout/Template.d.ts +0 -7
- package/types/ui/Layout/TopLeftAction.d.ts +0 -6
- package/types/ui/Layout/Unit.d.ts +0 -9
- package/types/ui/Layout/View.d.ts +0 -8
- package/types/ui/Layout/Zone.d.ts +0 -6
- package/types/ui/Layout/index.d.ts +0 -14
- package/types/ui/Layout.d.ts +0 -1
- package/types/ui/Link/Back.d.ts +0 -7
- package/types/ui/Link/Close.d.ts +0 -7
- package/types/ui/Link/CsrLink.d.ts +0 -2
- package/types/ui/Link/Lang.d.ts +0 -8
- package/types/ui/Link/SsrLink.d.ts +0 -2
- package/types/ui/Link/index.d.ts +0 -10
- package/types/ui/Link/types.d.ts +0 -42
- package/types/ui/Link.d.ts +0 -1
- package/types/ui/Load/Edit.d.ts +0 -4
- package/types/ui/Load/Edit_Client.d.ts +0 -27
- package/types/ui/Load/Page.d.ts +0 -15
- package/types/ui/Load/PageCSR.d.ts +0 -3
- package/types/ui/Load/Pagination.d.ts +0 -8
- package/types/ui/Load/Units.d.ts +0 -30
- package/types/ui/Load/View.d.ts +0 -22
- package/types/ui/Load/index.d.ts +0 -8
- package/types/ui/Load/index_.d.ts +0 -3
- package/types/ui/Load.d.ts +0 -1
- package/types/ui/Loading/Area.d.ts +0 -1
- package/types/ui/Loading/Button.d.ts +0 -7
- package/types/ui/Loading/Input.d.ts +0 -7
- package/types/ui/Loading/ProgressBar.d.ts +0 -6
- package/types/ui/Loading/Skeleton.d.ts +0 -7
- package/types/ui/Loading/Spin.d.ts +0 -7
- package/types/ui/Loading/index.d.ts +0 -8
- package/types/ui/Loading.d.ts +0 -1
- package/types/ui/Menu.d.ts +0 -26
- package/types/ui/Modal.d.ts +0 -19
- package/types/ui/Model/AdminPanel.d.ts +0 -31
- package/types/ui/Model/Edit.d.ts +0 -16
- package/types/ui/Model/EditModal.d.ts +0 -52
- package/types/ui/Model/EditWrapper.d.ts +0 -13
- package/types/ui/Model/LoadInit.d.ts +0 -10
- package/types/ui/Model/New.d.ts +0 -16
- package/types/ui/Model/NewWrapper.d.ts +0 -13
- package/types/ui/Model/NewWrapper_Client.d.ts +0 -13
- package/types/ui/Model/Remove.d.ts +0 -13
- package/types/ui/Model/RemoveWrapper.d.ts +0 -12
- package/types/ui/Model/SureToRemove.d.ts +0 -11
- package/types/ui/Model/View.d.ts +0 -19
- package/types/ui/Model/ViewEditModal.d.ts +0 -12
- package/types/ui/Model/ViewModal.d.ts +0 -14
- package/types/ui/Model/ViewWrapper.d.ts +0 -12
- package/types/ui/Model/index.d.ts +0 -16
- package/types/ui/Model/index_.d.ts +0 -14
- package/types/ui/Model.d.ts +0 -1
- package/types/ui/More.d.ts +0 -12
- package/types/ui/ObjectId.d.ts +0 -5
- package/types/ui/Pagination.d.ts +0 -20
- package/types/ui/Popconfirm.d.ts +0 -28
- package/types/ui/Portal.d.ts +0 -6
- package/types/ui/Radio.d.ts +0 -19
- package/types/ui/RecentTime.d.ts +0 -12
- package/types/ui/Refresh.d.ts +0 -7
- package/types/ui/ScreenNavigator.d.ts +0 -18
- package/types/ui/Select.d.ts +0 -43
- package/types/ui/Signal/Arg.d.ts +0 -78
- package/types/ui/Signal/Doc.d.ts +0 -33
- package/types/ui/Signal/Listener.d.ts +0 -9
- package/types/ui/Signal/Message.d.ts +0 -23
- package/types/ui/Signal/Object.d.ts +0 -20
- package/types/ui/Signal/PubSub.d.ts +0 -24
- package/types/ui/Signal/Request.d.ts +0 -8
- package/types/ui/Signal/Response.d.ts +0 -14
- package/types/ui/Signal/RestApi.d.ts +0 -40
- package/types/ui/Signal/WebSocket.d.ts +0 -11
- package/types/ui/Signal/index.d.ts +0 -18
- package/types/ui/Signal/makeExample.d.ts +0 -4
- package/types/ui/Signal/style.d.ts +0 -15
- package/types/ui/Signal.d.ts +0 -1
- package/types/ui/System/CSR.d.ts +0 -32
- package/types/ui/System/Client.d.ts +0 -47
- package/types/ui/System/Common.d.ts +0 -47
- package/types/ui/System/DevModeToggle.d.ts +0 -1
- package/types/ui/System/Gtag.d.ts +0 -4
- package/types/ui/System/Messages.d.ts +0 -1
- package/types/ui/System/Reconnect.d.ts +0 -1
- package/types/ui/System/Root.d.ts +0 -6
- package/types/ui/System/SSR.d.ts +0 -24
- package/types/ui/System/SelectLanguage.d.ts +0 -5
- package/types/ui/System/ThemeToggle.d.ts +0 -4
- package/types/ui/System/index.d.ts +0 -12
- package/types/ui/System.d.ts +0 -1
- package/types/ui/Tab/Menu.d.ts +0 -12
- package/types/ui/Tab/Menus.d.ts +0 -6
- package/types/ui/Tab/Panel.d.ts +0 -8
- package/types/ui/Tab/Provider.d.ts +0 -10
- package/types/ui/Tab/context.d.ts +0 -9
- package/types/ui/Tab/index.d.ts +0 -7
- package/types/ui/Tab.d.ts +0 -1
- package/types/ui/Table.d.ts +0 -41
- package/types/ui/ToggleSelect.d.ts +0 -33
- package/types/ui/Unauthorized.d.ts +0 -9
- package/types/ui/animated.d.ts +0 -5
- package/types/ui/fontCss.d.ts +0 -11
- package/types/ui/index.d.ts +0 -44
- package/types/ui.d.ts +0 -1
- package/types/webkit/bootCsr.d.ts +0 -16
- package/types/webkit/createRobotPage.d.ts +0 -15
- package/types/webkit/createSitemapPage.d.ts +0 -4
- package/types/webkit/index.d.ts +0 -17
- package/types/webkit/lazy.d.ts +0 -11
- package/types/webkit/types.d.ts +0 -7
- package/types/webkit/useCamera.d.ts +0 -19
- package/types/webkit/useCodepush.d.ts +0 -16
- package/types/webkit/useContact.d.ts +0 -11
- package/types/webkit/useCsrValues.d.ts +0 -30
- package/types/webkit/useDebounce.d.ts +0 -2
- package/types/webkit/useFetch.d.ts +0 -18
- package/types/webkit/useGeoLocation.d.ts +0 -8
- package/types/webkit/useHistory.d.ts +0 -23
- package/types/webkit/useInterval.d.ts +0 -2
- package/types/webkit/useLocation.d.ts +0 -8
- package/types/webkit/usePurchase.d.ts +0 -19
- package/types/webkit/usePushNoti.d.ts +0 -7
- package/types/webkit/useThrottle.d.ts +0 -2
- package/types/webkit.d.ts +0 -1
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { RouteClientCache } from "./routeClientCache";
|
|
3
|
+
import type { RoutesManifest } from "./routesManifestStore";
|
|
4
|
+
|
|
5
|
+
const emptySsrManifest = { moduleLoading: null, moduleMap: {} };
|
|
6
|
+
|
|
7
|
+
describe("RouteClientCache", () => {
|
|
8
|
+
test("seeds existing manifests and returns isolated snapshots", async () => {
|
|
9
|
+
const manifest: RoutesManifest = {
|
|
10
|
+
routeIds: ["/seeded"],
|
|
11
|
+
clientManifest: {
|
|
12
|
+
"apps/demo/Page.tsx#default": {
|
|
13
|
+
id: "/_akan/client/page.js",
|
|
14
|
+
chunks: ["/_akan/client/page.js"],
|
|
15
|
+
name: "default",
|
|
16
|
+
async: true,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
ssrManifest: {
|
|
20
|
+
moduleLoading: null,
|
|
21
|
+
moduleMap: { "/_akan/client/page.js": { default: { id: "page.ssr.js", chunks: [], name: "default" } } },
|
|
22
|
+
},
|
|
23
|
+
knownEntries: ["/repo/apps/demo/Page.tsx"],
|
|
24
|
+
};
|
|
25
|
+
const cache = new RouteClientCache({
|
|
26
|
+
buildRoute: async () => {
|
|
27
|
+
throw new Error("seeded routes should not rebuild");
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
cache.seed(manifest);
|
|
32
|
+
await cache.ensure("/seeded", []);
|
|
33
|
+
const snapshot = cache.snapshot();
|
|
34
|
+
snapshot.knownEntries.add("/mutated");
|
|
35
|
+
|
|
36
|
+
expect(cache.snapshot().knownEntries.has("/mutated")).toBe(false);
|
|
37
|
+
expect(cache.snapshot().clientManifest).toEqual(manifest.clientManifest);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test("deduplicates concurrent builds and retries failures", async () => {
|
|
41
|
+
let attempts = 0;
|
|
42
|
+
const cache = new RouteClientCache({
|
|
43
|
+
buildRoute: async (routeId, info) => {
|
|
44
|
+
attempts += 1;
|
|
45
|
+
if (attempts === 1) throw new Error("boom");
|
|
46
|
+
return {
|
|
47
|
+
manifestDelta: {
|
|
48
|
+
[`${routeId}#default`]: {
|
|
49
|
+
id: `/_akan/client/${attempts}.js`,
|
|
50
|
+
chunks: [`/_akan/client/${attempts}.js`],
|
|
51
|
+
name: "default",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
ssrManifestDelta: emptySsrManifest,
|
|
55
|
+
newEntries: [...info.knownEntries, `/repo${routeId}.tsx`],
|
|
56
|
+
clientDeps: [],
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
await expect(cache.ensure("/retry", [])).rejects.toThrow("boom");
|
|
62
|
+
const [first, second] = await Promise.all([cache.ensure("/retry", []), cache.ensure("/retry", [])]);
|
|
63
|
+
|
|
64
|
+
expect(first).toBe(second);
|
|
65
|
+
expect(attempts).toBe(2);
|
|
66
|
+
expect(cache.snapshot().knownEntries.has("/repo/retry.tsx")).toBe(true);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test("invalidates built routes, ignores stale builds, and clears generations", async () => {
|
|
70
|
+
let resolveBuild:
|
|
71
|
+
| ((value: Awaited<ReturnType<Parameters<typeof RouteClientCache>[0]["buildRoute"]>>) => void)
|
|
72
|
+
| null = null;
|
|
73
|
+
const cache = new RouteClientCache({
|
|
74
|
+
buildRoute: async (routeId, { generation }) =>
|
|
75
|
+
await new Promise((resolve) => {
|
|
76
|
+
resolveBuild = () =>
|
|
77
|
+
resolve({
|
|
78
|
+
manifestDelta: { [`${routeId}#${generation}`]: { id: "stale.js", chunks: [], name: "default" } },
|
|
79
|
+
ssrManifestDelta: emptySsrManifest,
|
|
80
|
+
newEntries: [`/repo/${routeId}-${generation}.tsx`],
|
|
81
|
+
clientDeps: [],
|
|
82
|
+
});
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const pending = cache.ensure("/slow", []);
|
|
87
|
+
expect(cache.clear()).toEqual([]);
|
|
88
|
+
resolveBuild?.({ manifestDelta: {}, ssrManifestDelta: emptySsrManifest, newEntries: [], clientDeps: [] });
|
|
89
|
+
await pending;
|
|
90
|
+
|
|
91
|
+
expect(cache.snapshot().clientManifest).toEqual({});
|
|
92
|
+
expect(cache.snapshot().knownEntries.size).toBe(0);
|
|
93
|
+
|
|
94
|
+
const immediate = new RouteClientCache({
|
|
95
|
+
buildRoute: async (routeId) => ({
|
|
96
|
+
manifestDelta: { [routeId]: { id: "fresh.js", chunks: [], name: "default" } },
|
|
97
|
+
ssrManifestDelta: emptySsrManifest,
|
|
98
|
+
newEntries: [`/repo/${routeId}.tsx`],
|
|
99
|
+
clientDeps: [],
|
|
100
|
+
}),
|
|
101
|
+
});
|
|
102
|
+
await immediate.ensure("/a", []);
|
|
103
|
+
await immediate.ensure("/b", []);
|
|
104
|
+
expect(immediate.invalidate((routeId) => routeId === "/a")).toEqual(["/a"]);
|
|
105
|
+
expect(immediate.snapshot().knownEntries).toEqual(new Set(["/repo//a.tsx", "/repo//b.tsx"]));
|
|
106
|
+
expect(immediate.clear().sort()).toEqual(["/b"]);
|
|
107
|
+
expect(immediate.snapshot().generation).toBe(2);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
test("client entry invalidation drops only stale entries and manifest rows", async () => {
|
|
111
|
+
const cache = new RouteClientCache({
|
|
112
|
+
buildRoute: async (routeId) => ({
|
|
113
|
+
manifestDelta: {
|
|
114
|
+
[`/repo${routeId}.tsx#default`]: {
|
|
115
|
+
id: `/_akan/client${routeId}.js`,
|
|
116
|
+
chunks: [`/_akan/client${routeId}.js`, `/_akan/client/chunk${routeId}.js`],
|
|
117
|
+
name: "default",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
ssrManifestDelta: {
|
|
121
|
+
moduleLoading: null,
|
|
122
|
+
moduleMap: {
|
|
123
|
+
[`/_akan/client${routeId}.js`]: {
|
|
124
|
+
default: { id: `ssr${routeId}.js`, chunks: [], name: "default" },
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
newEntries: [`/repo${routeId}.tsx`],
|
|
129
|
+
clientDeps: [],
|
|
130
|
+
}),
|
|
131
|
+
});
|
|
132
|
+
await cache.ensure("/a", []);
|
|
133
|
+
await cache.ensure("/b", []);
|
|
134
|
+
|
|
135
|
+
expect(
|
|
136
|
+
cache.invalidateClientEntries({
|
|
137
|
+
routePredicate: (routeId) => routeId === "/a",
|
|
138
|
+
staleEntries: ["/repo/a.tsx"],
|
|
139
|
+
}),
|
|
140
|
+
).toEqual(["/a"]);
|
|
141
|
+
|
|
142
|
+
const snapshot = cache.snapshot();
|
|
143
|
+
expect(snapshot.knownEntries).toEqual(new Set(["/repo/b.tsx"]));
|
|
144
|
+
expect(snapshot.clientManifest["/repo/a.tsx#default"]).toBeUndefined();
|
|
145
|
+
expect(snapshot.clientManifest["/repo/b.tsx#default"]).toBeDefined();
|
|
146
|
+
expect(snapshot.ssrManifest.moduleMap["/_akan/client/a.js"]).toBeUndefined();
|
|
147
|
+
expect(snapshot.ssrManifest.moduleMap["/_akan/client/b.js"]).toBeDefined();
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
test("route invalidation preserves known entries and manifest rows for server-only edits", async () => {
|
|
151
|
+
const cache = new RouteClientCache({
|
|
152
|
+
buildRoute: async (routeId) => ({
|
|
153
|
+
manifestDelta: {
|
|
154
|
+
[`/repo${routeId}.tsx#default`]: {
|
|
155
|
+
id: `/_akan/client${routeId}.js`,
|
|
156
|
+
chunks: [`/_akan/client${routeId}.js`],
|
|
157
|
+
name: "default",
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
ssrManifestDelta: emptySsrManifest,
|
|
161
|
+
newEntries: [`/repo${routeId}.tsx`],
|
|
162
|
+
clientDeps: [],
|
|
163
|
+
}),
|
|
164
|
+
});
|
|
165
|
+
await cache.ensure("/a", []);
|
|
166
|
+
|
|
167
|
+
expect(cache.invalidate((routeId) => routeId === "/a")).toEqual(["/a"]);
|
|
168
|
+
const snapshot = cache.snapshot();
|
|
169
|
+
expect(snapshot.knownEntries).toEqual(new Set(["/repo/a.tsx"]));
|
|
170
|
+
expect(snapshot.clientManifest["/repo/a.tsx#default"]).toBeDefined();
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
test("client entry invalidation also removes rows by stale chunk urls", async () => {
|
|
174
|
+
const cache = new RouteClientCache({
|
|
175
|
+
buildRoute: async () => ({
|
|
176
|
+
manifestDelta: {
|
|
177
|
+
"/repo/Entry.tsx#default": {
|
|
178
|
+
id: "/_akan/client/entry.js",
|
|
179
|
+
chunks: ["/_akan/client/entry.js", "/_akan/client/shared.js"],
|
|
180
|
+
name: "default",
|
|
181
|
+
},
|
|
182
|
+
"/repo/Entry.tsx#Named": {
|
|
183
|
+
id: "/_akan/client/shared.js",
|
|
184
|
+
chunks: ["/_akan/client/shared.js"],
|
|
185
|
+
name: "Named",
|
|
186
|
+
},
|
|
187
|
+
"/repo/Other.tsx#default": {
|
|
188
|
+
id: "/_akan/client/other.js",
|
|
189
|
+
chunks: ["/_akan/client/other.js"],
|
|
190
|
+
name: "default",
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
ssrManifestDelta: {
|
|
194
|
+
moduleLoading: null,
|
|
195
|
+
moduleMap: {
|
|
196
|
+
"/_akan/client/entry.js": {
|
|
197
|
+
default: { id: "entry.ssr.js", chunks: [], name: "default" },
|
|
198
|
+
},
|
|
199
|
+
"/_akan/client/shared.js": {
|
|
200
|
+
Named: { id: "named.ssr.js", chunks: [], name: "Named" },
|
|
201
|
+
},
|
|
202
|
+
"/_akan/client/other.js": {
|
|
203
|
+
default: { id: "other.ssr.js", chunks: [], name: "default" },
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
newEntries: ["/repo/Entry.tsx", "/repo/Other.tsx"],
|
|
208
|
+
clientDeps: [],
|
|
209
|
+
}),
|
|
210
|
+
});
|
|
211
|
+
await cache.ensure("/a", []);
|
|
212
|
+
|
|
213
|
+
cache.invalidateClientEntries({
|
|
214
|
+
routePredicate: (routeId) => routeId === "/a",
|
|
215
|
+
staleEntries: ["/repo/Entry.tsx"],
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
const snapshot = cache.snapshot();
|
|
219
|
+
expect(Object.keys(snapshot.clientManifest).sort()).toEqual(["/repo/Other.tsx#default"]);
|
|
220
|
+
expect(Object.keys(snapshot.ssrManifest.moduleMap).sort()).toEqual(["/_akan/client/other.js"]);
|
|
221
|
+
expect(snapshot.knownEntries).toEqual(new Set(["/repo/Other.tsx"]));
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
test("shared entries can be discovered by later routes without rebuilding the shared entry", async () => {
|
|
225
|
+
const builds: Array<{ routeId: string; knownEntries: string[] }> = [];
|
|
226
|
+
const cache = new RouteClientCache({
|
|
227
|
+
buildRoute: async (routeId, { knownEntries }) => {
|
|
228
|
+
builds.push({ routeId, knownEntries: [...knownEntries].sort() });
|
|
229
|
+
if (routeId === "/a") {
|
|
230
|
+
return {
|
|
231
|
+
manifestDelta: {
|
|
232
|
+
"/repo/Shared.tsx#default": {
|
|
233
|
+
id: "/_akan/client/shared.js",
|
|
234
|
+
chunks: ["/_akan/client/shared.js"],
|
|
235
|
+
name: "default",
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
ssrManifestDelta: emptySsrManifest,
|
|
239
|
+
newEntries: ["/repo/Shared.tsx"],
|
|
240
|
+
discoveredEntries: ["/repo/Shared.tsx"],
|
|
241
|
+
clientDeps: ["/repo/Shared.tsx"],
|
|
242
|
+
clientDepsByEntry: { "/repo/Shared.tsx": ["/repo/Shared.tsx"] },
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
manifestDelta: {},
|
|
247
|
+
ssrManifestDelta: emptySsrManifest,
|
|
248
|
+
newEntries: [],
|
|
249
|
+
discoveredEntries: ["/repo/Shared.tsx"],
|
|
250
|
+
clientDeps: [],
|
|
251
|
+
clientDepsByEntry: {},
|
|
252
|
+
};
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
await cache.ensure("/a", []);
|
|
257
|
+
await cache.ensure("/b", []);
|
|
258
|
+
|
|
259
|
+
expect(builds).toEqual([
|
|
260
|
+
{ routeId: "/a", knownEntries: [] },
|
|
261
|
+
{ routeId: "/b", knownEntries: ["/repo/Shared.tsx"] },
|
|
262
|
+
]);
|
|
263
|
+
expect(cache.snapshot().knownEntries).toEqual(new Set(["/repo/Shared.tsx"]));
|
|
264
|
+
});
|
|
265
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { RouteSeedIndexStore } from "./routeSeedIndexStore";
|
|
3
|
+
|
|
4
|
+
describe("route seed index artifact paths", () => {
|
|
5
|
+
test("restores relative seed paths from the artifact directory", () => {
|
|
6
|
+
const artifactDir = "/repo/dist/apps/akan/.akan/artifact";
|
|
7
|
+
const normalized = RouteSeedIndexStore.normalize(
|
|
8
|
+
{
|
|
9
|
+
entries: [
|
|
10
|
+
{
|
|
11
|
+
routeId: "/profile",
|
|
12
|
+
pattern: "/profile",
|
|
13
|
+
seeds: ["../generated/implicit-root-layout.tsx", "../../../../../apps/akan/page/profile.tsx"],
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
globalLayoutFiles: ["../generated/implicit-root-layout.tsx"],
|
|
17
|
+
},
|
|
18
|
+
artifactDir,
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
expect(normalized.entries[0]?.seeds).toEqual([
|
|
22
|
+
"/repo/dist/apps/akan/.akan/generated/implicit-root-layout.tsx",
|
|
23
|
+
"/repo/apps/akan/page/profile.tsx",
|
|
24
|
+
]);
|
|
25
|
+
expect(normalized.globalLayoutFiles).toEqual(["/repo/dist/apps/akan/.akan/generated/implicit-root-layout.tsx"]);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test("restores slim production seed index defaults", () => {
|
|
29
|
+
const normalized = RouteSeedIndexStore.normalize(
|
|
30
|
+
{
|
|
31
|
+
entries: [{ routeId: "/:lang/profile" }],
|
|
32
|
+
},
|
|
33
|
+
"/repo/dist/apps/akan/.akan/artifact",
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
expect(normalized).toEqual({
|
|
37
|
+
entries: [{ routeId: "/:lang/profile", pattern: "/:lang/profile", seeds: [] }],
|
|
38
|
+
globalLayoutFiles: [],
|
|
39
|
+
});
|
|
40
|
+
expect(RouteSeedIndexStore.match("/ko/profile", normalized.entries)?.entry.routeId).toBe("/:lang/profile");
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test("finds the nearest route seed prefix for unmatched layout fallbacks", () => {
|
|
44
|
+
const entries = [
|
|
45
|
+
{ routeId: "/:lang/blog", pattern: "/:lang/blog", seeds: ["blog-layout"] },
|
|
46
|
+
{ routeId: "/:lang/blog/benchmark", pattern: "/:lang/blog/benchmark", seeds: ["benchmark-page"] },
|
|
47
|
+
{ routeId: "/:lang/docs", pattern: "/:lang/docs", seeds: ["docs-layout"] },
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
const matched = RouteSeedIndexStore.matchPrefix("/ko/blog/missing", entries);
|
|
51
|
+
|
|
52
|
+
expect(matched?.entry.routeId).toBe("/:lang/blog");
|
|
53
|
+
expect(matched?.params).toEqual({ lang: "ko" });
|
|
54
|
+
expect(RouteSeedIndexStore.matchPrefix("/ko/unknown/missing", entries)).toBeNull();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { type RoutesManifest, RoutesManifestStore } from "./routesManifestStore";
|
|
3
|
+
|
|
4
|
+
describe("routes manifest artifact paths", () => {
|
|
5
|
+
test("serializes file-system paths relative to the artifact directory and restores them", () => {
|
|
6
|
+
const artifactDir = "/repo/dist/apps/akan/.akan/artifact";
|
|
7
|
+
const clientEntry = "apps/akan/ui/ProfileCard.tsx#default";
|
|
8
|
+
const knownEntry = "/repo/apps/akan/ui/ProfileCard.tsx";
|
|
9
|
+
const ssrEntry = "/repo/dist/apps/akan/.akan/artifact/client-ssr/ProfileCard-abc.js";
|
|
10
|
+
const manifest: RoutesManifest = {
|
|
11
|
+
routeIds: ["/profile"],
|
|
12
|
+
clientManifest: {
|
|
13
|
+
[clientEntry]: {
|
|
14
|
+
id: "/_akan/client/abc.js",
|
|
15
|
+
chunks: ["/_akan/client/abc.js", "/_akan/client/chunks/def.js"],
|
|
16
|
+
name: "default",
|
|
17
|
+
async: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
ssrManifest: {
|
|
21
|
+
moduleLoading: null,
|
|
22
|
+
moduleMap: {
|
|
23
|
+
"/_akan/client/abc.js": {
|
|
24
|
+
default: {
|
|
25
|
+
id: ssrEntry,
|
|
26
|
+
chunks: [ssrEntry, ssrEntry],
|
|
27
|
+
name: "default",
|
|
28
|
+
async: true,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
knownEntries: [knownEntry],
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const serialized = RoutesManifestStore.serialize(manifest, artifactDir);
|
|
37
|
+
|
|
38
|
+
expect(Object.keys(serialized.clientManifest)).toEqual(["apps/akan/ui/ProfileCard.tsx#default"]);
|
|
39
|
+
expect(serialized.clientManifest["apps/akan/ui/ProfileCard.tsx#default"]?.id).toBe("/_akan/client/abc.js");
|
|
40
|
+
expect(serialized.ssrManifest.moduleMap["/_akan/client/abc.js"]?.default.id).toBe("client-ssr/ProfileCard-abc.js");
|
|
41
|
+
expect(serialized.knownEntries).toEqual(["../../../../../apps/akan/ui/ProfileCard.tsx"]);
|
|
42
|
+
expect(JSON.stringify(serialized)).not.toContain("/repo/");
|
|
43
|
+
|
|
44
|
+
expect(RoutesManifestStore.normalize(serialized, artifactDir)).toEqual({
|
|
45
|
+
...manifest,
|
|
46
|
+
clientManifest: serialized.clientManifest,
|
|
47
|
+
knownEntries: manifest.knownEntries,
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("normalizes manifests without production-only known entries", () => {
|
|
52
|
+
const artifactDir = "/repo/dist/apps/akan/.akan/artifact";
|
|
53
|
+
const normalized = RoutesManifestStore.normalize(
|
|
54
|
+
{
|
|
55
|
+
routeIds: ["/profile"],
|
|
56
|
+
clientManifest: {},
|
|
57
|
+
ssrManifest: { moduleLoading: null, moduleMap: {} },
|
|
58
|
+
},
|
|
59
|
+
artifactDir,
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
expect(normalized.knownEntries).toEqual([]);
|
|
63
|
+
});
|
|
64
|
+
});
|
package/server/decorators.ts
CHANGED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { mkdtemp, rm } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import type { BackendEnv } from "akanjs/base";
|
|
6
|
+
import { SolidPubSub } from "akanjs/service";
|
|
7
|
+
import { AkanLib } from "../akanLib";
|
|
8
|
+
import { AkanOption } from "../akanOption";
|
|
9
|
+
import { HostBasePathWebProxy, LocaleWebProxy } from "../proxy";
|
|
10
|
+
import {
|
|
11
|
+
ServerResolverTestEndpoint,
|
|
12
|
+
ServerResolverTestInternal,
|
|
13
|
+
ServerResolverTestServerSignal,
|
|
14
|
+
ServerResolverTestSlice,
|
|
15
|
+
serverResolverTestConstant,
|
|
16
|
+
serverResolverTestDatabase,
|
|
17
|
+
serverResolverTestServiceModel,
|
|
18
|
+
validId,
|
|
19
|
+
} from "../resolver/resolver.contract.fixture";
|
|
20
|
+
|
|
21
|
+
describe("DiLifecycle declaration-to-runtime contract", () => {
|
|
22
|
+
test("prepends default web proxies before library proxies", async () => {
|
|
23
|
+
process.env.AKAN_PUBLIC_APP_NAME = "serverLifecycle";
|
|
24
|
+
process.env.AKAN_PUBLIC_REPO_NAME = "akan";
|
|
25
|
+
process.env.AKAN_PUBLIC_SERVE_DOMAIN = "example.com";
|
|
26
|
+
process.env.AKAN_PUBLIC_ENV = "local";
|
|
27
|
+
process.env.AKAN_PUBLIC_OPERATION_MODE = "local";
|
|
28
|
+
process.env.SERVER_MODE = "all";
|
|
29
|
+
process.env.NODE_ENV = "test";
|
|
30
|
+
const { DiLifecycle } = await import("./diLifecycle");
|
|
31
|
+
|
|
32
|
+
class CustomWebProxy {
|
|
33
|
+
static readonly refName = "CustomWebProxy";
|
|
34
|
+
use() {}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const env = {
|
|
38
|
+
repoName: "akan",
|
|
39
|
+
serveDomain: "example.com",
|
|
40
|
+
appName: "serverLifecycle",
|
|
41
|
+
environment: "local",
|
|
42
|
+
operationMode: "local",
|
|
43
|
+
tunnelUsername: "root",
|
|
44
|
+
tunnelPassword: "akan",
|
|
45
|
+
} satisfies BackendEnv;
|
|
46
|
+
const lib = new AkanLib("serverLifecycleTest", {
|
|
47
|
+
databases: [],
|
|
48
|
+
services: [],
|
|
49
|
+
scalars: [],
|
|
50
|
+
option: new AkanOption().applyWebProxy(CustomWebProxy),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const lifecycle = new DiLifecycle(env, "all", lib);
|
|
54
|
+
|
|
55
|
+
expect(lifecycle.webProxies).toEqual([LocaleWebProxy, HostBasePathWebProxy, CustomWebProxy]);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("assembles AkanLib declarations into registry, live services, and routes", async () => {
|
|
59
|
+
process.env.AKAN_PUBLIC_APP_NAME = "serverLifecycle";
|
|
60
|
+
process.env.AKAN_PUBLIC_REPO_NAME = "akan";
|
|
61
|
+
process.env.AKAN_PUBLIC_SERVE_DOMAIN = "example.com";
|
|
62
|
+
process.env.AKAN_PUBLIC_ENV = "local";
|
|
63
|
+
process.env.AKAN_PUBLIC_OPERATION_MODE = "local";
|
|
64
|
+
process.env.SERVER_MODE = "all";
|
|
65
|
+
process.env.NODE_ENV = "test";
|
|
66
|
+
const { DiLifecycle } = await import("./diLifecycle");
|
|
67
|
+
|
|
68
|
+
const tmp = await mkdtemp(join(tmpdir(), "akan-server-di-"));
|
|
69
|
+
const env = {
|
|
70
|
+
repoName: "akan",
|
|
71
|
+
serveDomain: "example.com",
|
|
72
|
+
appName: "serverLifecycle",
|
|
73
|
+
environment: "local",
|
|
74
|
+
operationMode: "local",
|
|
75
|
+
tunnelUsername: "root",
|
|
76
|
+
tunnelPassword: "akan",
|
|
77
|
+
workspaceRoot: tmp,
|
|
78
|
+
database: {
|
|
79
|
+
sqlite: {
|
|
80
|
+
filePath: join(tmp, "akan.db"),
|
|
81
|
+
journalMode: "WAL",
|
|
82
|
+
busyTimeoutMs: 1000,
|
|
83
|
+
synchronous: "NORMAL",
|
|
84
|
+
foreignKeys: true,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
solid: {
|
|
88
|
+
filePath: join(tmp, "solid.db"),
|
|
89
|
+
journalMode: "WAL",
|
|
90
|
+
busyTimeoutMs: 1000,
|
|
91
|
+
synchronous: "NORMAL",
|
|
92
|
+
cleanupIntervalMs: 60_000,
|
|
93
|
+
queuePollIntervalMs: 60_000,
|
|
94
|
+
queueLeaseMs: 30_000,
|
|
95
|
+
},
|
|
96
|
+
} satisfies BackendEnv & { workspaceRoot: string };
|
|
97
|
+
const lib = new AkanLib("serverLifecycleTest", {
|
|
98
|
+
databases: [
|
|
99
|
+
{
|
|
100
|
+
constant: serverResolverTestConstant,
|
|
101
|
+
database: serverResolverTestDatabase,
|
|
102
|
+
service: serverResolverTestServiceModel,
|
|
103
|
+
signal: {
|
|
104
|
+
endpoint: ServerResolverTestEndpoint,
|
|
105
|
+
slice: ServerResolverTestSlice,
|
|
106
|
+
internal: ServerResolverTestInternal,
|
|
107
|
+
server: ServerResolverTestServerSignal,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
services: [],
|
|
112
|
+
scalars: [],
|
|
113
|
+
option: new AkanOption(),
|
|
114
|
+
});
|
|
115
|
+
const lifecycle = new DiLifecycle(env, "all", lib);
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
const routes = await lifecycle.initializeAll();
|
|
119
|
+
|
|
120
|
+
expect(lifecycle.registry.adaptorCls.has("serverResolverTestItemModel")).toBe(true);
|
|
121
|
+
expect(lifecycle.live.adaptor.has("serverResolverTestItemModel")).toBe(true);
|
|
122
|
+
expect(lifecycle.registry.serviceCls.has("serverResolverTestItem")).toBe(true);
|
|
123
|
+
expect(lifecycle.live.service.has("serverResolverTestItem")).toBe(true);
|
|
124
|
+
expect(lifecycle.registry.serverSignalCls.has("serverResolverTestItemSignal")).toBe(true);
|
|
125
|
+
expect(lifecycle.registry.internalCls.has("serverResolverTestItemInternal")).toBe(true);
|
|
126
|
+
expect(lifecycle.live.internal.has("serverResolverTestItemInternal")).toBe(true);
|
|
127
|
+
expect(lifecycle.registry.endpointCls.has("serverResolverTestItemEndpoint")).toBe(true);
|
|
128
|
+
expect(lifecycle.live.sliceCls.has("serverResolverTestItem")).toBe(true);
|
|
129
|
+
|
|
130
|
+
expect(Object.keys(routes.routes ?? {})).toEqual(
|
|
131
|
+
expect.arrayContaining([
|
|
132
|
+
"/getTitle/:id",
|
|
133
|
+
"/serverResolverTestItem/updateTitle/:id",
|
|
134
|
+
"/serverResolverTestItem/serverResolverTestItem/:serverResolverTestItemId",
|
|
135
|
+
"/serverResolverTestItem/serverResolverTestItemListInCategory",
|
|
136
|
+
]),
|
|
137
|
+
);
|
|
138
|
+
expect(Object.keys(routes.wsRoutes ?? {})).toEqual(expect.arrayContaining(["roomFeed", "echoMessage"]));
|
|
139
|
+
expect(routes.routeOptions?.["/getTitle/:id"]).toEqual({ globalPrefix: false });
|
|
140
|
+
|
|
141
|
+
const service = lifecycle.live.service.get("serverResolverTestItem") as {
|
|
142
|
+
createServerResolverTestItem(data: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
143
|
+
listInCategory(...args: unknown[]): Promise<unknown[]>;
|
|
144
|
+
};
|
|
145
|
+
const created = await service.createServerResolverTestItem({
|
|
146
|
+
ownerId: validId,
|
|
147
|
+
category: "news",
|
|
148
|
+
title: "Alpha",
|
|
149
|
+
resolvedLabel: "resolved",
|
|
150
|
+
count: 1,
|
|
151
|
+
tags: ["featured"],
|
|
152
|
+
nested: { label: "Nested" },
|
|
153
|
+
});
|
|
154
|
+
expect(created).toMatchObject({
|
|
155
|
+
category: "news",
|
|
156
|
+
parentPostCreate: true,
|
|
157
|
+
childPostCreate: true,
|
|
158
|
+
});
|
|
159
|
+
expect(await service.listInCategory("news", false, { limit: 10 })).toHaveLength(1);
|
|
160
|
+
|
|
161
|
+
const websocket = lifecycle.registry.adaptor.get(SolidPubSub) as SolidPubSub | undefined;
|
|
162
|
+
expect(websocket).toBeDefined();
|
|
163
|
+
} finally {
|
|
164
|
+
await lifecycle.destroyAll();
|
|
165
|
+
await rm(tmp, { recursive: true, force: true });
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
});
|
package/server/di/diLifecycle.ts
CHANGED
|
@@ -94,12 +94,12 @@ export class DiLifecycle {
|
|
|
94
94
|
});
|
|
95
95
|
this.webProxies.push(...lib.option.getWebProxies());
|
|
96
96
|
lib.database.forEach((mod) => {
|
|
97
|
-
|
|
97
|
+
//TODO: change enable as a function
|
|
98
98
|
if (!mod.service.srv.enabled) return;
|
|
99
99
|
this.#database.set(mod.constant.refName, mod);
|
|
100
100
|
});
|
|
101
101
|
lib.service.forEach((mod) => {
|
|
102
|
-
|
|
102
|
+
//TODO: change enable as a function
|
|
103
103
|
if (!mod.service.srv.enabled) return;
|
|
104
104
|
this.#service.set(mod.service.srv.refName, mod);
|
|
105
105
|
});
|
|
@@ -144,7 +144,7 @@ export class DiLifecycle {
|
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
146
|
async destroyAll() {
|
|
147
|
-
|
|
147
|
+
// 1. Run destroy internals (scheduled jobs, etc.)
|
|
148
148
|
const internalNow = Date.now();
|
|
149
149
|
this.logger.verbose("Running destroy internals...");
|
|
150
150
|
try {
|
|
@@ -154,16 +154,19 @@ export class DiLifecycle {
|
|
|
154
154
|
}
|
|
155
155
|
this.logger.verbose(`Destroy internals in ${Date.now() - internalNow}ms`);
|
|
156
156
|
|
|
157
|
+
// 2. Destroy services (reverse order)
|
|
157
158
|
const serviceNow = Date.now();
|
|
158
159
|
this.logger.verbose("Destroying services...");
|
|
159
160
|
await this.destroyServices();
|
|
160
161
|
this.logger.verbose(`Destroy services in ${Date.now() - serviceNow}ms`);
|
|
161
162
|
|
|
163
|
+
// 3. Destroy adaptors (reverse order)
|
|
162
164
|
const adaptorNow = Date.now();
|
|
163
165
|
this.logger.verbose("Destroying adaptors...");
|
|
164
166
|
await this.destroyAdaptors();
|
|
165
167
|
this.logger.verbose(`Destroy adaptors in ${Date.now() - adaptorNow}ms`);
|
|
166
168
|
|
|
169
|
+
// 4. Destroy external uses (SDK clients, API wrappers, etc.)
|
|
167
170
|
const usesNow = Date.now();
|
|
168
171
|
this.logger.verbose("Destroying uses...");
|
|
169
172
|
await this.destroyUses();
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// Browser-side HMR client. Delivered as a classic inline <script> (appended
|
|
2
|
+
// to the RSC bootstrap content) so it starts listening before any module
|
|
3
|
+
// script runs. Keep it small and free of dependencies — we cannot rely on any
|
|
4
|
+
// framework code being available when this executes.
|
|
5
|
+
//
|
|
6
|
+
// Protocol (see wsHub.ts `HmrMessage` for the TypeScript shape):
|
|
7
|
+
// { type: "hello", buildId, cssAssets } → initial handshake on connect
|
|
8
|
+
// { type: "reload", buildId } → full page refresh
|
|
9
|
+
// { type: "rsc-refresh", buildId } → full page refresh
|
|
10
|
+
// { type: "client-refresh", buildId } → full page refresh
|
|
11
|
+
// { type: "css-update", cssAssets } → atomic current-subroute <link> swap, no reload
|
|
12
|
+
// { type: "error", message } → forwarded build error, console only
|
|
13
|
+
//
|
|
14
|
+
// The server-rendered HTML tags the "active" stylesheet with
|
|
15
|
+
// data-akan-css="active" (see rscWorker.tsx) so swapCss can remove the stale
|
|
16
|
+
// one after the new stylesheet has finished loading without a flash of
|
|
17
|
+
// unstyled content.
|
|
3
18
|
export const HMR_CLIENT_SCRIPT = `(function(){
|
|
4
19
|
if (self.__AKAN_HMR_INSTALLED__) return;
|
|
5
20
|
self.__AKAN_HMR_INSTALLED__ = true;
|
|
@@ -19,6 +34,8 @@ export const HMR_CLIENT_SCRIPT = `(function(){
|
|
|
19
34
|
var overlayJobs = {};
|
|
20
35
|
self.__AKAN_HMR_PHASE__ = null;
|
|
21
36
|
|
|
37
|
+
// Bun's React Fast Refresh transform can emit top-level calls to these globals
|
|
38
|
+
// even when we fall back to full reload instead of applying React Refresh.
|
|
22
39
|
self.$RefreshReg$ = self.$RefreshReg$ || function(){};
|
|
23
40
|
self.$RefreshSig$ = self.$RefreshSig$ || function(){ return function(type){ return type; }; };
|
|
24
41
|
|
|
@@ -73,6 +90,7 @@ export const HMR_CLIENT_SCRIPT = `(function(){
|
|
|
73
90
|
setTimeout(connect, delay);
|
|
74
91
|
}
|
|
75
92
|
|
|
93
|
+
// goseoghyeon: CSR route registry keeps stale module refs, so JS/RSC HMR uses full reload for now.
|
|
76
94
|
function reloadForHmr(msg){
|
|
77
95
|
try { self.__AKAN_RSC_CLEAR_CACHE__ && self.__AKAN_RSC_CLEAR_CACHE__(); } catch(e){}
|
|
78
96
|
if (msg && msg.buildId != null) lastBuildId = msg.buildId;
|
|
@@ -363,6 +363,9 @@ export class DevHmrController {
|
|
|
363
363
|
];
|
|
364
364
|
if (files.some((file) => runtimeRoots.some((needle) => path.resolve(file).includes(needle)))) return true;
|
|
365
365
|
|
|
366
|
+
// A route source file that is not in the current seed index is likely a
|
|
367
|
+
// newly added route/layout. The backend's route seed index is static for
|
|
368
|
+
// this process, so a full reload is the safer recovery path.
|
|
366
369
|
return (
|
|
367
370
|
routeIds === undefined &&
|
|
368
371
|
files.some((file) => path.resolve(file).includes(`${path.sep}page${path.sep}`) && /\.(tsx|ts|jsx|js)$/.test(file))
|
|
@@ -379,6 +382,7 @@ export class DevHmrController {
|
|
|
379
382
|
try {
|
|
380
383
|
return new URL(`${protoFallback}://${hostFallback}`).origin;
|
|
381
384
|
} catch {
|
|
385
|
+
/* fallthrough */
|
|
382
386
|
}
|
|
383
387
|
}
|
|
384
388
|
return parsed.origin;
|