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.
Files changed (532) hide show
  1. package/dist/.build-complete +1 -1
  2. package/dist/Brands.d.ts +16 -0
  3. package/dist/Brands.d.ts.map +1 -0
  4. package/dist/Brands.js +22 -0
  5. package/dist/Components.d.ts +4 -1
  6. package/dist/Components.d.ts.map +1 -1
  7. package/dist/Components.js +24 -6
  8. package/dist/ContentNode.d.ts +3 -2
  9. package/dist/ContentNode.d.ts.map +1 -1
  10. package/dist/ContentNode.js +11 -0
  11. package/dist/Framework.d.ts.map +1 -1
  12. package/dist/Framework.js +23 -4
  13. package/dist/FrameworkConfig.d.ts +9 -1
  14. package/dist/FrameworkConfig.d.ts.map +1 -1
  15. package/dist/FrameworkConfig.types.test.d.ts +2 -0
  16. package/dist/FrameworkConfig.types.test.d.ts.map +1 -0
  17. package/dist/FrameworkConfig.types.test.js +6 -0
  18. package/dist/FunctionComponent.d.ts +1 -0
  19. package/dist/FunctionComponent.d.ts.map +1 -1
  20. package/dist/FunctionComponentStandIn.d.ts.map +1 -1
  21. package/dist/Instance/Instance.d.ts +21 -9
  22. package/dist/Instance/Instance.d.ts.map +1 -1
  23. package/dist/Instance/Instance.js +42 -38
  24. package/dist/Instance/InstanceConfig.d.ts +3 -1
  25. package/dist/Instance/InstanceConfig.d.ts.map +1 -1
  26. package/dist/RenderedContentNode.d.ts.map +1 -1
  27. package/dist/RenderingNode.d.ts.map +1 -1
  28. package/dist/Servers/DevServer.d.ts +4 -2
  29. package/dist/Servers/DevServer.d.ts.map +1 -1
  30. package/dist/Servers/DevServer.js +72 -21
  31. package/dist/Servers/ProdServer.d.ts +5 -2
  32. package/dist/Servers/ProdServer.d.ts.map +1 -1
  33. package/dist/Servers/ProdServer.js +95 -19
  34. package/dist/Servers/StaticSiteServer.d.ts +1 -1
  35. package/dist/Servers/StaticSiteServer.d.ts.map +1 -1
  36. package/dist/Servers/TungstenServer.d.ts +2 -1
  37. package/dist/Servers/TungstenServer.d.ts.map +1 -1
  38. package/dist/Servers/TungstenServer.js +7 -0
  39. package/dist/Servers/cacheVersioned.d.ts +3 -0
  40. package/dist/Servers/cacheVersioned.d.ts.map +1 -0
  41. package/dist/Servers/cacheVersioned.js +23 -0
  42. package/dist/Servers/devErrorPageAutoRetry.d.ts.map +1 -1
  43. package/dist/Servers/devErrorPageAutoRetry.js +1 -0
  44. package/dist/Servers/initStores.d.ts +4 -4
  45. package/dist/Servers/initStores.d.ts.map +1 -1
  46. package/dist/Servers/initStores.js +2 -2
  47. package/dist/Servers/loadEnvsDev.d.ts.map +1 -1
  48. package/dist/Servers/loadEnvsDev.js +7 -6
  49. package/dist/Servers/resetRegistrations.d.ts +2 -0
  50. package/dist/Servers/resetRegistrations.d.ts.map +1 -0
  51. package/dist/Servers/resetRegistrations.js +13 -0
  52. package/dist/Servers/routing.d.ts +3 -2
  53. package/dist/Servers/routing.d.ts.map +1 -1
  54. package/dist/Servers/routing.js +12 -7
  55. package/dist/Servers/stubInstance.d.ts +8 -0
  56. package/dist/Servers/stubInstance.d.ts.map +1 -0
  57. package/dist/Servers/stubInstance.js +40 -0
  58. package/dist/Store/InternalStoreSchema.d.ts +1 -1
  59. package/dist/Store/Store.js +2 -1
  60. package/dist/Store/StoreSchemaClass.d.ts +6 -3
  61. package/dist/Store/StoreSchemaClass.d.ts.map +1 -1
  62. package/dist/Store/StoreSchemaClass.js +8 -1
  63. package/dist/Store/TypeSafeStore.js +2 -1
  64. package/dist/Store/createStores.d.ts +3 -3
  65. package/dist/Store/createStores.d.ts.map +1 -1
  66. package/dist/Store/createStores.js +7 -2
  67. package/dist/Store/getInternalStore.d.ts.map +1 -1
  68. package/dist/Store/registerStore.d.ts.map +1 -1
  69. package/dist/Store/registerStore.js +2 -2
  70. package/dist/Store/storeCreators.d.ts +2 -2
  71. package/dist/Store/storeCreators.d.ts.map +1 -1
  72. package/dist/TungstenApp.d.ts +3 -3
  73. package/dist/TungstenApp.d.ts.map +1 -1
  74. package/dist/_client/cjsHelpers.d.ts.map +1 -1
  75. package/dist/_client/cjsHelpers.js +5 -3
  76. package/dist/_client/client.d.ts +2 -0
  77. package/dist/_client/client.d.ts.map +1 -1
  78. package/dist/_client/client.js +10 -3
  79. package/dist/api/getApiRoutes.d.ts.map +1 -1
  80. package/dist/api/getExport.d.ts +1 -1
  81. package/dist/api/getExport.d.ts.map +1 -1
  82. package/dist/api/getExport.js +2 -1
  83. package/dist/api/getExportDev.d.ts +1 -1
  84. package/dist/api/getExportDev.d.ts.map +1 -1
  85. package/dist/appBuilder.d.ts +69 -0
  86. package/dist/appBuilder.d.ts.map +1 -0
  87. package/dist/appBuilder.js +98 -0
  88. package/dist/appBuilder.types.test.d.ts +110 -0
  89. package/dist/appBuilder.types.test.d.ts.map +1 -0
  90. package/dist/appBuilder.types.test.js +240 -0
  91. package/dist/babelPlugins/BabelTransformBindDirect.js +7 -7
  92. package/dist/babelPlugins/BabelTransformBindVar.js +7 -7
  93. package/dist/babelPlugins/BabelTransformComponentState.d.ts.map +1 -1
  94. package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
  95. package/dist/babelPlugins/BabelTransformComponentStyles.js +5 -5
  96. package/dist/babelPlugins/BabelTransformCssImports.d.ts.map +1 -1
  97. package/dist/babelPlugins/BabelTransformCssImports.js +2 -2
  98. package/dist/babelPlugins/BabelTransformDeproxyState.d.ts.map +1 -1
  99. package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
  100. package/dist/babelPlugins/BabelTransformPackageImports.js +11 -6
  101. package/dist/babelPlugins/BabelTransformRemoveDevBlocks.d.ts.map +1 -1
  102. package/dist/babelPlugins/BabelTransformRemoveServerBlocks.d.ts.map +1 -1
  103. package/dist/babelPlugins/BabelTypes.d.ts.map +1 -1
  104. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.d.ts.map +1 -1
  105. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsCjs.js +1 -1
  106. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.d.ts.map +1 -1
  107. package/dist/babelPlugins/transformPackageImports/BabelTransformDependencyImportsEsm.js +2 -2
  108. package/dist/bin/commands/compile.d.ts.map +1 -1
  109. package/dist/bin/commands/compile.js +2 -1
  110. package/dist/build/CompilationInfo.d.ts +3 -0
  111. package/dist/build/CompilationInfo.d.ts.map +1 -1
  112. package/dist/build/assetVersions.d.ts +9 -0
  113. package/dist/build/assetVersions.d.ts.map +1 -0
  114. package/dist/build/assetVersions.js +39 -0
  115. package/dist/build/babel.user.common.config.d.ts.map +1 -1
  116. package/dist/build/bundle.d.ts.map +1 -1
  117. package/dist/build/bundle.js +2 -1
  118. package/dist/build/bundleBabelOptions.d.ts.map +1 -1
  119. package/dist/build/clientRoutesFile.d.ts +2 -0
  120. package/dist/build/clientRoutesFile.d.ts.map +1 -0
  121. package/dist/build/clientRoutesFile.js +13 -0
  122. package/dist/build/compileJavascript.d.ts.map +1 -1
  123. package/dist/build/compileJavascript.js +4 -3
  124. package/dist/build/compileStyles.d.ts +2 -1
  125. package/dist/build/compileStyles.d.ts.map +1 -1
  126. package/dist/build/compileStyles.js +38 -83
  127. package/dist/build/compileUserApp.d.ts.map +1 -1
  128. package/dist/build/componentStylesCache.d.ts.map +1 -1
  129. package/dist/build/componentStylesCache.js +3 -2
  130. package/dist/build/copyAssets.d.ts.map +1 -1
  131. package/dist/build/copyAssets.js +2 -1
  132. package/dist/build/copyPackageModulesToPackagesFolder.d.ts.map +1 -1
  133. package/dist/build/copyPackageModulesToPackagesFolder.js +1 -1
  134. package/dist/build/copyPublicFiles.d.ts.map +1 -1
  135. package/dist/build/copyPublicFiles.js +2 -1
  136. package/dist/build/createClientFiles.d.ts.map +1 -1
  137. package/dist/build/createClientFiles.js +9 -5
  138. package/dist/build/createInstanceConfigFile.d.ts +1 -1
  139. package/dist/build/createInstanceConfigFile.d.ts.map +1 -1
  140. package/dist/build/createInstanceConfigFile.js +9 -3
  141. package/dist/build/frameworkDestLocation.d.ts.map +1 -1
  142. package/dist/build/frameworkDestLocation.js +5 -6
  143. package/dist/build/frameworkStylesheets.d.ts.map +1 -1
  144. package/dist/build/frameworkStylesheets.js +1 -1
  145. package/dist/build/makeBabelRawConfig.d.ts.map +1 -1
  146. package/dist/build/makeBabelUserDevConfig.d.ts +2 -2
  147. package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
  148. package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
  149. package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
  150. package/dist/build/rollup.user.prod.config.js +5 -3
  151. package/dist/build/rollupProdConstants.d.ts +5 -0
  152. package/dist/build/rollupProdConstants.d.ts.map +1 -0
  153. package/dist/build/rollupProdConstants.js +21 -0
  154. package/dist/cacheControl.d.ts +13 -0
  155. package/dist/cacheControl.d.ts.map +1 -0
  156. package/dist/cacheControl.js +22 -0
  157. package/dist/compat/types.d.ts +1 -1
  158. package/dist/compat/types.d.ts.map +1 -1
  159. package/dist/componentHelpers.d.ts +19 -0
  160. package/dist/componentHelpers.d.ts.map +1 -0
  161. package/dist/componentHelpers.js +31 -0
  162. package/dist/componentProxyHandlers.d.ts.map +1 -1
  163. package/dist/components/Fragment.d.ts +8 -0
  164. package/dist/components/Fragment.d.ts.map +1 -0
  165. package/dist/components/Fragment.js +10 -0
  166. package/dist/components/Link.d.ts +4 -3
  167. package/dist/components/Link.d.ts.map +1 -1
  168. package/dist/components/Link.js +1 -0
  169. package/dist/components/NoEscape.d.ts +8 -0
  170. package/dist/components/NoEscape.d.ts.map +1 -0
  171. package/dist/components/NoEscape.js +6 -0
  172. package/dist/components/RouteRedirectComponent.d.ts.map +1 -1
  173. package/dist/components/RouteRedirectComponent.js +1 -1
  174. package/dist/components/WebRedirectComponent.d.ts.map +1 -1
  175. package/dist/components/WebRedirectComponent.js +1 -1
  176. package/dist/components/bindable/BindVariable.d.ts +1 -0
  177. package/dist/components/bindable/BindVariable.d.ts.map +1 -1
  178. package/dist/components/bindable/BindableCheckbox.d.ts +7 -7
  179. package/dist/components/bindable/BindableCheckbox.d.ts.map +1 -1
  180. package/dist/components/bindable/BindableInput.d.ts +7 -7
  181. package/dist/components/bindable/BindableInput.d.ts.map +1 -1
  182. package/dist/components/bindable/BindableInputNonString.d.ts +2 -2
  183. package/dist/components/bindable/BindableInputNonString.d.ts.map +1 -1
  184. package/dist/components/bindable/BindableInputString.d.ts +2 -2
  185. package/dist/components/bindable/BindableInputString.d.ts.map +1 -1
  186. package/dist/components/bindable/BindableInputTyped.d.ts +3 -3
  187. package/dist/components/bindable/BindableInputTyped.d.ts.map +1 -1
  188. package/dist/components/bindable/BindableInputTypedLegacy.d.ts +3 -3
  189. package/dist/components/bindable/BindableInputTypedLegacy.d.ts.map +1 -1
  190. package/dist/components/bindable/BindableRadio.js +2 -2
  191. package/dist/components/bindable/BindableSelect.d.ts +13 -10
  192. package/dist/components/bindable/BindableSelect.d.ts.map +1 -1
  193. package/dist/components/bindable/BindableSelectNaive.js +3 -3
  194. package/dist/components/bindable/BindableTextarea.d.ts +7 -7
  195. package/dist/components/bindable/BindableTextarea.d.ts.map +1 -1
  196. package/dist/components/bindable/bindableCandidates.comparison.d.ts +136 -0
  197. package/dist/components/bindable/bindableCandidates.comparison.d.ts.map +1 -0
  198. package/dist/components/bindable/bindableCandidates.comparison.js +268 -0
  199. package/dist/components/bindable/bindableProps.types.test.d.ts +50 -0
  200. package/dist/components/bindable/bindableProps.types.test.d.ts.map +1 -0
  201. package/dist/components/bindable/bindableProps.types.test.js +252 -0
  202. package/dist/components/library/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  203. package/dist/components/library/RichTextEditor/contentTree.d.ts.map +1 -1
  204. package/dist/components/makeTypedLink.d.ts +9 -0
  205. package/dist/components/makeTypedLink.d.ts.map +1 -0
  206. package/dist/components/makeTypedLink.js +15 -0
  207. package/dist/context/registerContext.d.ts +22 -0
  208. package/dist/context/registerContext.d.ts.map +1 -0
  209. package/dist/context/registerContext.js +18 -0
  210. package/dist/env/getEnvSchemas.d.ts.map +1 -1
  211. package/dist/env/getEnvSchemas.js +2 -1
  212. package/dist/fileVersions.d.ts +9 -0
  213. package/dist/fileVersions.d.ts.map +1 -0
  214. package/dist/fileVersions.js +28 -0
  215. package/dist/findUserConfig.d.ts +1 -1
  216. package/dist/findUserConfig.d.ts.map +1 -1
  217. package/dist/findUserConfig.js +2 -1
  218. package/dist/frameworkConfigSchema.d.ts +16 -2
  219. package/dist/frameworkConfigSchema.d.ts.map +1 -1
  220. package/dist/frameworkConfigSchema.js +15 -3
  221. package/dist/getComponent.d.ts.map +1 -1
  222. package/dist/getComponent.js +4 -3
  223. package/dist/getRoutes.d.ts.map +1 -1
  224. package/dist/getRoutes.js +9 -8
  225. package/dist/getUserConfig.d.ts.map +1 -1
  226. package/dist/hmr/applyHmrModule.d.ts.map +1 -1
  227. package/dist/hmr/componentIdentity.js +1 -1
  228. package/dist/hooks/getCurrentComponent.d.ts +1 -1
  229. package/dist/hooks/getCurrentComponent.d.ts.map +1 -1
  230. package/dist/hydrate/hydrate.d.ts +5 -1
  231. package/dist/hydrate/hydrate.d.ts.map +1 -1
  232. package/dist/hydrate/hydrate.js +86 -52
  233. package/dist/hydrate/hydrateGlobalData.d.ts +4 -3
  234. package/dist/hydrate/hydrateGlobalData.d.ts.map +1 -1
  235. package/dist/hydrate/reconcileHydratedAttributes.d.ts +2 -1
  236. package/dist/hydrate/reconcileHydratedAttributes.d.ts.map +1 -1
  237. package/dist/hydrate/reconcileHydratedAttributes.js +4 -3
  238. package/dist/hydrate/renderHydrationMismatchBanner.d.ts.map +1 -1
  239. package/dist/hydrate/renderHydrationMismatchBanner.js +2 -1
  240. package/dist/hydrate/stubRouting.d.ts +8 -0
  241. package/dist/hydrate/stubRouting.d.ts.map +1 -0
  242. package/dist/hydrate/stubRouting.js +25 -0
  243. package/dist/importDevModuleWithRetry.d.ts +2 -1
  244. package/dist/importDevModuleWithRetry.d.ts.map +1 -1
  245. package/dist/importDevModuleWithRetry.js +2 -1
  246. package/dist/importModule.d.ts +3 -0
  247. package/dist/importModule.d.ts.map +1 -0
  248. package/dist/importModule.js +4 -0
  249. package/dist/index.js +2 -1
  250. package/dist/indexInner.d.ts +30 -7
  251. package/dist/indexInner.d.ts.map +1 -1
  252. package/dist/indexInner.js +37 -2
  253. package/dist/json.d.ts +12 -0
  254. package/dist/json.d.ts.map +1 -0
  255. package/dist/json.js +8 -0
  256. package/dist/jsxHelpers.d.ts +3 -0
  257. package/dist/jsxHelpers.d.ts.map +1 -0
  258. package/dist/jsxHelpers.js +6 -0
  259. package/dist/jsxRuntime.d.ts +1 -0
  260. package/dist/jsxRuntime.d.ts.map +1 -1
  261. package/dist/jsxRuntime.js +3 -1
  262. package/dist/jsxRuntimeSignals.d.ts.map +1 -1
  263. package/dist/jsxRuntimeSignals.js +1 -0
  264. package/dist/makeFinalConfig.d.ts.map +1 -1
  265. package/dist/makeFinalConfig.js +2 -0
  266. package/dist/makeInstanceConfigFromFrameworkConfig.d.ts.map +1 -1
  267. package/dist/makeInstanceConfigFromFrameworkConfig.js +2 -0
  268. package/dist/mergeConfigs.d.ts.map +1 -1
  269. package/dist/mergeConfigs.js +2 -6
  270. package/dist/nbsp.d.ts +1 -2
  271. package/dist/nbsp.d.ts.map +1 -1
  272. package/dist/nbsp.js +3 -7
  273. package/dist/objectMap.d.ts +1 -1
  274. package/dist/objectMap.d.ts.map +1 -1
  275. package/dist/pipeline/PipelineRequestHandler.d.ts +25 -0
  276. package/dist/pipeline/PipelineRequestHandler.d.ts.map +1 -0
  277. package/dist/pipeline/PipelineRequestHandler.js +104 -0
  278. package/dist/pipeline/contextStore.d.ts +12 -0
  279. package/dist/pipeline/contextStore.d.ts.map +1 -0
  280. package/dist/pipeline/contextStore.js +13 -0
  281. package/dist/pipeline/hydratePipeline.d.ts +4 -0
  282. package/dist/pipeline/hydratePipeline.d.ts.map +1 -0
  283. package/dist/pipeline/hydratePipeline.js +83 -0
  284. package/dist/pipeline/importRoutesModule.d.ts +6 -0
  285. package/dist/pipeline/importRoutesModule.d.ts.map +1 -0
  286. package/dist/pipeline/importRoutesModule.js +33 -0
  287. package/dist/pipeline/networkedTransport.d.ts +11 -0
  288. package/dist/pipeline/networkedTransport.d.ts.map +1 -0
  289. package/dist/pipeline/networkedTransport.js +54 -0
  290. package/dist/pipeline/pipeline.d.ts +107 -0
  291. package/dist/pipeline/pipeline.d.ts.map +1 -0
  292. package/dist/pipeline/pipeline.js +113 -0
  293. package/dist/pipeline/pipeline.types.test.d.ts +760 -0
  294. package/dist/pipeline/pipeline.types.test.d.ts.map +1 -0
  295. package/dist/pipeline/pipeline.types.test.js +344 -0
  296. package/dist/pipeline/pipelineDefinition.d.ts +78 -0
  297. package/dist/pipeline/pipelineDefinition.d.ts.map +1 -0
  298. package/dist/pipeline/pipelineDefinition.js +11 -0
  299. package/dist/pipeline/pipelineSplit.types.test.d.ts +2445 -0
  300. package/dist/pipeline/pipelineSplit.types.test.d.ts.map +1 -0
  301. package/dist/pipeline/pipelineSplit.types.test.js +440 -0
  302. package/dist/pipeline/runPipeline.d.ts +29 -0
  303. package/dist/pipeline/runPipeline.d.ts.map +1 -0
  304. package/dist/pipeline/runPipeline.js +71 -0
  305. package/dist/pipeline/runSplitPipeline.d.ts +10 -0
  306. package/dist/pipeline/runSplitPipeline.d.ts.map +1 -0
  307. package/dist/pipeline/runSplitPipeline.js +52 -0
  308. package/dist/pipeline/splitPipeline.d.ts +62 -0
  309. package/dist/pipeline/splitPipeline.d.ts.map +1 -0
  310. package/dist/pipeline/splitPipeline.js +76 -0
  311. package/dist/pop.js +1 -1
  312. package/dist/rawHtml/filterContentNode.d.ts.map +1 -1
  313. package/dist/render/HeadData.d.ts +3 -1
  314. package/dist/render/HeadData.d.ts.map +1 -1
  315. package/dist/render/classComponentNodeToRenderingTree.d.ts.map +1 -1
  316. package/dist/render/componentNodeToRenderingTree.d.ts.map +1 -1
  317. package/dist/render/contentToHtml.d.ts +2 -2
  318. package/dist/render/contentToHtml.d.ts.map +1 -1
  319. package/dist/render/contentToHtml.js +2 -1
  320. package/dist/render/contentToHtmlDev.d.ts +1 -1
  321. package/dist/render/contentToHtmlDev.d.ts.map +1 -1
  322. package/dist/render/contentTreeToRenderingTree.d.ts.map +1 -1
  323. package/dist/render/contentTreeToRenderingTree.js +6 -2
  324. package/dist/render/functionComponentNodeToRenderingTree.d.ts.map +1 -1
  325. package/dist/render/functionComponentNodeToRenderingTree.js +2 -2
  326. package/dist/render/instantiateComponent.d.ts.map +1 -1
  327. package/dist/render/processHead.d.ts.map +1 -1
  328. package/dist/render/processHead.js +12 -18
  329. package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
  330. package/dist/render/renderingTreeToHtml.js +6 -3
  331. package/dist/render/rootToHtml.d.ts +2 -2
  332. package/dist/render/rootToHtml.d.ts.map +1 -1
  333. package/dist/requests/fetch/delete.d.ts.map +1 -1
  334. package/dist/requests/fetch/delete.js +5 -2
  335. package/dist/requests/fetch/get.js +1 -1
  336. package/dist/requests/fetch/patch.d.ts.map +1 -1
  337. package/dist/requests/fetch/patch.js +5 -2
  338. package/dist/requests/fetch/post.d.ts.map +1 -1
  339. package/dist/requests/fetch/post.js +5 -2
  340. package/dist/requests/fetch/put.d.ts.map +1 -1
  341. package/dist/requests/fetch/put.js +5 -2
  342. package/dist/routesLocationParts.d.ts +6 -0
  343. package/dist/routesLocationParts.d.ts.map +1 -0
  344. package/dist/routesLocationParts.js +10 -0
  345. package/dist/routing/AppRoutes.d.ts +5 -3
  346. package/dist/routing/AppRoutes.d.ts.map +1 -1
  347. package/dist/routing/MatchedRouteInfo.d.ts +13 -0
  348. package/dist/routing/MatchedRouteInfo.d.ts.map +1 -0
  349. package/dist/routing/MatchedRouteInfo.js +1 -0
  350. package/dist/routing/RouteContentFunction.d.ts +1 -2
  351. package/dist/routing/RouteContentFunction.d.ts.map +1 -1
  352. package/dist/routing/RouteDataFunction.type.d.ts +4 -2
  353. package/dist/routing/RouteDataFunction.type.d.ts.map +1 -1
  354. package/dist/routing/RoutePaths.d.ts +12 -0
  355. package/dist/routing/RoutePaths.d.ts.map +1 -0
  356. package/dist/routing/RouteTypes.d.ts +6 -4
  357. package/dist/routing/RouteTypes.d.ts.map +1 -1
  358. package/dist/routing/Routes.d.ts +20 -11
  359. package/dist/routing/Routes.d.ts.map +1 -1
  360. package/dist/routing/RoutesFunction.d.ts +11 -2
  361. package/dist/routing/RoutesFunction.d.ts.map +1 -1
  362. package/dist/routing/Serializable.d.ts +5 -0
  363. package/dist/routing/Serializable.d.ts.map +1 -0
  364. package/dist/routing/Serializable.js +1 -0
  365. package/dist/routing/builder.d.ts +100 -0
  366. package/dist/routing/builder.d.ts.map +1 -0
  367. package/dist/routing/builder.js +219 -0
  368. package/dist/routing/builder.trial.d.ts +2 -0
  369. package/dist/routing/builder.trial.d.ts.map +1 -0
  370. package/dist/routing/builder.trial.js +85 -0
  371. package/dist/routing/defineRoutes.d.ts +8 -0
  372. package/dist/routing/defineRoutes.d.ts.map +1 -0
  373. package/dist/routing/defineRoutes.js +3 -0
  374. package/dist/routing/pyramidRouting.d.ts +2 -0
  375. package/dist/routing/pyramidRouting.d.ts.map +1 -0
  376. package/dist/routing/pyramidRouting.js +13 -0
  377. package/dist/routing/redirectOf.d.ts +11 -0
  378. package/dist/routing/redirectOf.d.ts.map +1 -0
  379. package/dist/routing/redirectOf.js +32 -0
  380. package/dist/routing/registerGlobalData.d.ts +11 -3
  381. package/dist/routing/registerGlobalData.d.ts.map +1 -1
  382. package/dist/routing/registerGlobalData.js +6 -0
  383. package/dist/routing/registerParts.types.test.d.ts +2 -0
  384. package/dist/routing/registerParts.types.test.d.ts.map +1 -0
  385. package/dist/routing/registerParts.types.test.js +139 -0
  386. package/dist/routing/registerRoutes.d.ts +10 -0
  387. package/dist/routing/registerRoutes.d.ts.map +1 -0
  388. package/dist/routing/registerRoutes.js +9 -0
  389. package/dist/routing/registerRouting.d.ts +36 -0
  390. package/dist/routing/registerRouting.d.ts.map +1 -0
  391. package/dist/routing/registerRouting.js +34 -0
  392. package/dist/routing/registerRouting.types.test.d.ts +80 -0
  393. package/dist/routing/registerRouting.types.test.d.ts.map +1 -0
  394. package/dist/routing/registerRouting.types.test.js +120 -0
  395. package/dist/routing/registrationTypes.d.ts +11 -0
  396. package/dist/routing/registrationTypes.d.ts.map +1 -0
  397. package/dist/routing/registrationTypes.js +1 -0
  398. package/dist/routing/resolveAppRoutes.d.ts +5 -0
  399. package/dist/routing/resolveAppRoutes.d.ts.map +1 -0
  400. package/dist/routing/resolveAppRoutes.js +25 -0
  401. package/dist/routing/routesArray.d.ts +23 -0
  402. package/dist/routing/routesArray.d.ts.map +1 -0
  403. package/dist/routing/routesArray.js +20 -0
  404. package/dist/routing/routesArray.types.test.d.ts +2 -0
  405. package/dist/routing/routesArray.types.test.d.ts.map +1 -0
  406. package/dist/routing/routesArray.types.test.js +132 -0
  407. package/dist/routing/routingBuilder.d.ts +34 -0
  408. package/dist/routing/routingBuilder.d.ts.map +1 -0
  409. package/dist/routing/routingBuilder.js +32 -0
  410. package/dist/routing/routingBuilder.types.test.d.ts +2 -0
  411. package/dist/routing/routingBuilder.types.test.d.ts.map +1 -0
  412. package/dist/routing/routingBuilder.types.test.js +171 -0
  413. package/dist/routing/routingRegistry.d.ts +19 -0
  414. package/dist/routing/routingRegistry.d.ts.map +1 -0
  415. package/dist/routing/routingRegistry.js +29 -0
  416. package/dist/staticGen/getAppRoutes.d.ts +2 -2
  417. package/dist/staticGen/getAppRoutes.d.ts.map +1 -1
  418. package/dist/staticGen/getAppRoutes.js +9 -6
  419. package/dist/staticGen/staticGen.d.ts.map +1 -1
  420. package/dist/staticGen/staticGen.js +8 -2
  421. package/dist/style/styleContentSxy.d.ts.map +1 -1
  422. package/dist/sync/index.d.ts.map +1 -1
  423. package/dist/sync/index.js +2 -0
  424. package/dist/syncServer/index.cjs +1 -2
  425. package/dist/syncServer/preload.js +2 -0
  426. package/dist/testing/contentToString.d.ts +13 -0
  427. package/dist/testing/contentToString.d.ts.map +1 -0
  428. package/dist/testing/contentToString.js +105 -0
  429. package/dist/testing/createTestApp.d.ts +25 -1
  430. package/dist/testing/createTestApp.d.ts.map +1 -1
  431. package/dist/testing/createTestApp.js +12 -3
  432. package/dist/testing/display.d.ts +2 -0
  433. package/dist/testing/display.d.ts.map +1 -0
  434. package/dist/testing/display.js +37 -0
  435. package/dist/testing/ensure.d.ts +119 -0
  436. package/dist/testing/ensure.d.ts.map +1 -0
  437. package/dist/testing/ensure.js +664 -0
  438. package/dist/testing/ensure.trial.d.ts +2 -0
  439. package/dist/testing/ensure.trial.d.ts.map +1 -0
  440. package/dist/testing/ensure.trial.js +9 -0
  441. package/dist/testing/ensure.types.test.d.ts +2 -0
  442. package/dist/testing/ensure.types.test.d.ts.map +1 -0
  443. package/dist/testing/ensure.types.test.js +34 -0
  444. package/dist/testing/helpers/contentHtmlElements.d.ts.map +1 -1
  445. package/dist/testing/host.d.ts +86 -15
  446. package/dist/testing/host.d.ts.map +1 -1
  447. package/dist/testing/host.js +82 -23
  448. package/dist/testing/host.types.test.d.ts +2 -0
  449. package/dist/testing/host.types.test.d.ts.map +1 -0
  450. package/dist/testing/host.types.test.js +81 -0
  451. package/dist/testing/hydrateTestApp.d.ts +17 -0
  452. package/dist/testing/hydrateTestApp.d.ts.map +1 -1
  453. package/dist/testing/hydrateTestApp.js +27 -6
  454. package/dist/testing/index.d.ts +5 -3
  455. package/dist/testing/index.d.ts.map +1 -1
  456. package/dist/testing/index.js +3 -1
  457. package/dist/testing/pipeline/createTestPacketApp.d.ts +30 -0
  458. package/dist/testing/pipeline/createTestPacketApp.d.ts.map +1 -0
  459. package/dist/testing/pipeline/createTestPacketApp.js +45 -0
  460. package/dist/testing/pipeline/createTestPacketApp.types.test.d.ts +3 -0
  461. package/dist/testing/pipeline/createTestPacketApp.types.test.d.ts.map +1 -0
  462. package/dist/testing/pipeline/createTestPacketApp.types.test.js +101 -0
  463. package/dist/testing/pipeline/createTestPipelineApp.d.ts +70 -0
  464. package/dist/testing/pipeline/createTestPipelineApp.d.ts.map +1 -0
  465. package/dist/testing/pipeline/createTestPipelineApp.js +90 -0
  466. package/dist/testing/pipeline/createTestPipelineApp.types.test.d.ts +6 -0
  467. package/dist/testing/pipeline/createTestPipelineApp.types.test.d.ts.map +1 -0
  468. package/dist/testing/pipeline/createTestPipelineApp.types.test.js +146 -0
  469. package/dist/testing/pipeline/hostPipeline.d.ts +25 -0
  470. package/dist/testing/pipeline/hostPipeline.d.ts.map +1 -0
  471. package/dist/testing/pipeline/hostPipeline.js +18 -0
  472. package/dist/testing/pipeline/hydrateTestPipelineApp.d.ts +30 -0
  473. package/dist/testing/pipeline/hydrateTestPipelineApp.d.ts.map +1 -0
  474. package/dist/testing/pipeline/hydrateTestPipelineApp.js +193 -0
  475. package/dist/testing/pipeline/hydrateTestPipelineApp.types.test.d.ts +2 -0
  476. package/dist/testing/pipeline/hydrateTestPipelineApp.types.test.d.ts.map +1 -0
  477. package/dist/testing/pipeline/hydrateTestPipelineApp.types.test.js +27 -0
  478. package/dist/testing/pipeline/index.d.ts +5 -0
  479. package/dist/testing/pipeline/index.d.ts.map +1 -0
  480. package/dist/testing/pipeline/index.js +4 -0
  481. package/dist/testing/pipeline/pipelineTestApp.d.ts +34 -0
  482. package/dist/testing/pipeline/pipelineTestApp.d.ts.map +1 -0
  483. package/dist/testing/pipeline/pipelineTestApp.js +100 -0
  484. package/dist/testing/pipeline/testPipelineRoute.d.ts +2 -0
  485. package/dist/testing/pipeline/testPipelineRoute.d.ts.map +1 -0
  486. package/dist/testing/pipeline/testPipelineRoute.js +1 -0
  487. package/dist/testing/resolveContent.d.ts +18 -0
  488. package/dist/testing/resolveContent.d.ts.map +1 -0
  489. package/dist/testing/resolveContent.js +73 -0
  490. package/dist/testing/testingComponentPackage.d.ts +3 -1
  491. package/dist/testing/testingComponentPackage.d.ts.map +1 -1
  492. package/dist/testing/testingComponentPackage.js +16 -1
  493. package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
  494. package/dist/update/integrateUpdateVdom.js +35 -31
  495. package/dist/update/integrateUpdateVdomPrebuild.js +20 -20
  496. package/dist/validChildren.d.ts.map +1 -1
  497. package/dist/zones/react.d.ts.map +1 -1
  498. package/package.json +23 -19
  499. package/types/helpers.d.ts +11 -2
  500. package/types/jsx/html.d.ts +29 -25
  501. package/types/jsx/jsx.d.ts +8 -8
  502. package/types/modules.d.ts +14 -3
  503. package/types/testing.d.ts +0 -0
  504. package/vendor/babel-core.js +5 -5
  505. package/vendor/babel-parser.js +1 -1
  506. package/vendor/babel-preset-react.js +32 -34
  507. package/vendor/babel-preset-typescript.js +5 -5
  508. package/vendor/chalk-extensions.js +3 -146
  509. package/vendor/chokidar.js +311 -5
  510. package/vendor/chunk-B34JUlnS.js +169 -0
  511. package/vendor/{chunk-Bu8ZRE-c.js → chunk-B9ttgKqg.js} +28 -25
  512. package/vendor/{chunk-D2EnpcLg.js → chunk-BGvapINa.js} +3 -164
  513. package/vendor/{chunk-Cqrj-Zqr.js → chunk-BmAiqUzD.js} +22 -8
  514. package/vendor/{chunk-BiUcnLhT.js → chunk-But4T5N_.js} +8 -3
  515. package/vendor/{chunk-OUnVY4Wm.js → chunk-DuR6SGzI.js} +162 -35
  516. package/vendor/css-select.js +3383 -0
  517. package/vendor/dotenv.js +2 -2
  518. package/vendor/express.js +61 -10
  519. package/vendor/manifest.json +4 -3
  520. package/vendor/postcss.js +1 -1
  521. package/vendor/precinct.js +5914 -3591
  522. package/vendor/valibot.js +418 -504
  523. package/dist/Servers/MatchedRouteInfo.d.ts +0 -11
  524. package/dist/Servers/MatchedRouteInfo.d.ts.map +0 -1
  525. package/dist/routing/__fluentRouteBuilder.d.ts +0 -80
  526. package/dist/routing/__fluentRouteBuilder.d.ts.map +0 -1
  527. package/dist/routing/__fluentRouteBuilder.js +0 -183
  528. package/dist/routing/__fluentRoutes.d.ts +0 -2
  529. package/dist/routing/__fluentRoutes.d.ts.map +0 -1
  530. package/dist/routing/__fluentRoutes.js +0 -59
  531. package/vendor/chunk-Hy-cCmu-.js +0 -23
  532. /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,CA4BlC"}
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":"AAiBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D,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
+ {"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 'tungsten/FunctionComponentStandIn.js';
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,sCAAsC,CAAA;AAEvF,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
+ {"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, RootComponent: TungstenBaseComponentType | null, instanceConfig: InstanceConfig): Promise<void>;
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":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAQnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAoCxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAO7C,OAAO,EAGH,KAAK,yBAAyB,EAEjC,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAmBlD,OAAO,EAC4B,KAAK,uBAAuB,EAC9D,MAAM,oCAAoC,CAAA;AAS3C,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,EACpB,aAAa,EAAE,yBAAyB,GAAG,IAAI,EAC/C,cAAc,EAAE,cAAc,iBA4DjC;AAyBD,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"}
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"}
@@ -1,4 +1,4 @@
1
- import { initStores } from 'tungsten/Servers/initStores.js';
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
- const location = urlToLocation(window.location, instanceConfig.siteBasePath, isProd && instanceConfig.staticSite);
64
- const routes = typeof appRoutes === 'function' ? appRoutes(null) : appRoutes;
65
- const matchedRouteInfo = hydrationRouting(__tungsten_matched_route_info__, routes);
66
- const globalData = __tungsten_global_data__;
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.__instance.setDefaultTitle(rootElement.title(rootElement.props, undefined).toString());
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
- if (node[$type] === 'body' && instance.config.csr) {
523
- // CSR: body shipped empty on purpose, nothing to hydrate against - create fresh.
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', 'CSR hydration reached <body> with no owning component');
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 ${JSON.stringify(node)}`);
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 ${JSON.stringify(mismatch.expected)}` + ` but the server sent ${JSON.stringify(mismatch.actual)}.` + ` The rendered value has been applied.`);
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 ('filter' in node[$props]) {
648
- const filterFunc = node[$props].filter;
679
+ if ('convert' in node[$props]) {
680
+ const convertFunc = node[$props].convert;
649
681
  handler = async event => {
650
- bindObject[bindKey] = await filterFunc(event.target.value, event);
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 ('filter' in node[$props]) {
666
- const filterFunc = node[$props].filter;
697
+ if ('convert' in node[$props]) {
698
+ const convertFunc = node[$props].convert;
667
699
  handler = async event => {
668
- bindObject[bindKey] = await filterFunc(event.target.value, event);
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 ('filterChecked' in node[$props]) {
687
- // const filterFunc = node[$props].filterChecked as FilterCheckedFunc<any, any>
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 filterFunc((event.target as HTMLCheckedBindableElement).checked, event)
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 ('filter' in node[$props]) {
709
- // const filterFunc = node[$props].filter as FilterCheckedFunc<any, any> // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
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 filterFunc((event.target as HTMLCheckedBindableElement).checked, event) // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion
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 filtering before the onInput
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 filtering before the onChange
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
- props.value = bindObject[bindKey] ?? ''; // nullish coalesce to avoid putting undef/null into elements
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 ('filter' in props) {
751
- const filterFunc = props.filter;
783
+ if ('convert' in props) {
784
+ const convertFunc = props.convert;
752
785
  handler = async event => {
753
- bindObject[bindKey] = await filterFunc(event.target.value, event);
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
- props.value = bindObject[bindKey] ?? ''; // nullish coalesce to avoid putting undef/null into elements
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 ('filter' in node[$props]) {
777
- const filterFunc = node[$props].filter;
810
+ if ('convert' in node[$props]) {
811
+ const convertFunc = node[$props].convert;
778
812
  handler = async event => {
779
- bindObject[bindKey] = await filterFunc(event.target.value, event);
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.filter;
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 ('filterChecked' in props) {
808
- const filterFunc = props.filterChecked;
841
+ if ('convertChecked' in props) {
842
+ const convertFunc = props.convertChecked;
809
843
  handler = async event => {
810
- bindObject[bindKey] = await filterFunc(event.target.checked, event);
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.filterChecked;
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 { GlobalData } from '../routing/registerGlobalData.js';
2
- import type { MatchedRouteInfo } from '../Servers/MatchedRouteInfo.js';
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__: GlobalData;
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,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAGtE,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;AAEvE,OAAO,CAAC,MAAM,CAAC;IACX,IAAI,wBAAwB,EAAE,UAAU,CAAA;IACxC,IAAI,+BAA+B,EAAE,uBAAuB,CAAA;IAE5D,IAAI,uBAAuB,EAAE,OAAO,CAAA;CACvC"}
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;AAMxD,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,GACnD,IAAI,CAuCN"}
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;AAIzE,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
+ {"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 ${JSON.stringify(mismatch.expected)}, server sent ${JSON.stringify(mismatch.actual)}`);
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<any>;
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":"AAuBA,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,GAAG,CAAC,CAUd"}
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 import(attemptUrl);
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,3 @@
1
+ export type ModuleNamespace = Record<string, unknown>;
2
+ export declare function importModule(specifier: string): Promise<ModuleNamespace>;
3
+ //# sourceMappingURL=importModule.d.ts.map
@@ -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"}
@@ -0,0 +1,4 @@
1
+ // specifier must be absolute - a relative one would resolve against this file
2
+ export async function importModule(specifier) {
3
+ return await import(specifier); // eslint-disable-line @typescript-eslint/no-unsafe-type-assertion -- a module namespace is an object
4
+ }
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 can't remember why I did this
6
+ export * as default from './indexInner.js'; // I think linking to indexInner may have been related to
7
+ // offering a synchronous export for CJS