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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipelineSplit.types.test.d.ts","sourceRoot":"","sources":["../../src/pipeline/pipelineSplit.types.test.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
+
import { contextStore } from './contextStore.js';
|
|
5
|
+
import { pipeline } from './pipeline.js';
|
|
6
|
+
import { splitPipeline } from './splitPipeline.js';
|
|
7
|
+
/*
|
|
8
|
+
* Type tests for the split pipeline. tsc is the assertion - nothing here runs.
|
|
9
|
+
*
|
|
10
|
+
* serverInit -> routing -> serverPost -> clientInit -> routing -> clientPost
|
|
11
|
+
*/
|
|
12
|
+
class ApiClient {
|
|
13
|
+
constructor(reqRes) {
|
|
14
|
+
_defineProperty(this, "get", async path => Promise.resolve(path));
|
|
15
|
+
void reqRes;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
class VersionManager {
|
|
19
|
+
constructor() {
|
|
20
|
+
_defineProperty(this, "version", 'v1');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const server = splitPipeline.server('express');
|
|
24
|
+
const serverInit = server.serverInit(reqRes => {
|
|
25
|
+
// the server's stages always have the request
|
|
26
|
+
const typed = reqRes;
|
|
27
|
+
void typed;
|
|
28
|
+
return {
|
|
29
|
+
context: {
|
|
30
|
+
api: new ApiClient(reqRes)
|
|
31
|
+
},
|
|
32
|
+
networked: {
|
|
33
|
+
userId: 1
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
const serverPost = serverInit.serverPost((reqRes, init) => {
|
|
38
|
+
const typed = reqRes;
|
|
39
|
+
const api = init.context.api;
|
|
40
|
+
void typed;
|
|
41
|
+
void api;
|
|
42
|
+
return {
|
|
43
|
+
context: {
|
|
44
|
+
api,
|
|
45
|
+
counter: contextStore({
|
|
46
|
+
count: init.networked.userId
|
|
47
|
+
})
|
|
48
|
+
},
|
|
49
|
+
networked: {
|
|
50
|
+
counter: contextStore({
|
|
51
|
+
count: init.networked.userId
|
|
52
|
+
}, {
|
|
53
|
+
sync: 'afterRouting'
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
// clientInit is handed the networked data from serverPost, and makes a context of its own
|
|
59
|
+
const clientInit = serverPost.clientInit(networked => {
|
|
60
|
+
const counter = networked.counter;
|
|
61
|
+
return {
|
|
62
|
+
context: {
|
|
63
|
+
api: new ApiClient(null),
|
|
64
|
+
versions: new VersionManager()
|
|
65
|
+
},
|
|
66
|
+
networked: {
|
|
67
|
+
userId: counter.count.get()
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
const app = clientInit.clientPost(init => ({
|
|
72
|
+
context: {
|
|
73
|
+
api: init.context.api,
|
|
74
|
+
versions: init.context.versions,
|
|
75
|
+
counter: contextStore({
|
|
76
|
+
count: init.networked.userId
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
}));
|
|
80
|
+
// ---- the components see either side's context -------------------------------
|
|
81
|
+
export class Page extends app.SimpleComponent {
|
|
82
|
+
constructor(...args) {
|
|
83
|
+
super(...args);
|
|
84
|
+
_defineProperty(this, "content", () => {
|
|
85
|
+
const context = this.tungsten.context;
|
|
86
|
+
// what both sides give
|
|
87
|
+
const api = context.api;
|
|
88
|
+
const count = context.counter.count.get();
|
|
89
|
+
void api;
|
|
90
|
+
void count;
|
|
91
|
+
// @ts-expect-error -- only the client gives it
|
|
92
|
+
void context.versions;
|
|
93
|
+
if ('versions' in context) {
|
|
94
|
+
const versions = context.versions;
|
|
95
|
+
void versions;
|
|
96
|
+
}
|
|
97
|
+
// @ts-expect-error -- the networked data is not the context
|
|
98
|
+
void context.userId;
|
|
99
|
+
return null;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export class CountView extends app.SimpleStoreComponent {
|
|
104
|
+
constructor(...args) {
|
|
105
|
+
super(...args);
|
|
106
|
+
_defineProperty(this, "store", this.createStore(({
|
|
107
|
+
counter
|
|
108
|
+
}) => counter));
|
|
109
|
+
_defineProperty(this, "content", () => null);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// the networked data is the one on both sides: the last server stage's, carried in the page
|
|
113
|
+
export class NetworkedCountView extends app.StatefulStoreComponent {
|
|
114
|
+
constructor(...args) {
|
|
115
|
+
super(...args);
|
|
116
|
+
_defineProperty(this, "store", this.createStore((context, networked) => {
|
|
117
|
+
// @ts-expect-error -- serverPost's, not serverInit's
|
|
118
|
+
void networked.userId;
|
|
119
|
+
return networked.counter;
|
|
120
|
+
}));
|
|
121
|
+
_defineProperty(this, "state", {});
|
|
122
|
+
_defineProperty(this, "content", () => null);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// the routes see either side's Init
|
|
126
|
+
app.routes((reqRes, init) => {
|
|
127
|
+
const api = init.context.api;
|
|
128
|
+
const userId = init.networked.userId;
|
|
129
|
+
void api;
|
|
130
|
+
void userId;
|
|
131
|
+
// @ts-expect-error -- only the client's
|
|
132
|
+
void init.context.versions;
|
|
133
|
+
return [];
|
|
134
|
+
});
|
|
135
|
+
// ---- the sides are independent -----------------------------------------------
|
|
136
|
+
// the client's stages need not match the server's
|
|
137
|
+
serverPost.clientInit(() => ({
|
|
138
|
+
context: {
|
|
139
|
+
other: 'yes'
|
|
140
|
+
}
|
|
141
|
+
}));
|
|
142
|
+
clientInit.clientPost(() => ({
|
|
143
|
+
context: {
|
|
144
|
+
other: 'yes'
|
|
145
|
+
}
|
|
146
|
+
}));
|
|
147
|
+
// clientPost is optional: the components then see clientInit's context
|
|
148
|
+
export class NoClientPostPage extends clientInit.SimpleComponent {
|
|
149
|
+
constructor(...args) {
|
|
150
|
+
super(...args);
|
|
151
|
+
_defineProperty(this, "content", () => {
|
|
152
|
+
const api = this.tungsten.context.api;
|
|
153
|
+
void api;
|
|
154
|
+
return null;
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
clientInit.routes(() => []);
|
|
159
|
+
clientInit.clientPost(init => ({
|
|
160
|
+
context: {
|
|
161
|
+
api: init.context.api
|
|
162
|
+
},
|
|
163
|
+
// @ts-expect-error -- clientPost has no networked data to give
|
|
164
|
+
networked: {}
|
|
165
|
+
}));
|
|
166
|
+
// @ts-expect-error -- a stage gives { context, networked }, not the context bare
|
|
167
|
+
serverPost.clientInit(() => ({
|
|
168
|
+
api: new ApiClient(null)
|
|
169
|
+
}));
|
|
170
|
+
// @ts-expect-error -- clientPost too
|
|
171
|
+
clientInit.clientPost(() => ({
|
|
172
|
+
api: new ApiClient(null)
|
|
173
|
+
}));
|
|
174
|
+
// ---- the chain is whole before routes and components ------------------------
|
|
175
|
+
// @ts-expect-error -- no routes before the client's stages
|
|
176
|
+
void serverInit.routes;
|
|
177
|
+
// @ts-expect-error -- nor components
|
|
178
|
+
void serverPost.SimpleComponent;
|
|
179
|
+
// ---- with no serverPost, clientInit has serverInit's networked data ---------
|
|
180
|
+
const initOnly = serverInit.clientInit(networked => {
|
|
181
|
+
const userId = networked.userId;
|
|
182
|
+
return {
|
|
183
|
+
context: {
|
|
184
|
+
api: new ApiClient(null)
|
|
185
|
+
},
|
|
186
|
+
networked: {
|
|
187
|
+
userId
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
export class InitOnlyPage extends initOnly.SimpleComponent {
|
|
192
|
+
constructor(...args) {
|
|
193
|
+
super(...args);
|
|
194
|
+
_defineProperty(this, "content", () => {
|
|
195
|
+
const api = this.tungsten.context.api;
|
|
196
|
+
void api;
|
|
197
|
+
return null;
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// serverInit may make only a context: clientInit then has nothing
|
|
202
|
+
server.serverInit(() => ({
|
|
203
|
+
context: {
|
|
204
|
+
a: 1
|
|
205
|
+
}
|
|
206
|
+
})).clientInit(networked => {
|
|
207
|
+
// @ts-expect-error -- no networked data
|
|
208
|
+
void networked.userId;
|
|
209
|
+
return {
|
|
210
|
+
context: {
|
|
211
|
+
a: 2
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
});
|
|
215
|
+
// ---- all-routes data: a function for each side, before Post ------------------
|
|
216
|
+
const withData = serverInit.serverAllRoutesData((reqRes, init) => {
|
|
217
|
+
// the server's, before SSR, with the request
|
|
218
|
+
const typed = reqRes;
|
|
219
|
+
void typed;
|
|
220
|
+
return {
|
|
221
|
+
theme: 'dark',
|
|
222
|
+
userId: init.networked.userId
|
|
223
|
+
};
|
|
224
|
+
});
|
|
225
|
+
const withDataClient = withData.serverPost((reqRes, init, allRoutesData) => ({
|
|
226
|
+
context: {
|
|
227
|
+
theme: allRoutesData.theme
|
|
228
|
+
}
|
|
229
|
+
})).clientInit(() => ({
|
|
230
|
+
context: {
|
|
231
|
+
versions: new VersionManager()
|
|
232
|
+
}
|
|
233
|
+
}));
|
|
234
|
+
// @ts-expect-error -- the client's all-routes data comes first
|
|
235
|
+
void withDataClient.routes;
|
|
236
|
+
// @ts-expect-error -- which gives the server's type
|
|
237
|
+
withDataClient.clientAllRoutesData(() => ({
|
|
238
|
+
theme: 1,
|
|
239
|
+
userId: 1
|
|
240
|
+
}));
|
|
241
|
+
// the client's, before each client navigation, with the client's Init, after clientPost in the chain
|
|
242
|
+
const withDataApp = withDataClient.clientPost((init, allRoutesData) => ({
|
|
243
|
+
context: {
|
|
244
|
+
theme: allRoutesData.theme
|
|
245
|
+
}
|
|
246
|
+
})).clientAllRoutesData(init => {
|
|
247
|
+
const versions = init.context.versions;
|
|
248
|
+
void versions;
|
|
249
|
+
return {
|
|
250
|
+
theme: 'light',
|
|
251
|
+
userId: 2
|
|
252
|
+
};
|
|
253
|
+
});
|
|
254
|
+
// @ts-expect-error -- clientPost comes before the client's all-routes data
|
|
255
|
+
void withDataClient.clientAllRoutesData(() => ({
|
|
256
|
+
theme: '',
|
|
257
|
+
userId: 0
|
|
258
|
+
})).clientPost;
|
|
259
|
+
export class ThemedPage extends withDataApp.SimpleComponent {
|
|
260
|
+
constructor(...args) {
|
|
261
|
+
super(...args);
|
|
262
|
+
_defineProperty(this, "content", () => {
|
|
263
|
+
const theme = this.tungsten.allRoutesData.theme;
|
|
264
|
+
const contextTheme = this.tungsten.context.theme;
|
|
265
|
+
void theme;
|
|
266
|
+
void contextTheme;
|
|
267
|
+
return null;
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
// the type by name, off the stage
|
|
272
|
+
const globalData = {
|
|
273
|
+
theme: 'dark',
|
|
274
|
+
userId: 1
|
|
275
|
+
};
|
|
276
|
+
// @ts-expect-error -- as serverAllRoutesData returned it
|
|
277
|
+
const wrongGlobalData = {
|
|
278
|
+
theme: 1,
|
|
279
|
+
userId: 1
|
|
280
|
+
};
|
|
281
|
+
void globalData;
|
|
282
|
+
void wrongGlobalData;
|
|
283
|
+
// clientInit's, whichever stage it returned
|
|
284
|
+
const withDataVersions = stageOf().versions;
|
|
285
|
+
const clientInitResult = stageOf();
|
|
286
|
+
const clientVersions = clientInitResult.context.versions;
|
|
287
|
+
const clientUserId = clientInitResult.networked.userId;
|
|
288
|
+
// @ts-expect-error -- the client's, not serverPost's
|
|
289
|
+
void stageOf().counter;
|
|
290
|
+
// serverPost's and serverInit's
|
|
291
|
+
const serverCounter = stageOf().counter;
|
|
292
|
+
const serverApi = stageOf().api;
|
|
293
|
+
// clientPost's context alone
|
|
294
|
+
const postVersions = stageOf().versions;
|
|
295
|
+
// the all-routes data stage: its data, with the context before it
|
|
296
|
+
const dataTheme = stageOf().theme;
|
|
297
|
+
const dataApi = stageOf().api;
|
|
298
|
+
void withDataVersions;
|
|
299
|
+
void clientVersions;
|
|
300
|
+
void clientUserId;
|
|
301
|
+
void serverCounter;
|
|
302
|
+
void serverApi;
|
|
303
|
+
void postVersions;
|
|
304
|
+
void dataTheme;
|
|
305
|
+
void dataApi;
|
|
306
|
+
// an earlier stage's, by name, off the last one
|
|
307
|
+
const namedClientInit = stageOf();
|
|
308
|
+
const namedVersions = namedClientInit.context.versions;
|
|
309
|
+
const namedUserId = namedClientInit.networked.userId;
|
|
310
|
+
const namedServerApi = stageOf().api;
|
|
311
|
+
const namedCounter = stageOf().counter;
|
|
312
|
+
const namedServerData = stageOf().theme;
|
|
313
|
+
const namedClientData = stageOf().theme;
|
|
314
|
+
// @ts-expect-error -- a stage this chain did not take
|
|
315
|
+
void stageOf();
|
|
316
|
+
// @ts-expect-error -- nor one after it
|
|
317
|
+
void stageOf();
|
|
318
|
+
// a branch keeps its own chain's records
|
|
319
|
+
const branchContext = stageOf();
|
|
320
|
+
const branchApi = branchContext.api;
|
|
321
|
+
// @ts-expect-error -- initOnly's clientInit made no versions
|
|
322
|
+
void branchContext.versions;
|
|
323
|
+
void namedVersions;
|
|
324
|
+
void namedUserId;
|
|
325
|
+
void namedServerApi;
|
|
326
|
+
void namedCounter;
|
|
327
|
+
void namedServerData;
|
|
328
|
+
void namedClientData;
|
|
329
|
+
void branchApi;
|
|
330
|
+
// ---- clientAfterRouting: after each client routing, the components' context ---
|
|
331
|
+
const afterRouting = app.clientAfterRouting((context, route, allRoutesData) => {
|
|
332
|
+
// clientPost's context, the matched route, the all-routes data
|
|
333
|
+
const versions = context.versions;
|
|
334
|
+
const key = route.key;
|
|
335
|
+
const location = route.location;
|
|
336
|
+
void versions;
|
|
337
|
+
void key;
|
|
338
|
+
void location;
|
|
339
|
+
void allRoutesData;
|
|
340
|
+
return {
|
|
341
|
+
context: {
|
|
342
|
+
versions,
|
|
343
|
+
page: route.key
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
});
|
|
347
|
+
export class AfterRoutingPage extends afterRouting.SimpleComponent {
|
|
348
|
+
constructor(...args) {
|
|
349
|
+
super(...args);
|
|
350
|
+
_defineProperty(this, "content", () => {
|
|
351
|
+
const context = this.tungsten.context;
|
|
352
|
+
// either the server's last context or clientAfterRouting's
|
|
353
|
+
if ('page' in context) {
|
|
354
|
+
const page = context.page;
|
|
355
|
+
void page;
|
|
356
|
+
}
|
|
357
|
+
// @ts-expect-error -- clientPost's alone is no longer what components see
|
|
358
|
+
void context.theme;
|
|
359
|
+
return null;
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
const afterRoutingPage = stageOf().page;
|
|
364
|
+
void afterRoutingPage;
|
|
365
|
+
// with no clientPost, clientInit's context
|
|
366
|
+
initOnly.clientAfterRouting(context => {
|
|
367
|
+
const api = context.api;
|
|
368
|
+
return {
|
|
369
|
+
context: {
|
|
370
|
+
api
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
});
|
|
374
|
+
// @ts-expect-error -- a stage gives { context }, not the context bare
|
|
375
|
+
app.clientAfterRouting(context => context);
|
|
376
|
+
// @ts-expect-error -- and after the client's all-routes data, when there is one
|
|
377
|
+
void withDataClient.clientAfterRouting;
|
|
378
|
+
// @ts-expect-error -- with no server all-routes data there is no client one
|
|
379
|
+
void clientInit.clientAllRoutesData;
|
|
380
|
+
// @ts-expect-error -- the server's is serialized into the page
|
|
381
|
+
serverInit.serverAllRoutesData(() => ({
|
|
382
|
+
when: new Date()
|
|
383
|
+
}));
|
|
384
|
+
// ---- what cannot cross the network ------------------------------------------
|
|
385
|
+
// @ts-expect-error -- the networked data is serialized into the page
|
|
386
|
+
server.serverInit(reqRes => ({
|
|
387
|
+
networked: {
|
|
388
|
+
leaked: reqRes
|
|
389
|
+
}
|
|
390
|
+
}));
|
|
391
|
+
// @ts-expect-error -- and so is serverPost's
|
|
392
|
+
serverInit.serverPost(reqRes => ({
|
|
393
|
+
networked: {
|
|
394
|
+
leaked: reqRes
|
|
395
|
+
}
|
|
396
|
+
}));
|
|
397
|
+
// @ts-expect-error -- as are the values of a networked store
|
|
398
|
+
serverInit.serverPost(() => ({
|
|
399
|
+
networked: {
|
|
400
|
+
store: contextStore({
|
|
401
|
+
when: new Date()
|
|
402
|
+
})
|
|
403
|
+
}
|
|
404
|
+
}));
|
|
405
|
+
// the context is not
|
|
406
|
+
server.serverInit(reqRes => ({
|
|
407
|
+
context: {
|
|
408
|
+
reqRes,
|
|
409
|
+
store: contextStore({
|
|
410
|
+
when: new Date()
|
|
411
|
+
})
|
|
412
|
+
}
|
|
413
|
+
}));
|
|
414
|
+
// ---- a stage gives { context, networked }, not the context bare --------------
|
|
415
|
+
// @ts-expect-error -- serverInit
|
|
416
|
+
server.serverInit(() => ({
|
|
417
|
+
api: new ApiClient(null)
|
|
418
|
+
}));
|
|
419
|
+
// @ts-expect-error -- nor beside them
|
|
420
|
+
server.serverInit(() => ({
|
|
421
|
+
context: {},
|
|
422
|
+
api: new ApiClient(null)
|
|
423
|
+
}));
|
|
424
|
+
// @ts-expect-error -- serverPost
|
|
425
|
+
serverInit.serverPost(() => ({
|
|
426
|
+
api: new ApiClient(null)
|
|
427
|
+
}));
|
|
428
|
+
// nothing at all is fine
|
|
429
|
+
server.serverInit(() => undefined);
|
|
430
|
+
// ---- the two pipelines do not mix -------------------------------------------
|
|
431
|
+
// @ts-expect-error -- the split pipeline has no init
|
|
432
|
+
void server.init;
|
|
433
|
+
// @ts-expect-error -- nor post
|
|
434
|
+
void serverInit.post;
|
|
435
|
+
// @ts-expect-error -- and serverInit comes first
|
|
436
|
+
void server.clientInit;
|
|
437
|
+
// @ts-expect-error -- and the other has no serverInit
|
|
438
|
+
void pipeline.server('express').serverInit;
|
|
439
|
+
// @ts-expect-error -- and only names a server tungsten knows
|
|
440
|
+
splitPipeline.server('koa');
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { BrandedContext, BrandedNetworkedData } from '../Brands.js';
|
|
2
|
+
import type { MatchedRouteInfo } from '../routing/MatchedRouteInfo.js';
|
|
3
|
+
import type { RoutesWithSettings } from '../routing/Routes.js';
|
|
4
|
+
import type { ServerDataLoading } from '../Store/ServerDataLoading.js';
|
|
5
|
+
import type { InstancePipeline } from '../Instance/Instance.js';
|
|
6
|
+
import type { AllRoutesDataConstraint, ClientPosted, ClientStarted, PipelineApp, StageContext } from './pipelineDefinition.js';
|
|
7
|
+
export type PipelineRouted = {
|
|
8
|
+
init: StageContext | undefined;
|
|
9
|
+
routes: RoutesWithSettings<any>;
|
|
10
|
+
allRoutesData: AllRoutesDataConstraint;
|
|
11
|
+
matchedRouteInfo: MatchedRouteInfo;
|
|
12
|
+
};
|
|
13
|
+
export type ServerRunner = {
|
|
14
|
+
route: (app: PipelineApp, reqRes: unknown, location: string, serverDataLoading: ServerDataLoading | null, dev: boolean) => Promise<PipelineRouted>;
|
|
15
|
+
post: (app: PipelineApp, reqRes: unknown, init: StageContext | undefined, allRoutesData: AllRoutesDataConstraint) => Promise<StageContext | undefined>;
|
|
16
|
+
context: (init: StageContext | undefined, post: StageContext | undefined) => object;
|
|
17
|
+
networked: (init: StageContext | undefined, post: StageContext | undefined) => object | undefined;
|
|
18
|
+
};
|
|
19
|
+
export declare function pipelineRoutes(app: PipelineApp, reqRes: unknown, init: StageContext | undefined, dev: boolean): RoutesWithSettings<any>;
|
|
20
|
+
export declare function routeWithPipeline(app: PipelineApp, reqRes: unknown, location: string, serverDataLoading: ServerDataLoading | null, dev: boolean): Promise<PipelineRouted>;
|
|
21
|
+
export declare function routeAfterInit(app: PipelineApp, reqRes: unknown, location: string, serverDataLoading: ServerDataLoading | null, dev: boolean, init: StageContext | undefined, context: object | undefined, networked: object | undefined): Promise<PipelineRouted>;
|
|
22
|
+
export declare const routingContext: (context: object | undefined) => BrandedContext;
|
|
23
|
+
export declare const routingNetworkedData: (networked: object | undefined) => BrandedNetworkedData;
|
|
24
|
+
export declare const afterRoutingFor: (run: ClientPosted["afterRouting"]) => InstancePipeline["afterRouting"];
|
|
25
|
+
export declare function runPost(app: PipelineApp, reqRes: unknown, init: StageContext | undefined, allRoutesData: AllRoutesDataConstraint): Promise<StageContext | undefined>;
|
|
26
|
+
export declare const pipelineContext: (init: StageContext | undefined, post: StageContext | undefined) => object;
|
|
27
|
+
export declare const symmetricServer: ServerRunner;
|
|
28
|
+
export declare function runClientPipeline(app: PipelineApp): Promise<ClientStarted>;
|
|
29
|
+
//# sourceMappingURL=runPipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runPipeline.d.ts","sourceRoot":"","sources":["../../src/pipeline/runPipeline.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { $cacheControl } from '../cacheControl.js';
|
|
2
|
+
import { routing } from "../Servers/routing.js";
|
|
3
|
+
import { toRoutes } from '../routing/routesArray.js';
|
|
4
|
+
import { appRoutesFunction } from './pipelineDefinition.js';
|
|
5
|
+
// the routes as the router reads them, with the routes options where the object form's settings go
|
|
6
|
+
export function pipelineRoutes(app, reqRes, init, dev) {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- typed by the stage
|
|
8
|
+
const returned = appRoutesFunction(app)(reqRes, init);
|
|
9
|
+
const routes = toRoutes(returned, dev);
|
|
10
|
+
const cacheControl = app.routesOptions.cacheControl;
|
|
11
|
+
return cacheControl !== undefined ? {
|
|
12
|
+
...routes,
|
|
13
|
+
[$cacheControl]: cacheControl
|
|
14
|
+
} : routes;
|
|
15
|
+
}
|
|
16
|
+
// Init, then the routes; the all-routes data beside routing, as the classic global data runs.
|
|
17
|
+
// Route data functions see Init's context
|
|
18
|
+
export async function routeWithPipeline(app, reqRes, location, serverDataLoading, dev) {
|
|
19
|
+
const init = await app.init?.(reqRes, undefined);
|
|
20
|
+
return routeAfterInit(app, reqRes, location, serverDataLoading, dev, init, init, undefined);
|
|
21
|
+
}
|
|
22
|
+
// the route data functions are handed the context and networked data Init made
|
|
23
|
+
export async function routeAfterInit(app, reqRes, location, serverDataLoading, dev, init, context, networked) {
|
|
24
|
+
const routes = pipelineRoutes(app, reqRes, init, dev);
|
|
25
|
+
const [allRoutesData, matchedRouteInfo] = await Promise.all([app.allRoutesData?.(reqRes, init), routing(location, routes, routingContext(context), routingNetworkedData(networked), serverDataLoading)]);
|
|
26
|
+
return {
|
|
27
|
+
init,
|
|
28
|
+
routes,
|
|
29
|
+
allRoutesData,
|
|
30
|
+
matchedRouteInfo
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// the framework brands what it builds
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
35
|
+
export const routingContext = context => context ?? {};
|
|
36
|
+
export const routingNetworkedData = networked => networked ?? {}; // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
37
|
+
// the split pipeline's clientAfterRouting, as the instance calls it after each client routing
|
|
38
|
+
export const afterRoutingFor = run => {
|
|
39
|
+
if (run === undefined) return undefined;
|
|
40
|
+
return async (route, allRoutesData) => await run(route, allRoutesData); // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
|
|
41
|
+
};
|
|
42
|
+
// after routing, and not at all for a redirect
|
|
43
|
+
export async function runPost(app, reqRes, init, allRoutesData) {
|
|
44
|
+
return app.post?.(reqRes, init, allRoutesData);
|
|
45
|
+
}
|
|
46
|
+
// what this.tungsten.context reads: the last stage's context
|
|
47
|
+
export const pipelineContext = (init, post) => post ?? init ?? {};
|
|
48
|
+
// what the request handler runs, beside the split pipeline's
|
|
49
|
+
export const symmetricServer = {
|
|
50
|
+
route: routeWithPipeline,
|
|
51
|
+
post: runPost,
|
|
52
|
+
context: pipelineContext,
|
|
53
|
+
networked: () => undefined
|
|
54
|
+
};
|
|
55
|
+
// The browser's run, for hydration: the same stages, with null for the request. Post's all-routes
|
|
56
|
+
// data is the one hydration hands it
|
|
57
|
+
export async function runClientPipeline(app) {
|
|
58
|
+
const init = await app.init?.(null, undefined);
|
|
59
|
+
const registered = app.allRoutesData;
|
|
60
|
+
return {
|
|
61
|
+
init,
|
|
62
|
+
routingContext: init ?? {},
|
|
63
|
+
routingNetworkedData: {},
|
|
64
|
+
allRoutesData: registered && (() => registered(null, init)),
|
|
65
|
+
networked: {},
|
|
66
|
+
post: async allRoutesData => ({
|
|
67
|
+
context: pipelineContext(init, await app.post?.(null, init, allRoutesData)),
|
|
68
|
+
afterRouting: undefined
|
|
69
|
+
})
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ServerDataLoading } from '../Store/ServerDataLoading.js';
|
|
2
|
+
import type { AllRoutesDataConstraint, ClientStarted, PipelineApp, SplitResult } from './pipelineDefinition.js';
|
|
3
|
+
import type { PipelineRouted, ServerRunner } from './runPipeline.js';
|
|
4
|
+
export declare function routeWithSplitPipeline(app: PipelineApp, reqRes: unknown, location: string, serverDataLoading: ServerDataLoading | null, dev: boolean): Promise<PipelineRouted>;
|
|
5
|
+
export declare function runServerPost(app: PipelineApp, reqRes: unknown, init: object | undefined, allRoutesData: AllRoutesDataConstraint): Promise<SplitResult | undefined>;
|
|
6
|
+
export declare const splitContext: (init: object | undefined, post: object | undefined) => object;
|
|
7
|
+
export declare const splitNetworked: (init: object | undefined, post: object | undefined) => object | undefined;
|
|
8
|
+
export declare const splitServer: ServerRunner;
|
|
9
|
+
export declare function runSplitClient(app: PipelineApp, fromPage: unknown): Promise<ClientStarted>;
|
|
10
|
+
//# sourceMappingURL=runSplitPipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runSplitPipeline.d.ts","sourceRoot":"","sources":["../../src/pipeline/runSplitPipeline.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,KAAK,EACR,uBAAuB,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EACnE,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAepE,wBAAsB,sBAAsB,CACxC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EACnD,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,EAAE,GAAG,EAAE,OAAO,GAC1D,OAAO,CAAC,cAAc,CAAC,CAKzB;AAGD,wBAAsB,aAAa,CAC/B,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,EAAE,uBAAuB,GACpG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAElC;AAGD,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,GAAG,SAAS,EAAE,MAAM,MAAM,GAAG,SAAS,WACvC,CAAA;AAGxC,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,GAAG,SAAS,EAAE,MAAM,MAAM,GAAG,SAAS,uBAC7C,CAAA;AAEpC,eAAO,MAAM,WAAW,EAAE,YAKzB,CAAA;AAKD,wBAAsB,cAAc,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAqBhG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { fromTransport } from './networkedTransport.js';
|
|
2
|
+
import { routeAfterInit } from './runPipeline.js';
|
|
3
|
+
/*
|
|
4
|
+
* Runs a split pipeline app: serverInit -> routing -> serverPost on the server, clientInit ->
|
|
5
|
+
* routing -> clientPost in the browser. The route data functions are handed Init's context and
|
|
6
|
+
* networked data; the components, the last stage's context
|
|
7
|
+
*/
|
|
8
|
+
// The stages' results. The app holds them loosely, as the builder typed them
|
|
9
|
+
const asSplit = stage => stage;
|
|
10
|
+
export async function routeWithSplitPipeline(app, reqRes, location, serverDataLoading, dev) {
|
|
11
|
+
const init = await app.serverInit?.(reqRes);
|
|
12
|
+
return routeAfterInit(app, reqRes, location, serverDataLoading, dev, init, init?.context, init?.networked);
|
|
13
|
+
}
|
|
14
|
+
// after routing, and not at all for a redirect
|
|
15
|
+
export async function runServerPost(app, reqRes, init, allRoutesData) {
|
|
16
|
+
return app.serverPost?.(reqRes, asSplit(init), allRoutesData);
|
|
17
|
+
}
|
|
18
|
+
// what this.tungsten.context reads: the last stage's context
|
|
19
|
+
export const splitContext = (init, post) => asSplit(post ?? init)?.context ?? {};
|
|
20
|
+
// what goes into the page: the last server stage's networked data
|
|
21
|
+
export const splitNetworked = (init, post) => asSplit(post ?? init)?.networked;
|
|
22
|
+
export const splitServer = {
|
|
23
|
+
route: routeWithSplitPipeline,
|
|
24
|
+
post: runServerPost,
|
|
25
|
+
context: splitContext,
|
|
26
|
+
networked: splitNetworked
|
|
27
|
+
};
|
|
28
|
+
// The browser's run, for hydration: clientInit from the networked data in the page, its stores
|
|
29
|
+
// rebuilt, then clientPost with the all-routes data hydration hands it. Each navigation's is the
|
|
30
|
+
// client's own
|
|
31
|
+
export async function runSplitClient(app, fromPage) {
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- the request handler wrote it
|
|
33
|
+
const networked = fromTransport(fromPage) ?? {};
|
|
34
|
+
const init = await app.clientInit?.(networked);
|
|
35
|
+
const registered = app.clientAllRoutesData;
|
|
36
|
+
return {
|
|
37
|
+
init,
|
|
38
|
+
routingContext: init?.context ?? {},
|
|
39
|
+
routingNetworkedData: init?.networked ?? {},
|
|
40
|
+
allRoutesData: registered && (() => registered(init)),
|
|
41
|
+
networked,
|
|
42
|
+
post: async allRoutesData => {
|
|
43
|
+
const context = splitContext(init, await app.clientPost?.(init, allRoutesData));
|
|
44
|
+
const afterRouting = app.clientAfterRouting;
|
|
45
|
+
return {
|
|
46
|
+
context,
|
|
47
|
+
// clientPost's context in each time, the components' out
|
|
48
|
+
afterRouting: afterRouting && (async (route, data) => splitContext(await afterRouting(context, route, data), undefined))
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|