tungsten 0.6.3 → 0.7.1
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/.build-complete +1 -1
- package/dist/Brands.d.ts +16 -0
- package/dist/Brands.d.ts.map +1 -0
- package/dist/Brands.js +22 -0
- package/dist/Components.d.ts +4 -1
- package/dist/Components.d.ts.map +1 -1
- package/dist/Components.js +24 -6
- package/dist/ContentNode.d.ts +3 -2
- package/dist/ContentNode.d.ts.map +1 -1
- package/dist/ContentNode.js +11 -0
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js +23 -4
- package/dist/FrameworkConfig.d.ts +9 -1
- package/dist/FrameworkConfig.d.ts.map +1 -1
- package/dist/FrameworkConfig.types.test.d.ts +2 -0
- package/dist/FrameworkConfig.types.test.d.ts.map +1 -0
- package/dist/FrameworkConfig.types.test.js +6 -0
- package/dist/FunctionComponent.d.ts +1 -0
- package/dist/FunctionComponent.d.ts.map +1 -1
- package/dist/FunctionComponentStandIn.d.ts.map +1 -1
- package/dist/Instance/Instance.d.ts +21 -9
- package/dist/Instance/Instance.d.ts.map +1 -1
- package/dist/Instance/Instance.js +42 -38
- package/dist/Instance/InstanceConfig.d.ts +3 -1
- package/dist/Instance/InstanceConfig.d.ts.map +1 -1
- package/dist/RenderedContentNode.d.ts.map +1 -1
- package/dist/RenderingNode.d.ts.map +1 -1
- package/dist/Servers/DevServer.d.ts +4 -2
- package/dist/Servers/DevServer.d.ts.map +1 -1
- package/dist/Servers/DevServer.js +72 -21
- package/dist/Servers/ProdServer.d.ts +5 -2
- package/dist/Servers/ProdServer.d.ts.map +1 -1
- package/dist/Servers/ProdServer.js +95 -19
- package/dist/Servers/StaticSiteServer.d.ts +1 -1
- package/dist/Servers/StaticSiteServer.d.ts.map +1 -1
- package/dist/Servers/TungstenServer.d.ts +2 -1
- package/dist/Servers/TungstenServer.d.ts.map +1 -1
- package/dist/Servers/TungstenServer.js +7 -0
- package/dist/Servers/cacheVersioned.d.ts +3 -0
- package/dist/Servers/cacheVersioned.d.ts.map +1 -0
- package/dist/Servers/cacheVersioned.js +23 -0
- package/dist/Servers/devErrorPageAutoRetry.d.ts.map +1 -1
- package/dist/Servers/devErrorPageAutoRetry.js +1 -0
- package/dist/Servers/initStores.d.ts +4 -4
- package/dist/Servers/initStores.d.ts.map +1 -1
- package/dist/Servers/initStores.js +2 -2
- package/dist/Servers/loadEnvsDev.d.ts.map +1 -1
- package/dist/Servers/loadEnvsDev.js +7 -6
- package/dist/Servers/resetRegistrations.d.ts +2 -0
- package/dist/Servers/resetRegistrations.d.ts.map +1 -0
- package/dist/Servers/resetRegistrations.js +13 -0
- package/dist/Servers/routing.d.ts +3 -2
- package/dist/Servers/routing.d.ts.map +1 -1
- package/dist/Servers/routing.js +12 -7
- package/dist/Servers/stubInstance.d.ts +8 -0
- package/dist/Servers/stubInstance.d.ts.map +1 -0
- package/dist/Servers/stubInstance.js +40 -0
- package/dist/Store/InternalStoreSchema.d.ts +1 -1
- package/dist/Store/Store.js +2 -1
- package/dist/Store/StoreSchemaClass.d.ts +6 -3
- package/dist/Store/StoreSchemaClass.d.ts.map +1 -1
- package/dist/Store/StoreSchemaClass.js +8 -1
- package/dist/Store/TypeSafeStore.js +2 -1
- package/dist/Store/createStores.d.ts +3 -3
- package/dist/Store/createStores.d.ts.map +1 -1
- package/dist/Store/createStores.js +7 -2
- package/dist/Store/getInternalStore.d.ts.map +1 -1
- package/dist/Store/registerStore.d.ts.map +1 -1
- package/dist/Store/registerStore.js +2 -2
- package/dist/Store/storeCreators.d.ts +2 -2
- package/dist/Store/storeCreators.d.ts.map +1 -1
- package/dist/TungstenApp.d.ts +3 -3
- package/dist/TungstenApp.d.ts.map +1 -1
- package/dist/_client/cjsHelpers.d.ts.map +1 -1
- package/dist/_client/cjsHelpers.js +5 -3
- package/dist/_client/client.d.ts +2 -0
- package/dist/_client/client.d.ts.map +1 -1
- package/dist/_client/client.js +10 -3
- package/dist/api/getApiRoutes.d.ts.map +1 -1
- package/dist/api/getExport.d.ts +1 -1
- package/dist/api/getExport.d.ts.map +1 -1
- package/dist/api/getExport.js +2 -1
- package/dist/api/getExportDev.d.ts +1 -1
- package/dist/api/getExportDev.d.ts.map +1 -1
- package/dist/appBuilder.d.ts +69 -0
- package/dist/appBuilder.d.ts.map +1 -0
- package/dist/appBuilder.js +98 -0
- package/dist/appBuilder.types.test.d.ts +110 -0
- package/dist/appBuilder.types.test.d.ts.map +1 -0
- package/dist/appBuilder.types.test.js +240 -0
- package/dist/babelPlugins/BabelTransformBindDirect.js +7 -7
- package/dist/babelPlugins/BabelTransformBindVar.js +7 -7
- package/dist/babelPlugins/BabelTransformComponentState.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformComponentStyles.js +5 -5
- package/dist/babelPlugins/BabelTransformCssImports.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformCssImports.js +2 -2
- package/dist/babelPlugins/BabelTransformDeproxyState.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformPackageImports.js +11 -6
- package/dist/babelPlugins/BabelTransformRemoveDevBlocks.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformRemoveServerBlocks.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTypes.d.ts.map +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.d.ts.map +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.js +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.d.ts.map +1 -1
- package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +2 -2
- package/dist/bin/commands/compile.d.ts.map +1 -1
- package/dist/bin/commands/compile.js +2 -1
- package/dist/build/CompilationInfo.d.ts +3 -0
- package/dist/build/CompilationInfo.d.ts.map +1 -1
- package/dist/build/assetVersions.d.ts +9 -0
- package/dist/build/assetVersions.d.ts.map +1 -0
- package/dist/build/assetVersions.js +39 -0
- package/dist/build/babel.user.common.config.d.ts.map +1 -1
- package/dist/build/bundle.d.ts.map +1 -1
- package/dist/build/bundle.js +2 -1
- package/dist/build/bundleBabelOptions.d.ts.map +1 -1
- package/dist/build/clientRoutesFile.d.ts +2 -0
- package/dist/build/clientRoutesFile.d.ts.map +1 -0
- package/dist/build/clientRoutesFile.js +13 -0
- package/dist/build/compileJavascript.d.ts.map +1 -1
- package/dist/build/compileJavascript.js +4 -3
- package/dist/build/compileStyles.d.ts +2 -1
- package/dist/build/compileStyles.d.ts.map +1 -1
- package/dist/build/compileStyles.js +38 -83
- package/dist/build/compileUserApp.d.ts.map +1 -1
- package/dist/build/componentStylesCache.d.ts.map +1 -1
- package/dist/build/componentStylesCache.js +3 -2
- package/dist/build/copyAssets.d.ts.map +1 -1
- package/dist/build/copyAssets.js +2 -1
- package/dist/build/copyPackageModulesToPackagesFolder.d.ts.map +1 -1
- package/dist/build/copyPackageModulesToPackagesFolder.js +1 -1
- package/dist/build/copyPublicFiles.d.ts.map +1 -1
- package/dist/build/copyPublicFiles.js +2 -1
- package/dist/build/createClientFiles.d.ts.map +1 -1
- package/dist/build/createClientFiles.js +9 -5
- package/dist/build/createInstanceConfigFile.d.ts +1 -1
- package/dist/build/createInstanceConfigFile.d.ts.map +1 -1
- package/dist/build/createInstanceConfigFile.js +9 -3
- package/dist/build/frameworkDestLocation.d.ts.map +1 -1
- package/dist/build/frameworkDestLocation.js +5 -6
- package/dist/build/frameworkStylesheets.d.ts.map +1 -1
- package/dist/build/frameworkStylesheets.js +1 -1
- package/dist/build/makeBabelRawConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserDevConfig.d.ts +2 -2
- package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
- package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
- package/dist/build/rollup.user.prod.config.js +5 -3
- package/dist/build/rollupProdConstants.d.ts +5 -0
- package/dist/build/rollupProdConstants.d.ts.map +1 -0
- package/dist/build/rollupProdConstants.js +21 -0
- package/dist/cacheControl.d.ts +13 -0
- package/dist/cacheControl.d.ts.map +1 -0
- package/dist/cacheControl.js +22 -0
- package/dist/compat/types.d.ts +1 -1
- package/dist/compat/types.d.ts.map +1 -1
- package/dist/componentHelpers.d.ts +19 -0
- package/dist/componentHelpers.d.ts.map +1 -0
- package/dist/componentHelpers.js +31 -0
- package/dist/componentProxyHandlers.d.ts.map +1 -1
- package/dist/components/Fragment.d.ts +8 -0
- package/dist/components/Fragment.d.ts.map +1 -0
- package/dist/components/Fragment.js +10 -0
- package/dist/components/Link.d.ts +4 -3
- package/dist/components/Link.d.ts.map +1 -1
- package/dist/components/Link.js +1 -0
- package/dist/components/NoEscape.d.ts +8 -0
- package/dist/components/NoEscape.d.ts.map +1 -0
- package/dist/components/NoEscape.js +6 -0
- package/dist/components/RouteRedirectComponent.d.ts.map +1 -1
- package/dist/components/RouteRedirectComponent.js +1 -1
- package/dist/components/WebRedirectComponent.d.ts.map +1 -1
- package/dist/components/WebRedirectComponent.js +1 -1
- package/dist/components/bindable/BindVariable.d.ts +1 -0
- package/dist/components/bindable/BindVariable.d.ts.map +1 -1
- package/dist/components/bindable/BindableCheckbox.d.ts +7 -7
- package/dist/components/bindable/BindableCheckbox.d.ts.map +1 -1
- package/dist/components/bindable/BindableInput.d.ts +7 -7
- package/dist/components/bindable/BindableInput.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputNonString.d.ts +2 -2
- package/dist/components/bindable/BindableInputNonString.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputString.d.ts +2 -2
- package/dist/components/bindable/BindableInputString.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputTyped.d.ts +3 -3
- package/dist/components/bindable/BindableInputTyped.d.ts.map +1 -1
- package/dist/components/bindable/BindableInputTypedLegacy.d.ts +3 -3
- package/dist/components/bindable/BindableInputTypedLegacy.d.ts.map +1 -1
- package/dist/components/bindable/BindableRadio.js +2 -2
- package/dist/components/bindable/BindableSelect.d.ts +13 -10
- package/dist/components/bindable/BindableSelect.d.ts.map +1 -1
- package/dist/components/bindable/BindableSelectNaive.js +3 -3
- package/dist/components/bindable/BindableTextarea.d.ts +7 -7
- package/dist/components/bindable/BindableTextarea.d.ts.map +1 -1
- package/dist/components/bindable/bindableCandidates.comparison.d.ts +136 -0
- package/dist/components/bindable/bindableCandidates.comparison.d.ts.map +1 -0
- package/dist/components/bindable/bindableCandidates.comparison.js +268 -0
- package/dist/components/bindable/bindableProps.types.test.d.ts +50 -0
- package/dist/components/bindable/bindableProps.types.test.d.ts.map +1 -0
- package/dist/components/bindable/bindableProps.types.test.js +252 -0
- package/dist/components/library/RichTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/library/RichTextEditor/contentTree.d.ts.map +1 -1
- package/dist/components/makeTypedLink.d.ts +9 -0
- package/dist/components/makeTypedLink.d.ts.map +1 -0
- package/dist/components/makeTypedLink.js +15 -0
- package/dist/context/registerContext.d.ts +22 -0
- package/dist/context/registerContext.d.ts.map +1 -0
- package/dist/context/registerContext.js +18 -0
- package/dist/env/getEnvSchemas.d.ts.map +1 -1
- package/dist/env/getEnvSchemas.js +2 -1
- package/dist/fileVersions.d.ts +9 -0
- package/dist/fileVersions.d.ts.map +1 -0
- package/dist/fileVersions.js +28 -0
- package/dist/findUserConfig.d.ts +1 -1
- package/dist/findUserConfig.d.ts.map +1 -1
- package/dist/findUserConfig.js +2 -1
- package/dist/frameworkConfigSchema.d.ts +16 -2
- package/dist/frameworkConfigSchema.d.ts.map +1 -1
- package/dist/frameworkConfigSchema.js +15 -3
- package/dist/getComponent.d.ts.map +1 -1
- package/dist/getComponent.js +4 -3
- package/dist/getRoutes.d.ts.map +1 -1
- package/dist/getRoutes.js +9 -8
- package/dist/getUserConfig.d.ts.map +1 -1
- package/dist/hmr/applyHmrModule.d.ts.map +1 -1
- package/dist/hmr/componentIdentity.js +1 -1
- package/dist/hooks/getCurrentComponent.d.ts +1 -1
- package/dist/hooks/getCurrentComponent.d.ts.map +1 -1
- package/dist/hydrate/hydrate.d.ts +5 -1
- package/dist/hydrate/hydrate.d.ts.map +1 -1
- package/dist/hydrate/hydrate.js +86 -52
- package/dist/hydrate/hydrateGlobalData.d.ts +4 -3
- package/dist/hydrate/hydrateGlobalData.d.ts.map +1 -1
- package/dist/hydrate/reconcileHydratedAttributes.d.ts +2 -1
- package/dist/hydrate/reconcileHydratedAttributes.d.ts.map +1 -1
- package/dist/hydrate/reconcileHydratedAttributes.js +4 -3
- package/dist/hydrate/renderHydrationMismatchBanner.d.ts.map +1 -1
- package/dist/hydrate/renderHydrationMismatchBanner.js +2 -1
- package/dist/hydrate/stubRouting.d.ts +8 -0
- package/dist/hydrate/stubRouting.d.ts.map +1 -0
- package/dist/hydrate/stubRouting.js +25 -0
- package/dist/importDevModuleWithRetry.d.ts +2 -1
- package/dist/importDevModuleWithRetry.d.ts.map +1 -1
- package/dist/importDevModuleWithRetry.js +2 -1
- package/dist/importModule.d.ts +3 -0
- package/dist/importModule.d.ts.map +1 -0
- package/dist/importModule.js +4 -0
- package/dist/index.js +2 -1
- package/dist/indexInner.d.ts +30 -7
- package/dist/indexInner.d.ts.map +1 -1
- package/dist/indexInner.js +37 -2
- package/dist/json.d.ts +12 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +8 -0
- package/dist/jsxHelpers.d.ts +3 -0
- package/dist/jsxHelpers.d.ts.map +1 -0
- package/dist/jsxHelpers.js +6 -0
- package/dist/jsxRuntime.d.ts +1 -0
- package/dist/jsxRuntime.d.ts.map +1 -1
- package/dist/jsxRuntime.js +3 -1
- package/dist/jsxRuntimeSignals.d.ts.map +1 -1
- package/dist/jsxRuntimeSignals.js +1 -0
- package/dist/makeFinalConfig.d.ts.map +1 -1
- package/dist/makeFinalConfig.js +2 -0
- package/dist/makeInstanceConfigFromFrameworkConfig.d.ts.map +1 -1
- package/dist/makeInstanceConfigFromFrameworkConfig.js +2 -0
- package/dist/mergeConfigs.d.ts.map +1 -1
- package/dist/mergeConfigs.js +2 -6
- package/dist/nbsp.d.ts +1 -2
- package/dist/nbsp.d.ts.map +1 -1
- package/dist/nbsp.js +3 -7
- package/dist/objectMap.d.ts +1 -1
- package/dist/objectMap.d.ts.map +1 -1
- package/dist/pipeline/PipelineRequestHandler.d.ts +25 -0
- package/dist/pipeline/PipelineRequestHandler.d.ts.map +1 -0
- package/dist/pipeline/PipelineRequestHandler.js +104 -0
- package/dist/pipeline/contextStore.d.ts +12 -0
- package/dist/pipeline/contextStore.d.ts.map +1 -0
- package/dist/pipeline/contextStore.js +13 -0
- package/dist/pipeline/hydratePipeline.d.ts +4 -0
- package/dist/pipeline/hydratePipeline.d.ts.map +1 -0
- package/dist/pipeline/hydratePipeline.js +83 -0
- package/dist/pipeline/importRoutesModule.d.ts +6 -0
- package/dist/pipeline/importRoutesModule.d.ts.map +1 -0
- package/dist/pipeline/importRoutesModule.js +33 -0
- package/dist/pipeline/networkedTransport.d.ts +11 -0
- package/dist/pipeline/networkedTransport.d.ts.map +1 -0
- package/dist/pipeline/networkedTransport.js +54 -0
- package/dist/pipeline/pipeline.d.ts +107 -0
- package/dist/pipeline/pipeline.d.ts.map +1 -0
- package/dist/pipeline/pipeline.js +113 -0
- package/dist/pipeline/pipeline.types.test.d.ts +760 -0
- package/dist/pipeline/pipeline.types.test.d.ts.map +1 -0
- package/dist/pipeline/pipeline.types.test.js +344 -0
- package/dist/pipeline/pipelineDefinition.d.ts +78 -0
- package/dist/pipeline/pipelineDefinition.d.ts.map +1 -0
- package/dist/pipeline/pipelineDefinition.js +11 -0
- package/dist/pipeline/pipelineSplit.types.test.d.ts +2445 -0
- package/dist/pipeline/pipelineSplit.types.test.d.ts.map +1 -0
- package/dist/pipeline/pipelineSplit.types.test.js +440 -0
- package/dist/pipeline/runPipeline.d.ts +29 -0
- package/dist/pipeline/runPipeline.d.ts.map +1 -0
- package/dist/pipeline/runPipeline.js +71 -0
- package/dist/pipeline/runSplitPipeline.d.ts +10 -0
- package/dist/pipeline/runSplitPipeline.d.ts.map +1 -0
- package/dist/pipeline/runSplitPipeline.js +52 -0
- package/dist/pipeline/splitPipeline.d.ts +62 -0
- package/dist/pipeline/splitPipeline.d.ts.map +1 -0
- package/dist/pipeline/splitPipeline.js +76 -0
- package/dist/pop.js +1 -1
- package/dist/rawHtml/filterContentNode.d.ts.map +1 -1
- package/dist/render/HeadData.d.ts +3 -1
- package/dist/render/HeadData.d.ts.map +1 -1
- package/dist/render/classComponentNodeToRenderingTree.d.ts.map +1 -1
- package/dist/render/componentNodeToRenderingTree.d.ts.map +1 -1
- package/dist/render/contentToHtml.d.ts +2 -2
- package/dist/render/contentToHtml.d.ts.map +1 -1
- package/dist/render/contentToHtml.js +2 -1
- package/dist/render/contentToHtmlDev.d.ts +1 -1
- package/dist/render/contentToHtmlDev.d.ts.map +1 -1
- package/dist/render/contentTreeToRenderingTree.d.ts.map +1 -1
- package/dist/render/contentTreeToRenderingTree.js +6 -2
- package/dist/render/functionComponentNodeToRenderingTree.d.ts.map +1 -1
- package/dist/render/functionComponentNodeToRenderingTree.js +2 -2
- package/dist/render/instantiateComponent.d.ts.map +1 -1
- package/dist/render/processHead.d.ts.map +1 -1
- package/dist/render/processHead.js +12 -18
- package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
- package/dist/render/renderingTreeToHtml.js +6 -3
- package/dist/render/rootToHtml.d.ts +2 -2
- package/dist/render/rootToHtml.d.ts.map +1 -1
- package/dist/requests/fetch/delete.d.ts.map +1 -1
- package/dist/requests/fetch/delete.js +5 -2
- package/dist/requests/fetch/get.js +1 -1
- package/dist/requests/fetch/patch.d.ts.map +1 -1
- package/dist/requests/fetch/patch.js +5 -2
- package/dist/requests/fetch/post.d.ts.map +1 -1
- package/dist/requests/fetch/post.js +5 -2
- package/dist/requests/fetch/put.d.ts.map +1 -1
- package/dist/requests/fetch/put.js +5 -2
- package/dist/routesLocationParts.d.ts +6 -0
- package/dist/routesLocationParts.d.ts.map +1 -0
- package/dist/routesLocationParts.js +10 -0
- package/dist/routing/AppRoutes.d.ts +5 -3
- package/dist/routing/AppRoutes.d.ts.map +1 -1
- package/dist/routing/MatchedRouteInfo.d.ts +13 -0
- package/dist/routing/MatchedRouteInfo.d.ts.map +1 -0
- package/dist/routing/MatchedRouteInfo.js +1 -0
- package/dist/routing/RouteContentFunction.d.ts +1 -2
- package/dist/routing/RouteContentFunction.d.ts.map +1 -1
- package/dist/routing/RouteDataFunction.type.d.ts +4 -2
- package/dist/routing/RouteDataFunction.type.d.ts.map +1 -1
- package/dist/routing/RoutePaths.d.ts +12 -0
- package/dist/routing/RoutePaths.d.ts.map +1 -0
- package/dist/routing/RouteTypes.d.ts +6 -4
- package/dist/routing/RouteTypes.d.ts.map +1 -1
- package/dist/routing/Routes.d.ts +20 -11
- package/dist/routing/Routes.d.ts.map +1 -1
- package/dist/routing/RoutesFunction.d.ts +11 -2
- package/dist/routing/RoutesFunction.d.ts.map +1 -1
- package/dist/routing/Serializable.d.ts +5 -0
- package/dist/routing/Serializable.d.ts.map +1 -0
- package/dist/routing/Serializable.js +1 -0
- package/dist/routing/builder.d.ts +100 -0
- package/dist/routing/builder.d.ts.map +1 -0
- package/dist/routing/builder.js +219 -0
- package/dist/routing/builder.trial.d.ts +2 -0
- package/dist/routing/builder.trial.d.ts.map +1 -0
- package/dist/routing/builder.trial.js +85 -0
- package/dist/routing/defineRoutes.d.ts +8 -0
- package/dist/routing/defineRoutes.d.ts.map +1 -0
- package/dist/routing/defineRoutes.js +3 -0
- package/dist/routing/pyramidRouting.d.ts +2 -0
- package/dist/routing/pyramidRouting.d.ts.map +1 -0
- package/dist/routing/pyramidRouting.js +13 -0
- package/dist/routing/redirectOf.d.ts +11 -0
- package/dist/routing/redirectOf.d.ts.map +1 -0
- package/dist/routing/redirectOf.js +32 -0
- package/dist/routing/registerGlobalData.d.ts +11 -3
- package/dist/routing/registerGlobalData.d.ts.map +1 -1
- package/dist/routing/registerGlobalData.js +6 -0
- package/dist/routing/registerParts.types.test.d.ts +2 -0
- package/dist/routing/registerParts.types.test.d.ts.map +1 -0
- package/dist/routing/registerParts.types.test.js +139 -0
- package/dist/routing/registerRoutes.d.ts +10 -0
- package/dist/routing/registerRoutes.d.ts.map +1 -0
- package/dist/routing/registerRoutes.js +9 -0
- package/dist/routing/registerRouting.d.ts +36 -0
- package/dist/routing/registerRouting.d.ts.map +1 -0
- package/dist/routing/registerRouting.js +34 -0
- package/dist/routing/registerRouting.types.test.d.ts +80 -0
- package/dist/routing/registerRouting.types.test.d.ts.map +1 -0
- package/dist/routing/registerRouting.types.test.js +120 -0
- package/dist/routing/registrationTypes.d.ts +11 -0
- package/dist/routing/registrationTypes.d.ts.map +1 -0
- package/dist/routing/registrationTypes.js +1 -0
- package/dist/routing/resolveAppRoutes.d.ts +5 -0
- package/dist/routing/resolveAppRoutes.d.ts.map +1 -0
- package/dist/routing/resolveAppRoutes.js +25 -0
- package/dist/routing/routesArray.d.ts +23 -0
- package/dist/routing/routesArray.d.ts.map +1 -0
- package/dist/routing/routesArray.js +20 -0
- package/dist/routing/routesArray.types.test.d.ts +2 -0
- package/dist/routing/routesArray.types.test.d.ts.map +1 -0
- package/dist/routing/routesArray.types.test.js +132 -0
- package/dist/routing/routingBuilder.d.ts +34 -0
- package/dist/routing/routingBuilder.d.ts.map +1 -0
- package/dist/routing/routingBuilder.js +32 -0
- package/dist/routing/routingBuilder.types.test.d.ts +2 -0
- package/dist/routing/routingBuilder.types.test.d.ts.map +1 -0
- package/dist/routing/routingBuilder.types.test.js +171 -0
- package/dist/routing/routingRegistry.d.ts +19 -0
- package/dist/routing/routingRegistry.d.ts.map +1 -0
- package/dist/routing/routingRegistry.js +29 -0
- package/dist/staticGen/getAppRoutes.d.ts +2 -2
- package/dist/staticGen/getAppRoutes.d.ts.map +1 -1
- package/dist/staticGen/getAppRoutes.js +9 -6
- package/dist/staticGen/staticGen.d.ts.map +1 -1
- package/dist/staticGen/staticGen.js +8 -2
- package/dist/style/styleContentSxy.d.ts.map +1 -1
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +2 -0
- package/dist/syncServer/index.cjs +1 -2
- package/dist/syncServer/preload.js +2 -0
- package/dist/testing/contentToString.d.ts +13 -0
- package/dist/testing/contentToString.d.ts.map +1 -0
- package/dist/testing/contentToString.js +105 -0
- package/dist/testing/createTestApp.d.ts +25 -1
- package/dist/testing/createTestApp.d.ts.map +1 -1
- package/dist/testing/createTestApp.js +12 -3
- package/dist/testing/display.d.ts +2 -0
- package/dist/testing/display.d.ts.map +1 -0
- package/dist/testing/display.js +37 -0
- package/dist/testing/ensure.d.ts +119 -0
- package/dist/testing/ensure.d.ts.map +1 -0
- package/dist/testing/ensure.js +664 -0
- package/dist/testing/ensure.trial.d.ts +2 -0
- package/dist/testing/ensure.trial.d.ts.map +1 -0
- package/dist/testing/ensure.trial.js +9 -0
- package/dist/testing/ensure.types.test.d.ts +2 -0
- package/dist/testing/ensure.types.test.d.ts.map +1 -0
- package/dist/testing/ensure.types.test.js +34 -0
- package/dist/testing/helpers/contentHtmlElements.d.ts.map +1 -1
- package/dist/testing/host.d.ts +86 -15
- package/dist/testing/host.d.ts.map +1 -1
- package/dist/testing/host.js +82 -23
- package/dist/testing/host.types.test.d.ts +2 -0
- package/dist/testing/host.types.test.d.ts.map +1 -0
- package/dist/testing/host.types.test.js +81 -0
- package/dist/testing/hydrateTestApp.d.ts +17 -0
- package/dist/testing/hydrateTestApp.d.ts.map +1 -1
- package/dist/testing/hydrateTestApp.js +27 -6
- package/dist/testing/index.d.ts +5 -3
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3 -1
- package/dist/testing/pipeline/createTestPacketApp.d.ts +30 -0
- package/dist/testing/pipeline/createTestPacketApp.d.ts.map +1 -0
- package/dist/testing/pipeline/createTestPacketApp.js +45 -0
- package/dist/testing/pipeline/createTestPacketApp.types.test.d.ts +3 -0
- package/dist/testing/pipeline/createTestPacketApp.types.test.d.ts.map +1 -0
- package/dist/testing/pipeline/createTestPacketApp.types.test.js +101 -0
- package/dist/testing/pipeline/createTestPipelineApp.d.ts +70 -0
- package/dist/testing/pipeline/createTestPipelineApp.d.ts.map +1 -0
- package/dist/testing/pipeline/createTestPipelineApp.js +90 -0
- package/dist/testing/pipeline/createTestPipelineApp.types.test.d.ts +6 -0
- package/dist/testing/pipeline/createTestPipelineApp.types.test.d.ts.map +1 -0
- package/dist/testing/pipeline/createTestPipelineApp.types.test.js +146 -0
- package/dist/testing/pipeline/hostPipeline.d.ts +25 -0
- package/dist/testing/pipeline/hostPipeline.d.ts.map +1 -0
- package/dist/testing/pipeline/hostPipeline.js +18 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.d.ts +30 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.d.ts.map +1 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.js +193 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.types.test.d.ts +2 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.types.test.d.ts.map +1 -0
- package/dist/testing/pipeline/hydrateTestPipelineApp.types.test.js +27 -0
- package/dist/testing/pipeline/index.d.ts +5 -0
- package/dist/testing/pipeline/index.d.ts.map +1 -0
- package/dist/testing/pipeline/index.js +4 -0
- package/dist/testing/pipeline/pipelineTestApp.d.ts +34 -0
- package/dist/testing/pipeline/pipelineTestApp.d.ts.map +1 -0
- package/dist/testing/pipeline/pipelineTestApp.js +100 -0
- package/dist/testing/pipeline/testPipelineRoute.d.ts +2 -0
- package/dist/testing/pipeline/testPipelineRoute.d.ts.map +1 -0
- package/dist/testing/pipeline/testPipelineRoute.js +1 -0
- package/dist/testing/resolveContent.d.ts +18 -0
- package/dist/testing/resolveContent.d.ts.map +1 -0
- package/dist/testing/resolveContent.js +73 -0
- package/dist/testing/testingComponentPackage.d.ts +3 -1
- package/dist/testing/testingComponentPackage.d.ts.map +1 -1
- package/dist/testing/testingComponentPackage.js +16 -1
- package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
- package/dist/update/integrateUpdateVdom.js +35 -31
- package/dist/update/integrateUpdateVdomPrebuild.js +20 -20
- package/dist/validChildren.d.ts.map +1 -1
- package/dist/zones/react.d.ts.map +1 -1
- package/package.json +23 -19
- package/types/helpers.d.ts +11 -2
- package/types/jsx/html.d.ts +29 -25
- package/types/jsx/jsx.d.ts +8 -8
- package/types/modules.d.ts +14 -3
- package/types/testing.d.ts +0 -0
- package/vendor/babel-core.js +5 -5
- package/vendor/babel-parser.js +1 -1
- package/vendor/babel-preset-react.js +32 -34
- package/vendor/babel-preset-typescript.js +5 -5
- package/vendor/chalk-extensions.js +3 -146
- package/vendor/chokidar.js +311 -5
- package/vendor/chunk-B34JUlnS.js +169 -0
- package/vendor/{chunk-Bu8ZRE-c.js → chunk-B9ttgKqg.js} +28 -25
- package/vendor/{chunk-D2EnpcLg.js → chunk-BGvapINa.js} +3 -164
- package/vendor/{chunk-Cqrj-Zqr.js → chunk-BmAiqUzD.js} +22 -8
- package/vendor/{chunk-BiUcnLhT.js → chunk-But4T5N_.js} +8 -3
- package/vendor/{chunk-OUnVY4Wm.js → chunk-DuR6SGzI.js} +162 -35
- package/vendor/css-select.js +3383 -0
- package/vendor/dotenv.js +2 -2
- package/vendor/express.js +61 -10
- package/vendor/manifest.json +4 -3
- package/vendor/postcss.js +1 -1
- package/vendor/precinct.js +5914 -3591
- package/vendor/valibot.js +418 -504
- package/dist/Servers/MatchedRouteInfo.d.ts +0 -11
- package/dist/Servers/MatchedRouteInfo.d.ts.map +0 -1
- package/dist/routing/__fluentRouteBuilder.d.ts +0 -80
- package/dist/routing/__fluentRouteBuilder.d.ts.map +0 -1
- package/dist/routing/__fluentRouteBuilder.js +0 -183
- package/dist/routing/__fluentRoutes.d.ts +0 -2
- package/dist/routing/__fluentRoutes.d.ts.map +0 -1
- package/dist/routing/__fluentRoutes.js +0 -59
- package/vendor/chunk-Hy-cCmu-.js +0 -23
- /package/dist/{Servers/MatchedRouteInfo.js → routing/RoutePaths.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserConfig.d.ts","sourceRoot":"","sources":["../src/getUserConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAU7F,wBAAsB,aAAa,CAC/B,SAAS,GAAE,wBAAwB,GAAG,IAAW,EACjD,MAAM,GAAE,QAAQ,GAAG,OAAiB,GACrC,OAAO,CAAC,uBAAuB,CAAC,
|
|
1
|
+
{"version":3,"file":"getUserConfig.d.ts","sourceRoot":"","sources":["../src/getUserConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAU7F,wBAAsB,aAAa,CAC/B,SAAS,GAAE,wBAAwB,GAAG,IAAW,EACjD,MAAM,GAAE,QAAQ,GAAG,OAAiB,GACrC,OAAO,CAAC,uBAAuB,CAAC,CA2BlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyHmrModule.d.ts","sourceRoot":"","sources":["../../src/hmr/applyHmrModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"applyHmrModule.d.ts","sourceRoot":"","sources":["../../src/hmr/applyHmrModule.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAG5D,MAAM,MAAM,oBAAoB,GACxB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GACrD;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAA;AAsB3C,wBAAsB,cAAc,CAChC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,GACtD,OAAO,CAAC,oBAAoB,CAAC,CAkD/B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnyComponentIsFunctionComponentStandIn } from '../AnyComponent.js';
|
|
2
2
|
import { AnyComponentTypeIsClassComponentType } from '../AnyComponentType.js';
|
|
3
3
|
export function componentTypeIdentityKey(Type) {
|
|
4
|
-
return Type.tagName || Type.name || Type.displayName || '--unnamed--';
|
|
4
|
+
return Type.tagName || Type.name || Type.displayName || '--unnamed--'; // eslint-disable-line @typescript-eslint/strict-boolean-expressions
|
|
5
5
|
}
|
|
6
6
|
export function componentTypeKind(Type) {
|
|
7
7
|
return AnyComponentTypeIsClassComponentType(Type) ? 'class' : 'function';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FunctionComponentStandInAny } from '
|
|
1
|
+
import type { FunctionComponentStandInAny } from '../FunctionComponentStandIn.js';
|
|
2
2
|
import type { FunctionElement } from '../FunctionComponentStandIn.js';
|
|
3
3
|
declare global {
|
|
4
4
|
let __tungsten_current_function_component_stand_in: FunctionComponentStandInAny;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCurrentComponent.d.ts","sourceRoot":"","sources":["../../src/hooks/getCurrentComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getCurrentComponent.d.ts","sourceRoot":"","sources":["../../src/hooks/getCurrentComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAMrE,OAAO,CAAC,MAAM,CAAC;IACX,IAAI,8CAA8C,EAAE,2BAA2B,CAAA;CAClF;AAED,wBAAgB,mBAAmB,IAAI,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAc/D"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { InstanceConfig } from '../Instance/InstanceConfig.js';
|
|
2
2
|
import type { AppRoutes } from '../routing/AppRoutes.js';
|
|
3
|
+
import type { Routes } from '../routing/Routes.js';
|
|
4
|
+
import type { MatchedRouteInfo } from '../routing/MatchedRouteInfo.js';
|
|
5
|
+
import type { NetworkMatchedRouteInfo } from './hydrateGlobalData.js';
|
|
3
6
|
import { DomPointer } from '../DomPointer.js';
|
|
4
7
|
import { type TungstenBaseComponentType } from '../Components.jsx';
|
|
5
8
|
import { Instance } from '../Instance/Instance.js';
|
|
@@ -11,6 +14,7 @@ export type HydrateMeta = {
|
|
|
11
14
|
selectValue: unknown;
|
|
12
15
|
};
|
|
13
16
|
export declare function makeDefaultHydrateMeta(): HydrateMeta;
|
|
14
|
-
export declare function hydrate(appRoutes: AppRoutes
|
|
17
|
+
export declare function hydrate(appRoutes: AppRoutes<any>, RootComponent: TungstenBaseComponentType | null, instanceConfig: InstanceConfig, fileVersions?: Record<string, string>): Promise<void>;
|
|
18
|
+
export declare function hydrationRouting(matchedRouteInfo: NetworkMatchedRouteInfo, routes: Routes<any>): MatchedRouteInfo;
|
|
15
19
|
export declare function hydrateRootComponent<ComponentType extends TungstenBaseComponentType<any, any>>(instance: Instance, RootComponent: ComponentType, domPointer: DomPointer, meta: HydrateMeta, props?: InstanceType<ComponentType>['props'], routeParams?: Record<string, string>, routeData?: unknown): Promise<InstanceType<ComponentType>>;
|
|
16
20
|
//# sourceMappingURL=hydrate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrate.d.ts","sourceRoot":"","sources":["../../src/hydrate/hydrate.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hydrate.d.ts","sourceRoot":"","sources":["../../src/hydrate/hydrate.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAQnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAuBrE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAO7C,OAAO,EACH,KAAK,yBAAyB,EAEjC,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAuBlD,OAAO,EACH,KAAK,uBAAuB,EAE/B,MAAM,oCAAoC,CAAA;AAc3C,OAAO,0BAA0B,CAAA;AASjC,MAAM,MAAM,WAAW,GAAG;IACtB,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,uBAAuB,EAAE,CAAA;IAGrC,WAAW,EAAE,OAAO,CAAA;CACvB,CAAA;AACD,wBAAgB,sBAAsB,IAAI,WAAW,CAEpD;AAID,wBAAsB,OAAO,CACzB,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,EACzB,aAAa,EAAE,yBAAyB,GAAG,IAAI,EAC/C,cAAc,EAAE,cAAc,EAC9B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,iBAuFxC;AAED,wBAAgB,gBAAgB,CAC5B,gBAAgB,EAAE,uBAAuB,EAEzC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,GACpB,gBAAgB,CAiBlB;AAED,wBAAsB,oBAAoB,CACtC,aAAa,SAAS,yBAAyB,CAAC,GAAG,EAAE,GAAG,CAAC,EAEzD,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,WAAW,EAIjB,KAAK,GAAE,YAAY,CAAC,aAAa,CAAC,CAAC,OAAO,CAAM,EAChD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,SAAS,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CA6DtC"}
|
package/dist/hydrate/hydrate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { initStores } from '
|
|
1
|
+
import { initStores } from '../Servers/initStores.js';
|
|
2
2
|
import { applyUpdate, integrateElementUpdateVdom } from '../update/integrateUpdateVdom.js';
|
|
3
3
|
//import type { RouteType } from '../routing/RouteType.js'
|
|
4
4
|
import { $number, $string, makeRenderedContentNodeNonRendered, makeRenderedContentNodeClassComponent, makeRenderedContentNodeFunctionComponent } from '../RenderedContentNode.js';
|
|
@@ -29,12 +29,19 @@ import { MatchedRoute } from '../routing/MatchedRoute.js';
|
|
|
29
29
|
import { isDev } from '../isDev.js';
|
|
30
30
|
import { isProd } from '../isProd.js';
|
|
31
31
|
import { urlToLocation } from '../routing/routeUrl.js';
|
|
32
|
+
import { toRoutes } from '../routing/routesArray.js';
|
|
32
33
|
import { warn } from '../appOutput.js';
|
|
33
34
|
import { reconcileHydratedAttributes } from './reconcileHydratedAttributes.js';
|
|
34
35
|
import { markOptionSelected } from '../markOptionSelected.js';
|
|
36
|
+
import { JSONstringify } from '../json.js';
|
|
35
37
|
import { renderHydrationMismatchBanner } from './renderHydrationMismatchBanner.js';
|
|
36
38
|
import { setCurrentInstance } from '../hmr/instanceRegistry.js';
|
|
39
|
+
import { createContext } from '../context/registerContext.js';
|
|
37
40
|
import { renderDocInitErrorBanner } from '../docInit.js';
|
|
41
|
+
import { globalDataFunc } from '../routing/registerGlobalData.js';
|
|
42
|
+
import { createNetworkedData } from '../routing/routingRegistry.js';
|
|
43
|
+
import { routing } from "../Servers/routing.js";
|
|
44
|
+
import { stubRouting } from './stubRouting.js';
|
|
38
45
|
// side-effect only: pulls applyHmrModule.js (and its clean, non-dynamic-import dependencies)
|
|
39
46
|
// into the framework's traced dependency graph so it gets copied to .packages/ and is servable
|
|
40
47
|
// to the browser. It is invoked from a raw, untraced inline script (processHead.ts) instead of
|
|
@@ -54,22 +61,44 @@ export function makeDefaultHydrateMeta() {
|
|
|
54
61
|
selectValue: undefined
|
|
55
62
|
};
|
|
56
63
|
}
|
|
57
|
-
export async function hydrate(appRoutes, RootComponent, instanceConfig) {
|
|
64
|
+
export async function hydrate(appRoutes, RootComponent, instanceConfig, fileVersions) {
|
|
58
65
|
debug('hydrate start');
|
|
59
66
|
// first, before any component is built: a DocInit that threw in the head is on screen whatever
|
|
60
67
|
// happens next (a read of its value throws below). Rendered again at the end, for the count.
|
|
61
68
|
if (isDev) renderDocInitErrorBanner();
|
|
62
69
|
//console.log('hydration global data ', __tungsten_global_data__)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
const
|
|
70
|
+
let location = urlToLocation(window.location, instanceConfig.siteBasePath, isProd && instanceConfig.staticSite);
|
|
71
|
+
// one for the page: navigation keeps this instance, and so this context
|
|
72
|
+
const context = createContext('client', null);
|
|
73
|
+
const stub = instanceConfig.serverSideRouting === false;
|
|
74
|
+
// carried over from the server's render, not rebuilt: the client has no request to build from.
|
|
75
|
+
// A stub page carries none, so the client makes its own
|
|
76
|
+
const networkedData = stub ? createNetworkedData(null, context) : __tungsten_networked_data__;
|
|
77
|
+
const routes = toRoutes(typeof appRoutes === 'function' ? appRoutes(null, context, networkedData) : appRoutes, isDev);
|
|
78
|
+
let matchedRouteInfo;
|
|
79
|
+
let globalData;
|
|
80
|
+
if (stub) {
|
|
81
|
+
// as a client navigation fetches: the global data beside routing
|
|
82
|
+
const [fetched, routed] = await Promise.all([globalDataFunc.value?.(null, context, networkedData) ?? {}, stubRouting(location, to => routing(to, routes, context, networkedData), instanceConfig)]);
|
|
83
|
+
if (routed === null) return;
|
|
84
|
+
({
|
|
85
|
+
location,
|
|
86
|
+
matchedRouteInfo
|
|
87
|
+
} = routed);
|
|
88
|
+
globalData = fetched;
|
|
89
|
+
} else {
|
|
90
|
+
matchedRouteInfo = hydrationRouting(__tungsten_matched_route_info__, routes);
|
|
91
|
+
globalData = __tungsten_global_data__;
|
|
92
|
+
}
|
|
67
93
|
const {
|
|
68
94
|
internalStore,
|
|
69
95
|
stores,
|
|
70
96
|
storeSubscriptions
|
|
71
|
-
} = initStores(location, null, globalData, matchedRouteInfo);
|
|
97
|
+
} = initStores(location, null, globalData, matchedRouteInfo, null, context, networkedData);
|
|
72
98
|
const instance = new Instance(location, instanceConfig, null, appRoutes, routes, internalStore, stores, storeSubscriptions, globalData, matchedRouteInfo);
|
|
99
|
+
instance.fileVersions = fileVersions;
|
|
100
|
+
instance.context = context;
|
|
101
|
+
instance.networkedData = networkedData;
|
|
73
102
|
if (isDev) setCurrentInstance(instance);
|
|
74
103
|
//const routes = instance.getRoutes()
|
|
75
104
|
// we know which route was matched
|
|
@@ -77,7 +106,7 @@ export async function hydrate(appRoutes, RootComponent, instanceConfig) {
|
|
|
77
106
|
// instance.routerData = __tungsten_router_data__
|
|
78
107
|
// }
|
|
79
108
|
// save the route data
|
|
80
|
-
if (typeof __tungsten_route_data__ !== 'undefined') {
|
|
109
|
+
if (!stub && typeof __tungsten_route_data__ !== 'undefined') {
|
|
81
110
|
instance.routeData = __tungsten_route_data__;
|
|
82
111
|
}
|
|
83
112
|
const domPointer = new DomPointer(document, 1);
|
|
@@ -102,7 +131,7 @@ export async function hydrate(appRoutes, RootComponent, instanceConfig) {
|
|
|
102
131
|
//// Can we pause any further update until hydration completes, to retain coherency?
|
|
103
132
|
//// Or should we set a value on each component that is hydrating to guarantee correctness? seems better
|
|
104
133
|
}
|
|
105
|
-
function hydrationRouting(matchedRouteInfo,
|
|
134
|
+
export function hydrationRouting(matchedRouteInfo,
|
|
106
135
|
//location: string,
|
|
107
136
|
routes) {
|
|
108
137
|
const {
|
|
@@ -180,7 +209,8 @@ function handleRootTitle(rootElement) {
|
|
|
180
209
|
} else if (rootElement instanceof TungstenSignalsComponent) {
|
|
181
210
|
rootElement.__instance.setDefaultTitle(rootElement.title(rootElement.props, rootElement.signals).toString());
|
|
182
211
|
} else {
|
|
183
|
-
rootElement.
|
|
212
|
+
const title = rootElement.title(rootElement.props, undefined); // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
213
|
+
rootElement.__instance.setDefaultTitle(title.toString());
|
|
184
214
|
}
|
|
185
215
|
} else {
|
|
186
216
|
rootElement.__instance.setDefaultTitle(rootElement.title.toString());
|
|
@@ -505,7 +535,7 @@ parentElement, domPointer, instance, meta) {
|
|
|
505
535
|
// node[$props].ref.current = domNode
|
|
506
536
|
// }
|
|
507
537
|
debug('hydarating atts');
|
|
508
|
-
hydrateAttributes(node, domNode, meta);
|
|
538
|
+
hydrateAttributes(node, domNode, meta, instance);
|
|
509
539
|
//!!! node.domElement = domNode
|
|
510
540
|
// look up any refs
|
|
511
541
|
//const props = node[$props]
|
|
@@ -519,12 +549,14 @@ parentElement, domPointer, instance, meta) {
|
|
|
519
549
|
const outerSelectValue = meta.selectValue;
|
|
520
550
|
if (node[$type] === 'select') meta.selectValue = node[$props].value;
|
|
521
551
|
let renderedChildren = $contentNull;
|
|
522
|
-
|
|
523
|
-
|
|
552
|
+
// CSR: body shipped empty on purpose, nothing to hydrate against - create fresh. A stub
|
|
553
|
+
// page (serverSideRouting false) ships the head without the app's children too
|
|
554
|
+
const fresh = node[$type] === 'body' && instance.config.csr || node[$type] === 'head' && instance.config.serverSideRouting === false;
|
|
555
|
+
if (fresh) {
|
|
524
556
|
if (parentElement === null) {
|
|
525
|
-
throwError('hydrateNodeSingle',
|
|
557
|
+
throwError('hydrateNodeSingle', `CSR hydration reached <${node[$type]}> with no owning component`);
|
|
526
558
|
}
|
|
527
|
-
const childDomPointer = new DomPointer(domNode);
|
|
559
|
+
const childDomPointer = new DomPointer(domNode, node[$type] === 'head' ? appHeadChildrenStart(domNode) : 0);
|
|
528
560
|
renderedChildren = await applyUpdate({
|
|
529
561
|
tungstenElement: parentElement,
|
|
530
562
|
instance,
|
|
@@ -558,7 +590,7 @@ parentElement, domPointer, instance, meta) {
|
|
|
558
590
|
}
|
|
559
591
|
// confirm that this code is not reached
|
|
560
592
|
const n = node; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
561
|
-
throwError('hydrateNodeSingle', `should never occur ${
|
|
593
|
+
throwError('hydrateNodeSingle', `should never occur ${JSONstringify(node)}`);
|
|
562
594
|
// TS shouldn't require this, because this code will never run, but it is bitching without it
|
|
563
595
|
//return makeRenderedContentNodeNonRendered()
|
|
564
596
|
}
|
|
@@ -580,7 +612,7 @@ async function hydrateNodeComponent(node, parentElement, domPointer, instance, m
|
|
|
580
612
|
}
|
|
581
613
|
// export type HTMLBindableElement = HTMLButtonElement | HTMLDataElement | HTMLInputElement | HTMLLIElement
|
|
582
614
|
// | HTMLMeterElement | HTMLOptionElement | HTMLParamElement | HTMLProgressElement | HTMLSelectElement | HTMLTextAreaElement
|
|
583
|
-
function hydrateAttributes(node, domNode, meta) {
|
|
615
|
+
function hydrateAttributes(node, domNode, meta, instance) {
|
|
584
616
|
// handle bind attributes and merge together event handlers
|
|
585
617
|
processAttributes(node);
|
|
586
618
|
// The two prop rewrites the server does before it writes any markup (processRenderingNodeHtml).
|
|
@@ -614,9 +646,9 @@ function hydrateAttributes(node, domNode, meta) {
|
|
|
614
646
|
...mismatch
|
|
615
647
|
});
|
|
616
648
|
if (isDev) {
|
|
617
|
-
warn(`hydration mismatch on <${node[$type]}>:` + ` ${mismatch.name} rendered as ${
|
|
649
|
+
warn(`hydration mismatch on <${node[$type]}>:` + ` ${mismatch.name} rendered as ${JSONstringify(mismatch.expected)}` + ` but the server sent ${JSONstringify(mismatch.actual)}.` + ` The rendered value has been applied.`);
|
|
618
650
|
}
|
|
619
|
-
});
|
|
651
|
+
}, instance);
|
|
620
652
|
}
|
|
621
653
|
debug('--\nhydrateAttributes', domNode);
|
|
622
654
|
for (const key in node[$props]) {
|
|
@@ -641,13 +673,13 @@ function hydrateAttributes(node, domNode, meta) {
|
|
|
641
673
|
const eventName = 'input';
|
|
642
674
|
if (node[$type] in bindableHtmlElementsString) {
|
|
643
675
|
debug('binding');
|
|
644
|
-
const [bindObject, bindKey] = node[$props][key];
|
|
676
|
+
const [bindObject, bindKey] = node[$props][key]; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
645
677
|
domNode.value = bindObject[bindKey] ?? ''; // nullish coalesce to avoid putting undef/null into elements
|
|
646
678
|
let handler;
|
|
647
|
-
if ('
|
|
648
|
-
const
|
|
679
|
+
if ('convert' in node[$props]) {
|
|
680
|
+
const convertFunc = node[$props].convert;
|
|
649
681
|
handler = async event => {
|
|
650
|
-
bindObject[bindKey] = await
|
|
682
|
+
bindObject[bindKey] = await convertFunc(event.target.value, event);
|
|
651
683
|
};
|
|
652
684
|
} else {
|
|
653
685
|
handler = event => {
|
|
@@ -659,13 +691,13 @@ function hydrateAttributes(node, domNode, meta) {
|
|
|
659
691
|
domNode[htmlEventHandlerKey(eventName)] = handler;
|
|
660
692
|
} else if (node[$type] in bindableHtmlElementsNumber) {
|
|
661
693
|
debug('binding');
|
|
662
|
-
const [bindObject, bindKey] = node[$props][key];
|
|
694
|
+
const [bindObject, bindKey] = node[$props][key]; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
663
695
|
domNode.value = bindObject[bindKey] ?? ''; // nullish coalesce to avoid putting undef/null into elements
|
|
664
696
|
let handler;
|
|
665
|
-
if ('
|
|
666
|
-
const
|
|
697
|
+
if ('convert' in node[$props]) {
|
|
698
|
+
const convertFunc = node[$props].convert;
|
|
667
699
|
handler = async event => {
|
|
668
|
-
bindObject[bindKey] = await
|
|
700
|
+
bindObject[bindKey] = await convertFunc(event.target.value, event);
|
|
669
701
|
};
|
|
670
702
|
} else {
|
|
671
703
|
handler = event => {
|
|
@@ -683,10 +715,10 @@ function hydrateAttributes(node, domNode, meta) {
|
|
|
683
715
|
domNode.checked = bindObject[bindKey];
|
|
684
716
|
const eventName = 'input';
|
|
685
717
|
//let handler
|
|
686
|
-
// if ('
|
|
687
|
-
// const
|
|
718
|
+
// if ('convertChecked' in node[$props]) {
|
|
719
|
+
// const convertFunc = node[$props].convertChecked as ConvertCheckedFunc<any, any>
|
|
688
720
|
// handler = async (event: Event) => {
|
|
689
|
-
// bindObject[bindKey] = await
|
|
721
|
+
// bindObject[bindKey] = await convertFunc((event.target as HTMLCheckedBindableElement).checked, event)
|
|
690
722
|
// }
|
|
691
723
|
// } else {
|
|
692
724
|
const handler = event => {
|
|
@@ -705,11 +737,11 @@ function hydrateAttributes(node, domNode, meta) {
|
|
|
705
737
|
domNode.checked = node[$props].value === bindObject[bindKey];
|
|
706
738
|
const eventName = 'change';
|
|
707
739
|
//let handler
|
|
708
|
-
// if ('
|
|
709
|
-
// const
|
|
740
|
+
// if ('convert' in node[$props]) {
|
|
741
|
+
// const convertFunc = node[$props].convert as ConvertCheckedFunc<any, any> // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
710
742
|
// handler = async (event: HTMLElementEventMap['change']) => {
|
|
711
743
|
// console.log('radio changed handler')
|
|
712
|
-
// bindObject[bindKey] = await
|
|
744
|
+
// bindObject[bindKey] = await convertFunc((event.target as HTMLCheckedBindableElement).checked, event) // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
713
745
|
// }
|
|
714
746
|
// } else {
|
|
715
747
|
const handler = event => {
|
|
@@ -729,9 +761,9 @@ function hydrateAttributes(node, domNode, meta) {
|
|
|
729
761
|
//
|
|
730
762
|
// This process some details related to binding.
|
|
731
763
|
// Bind (value) is using onInput
|
|
732
|
-
// if an onInput handler exists, we combine the two, running the binding and
|
|
764
|
+
// if an onInput handler exists, we combine the two, running the binding and conversion before the onInput
|
|
733
765
|
// Bind (checked) is using onChange
|
|
734
|
-
// if an onChange handler exists, we combine the two, running the binding and
|
|
766
|
+
// if an onChange handler exists, we combine the two, running the binding and conversion before the onChange
|
|
735
767
|
// If we were to have 2 separate bindings using the same event, the system should work to marge all event handlers together
|
|
736
768
|
// the execution order of the bind events would probably match the order of the props
|
|
737
769
|
function processAttributes(node) {
|
|
@@ -744,13 +776,14 @@ function processAttributes(node) {
|
|
|
744
776
|
const eventName = 'onInput';
|
|
745
777
|
if (node[$type] in bindableHtmlElementsString) {
|
|
746
778
|
debug('binding');
|
|
747
|
-
const [bindObject, bindKey] = props[key];
|
|
748
|
-
|
|
779
|
+
const [bindObject, bindKey] = props[key]; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
780
|
+
// nullish coalesce to avoid putting undef/null into elements
|
|
781
|
+
props.value = bindObject[bindKey] ?? ''; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
749
782
|
let handler;
|
|
750
|
-
if ('
|
|
751
|
-
const
|
|
783
|
+
if ('convert' in props) {
|
|
784
|
+
const convertFunc = props.convert;
|
|
752
785
|
handler = async event => {
|
|
753
|
-
bindObject[bindKey] = await
|
|
786
|
+
bindObject[bindKey] = await convertFunc(event.target.value, event);
|
|
754
787
|
};
|
|
755
788
|
} else {
|
|
756
789
|
handler = event => {
|
|
@@ -770,13 +803,14 @@ function processAttributes(node) {
|
|
|
770
803
|
//domNode[htmlEventHandlerKey(eventName)] = handler
|
|
771
804
|
} else if (node[$type] in bindableHtmlElementsNumber) {
|
|
772
805
|
debug('binding');
|
|
773
|
-
const [bindObject, bindKey] = node[$props][key];
|
|
774
|
-
|
|
806
|
+
const [bindObject, bindKey] = node[$props][key]; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
807
|
+
// nullish coalesce to avoid putting undef/null into elements
|
|
808
|
+
props.value = bindObject[bindKey] ?? ''; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
775
809
|
let handler;
|
|
776
|
-
if ('
|
|
777
|
-
const
|
|
810
|
+
if ('convert' in node[$props]) {
|
|
811
|
+
const convertFunc = node[$props].convert;
|
|
778
812
|
handler = async event => {
|
|
779
|
-
bindObject[bindKey] = await
|
|
813
|
+
bindObject[bindKey] = await convertFunc(event.target.value, event);
|
|
780
814
|
};
|
|
781
815
|
} else {
|
|
782
816
|
handler = event => {
|
|
@@ -796,18 +830,18 @@ function processAttributes(node) {
|
|
|
796
830
|
//domNode[htmlEventHandlerKey(eventName)] = handler
|
|
797
831
|
}
|
|
798
832
|
delete props.bind;
|
|
799
|
-
delete props.
|
|
833
|
+
delete props.convert;
|
|
800
834
|
} else if (key === 'bindChecked' && ContentNodeElementIsHtml(node)) {
|
|
801
835
|
// not checking that el is bindable, don't think its necessary
|
|
802
836
|
debug('binding checked');
|
|
803
837
|
const eventName = 'onChange';
|
|
804
|
-
const [bindObject, bindKey] = props[key];
|
|
838
|
+
const [bindObject, bindKey] = props[key]; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
805
839
|
props.checked = checkedValueToBoolean(bindObject[bindKey]);
|
|
806
840
|
let handler;
|
|
807
|
-
if ('
|
|
808
|
-
const
|
|
841
|
+
if ('convertChecked' in props) {
|
|
842
|
+
const convertFunc = props.convertChecked;
|
|
809
843
|
handler = async event => {
|
|
810
|
-
bindObject[bindKey] = await
|
|
844
|
+
bindObject[bindKey] = await convertFunc(event.target.checked, event);
|
|
811
845
|
};
|
|
812
846
|
} else {
|
|
813
847
|
handler = event => {
|
|
@@ -828,12 +862,12 @@ function processAttributes(node) {
|
|
|
828
862
|
// //domNode.addEventListener(eventName, handler)
|
|
829
863
|
// domNode[htmlEventHandlerKey(eventName)] = handler
|
|
830
864
|
delete props.bindChecked;
|
|
831
|
-
delete props.
|
|
865
|
+
delete props.convertChecked;
|
|
832
866
|
} else if (key === 'bindRadio' && ContentNodeElementIsHtml(node)) {
|
|
833
867
|
// not checking that el is bindable, don't think its necessary
|
|
834
868
|
debug('binding radio');
|
|
835
869
|
const eventName = 'onChange';
|
|
836
|
-
const [bindObject, bindKey] = props[key];
|
|
870
|
+
const [bindObject, bindKey] = props[key]; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
837
871
|
props.checked = bindObject[bindKey] === node[$props].value;
|
|
838
872
|
const handler = event => {
|
|
839
873
|
//console.log('bound radio changed 2')
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { MatchedRouteInfo } from '../routing/MatchedRouteInfo.js';
|
|
2
|
+
import type { BrandedGlobalData, BrandedNetworkedData } from '../Brands.js';
|
|
3
3
|
export type NetworkMatchedRouteInfo = Omit<MatchedRouteInfo, 'content'>;
|
|
4
4
|
declare global {
|
|
5
|
-
let __tungsten_global_data__:
|
|
5
|
+
let __tungsten_global_data__: BrandedGlobalData;
|
|
6
|
+
let __tungsten_networked_data__: BrandedNetworkedData;
|
|
6
7
|
let __tungsten_matched_route_info__: NetworkMatchedRouteInfo;
|
|
7
8
|
let __tungsten_route_data__: unknown;
|
|
8
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrateGlobalData.d.ts","sourceRoot":"","sources":["../../src/hydrate/hydrateGlobalData.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"hydrateGlobalData.d.ts","sourceRoot":"","sources":["../../src/hydrate/hydrateGlobalData.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAG3E,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;AAEvE,OAAO,CAAC,MAAM,CAAC;IACX,IAAI,wBAAwB,EAAE,iBAAiB,CAAA;IAE/C,IAAI,2BAA2B,EAAE,oBAAoB,CAAA;IACrD,IAAI,+BAA+B,EAAE,uBAAuB,CAAA;IAE5D,IAAI,uBAAuB,EAAE,OAAO,CAAA;CACvC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContentNodeHtml } from '../ContentNode.js';
|
|
2
|
+
import { type VersionSource } from '../fileVersions.js';
|
|
2
3
|
export type AttributeMismatch = {
|
|
3
4
|
name: string;
|
|
4
5
|
/** The value the client rendered, or null when it renders no such attribute. */
|
|
@@ -20,5 +21,5 @@ export type AttributeMismatch = {
|
|
|
20
21
|
* `processProps()`, the same function that produced the markup being compared
|
|
21
22
|
* against, so a matching element costs one attribute read each and no writes.
|
|
22
23
|
*/
|
|
23
|
-
export declare function reconcileHydratedAttributes(node: ContentNodeHtml, domNode: HTMLElement, onMismatch?: (mismatch: AttributeMismatch) => void): void;
|
|
24
|
+
export declare function reconcileHydratedAttributes(node: ContentNodeHtml, domNode: HTMLElement, onMismatch?: (mismatch: AttributeMismatch) => void, versions?: VersionSource): void;
|
|
24
25
|
//# sourceMappingURL=reconcileHydratedAttributes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcileHydratedAttributes.d.ts","sourceRoot":"","sources":["../../src/hydrate/reconcileHydratedAttributes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"reconcileHydratedAttributes.d.ts","sourceRoot":"","sources":["../../src/hydrate/reconcileHydratedAttributes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAGxD,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAI1E,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,gFAAgF;IAChF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,2EAA2E;IAC3E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB,CAAA;AA6BD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,CACvC,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,WAAW,EACpB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,EAClD,QAAQ,CAAC,EAAE,aAAa,GACzB,IAAI,CAuCN"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { $props } from '../contentNodeSymbols.js';
|
|
2
2
|
import { processProps } from '../render/processProps.js';
|
|
3
|
+
import { versionAttributes } from '../fileVersions.js';
|
|
3
4
|
import { booleanAttributeValue } from '../booleanAttributeValue.js';
|
|
4
5
|
/**
|
|
5
6
|
* The attribute value a render produces for a prop, or null for "no attribute".
|
|
@@ -39,7 +40,7 @@ function setAttribute(domNode, name, value) {
|
|
|
39
40
|
* `processProps()`, the same function that produced the markup being compared
|
|
40
41
|
* against, so a matching element costs one attribute read each and no writes.
|
|
41
42
|
*/
|
|
42
|
-
export function reconcileHydratedAttributes(node, domNode, onMismatch) {
|
|
43
|
+
export function reconcileHydratedAttributes(node, domNode, onMismatch, versions) {
|
|
43
44
|
// A copy: processProps() rewrites what it is given, and these props stay in
|
|
44
45
|
// the content tree for the next update to diff against. children is pulled out
|
|
45
46
|
// first, same as the server renderer (renderingTreeToHtml.ts) and the client
|
|
@@ -50,9 +51,9 @@ export function reconcileHydratedAttributes(node, domNode, onMismatch) {
|
|
|
50
51
|
children: _children,
|
|
51
52
|
...restProps
|
|
52
53
|
} = node[$props];
|
|
53
|
-
const expected = processProps({
|
|
54
|
+
const expected = versionAttributes(processProps({
|
|
54
55
|
...restProps
|
|
55
|
-
});
|
|
56
|
+
}), versions);
|
|
56
57
|
const handled = new Set();
|
|
57
58
|
for (const name in expected) {
|
|
58
59
|
handled.add(name.toLowerCase());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderHydrationMismatchBanner.d.ts","sourceRoot":"","sources":["../../src/hydrate/renderHydrationMismatchBanner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"renderHydrationMismatchBanner.d.ts","sourceRoot":"","sources":["../../src/hydrate/renderHydrationMismatchBanner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAKzE,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAK7E,eAAO,MAAM,0BAA0B,uCAAuC,CAAA;AAE9E,eAAO,MAAM,yBAAyB,kCAAkC,CAAA;AAIxE,wBAAgB,6BAA6B,CACzC,UAAU,EAAE,SAAS,uBAAuB,EAAE,EAC9C,GAAG,GAAE,QAAmB,GACzB,IAAI,CAUN"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { renderDevBanner } from '../devBanner.js';
|
|
2
|
+
import { JSONstringify } from '../json.js';
|
|
2
3
|
// The report as an attribute on <html>: a machine-readable hook (tests, tooling, app styling)
|
|
3
4
|
// that no Tungsten bookkeeping ever touches - updateAttributes diffs against its own record of
|
|
4
5
|
// what it last set, never the DOM's live attribute list, so this is never visited or removed.
|
|
@@ -10,7 +11,7 @@ export const hydrationMismatchBannerId = 'tungsten-hydration-mismatches';
|
|
|
10
11
|
export function renderHydrationMismatchBanner(mismatches, doc = document) {
|
|
11
12
|
if (mismatches.length === 0) return;
|
|
12
13
|
const heading = `Tungsten: ${mismatches.length} hydration mismatch${mismatches.length === 1 ? '' : 'es'} (dev only)`;
|
|
13
|
-
const lines = mismatches.map(mismatch => `<${mismatch.tagName}> ${mismatch.name}: ` + `rendered ${
|
|
14
|
+
const lines = mismatches.map(mismatch => `<${mismatch.tagName}> ${mismatch.name}: ` + `rendered ${JSONstringify(mismatch.expected)}, server sent ${JSONstringify(mismatch.actual)}`);
|
|
14
15
|
const report = [heading, ...lines].join('\n');
|
|
15
16
|
doc.documentElement.setAttribute(hydrationMismatchAttribute, report);
|
|
16
17
|
renderDevBanner(hydrationMismatchBannerId, report, doc);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InstanceConfig } from '../Instance/InstanceConfig.js';
|
|
2
|
+
import type { MatchedRouteInfo } from '../routing/MatchedRouteInfo.js';
|
|
3
|
+
export type StubRouted = {
|
|
4
|
+
location: string;
|
|
5
|
+
matchedRouteInfo: MatchedRouteInfo;
|
|
6
|
+
};
|
|
7
|
+
export declare function stubRouting(location: string, route: (location: string) => Promise<MatchedRouteInfo>, instanceConfig: InstanceConfig): Promise<StubRouted | null>;
|
|
8
|
+
//# sourceMappingURL=stubRouting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stubRouting.d.ts","sourceRoot":"","sources":["../../src/hydrate/stubRouting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAOtE,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKjF,wBAAsB,WAAW,CAC7B,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,EACxE,cAAc,EAAE,cAAc,GAC/B,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAgB5B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isProd } from '../isProd.js';
|
|
2
|
+
import { redirectOf } from '../routing/redirectOf.js';
|
|
3
|
+
import { routeKeyToUrl } from '../routing/routeUrl.js';
|
|
4
|
+
import { TungstenError } from '../TungstenError.js';
|
|
5
|
+
// config.serverSideRouting false: the page's first routing is the client's, with its route data. A
|
|
6
|
+
// redirect to a route routes again, the address bar replaced, before anything is built; one to a
|
|
7
|
+
// URL leaves the page, and gives null
|
|
8
|
+
export async function stubRouting(location, route, instanceConfig) {
|
|
9
|
+
for (let hops = 0; hops <= 10; hops++) {
|
|
10
|
+
const matchedRouteInfo = await route(location);
|
|
11
|
+
const redirection = redirectOf(matchedRouteInfo);
|
|
12
|
+
if (redirection === undefined) return {
|
|
13
|
+
location,
|
|
14
|
+
matchedRouteInfo
|
|
15
|
+
};
|
|
16
|
+
if ('url' in redirection) {
|
|
17
|
+
window.location.replace(redirection.url);
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
location = redirection.route;
|
|
21
|
+
const url = routeKeyToUrl(redirection.route, instanceConfig.siteBasePath, isProd && instanceConfig.staticSite);
|
|
22
|
+
window.history.replaceState(null, '', url);
|
|
23
|
+
}
|
|
24
|
+
throw new TungstenError(`Routing '${location}' redirected more than 10 times`);
|
|
25
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ModuleNamespace } from './importModule.js';
|
|
1
2
|
export declare function isTransientDevModuleError(e: unknown): boolean;
|
|
2
|
-
export declare function importDevModuleWithRetry(url: string, attempts?: number, delayMs?: number): Promise<
|
|
3
|
+
export declare function importDevModuleWithRetry(url: string, attempts?: number, delayMs?: number): Promise<ModuleNamespace>;
|
|
3
4
|
//# sourceMappingURL=importDevModuleWithRetry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importDevModuleWithRetry.d.ts","sourceRoot":"","sources":["../src/importDevModuleWithRetry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"importDevModuleWithRetry.d.ts","sourceRoot":"","sources":["../src/importDevModuleWithRetry.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAMtE,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAU7D;AAMD,wBAAsB,wBAAwB,CAC1C,GAAG,EAAE,MAAM,EACX,QAAQ,SAAK,EACb,OAAO,SAAM,GACd,OAAO,CAAC,eAAe,CAAC,CAU1B"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
// than tuned to a happy-path guess. There's no precise "compile cycle
|
|
17
17
|
// finished" signal plumbed through to here to await instead; this is a
|
|
18
18
|
// bounded heuristic, not a proper synchronization fix.
|
|
19
|
+
import { importModule } from './importModule.js';
|
|
19
20
|
// Exported so other dev-only tools (the error page's auto-retry script - see
|
|
20
21
|
// devErrorPageAutoRetry.ts) can recognize the same transient shape without
|
|
21
22
|
// duplicating the heuristic.
|
|
@@ -37,7 +38,7 @@ export async function importDevModuleWithRetry(url, attempts = 30, delayMs = 250
|
|
|
37
38
|
for (let attempt = 0;; attempt++) {
|
|
38
39
|
try {
|
|
39
40
|
const attemptUrl = attempt === 0 ? url : `${url}${url.includes('?') ? '&' : '?'}retryAttempt=${attempt}`;
|
|
40
|
-
return await
|
|
41
|
+
return await importModule(attemptUrl);
|
|
41
42
|
} catch (e) {
|
|
42
43
|
if (attempt >= attempts - 1 || !isTransientDevModuleError(e)) throw e;
|
|
43
44
|
await delay(delayMs);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importModule.d.ts","sourceRoot":"","sources":["../src/importModule.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAGrD,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAE9E"}
|
package/dist/index.js
CHANGED
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
4
4
|
/// <reference path="../types/index.d.ts" preserve="true" />
|
|
5
5
|
export * from './indexInner.js';
|
|
6
|
-
export * as default from './indexInner.js'; // I
|
|
6
|
+
export * as default from './indexInner.js'; // I think linking to indexInner may have been related to
|
|
7
|
+
// offering a synchronous export for CJS
|