@askrjs/askr 0.0.51 → 0.0.52

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 (593) hide show
  1. package/dist/bench/components/benchmark-row.d.ts +2 -2
  2. package/dist/bench/components/benchmark-row.js +0 -2
  3. package/dist/bench/components/benchmark-table.js +0 -2
  4. package/dist/benchmark.d.ts +1 -2
  5. package/dist/benchmark.js +2 -4
  6. package/dist/bin/askr-ssg.d.ts +1 -2
  7. package/dist/bin/askr-ssg.js +21 -6
  8. package/dist/boot/hydration.js +10 -11
  9. package/dist/boot/index.d.ts +1 -2
  10. package/dist/boot/index.js +20 -11
  11. package/dist/boot/root-lifecycle.d.ts +6 -3
  12. package/dist/boot/root-lifecycle.js +14 -10
  13. package/dist/boot/route-startup.js +13 -4
  14. package/dist/boot/types.d.ts +1 -2
  15. package/dist/common/attr-names.js +0 -2
  16. package/dist/common/component.d.ts +1 -2
  17. package/dist/common/control.d.ts +1 -2
  18. package/dist/common/control.js +0 -2
  19. package/dist/common/dom-range.d.ts +13 -0
  20. package/dist/common/env.js +1 -7
  21. package/dist/common/error-boundary.d.ts +1 -2
  22. package/dist/common/invariant.js +0 -2
  23. package/dist/common/jsx.d.ts +1 -2
  24. package/dist/common/jsx.js +0 -2
  25. package/dist/common/logger.js +0 -2
  26. package/dist/common/promise.js +0 -2
  27. package/dist/common/props.d.ts +1 -2
  28. package/dist/common/render-context.js +0 -2
  29. package/dist/common/route-activity.js +0 -2
  30. package/dist/common/router-internal.js +0 -2
  31. package/dist/common/router.d.ts +1 -2
  32. package/dist/common/ssr-errors.d.ts +1 -2
  33. package/dist/common/ssr-errors.js +0 -2
  34. package/dist/common/ssr.d.ts +1 -2
  35. package/dist/common/ssr.js +0 -2
  36. package/dist/common/vnode.d.ts +1 -2
  37. package/dist/common/vnode.js +0 -2
  38. package/dist/components/error-boundary.d.ts +1 -2
  39. package/dist/components/error-boundary.js +0 -2
  40. package/dist/components/link.d.ts +2 -2
  41. package/dist/components/link.js +0 -2
  42. package/dist/control/case.d.ts +1 -2
  43. package/dist/control/case.js +0 -2
  44. package/dist/control/for.d.ts +1 -2
  45. package/dist/control/for.js +0 -2
  46. package/dist/control/shared.d.ts +1 -2
  47. package/dist/control/shared.js +0 -2
  48. package/dist/control/show.d.ts +1 -2
  49. package/dist/control/show.js +0 -2
  50. package/dist/data/data-runtime.d.ts +1 -2
  51. package/dist/data/data-runtime.js +3 -5
  52. package/dist/data/invalidation-listeners.js +0 -2
  53. package/dist/data/invalidation.d.ts +1 -2
  54. package/dist/data/invalidation.js +0 -2
  55. package/dist/data/mutation-cell.d.ts +1 -2
  56. package/dist/data/mutation-cell.js +6 -5
  57. package/dist/data/query-cell.d.ts +3 -2
  58. package/dist/data/query-cell.js +43 -9
  59. package/dist/data/query-key.js +0 -2
  60. package/dist/data/shared.js +2 -3
  61. package/dist/data/types.d.ts +1 -2
  62. package/dist/foundations/icon/icon.d.ts +1 -2
  63. package/dist/foundations/icon/icon.js +0 -2
  64. package/dist/foundations/icon/icon.types.d.ts +1 -2
  65. package/dist/foundations/interactions/dismissable.d.ts +1 -2
  66. package/dist/foundations/interactions/dismissable.js +0 -2
  67. package/dist/foundations/interactions/focusable.d.ts +1 -2
  68. package/dist/foundations/interactions/focusable.js +0 -2
  69. package/dist/foundations/interactions/hoverable.d.ts +1 -2
  70. package/dist/foundations/interactions/hoverable.js +0 -2
  71. package/dist/foundations/interactions/interaction-policy.d.ts +1 -2
  72. package/dist/foundations/interactions/interaction-policy.js +0 -2
  73. package/dist/foundations/interactions/pressable.d.ts +1 -2
  74. package/dist/foundations/interactions/pressable.js +0 -2
  75. package/dist/foundations/interactions/roving-focus.d.ts +1 -2
  76. package/dist/foundations/interactions/roving-focus.js +0 -2
  77. package/dist/foundations/state/controllable.d.ts +1 -2
  78. package/dist/foundations/state/controllable.js +0 -2
  79. package/dist/foundations/structures/collection.d.ts +1 -2
  80. package/dist/foundations/structures/collection.js +0 -2
  81. package/dist/foundations/structures/layer.d.ts +1 -2
  82. package/dist/foundations/structures/layer.js +0 -2
  83. package/dist/foundations/structures/layout.d.ts +1 -2
  84. package/dist/foundations/structures/layout.js +0 -2
  85. package/dist/foundations/structures/presence.d.ts +1 -2
  86. package/dist/foundations/structures/presence.js +0 -2
  87. package/dist/foundations/structures/slot.d.ts +1 -2
  88. package/dist/foundations/structures/slot.js +0 -2
  89. package/dist/foundations/utilities/aria.d.ts +1 -2
  90. package/dist/foundations/utilities/aria.js +0 -2
  91. package/dist/foundations/utilities/compose-handlers.d.ts +1 -2
  92. package/dist/foundations/utilities/compose-handlers.js +0 -2
  93. package/dist/foundations/utilities/compose-ref.d.ts +1 -2
  94. package/dist/foundations/utilities/compose-ref.js +0 -2
  95. package/dist/foundations/utilities/event-types.d.ts +1 -2
  96. package/dist/foundations/utilities/merge-props.d.ts +1 -2
  97. package/dist/foundations/utilities/merge-props.js +0 -2
  98. package/dist/foundations/utilities/use-id.d.ts +1 -2
  99. package/dist/foundations/utilities/use-id.js +0 -2
  100. package/dist/fx/fx.d.ts +1 -2
  101. package/dist/fx/fx.js +0 -2
  102. package/dist/fx/noop.js +0 -2
  103. package/dist/fx/timing.d.ts +1 -2
  104. package/dist/fx/timing.js +0 -2
  105. package/dist/index.d.ts +1 -1
  106. package/dist/index.js +0 -2
  107. package/dist/jsx/types.d.ts +1 -2
  108. package/dist/jsx/utils.d.ts +1 -2
  109. package/dist/jsx/utils.js +0 -2
  110. package/dist/jsx-dev-runtime.d.ts +16 -2
  111. package/dist/jsx-dev-runtime.js +3 -12
  112. package/dist/jsx-runtime.d.ts +16 -2
  113. package/dist/jsx-runtime.js +15 -24
  114. package/dist/jsx-runtime2.d.ts +1 -1
  115. package/dist/renderer/attributes.js +28 -6
  116. package/dist/renderer/boundaries.js +48 -172
  117. package/dist/renderer/boundary-materialization.js +72 -0
  118. package/dist/renderer/boundary-range-adoption.js +76 -0
  119. package/dist/renderer/boundary-range-sync.js +101 -0
  120. package/dist/renderer/boundary-state.js +50 -0
  121. package/dist/renderer/child-shape.js +0 -2
  122. package/dist/renderer/children-fastpath.js +3 -3
  123. package/dist/renderer/children.js +0 -2
  124. package/dist/renderer/cleanup.js +70 -13
  125. package/dist/renderer/component-host-cleanup.js +123 -48
  126. package/dist/renderer/component-host-instances.js +59 -8
  127. package/dist/renderer/component-host-replacement.js +105 -0
  128. package/dist/renderer/component-host-results.js +138 -0
  129. package/dist/renderer/component-host.js +94 -169
  130. package/dist/renderer/dom-host.js +0 -2
  131. package/dist/renderer/dom-internal.js +110 -53
  132. package/dist/renderer/dom-range.js +161 -0
  133. package/dist/renderer/dom.js +5 -4
  134. package/dist/renderer/element-children.js +112 -32
  135. package/dist/renderer/error-boundary-dom.js +19 -11
  136. package/dist/renderer/evaluate-dom-range.js +3 -4
  137. package/dist/renderer/evaluate-reconcile.js +12 -37
  138. package/dist/renderer/evaluate.js +14 -3
  139. package/dist/renderer/fastpath.js +4 -12
  140. package/dist/renderer/for-commit-dom-map.js +6 -18
  141. package/dist/renderer/for-commit-removal.js +7 -16
  142. package/dist/renderer/for-commit-reorder.js +0 -2
  143. package/dist/renderer/for-commit.js +172 -44
  144. package/dist/renderer/hydration-boundaries.js +60 -0
  145. package/dist/renderer/hydration-listener-transaction.js +49 -0
  146. package/dist/renderer/index.js +8 -7
  147. package/dist/renderer/intrinsic-blueprint-analysis.js +202 -0
  148. package/dist/renderer/intrinsic-blueprint-bindings.js +152 -0
  149. package/dist/renderer/intrinsic-blueprint-materialization.js +100 -0
  150. package/dist/renderer/intrinsic-blueprint.js +30 -0
  151. package/dist/renderer/intrinsic-hydration-adoption.js +66 -0
  152. package/dist/renderer/keyed-children.js +3 -9
  153. package/dist/renderer/keyed.js +10 -10
  154. package/dist/renderer/namespaces.js +0 -2
  155. package/dist/renderer/prop-bindings.js +56 -21
  156. package/dist/renderer/reactive-child-dom.js +10 -4
  157. package/dist/renderer/reactive-child-sources.js +0 -2
  158. package/dist/renderer/reactive-children.js +29 -20
  159. package/dist/renderer/reconcile-commit.js +0 -2
  160. package/dist/renderer/reconcile-fastpaths.js +4 -11
  161. package/dist/renderer/reconcile-resolution.js +31 -55
  162. package/dist/renderer/reconcile.js +0 -2
  163. package/dist/renderer/retained-element-rollback.js +159 -148
  164. package/dist/renderer/stable-patch.js +3 -4
  165. package/dist/renderer/static-reuse.js +0 -2
  166. package/dist/renderer/utils.js +18 -9
  167. package/dist/router/access.js +0 -2
  168. package/dist/router/activity.d.ts +1 -2
  169. package/dist/router/activity.js +0 -2
  170. package/dist/router/authoring.d.ts +1 -2
  171. package/dist/router/authoring.js +0 -2
  172. package/dist/router/internal-types.d.ts +1 -2
  173. package/dist/router/lazy.d.ts +1 -2
  174. package/dist/router/lazy.js +0 -2
  175. package/dist/router/manifest.d.ts +1 -2
  176. package/dist/router/manifest.js +0 -2
  177. package/dist/router/match.js +0 -2
  178. package/dist/router/navigate.d.ts +1 -2
  179. package/dist/router/navigate.js +4 -7
  180. package/dist/router/navigation-registry.d.ts +1 -2
  181. package/dist/router/navigation-registry.js +0 -2
  182. package/dist/router/navigation-scroll.d.ts +1 -2
  183. package/dist/router/navigation-scroll.js +0 -2
  184. package/dist/router/navigation-targets.d.ts +3 -4
  185. package/dist/router/navigation-targets.js +419 -40
  186. package/dist/router/policy.d.ts +1 -2
  187. package/dist/router/policy.js +0 -2
  188. package/dist/router/rendering.d.ts +1 -2
  189. package/dist/router/rendering.js +4 -3
  190. package/dist/router/resolution.d.ts +1 -2
  191. package/dist/router/resolution.js +0 -2
  192. package/dist/router/route-context.js +0 -2
  193. package/dist/router/route-matching.d.ts +1 -2
  194. package/dist/router/route-matching.js +0 -2
  195. package/dist/router/route-query.d.ts +1 -2
  196. package/dist/router/route-query.js +1 -3
  197. package/dist/router/store.d.ts +1 -2
  198. package/dist/router/store.js +0 -2
  199. package/dist/runtime/access.d.ts +1 -2
  200. package/dist/runtime/access.js +0 -2
  201. package/dist/runtime/child-scope.d.ts +21 -2
  202. package/dist/runtime/child-scope.js +101 -54
  203. package/dist/runtime/component-cleanup.d.ts +1 -2
  204. package/dist/runtime/component-cleanup.js +2 -4
  205. package/dist/runtime/component-commit.js +25 -23
  206. package/dist/runtime/component-facade.js +5 -3
  207. package/dist/runtime/component-internal.d.ts +11 -6
  208. package/dist/runtime/component-internal.js +63 -45
  209. package/dist/runtime/component-lifecycle.d.ts +2 -41
  210. package/dist/runtime/component-lifecycle.js +6 -149
  211. package/dist/runtime/component-scope.d.ts +3 -4
  212. package/dist/runtime/component-scope.js +27 -8
  213. package/dist/runtime/component.js +4 -3
  214. package/dist/runtime/context.d.ts +5 -2
  215. package/dist/runtime/context.js +29 -3
  216. package/dist/runtime/control.d.ts +22 -3
  217. package/dist/runtime/control.js +168 -55
  218. package/dist/runtime/derive.d.ts +1 -2
  219. package/dist/runtime/derive.js +0 -2
  220. package/dist/runtime/dev-namespace.d.ts +5 -6
  221. package/dist/runtime/dev-namespace.js +32 -25
  222. package/dist/runtime/effect.d.ts +8 -5
  223. package/dist/runtime/effect.js +158 -75
  224. package/dist/runtime/error-boundary.d.ts +1 -2
  225. package/dist/runtime/error-boundary.js +0 -2
  226. package/dist/runtime/events.d.ts +3 -3
  227. package/dist/runtime/events.js +66 -69
  228. package/dist/runtime/execution-model.d.ts +1 -2
  229. package/dist/runtime/execution-model.js +0 -2
  230. package/dist/runtime/fastlane.d.ts +1 -2
  231. package/dist/runtime/fastlane.js +0 -2
  232. package/dist/runtime/for-bench.d.ts +1 -2
  233. package/dist/runtime/for-bench.js +9 -167
  234. package/dist/runtime/for-internal.d.ts +68 -5
  235. package/dist/runtime/for-internal.js +201 -14
  236. package/dist/runtime/for-reconcile.d.ts +1 -2
  237. package/dist/runtime/for-reconcile.js +76 -23
  238. package/dist/runtime/for-scopes.d.ts +5 -5
  239. package/dist/runtime/for-scopes.js +168 -48
  240. package/dist/runtime/for-signals.d.ts +13 -4
  241. package/dist/runtime/for-signals.js +155 -81
  242. package/dist/runtime/for-types.d.ts +1 -2
  243. package/dist/runtime/for.d.ts +2 -2
  244. package/dist/runtime/for.js +3 -3
  245. package/dist/runtime/index.d.ts +5 -5
  246. package/dist/runtime/index.js +12 -10
  247. package/dist/runtime/lifecycle-batch.d.ts +59 -0
  248. package/dist/runtime/lifecycle-batch.js +178 -0
  249. package/dist/runtime/lifecycle-operation-settlement.d.ts +5 -0
  250. package/dist/runtime/lifecycle-operation-settlement.js +51 -0
  251. package/dist/runtime/lifecycle-operations.d.ts +1 -2
  252. package/dist/runtime/lifecycle-operations.js +5 -6
  253. package/dist/runtime/perf-metrics.d.ts +8 -7
  254. package/dist/runtime/perf-metrics.js +4 -68
  255. package/dist/runtime/portal.d.ts +1 -2
  256. package/dist/runtime/portal.js +103 -11
  257. package/dist/runtime/readable.d.ts +9 -4
  258. package/dist/runtime/readable.js +41 -17
  259. package/dist/runtime/resource-cell.js +2 -4
  260. package/dist/runtime/resource-operation.d.ts +1 -2
  261. package/dist/runtime/resource-operation.js +37 -34
  262. package/dist/runtime/runtime.d.ts +1 -2
  263. package/dist/runtime/runtime.js +0 -2
  264. package/dist/runtime/scheduler.d.ts +1 -2
  265. package/dist/runtime/scheduler.js +8 -11
  266. package/dist/runtime/selector-store.js +0 -2
  267. package/dist/runtime/selector.d.ts +1 -2
  268. package/dist/runtime/selector.js +3 -11
  269. package/dist/runtime/snapshot-source.d.ts +1 -2
  270. package/dist/runtime/snapshot-source.js +0 -2
  271. package/dist/runtime/state.d.ts +1 -2
  272. package/dist/runtime/state.js +1 -3
  273. package/dist/ssg/batch-render.js +0 -2
  274. package/dist/ssg/create-static-gen.d.ts +4 -2
  275. package/dist/ssg/create-static-gen.js +65 -14
  276. package/dist/ssg/generate-metadata.js +0 -2
  277. package/dist/ssg/generation-plan.js +0 -2
  278. package/dist/ssg/incremental-manifest.js +1 -3
  279. package/dist/ssg/resolve-ssg-data.js +0 -2
  280. package/dist/ssg/route-utils.js +0 -2
  281. package/dist/ssg/static-routes.js +0 -2
  282. package/dist/ssg/types.d.ts +2 -3
  283. package/dist/ssg/write-static-files.js +16 -12
  284. package/dist/ssr/attrs.js +0 -2
  285. package/dist/ssr/boundaries.js +16 -5
  286. package/dist/ssr/component-runtime.js +1 -27
  287. package/dist/ssr/context.d.ts +1 -2
  288. package/dist/ssr/context.js +0 -2
  289. package/dist/ssr/errors.d.ts +1 -2
  290. package/dist/ssr/errors.js +0 -2
  291. package/dist/ssr/escape.js +0 -2
  292. package/dist/ssr/hydration-data.js +0 -2
  293. package/dist/ssr/hydration-verify.d.ts +1 -2
  294. package/dist/ssr/hydration-verify.js +34 -7
  295. package/dist/ssr/index-internal.d.ts +1 -2
  296. package/dist/ssr/index-internal.js +0 -2
  297. package/dist/ssr/render-keys.js +0 -2
  298. package/dist/ssr/render-resolved.d.ts +1 -2
  299. package/dist/ssr/render-resolved.js +0 -2
  300. package/dist/ssr/render-sync.d.ts +1 -2
  301. package/dist/ssr/render-sync.js +27 -19
  302. package/dist/ssr/route-policy-resolution.js +0 -2
  303. package/dist/ssr/route-render.d.ts +1 -2
  304. package/dist/ssr/route-render.js +0 -2
  305. package/dist/ssr/sink.d.ts +1 -2
  306. package/dist/ssr/sink.js +0 -2
  307. package/dist/ssr/types.d.ts +1 -2
  308. package/dist/ssr/verify-hydration.js +0 -2
  309. package/dist/testing/index.d.ts +1 -2
  310. package/dist/testing/index.js +0 -2
  311. package/package.json +57 -44
  312. package/dist/bench/components/benchmark-row.d.ts.map +0 -1
  313. package/dist/bench/components/benchmark-row.js.map +0 -1
  314. package/dist/bench/components/benchmark-table.js.map +0 -1
  315. package/dist/benchmark.d.ts.map +0 -1
  316. package/dist/benchmark.js.map +0 -1
  317. package/dist/bin/askr-ssg.d.ts.map +0 -1
  318. package/dist/bin/askr-ssg.js.map +0 -1
  319. package/dist/boot/hydration.js.map +0 -1
  320. package/dist/boot/index.d.ts.map +0 -1
  321. package/dist/boot/index.js.map +0 -1
  322. package/dist/boot/root-lifecycle.d.ts.map +0 -1
  323. package/dist/boot/root-lifecycle.js.map +0 -1
  324. package/dist/boot/route-startup.js.map +0 -1
  325. package/dist/boot/types.d.ts.map +0 -1
  326. package/dist/common/attr-names.js.map +0 -1
  327. package/dist/common/component.d.ts.map +0 -1
  328. package/dist/common/control.d.ts.map +0 -1
  329. package/dist/common/control.js.map +0 -1
  330. package/dist/common/env.js.map +0 -1
  331. package/dist/common/error-boundary.d.ts.map +0 -1
  332. package/dist/common/invariant.js.map +0 -1
  333. package/dist/common/jsx.d.ts.map +0 -1
  334. package/dist/common/jsx.js.map +0 -1
  335. package/dist/common/logger.js.map +0 -1
  336. package/dist/common/promise.js.map +0 -1
  337. package/dist/common/props.d.ts.map +0 -1
  338. package/dist/common/render-context.js.map +0 -1
  339. package/dist/common/route-activity.js.map +0 -1
  340. package/dist/common/router-internal.js.map +0 -1
  341. package/dist/common/router.d.ts.map +0 -1
  342. package/dist/common/ssr-errors.d.ts.map +0 -1
  343. package/dist/common/ssr-errors.js.map +0 -1
  344. package/dist/common/ssr.d.ts.map +0 -1
  345. package/dist/common/ssr.js.map +0 -1
  346. package/dist/common/vnode.d.ts.map +0 -1
  347. package/dist/common/vnode.js.map +0 -1
  348. package/dist/components/error-boundary.d.ts.map +0 -1
  349. package/dist/components/error-boundary.js.map +0 -1
  350. package/dist/components/link.d.ts.map +0 -1
  351. package/dist/components/link.js.map +0 -1
  352. package/dist/control/case.d.ts.map +0 -1
  353. package/dist/control/case.js.map +0 -1
  354. package/dist/control/for.d.ts.map +0 -1
  355. package/dist/control/for.js.map +0 -1
  356. package/dist/control/shared.d.ts.map +0 -1
  357. package/dist/control/shared.js.map +0 -1
  358. package/dist/control/show.d.ts.map +0 -1
  359. package/dist/control/show.js.map +0 -1
  360. package/dist/data/data-runtime.d.ts.map +0 -1
  361. package/dist/data/data-runtime.js.map +0 -1
  362. package/dist/data/invalidation-listeners.js.map +0 -1
  363. package/dist/data/invalidation.d.ts.map +0 -1
  364. package/dist/data/invalidation.js.map +0 -1
  365. package/dist/data/mutation-cell.d.ts.map +0 -1
  366. package/dist/data/mutation-cell.js.map +0 -1
  367. package/dist/data/query-cell.d.ts.map +0 -1
  368. package/dist/data/query-cell.js.map +0 -1
  369. package/dist/data/query-key.js.map +0 -1
  370. package/dist/data/shared.js.map +0 -1
  371. package/dist/data/types.d.ts.map +0 -1
  372. package/dist/foundations/icon/icon.d.ts.map +0 -1
  373. package/dist/foundations/icon/icon.js.map +0 -1
  374. package/dist/foundations/icon/icon.types.d.ts.map +0 -1
  375. package/dist/foundations/interactions/dismissable.d.ts.map +0 -1
  376. package/dist/foundations/interactions/dismissable.js.map +0 -1
  377. package/dist/foundations/interactions/focusable.d.ts.map +0 -1
  378. package/dist/foundations/interactions/focusable.js.map +0 -1
  379. package/dist/foundations/interactions/hoverable.d.ts.map +0 -1
  380. package/dist/foundations/interactions/hoverable.js.map +0 -1
  381. package/dist/foundations/interactions/interaction-policy.d.ts.map +0 -1
  382. package/dist/foundations/interactions/interaction-policy.js.map +0 -1
  383. package/dist/foundations/interactions/pressable.d.ts.map +0 -1
  384. package/dist/foundations/interactions/pressable.js.map +0 -1
  385. package/dist/foundations/interactions/roving-focus.d.ts.map +0 -1
  386. package/dist/foundations/interactions/roving-focus.js.map +0 -1
  387. package/dist/foundations/state/controllable.d.ts.map +0 -1
  388. package/dist/foundations/state/controllable.js.map +0 -1
  389. package/dist/foundations/structures/collection.d.ts.map +0 -1
  390. package/dist/foundations/structures/collection.js.map +0 -1
  391. package/dist/foundations/structures/layer.d.ts.map +0 -1
  392. package/dist/foundations/structures/layer.js.map +0 -1
  393. package/dist/foundations/structures/layout.d.ts.map +0 -1
  394. package/dist/foundations/structures/layout.js.map +0 -1
  395. package/dist/foundations/structures/presence.d.ts.map +0 -1
  396. package/dist/foundations/structures/presence.js.map +0 -1
  397. package/dist/foundations/structures/slot.d.ts.map +0 -1
  398. package/dist/foundations/structures/slot.js.map +0 -1
  399. package/dist/foundations/utilities/aria.d.ts.map +0 -1
  400. package/dist/foundations/utilities/aria.js.map +0 -1
  401. package/dist/foundations/utilities/compose-handlers.d.ts.map +0 -1
  402. package/dist/foundations/utilities/compose-handlers.js.map +0 -1
  403. package/dist/foundations/utilities/compose-ref.d.ts.map +0 -1
  404. package/dist/foundations/utilities/compose-ref.js.map +0 -1
  405. package/dist/foundations/utilities/event-types.d.ts.map +0 -1
  406. package/dist/foundations/utilities/merge-props.d.ts.map +0 -1
  407. package/dist/foundations/utilities/merge-props.js.map +0 -1
  408. package/dist/foundations/utilities/use-id.d.ts.map +0 -1
  409. package/dist/foundations/utilities/use-id.js.map +0 -1
  410. package/dist/fx/fx.d.ts.map +0 -1
  411. package/dist/fx/fx.js.map +0 -1
  412. package/dist/fx/noop.js.map +0 -1
  413. package/dist/fx/timing.d.ts.map +0 -1
  414. package/dist/fx/timing.js.map +0 -1
  415. package/dist/index.js.map +0 -1
  416. package/dist/jsx/types.d.ts.map +0 -1
  417. package/dist/jsx/utils.d.ts.map +0 -1
  418. package/dist/jsx/utils.js.map +0 -1
  419. package/dist/jsx-dev-runtime.d.ts.map +0 -1
  420. package/dist/jsx-dev-runtime.js.map +0 -1
  421. package/dist/jsx-runtime.d.ts.map +0 -1
  422. package/dist/jsx-runtime.js.map +0 -1
  423. package/dist/renderer/attributes.js.map +0 -1
  424. package/dist/renderer/boundaries.js.map +0 -1
  425. package/dist/renderer/child-shape.js.map +0 -1
  426. package/dist/renderer/children-fastpath.js.map +0 -1
  427. package/dist/renderer/children.js.map +0 -1
  428. package/dist/renderer/cleanup.js.map +0 -1
  429. package/dist/renderer/component-host-cleanup.js.map +0 -1
  430. package/dist/renderer/component-host-instances.js.map +0 -1
  431. package/dist/renderer/component-host.js.map +0 -1
  432. package/dist/renderer/dom-host.js.map +0 -1
  433. package/dist/renderer/dom-internal.js.map +0 -1
  434. package/dist/renderer/element-children.js.map +0 -1
  435. package/dist/renderer/error-boundary-dom.js.map +0 -1
  436. package/dist/renderer/evaluate-dom-range.js.map +0 -1
  437. package/dist/renderer/evaluate-reconcile.js.map +0 -1
  438. package/dist/renderer/evaluate.js.map +0 -1
  439. package/dist/renderer/fastpath.js.map +0 -1
  440. package/dist/renderer/for-commit-dom-map.js.map +0 -1
  441. package/dist/renderer/for-commit-removal.js.map +0 -1
  442. package/dist/renderer/for-commit-reorder.js.map +0 -1
  443. package/dist/renderer/for-commit.js.map +0 -1
  444. package/dist/renderer/index.js.map +0 -1
  445. package/dist/renderer/keyed-children.js.map +0 -1
  446. package/dist/renderer/keyed.js.map +0 -1
  447. package/dist/renderer/namespaces.js.map +0 -1
  448. package/dist/renderer/prop-bindings.js.map +0 -1
  449. package/dist/renderer/reactive-child-dom.js.map +0 -1
  450. package/dist/renderer/reactive-child-sources.js.map +0 -1
  451. package/dist/renderer/reactive-children.js.map +0 -1
  452. package/dist/renderer/reconcile-commit.js.map +0 -1
  453. package/dist/renderer/reconcile-fastpaths.js.map +0 -1
  454. package/dist/renderer/reconcile-resolution.js.map +0 -1
  455. package/dist/renderer/reconcile.js.map +0 -1
  456. package/dist/renderer/retained-element-rollback.js.map +0 -1
  457. package/dist/renderer/stable-patch.js.map +0 -1
  458. package/dist/renderer/static-reuse.js.map +0 -1
  459. package/dist/renderer/utils.js.map +0 -1
  460. package/dist/router/access.js.map +0 -1
  461. package/dist/router/activity.d.ts.map +0 -1
  462. package/dist/router/activity.js.map +0 -1
  463. package/dist/router/authoring.d.ts.map +0 -1
  464. package/dist/router/authoring.js.map +0 -1
  465. package/dist/router/internal-types.d.ts.map +0 -1
  466. package/dist/router/lazy.d.ts.map +0 -1
  467. package/dist/router/lazy.js.map +0 -1
  468. package/dist/router/manifest.d.ts.map +0 -1
  469. package/dist/router/manifest.js.map +0 -1
  470. package/dist/router/match.js.map +0 -1
  471. package/dist/router/navigate.d.ts.map +0 -1
  472. package/dist/router/navigate.js.map +0 -1
  473. package/dist/router/navigation-registry.d.ts.map +0 -1
  474. package/dist/router/navigation-registry.js.map +0 -1
  475. package/dist/router/navigation-scroll.d.ts.map +0 -1
  476. package/dist/router/navigation-scroll.js.map +0 -1
  477. package/dist/router/navigation-targets.d.ts.map +0 -1
  478. package/dist/router/navigation-targets.js.map +0 -1
  479. package/dist/router/policy.d.ts.map +0 -1
  480. package/dist/router/policy.js.map +0 -1
  481. package/dist/router/rendering.d.ts.map +0 -1
  482. package/dist/router/rendering.js.map +0 -1
  483. package/dist/router/resolution.d.ts.map +0 -1
  484. package/dist/router/resolution.js.map +0 -1
  485. package/dist/router/route-context.js.map +0 -1
  486. package/dist/router/route-matching.d.ts.map +0 -1
  487. package/dist/router/route-matching.js.map +0 -1
  488. package/dist/router/route-query.d.ts.map +0 -1
  489. package/dist/router/route-query.js.map +0 -1
  490. package/dist/router/store.d.ts.map +0 -1
  491. package/dist/router/store.js.map +0 -1
  492. package/dist/runtime/access.d.ts.map +0 -1
  493. package/dist/runtime/access.js.map +0 -1
  494. package/dist/runtime/child-scope.d.ts.map +0 -1
  495. package/dist/runtime/child-scope.js.map +0 -1
  496. package/dist/runtime/component-cleanup.d.ts.map +0 -1
  497. package/dist/runtime/component-cleanup.js.map +0 -1
  498. package/dist/runtime/component-commit.js.map +0 -1
  499. package/dist/runtime/component-internal.d.ts.map +0 -1
  500. package/dist/runtime/component-internal.js.map +0 -1
  501. package/dist/runtime/component-lifecycle.d.ts.map +0 -1
  502. package/dist/runtime/component-lifecycle.js.map +0 -1
  503. package/dist/runtime/component-scope.d.ts.map +0 -1
  504. package/dist/runtime/component-scope.js.map +0 -1
  505. package/dist/runtime/context.d.ts.map +0 -1
  506. package/dist/runtime/context.js.map +0 -1
  507. package/dist/runtime/control.d.ts.map +0 -1
  508. package/dist/runtime/control.js.map +0 -1
  509. package/dist/runtime/derive.d.ts.map +0 -1
  510. package/dist/runtime/derive.js.map +0 -1
  511. package/dist/runtime/dev-namespace.d.ts.map +0 -1
  512. package/dist/runtime/dev-namespace.js.map +0 -1
  513. package/dist/runtime/effect.d.ts.map +0 -1
  514. package/dist/runtime/effect.js.map +0 -1
  515. package/dist/runtime/error-boundary.d.ts.map +0 -1
  516. package/dist/runtime/error-boundary.js.map +0 -1
  517. package/dist/runtime/events.d.ts.map +0 -1
  518. package/dist/runtime/events.js.map +0 -1
  519. package/dist/runtime/execution-model.d.ts.map +0 -1
  520. package/dist/runtime/execution-model.js.map +0 -1
  521. package/dist/runtime/fastlane.d.ts.map +0 -1
  522. package/dist/runtime/fastlane.js.map +0 -1
  523. package/dist/runtime/for-bench.d.ts.map +0 -1
  524. package/dist/runtime/for-bench.js.map +0 -1
  525. package/dist/runtime/for-internal.d.ts.map +0 -1
  526. package/dist/runtime/for-internal.js.map +0 -1
  527. package/dist/runtime/for-reconcile.d.ts.map +0 -1
  528. package/dist/runtime/for-reconcile.js.map +0 -1
  529. package/dist/runtime/for-scopes.d.ts.map +0 -1
  530. package/dist/runtime/for-scopes.js.map +0 -1
  531. package/dist/runtime/for-signals.d.ts.map +0 -1
  532. package/dist/runtime/for-signals.js.map +0 -1
  533. package/dist/runtime/for-types.d.ts.map +0 -1
  534. package/dist/runtime/lifecycle-operations.d.ts.map +0 -1
  535. package/dist/runtime/lifecycle-operations.js.map +0 -1
  536. package/dist/runtime/perf-metrics.d.ts.map +0 -1
  537. package/dist/runtime/perf-metrics.js.map +0 -1
  538. package/dist/runtime/portal.d.ts.map +0 -1
  539. package/dist/runtime/portal.js.map +0 -1
  540. package/dist/runtime/readable.d.ts.map +0 -1
  541. package/dist/runtime/readable.js.map +0 -1
  542. package/dist/runtime/resource-cell.js.map +0 -1
  543. package/dist/runtime/resource-operation.d.ts.map +0 -1
  544. package/dist/runtime/resource-operation.js.map +0 -1
  545. package/dist/runtime/runtime.d.ts.map +0 -1
  546. package/dist/runtime/runtime.js.map +0 -1
  547. package/dist/runtime/scheduler.d.ts.map +0 -1
  548. package/dist/runtime/scheduler.js.map +0 -1
  549. package/dist/runtime/selector-store.js.map +0 -1
  550. package/dist/runtime/selector.d.ts.map +0 -1
  551. package/dist/runtime/selector.js.map +0 -1
  552. package/dist/runtime/snapshot-source.d.ts.map +0 -1
  553. package/dist/runtime/snapshot-source.js.map +0 -1
  554. package/dist/runtime/state.d.ts.map +0 -1
  555. package/dist/runtime/state.js.map +0 -1
  556. package/dist/ssg/batch-render.js.map +0 -1
  557. package/dist/ssg/create-static-gen.d.ts.map +0 -1
  558. package/dist/ssg/create-static-gen.js.map +0 -1
  559. package/dist/ssg/generate-metadata.js.map +0 -1
  560. package/dist/ssg/generation-plan.js.map +0 -1
  561. package/dist/ssg/incremental-manifest.js.map +0 -1
  562. package/dist/ssg/resolve-ssg-data.js.map +0 -1
  563. package/dist/ssg/route-utils.js.map +0 -1
  564. package/dist/ssg/static-routes.js.map +0 -1
  565. package/dist/ssg/types.d.ts.map +0 -1
  566. package/dist/ssg/write-static-files.js.map +0 -1
  567. package/dist/ssr/attrs.js.map +0 -1
  568. package/dist/ssr/boundaries.js.map +0 -1
  569. package/dist/ssr/component-runtime.js.map +0 -1
  570. package/dist/ssr/context.d.ts.map +0 -1
  571. package/dist/ssr/context.js.map +0 -1
  572. package/dist/ssr/errors.d.ts.map +0 -1
  573. package/dist/ssr/errors.js.map +0 -1
  574. package/dist/ssr/escape.js.map +0 -1
  575. package/dist/ssr/hydration-data.js.map +0 -1
  576. package/dist/ssr/hydration-verify.d.ts.map +0 -1
  577. package/dist/ssr/hydration-verify.js.map +0 -1
  578. package/dist/ssr/index-internal.d.ts.map +0 -1
  579. package/dist/ssr/index-internal.js.map +0 -1
  580. package/dist/ssr/render-keys.js.map +0 -1
  581. package/dist/ssr/render-resolved.d.ts.map +0 -1
  582. package/dist/ssr/render-resolved.js.map +0 -1
  583. package/dist/ssr/render-sync.d.ts.map +0 -1
  584. package/dist/ssr/render-sync.js.map +0 -1
  585. package/dist/ssr/route-policy-resolution.js.map +0 -1
  586. package/dist/ssr/route-render.d.ts.map +0 -1
  587. package/dist/ssr/route-render.js.map +0 -1
  588. package/dist/ssr/sink.d.ts.map +0 -1
  589. package/dist/ssr/sink.js.map +0 -1
  590. package/dist/ssr/types.d.ts.map +0 -1
  591. package/dist/ssr/verify-hydration.js.map +0 -1
  592. package/dist/testing/index.d.ts.map +0 -1
  593. package/dist/testing/index.js.map +0 -1
@@ -101,5 +101,3 @@ function unregisterAppInstance(instance) {
101
101
  }
102
102
  //#endregion
103
103
  export { configureNavigationRegistryHost, getCurrentHref, getCurrentPathname, getRegisteredAppsSnapshot, getWindowHref, hasRegisteredApps, parseTargetUrl, registerAppInstance, setCurrentRouteLocation, syncAppRegistrationLocation, syncRegisteredRouteSnapshot, unregisterAppInstance };
104
-
105
- //# sourceMappingURL=navigation-registry.js.map
@@ -10,5 +10,4 @@ declare function applyNavigationScroll(behavior?: NavigationScrollBehavior): voi
10
10
  declare function applyHistoryScroll(href: string, state: PopStateEvent['state']): void;
11
11
  declare function configureScrollRestoration(options?: boolean | ScrollRestorationOptions): void;
12
12
  //#endregion
13
- export { HistoryScrollBehavior, NavigationScrollBehavior, ScrollRestorationOptions };
14
- //# sourceMappingURL=navigation-scroll.d.ts.map
13
+ export { HistoryScrollBehavior, NavigationScrollBehavior, ScrollRestorationOptions };
@@ -89,5 +89,3 @@ function configureScrollRestoration(options) {
89
89
  }
90
90
  //#endregion
91
91
  export { applyHistoryScroll, applyNavigationScroll, configureScrollRestoration, saveScrollPosition };
92
-
93
- //# sourceMappingURL=navigation-scroll.js.map
@@ -24,8 +24,7 @@ declare function isStaleRouteRequest(requestId: number): boolean;
24
24
  declare function cancelRouteRequests(): void;
25
25
  declare function getRedirectHistoryMode(replace: boolean | undefined): 'push' | 'replace';
26
26
  declare function resolveNavigationTargetsForApps(pathname: string, href: string, signal: AbortSignal): AppNavigationTarget[] | Promise<AppNavigationTarget[]>;
27
- declare function applyNavigationTargets(path: string, options: NavigateOptions, redirectState: NavigationRedirectState, pathname: string, href: string, targets: AppNavigationTarget[], navigateWithRedirectState: (path: string, options: NavigateOptions, redirectState: NavigationRedirectState) => void): void;
28
- declare function applyPopStateNavigationTargets(requestId: number, pathname: string, href: string, state: unknown, targets: AppNavigationTarget[], navigate: (path: string, options: NavigateOptions) => void): void;
27
+ declare function applyNavigationTargets(requestId: number, path: string, options: NavigateOptions, redirectState: NavigationRedirectState, pathname: string, href: string, targets: AppNavigationTarget[], navigateWithRedirectState: (path: string, options: NavigateOptions, redirectState: NavigationRedirectState) => void): void;
28
+ declare function applyPopStateNavigationTargets(requestId: number, previousHref: string, previousState: unknown, pathname: string, href: string, state: unknown, targets: AppNavigationTarget[], navigate: (path: string, options: NavigateOptions) => void): void;
29
29
  //#endregion
30
- export { AppNavigationTarget, NavigateOptions, NavigationRedirectState };
31
- //# sourceMappingURL=navigation-targets.d.ts.map
30
+ export { AppNavigationTarget, NavigateOptions, NavigationRedirectState };
@@ -1,19 +1,20 @@
1
1
  import { isDevelopmentEnvironment } from "../common/env.js";
2
2
  import { logger } from "../common/logger.js";
3
+ import { flushRuntimeScheduler } from "../runtime/access.js";
3
4
  import { ELEMENT_TYPE, Fragment } from "../common/jsx.js";
4
5
  import { cleanupComponent } from "../runtime/component-cleanup.js";
5
6
  import { isPromiseLike } from "../common/promise.js";
7
+ import { beginLifecycleCommitBatch, discardLifecycleCommitBatch, drainLifecycleCommitErrors, flushLifecycleCommitBatch } from "../runtime/lifecycle-batch.js";
6
8
  import { mountComponent } from "../runtime/component-internal.js";
7
9
  import { DefaultPortal, clearDefaultPortalForInstance } from "../runtime/portal.js";
8
10
  import "../runtime/index.js";
9
- import { cleanupInstancesUnder } from "../renderer/cleanup.js";
10
- import "../renderer/index.js";
11
- import { applyHistoryScroll, applyNavigationScroll, saveScrollPosition } from "./navigation-scroll.js";
11
+ import { teardownNodeSubtree } from "../renderer/cleanup.js";
12
+ import "../jsx/index.js";
12
13
  import { resolveRouteFromRoutes } from "./route-matching.js";
13
14
  import { resolveRouteRequest } from "./resolution.js";
14
15
  import "./route.js";
15
16
  import { getCurrentHref, getCurrentPathname, getRegisteredAppsSnapshot, parseTargetUrl, setCurrentRouteLocation, syncAppRegistrationLocation, syncRegisteredRouteSnapshot } from "./navigation-registry.js";
16
- import "../jsx/index.js";
17
+ import { applyHistoryScroll, applyNavigationScroll, saveScrollPosition } from "./navigation-scroll.js";
17
18
  //#region src/router/navigation-targets.ts
18
19
  const MAX_NAVIGATION_REDIRECTS = 20;
19
20
  let activeRouteRequestId = 0;
@@ -77,24 +78,249 @@ function wrapRootRouteHandler(componentFn) {
77
78
  Object.defineProperty(wrappedFn, "name", { value: componentFn.name || "Component" });
78
79
  return wrappedFn;
79
80
  }
80
- function cleanupRouteOwnership(instance) {
81
- const cleanupErrors = [];
82
- const children = instance.target ? Array.from(instance.target.childNodes) : [];
83
- for (const child of children) try {
84
- cleanupInstancesUnder(child, { strict: instance.cleanupStrict });
81
+ function flattenLifecycleErrors(error, result) {
82
+ if (error instanceof AggregateError) {
83
+ for (const nested of error.errors) flattenLifecycleErrors(nested, result);
84
+ return;
85
+ }
86
+ result.push(error);
87
+ }
88
+ function reportRouteCleanupErrors(errors) {
89
+ for (const error of errors) {
90
+ const flattened = [];
91
+ flattenLifecycleErrors(error, flattened);
92
+ for (const cleanupError of flattened.length > 0 ? flattened : [error]) logger.error("[Askr] route cleanup failed:", cleanupError);
93
+ }
94
+ }
95
+ function captureRouteDom(root) {
96
+ if (!root) return null;
97
+ const nodes = [];
98
+ const visit = (node) => {
99
+ nodes.push({
100
+ node,
101
+ children: Array.from(node.childNodes),
102
+ attributes: node instanceof Element ? Array.from(node.attributes).map((attribute) => [attribute.name, attribute.value]) : null,
103
+ nodeValue: node.nodeValue
104
+ });
105
+ for (const child of Array.from(node.childNodes)) visit(child);
106
+ };
107
+ visit(root);
108
+ return {
109
+ root,
110
+ nodes
111
+ };
112
+ }
113
+ function collectProvisionalRouteNodes(snapshot) {
114
+ const originalNodes = new Set(snapshot.nodes.map((entry) => entry.node));
115
+ const provisional = [];
116
+ const visit = (node) => {
117
+ if (!originalNodes.has(node)) {
118
+ provisional.push(node);
119
+ return;
120
+ }
121
+ for (const child of Array.from(node.childNodes)) visit(child);
122
+ };
123
+ for (const child of Array.from(snapshot.root.childNodes)) visit(child);
124
+ return provisional;
125
+ }
126
+ function restoreRouteDom(snapshot) {
127
+ if (!snapshot) return [];
128
+ const errors = [];
129
+ for (const node of collectProvisionalRouteNodes(snapshot)) try {
130
+ teardownNodeSubtree(node, { strict: true });
85
131
  } catch (error) {
86
- cleanupErrors.push(error);
132
+ errors.push(error);
133
+ }
134
+ for (const entry of snapshot.nodes) {
135
+ const { node, attributes } = entry;
136
+ try {
137
+ if (attributes && node instanceof Element) {
138
+ const expected = new Map(attributes);
139
+ for (const attribute of Array.from(node.attributes)) if (!expected.has(attribute.name)) node.removeAttribute(attribute.name);
140
+ for (const [name, value] of attributes) if (node.getAttribute(name) !== value) node.setAttribute(name, value);
141
+ } else if (!(node instanceof Element)) node.nodeValue = entry.nodeValue;
142
+ if (node instanceof Element || node instanceof DocumentFragment) node.replaceChildren(...entry.children);
143
+ } catch (error) {
144
+ errors.push(error);
145
+ }
87
146
  }
147
+ return errors;
148
+ }
149
+ function collectHostInstances(root) {
150
+ const instances = [];
151
+ const seen = /* @__PURE__ */ new Set();
152
+ const pending = [root];
153
+ while (pending.length > 0) {
154
+ const node = pending.pop();
155
+ if (node instanceof Element) {
156
+ const host = node;
157
+ for (const instance of host.__ASKR_INSTANCES ?? []) if (!seen.has(instance)) {
158
+ seen.add(instance);
159
+ instances.push(instance);
160
+ }
161
+ if (host.__ASKR_INSTANCE && !seen.has(host.__ASKR_INSTANCE)) {
162
+ seen.add(host.__ASKR_INSTANCE);
163
+ instances.push(host.__ASKR_INSTANCE);
164
+ }
165
+ } else {
166
+ const instance = node.__ASKR_INSTANCE;
167
+ if (instance && !seen.has(instance)) {
168
+ seen.add(instance);
169
+ instances.push(instance);
170
+ }
171
+ }
172
+ for (let child = node.lastChild; child; child = child.previousSibling) pending.push(child);
173
+ }
174
+ return instances;
175
+ }
176
+ function captureDeferredRouteCleanup(instance) {
177
+ return {
178
+ instance,
179
+ previousFn: instance.fn,
180
+ previousProps: instance.props,
181
+ previousExpectedStateIndices: instance.expectedStateIndices,
182
+ previousFirstRenderComplete: instance.firstRenderComplete,
183
+ previousStateIndexCheck: instance.stateIndexCheck,
184
+ previousErrorBoundaryState: instance.errorBoundaryState,
185
+ previousTarget: instance.target,
186
+ previousDom: captureRouteDom(instance.target),
187
+ previousStateValues: instance.stateValues,
188
+ previousCleanupFns: instance.cleanupFns,
189
+ previousOwnedChildScopes: instance._ownedChildScopes,
190
+ previousAbortController: instance.abortController,
191
+ previousMountOperations: instance.mountOperations,
192
+ previousCommitOperations: instance.commitOperations,
193
+ previousLifecycleSlots: instance.lifecycleSlots,
194
+ previousLifecycleGeneration: instance.lifecycleGeneration,
195
+ previousEvaluationGeneration: instance.evaluationGeneration,
196
+ previousHasPendingUpdate: instance.hasPendingUpdate,
197
+ previousNotifyUpdate: instance.notifyUpdate,
198
+ previousPlaceholder: instance._placeholder,
199
+ previousMounted: instance.mounted,
200
+ previousCurrentRenderToken: instance._currentRenderToken,
201
+ previousLastRenderToken: instance.lastRenderToken,
202
+ previousPendingReadSources: instance._pendingReadSources,
203
+ previousPendingReadSourceVersions: instance._pendingReadSourceVersions,
204
+ previousLastReadSources: instance._lastReadSources,
205
+ previousInstances: instance.target ? collectHostInstances(instance.target) : []
206
+ };
207
+ }
208
+ function restoreDeferredRouteInstance(deferred) {
209
+ const instance = deferred.instance;
210
+ const errors = restoreRouteDom(deferred.previousDom);
211
+ instance.fn = deferred.previousFn;
212
+ instance.props = deferred.previousProps;
213
+ instance.expectedStateIndices = deferred.previousExpectedStateIndices;
214
+ instance.firstRenderComplete = deferred.previousFirstRenderComplete;
215
+ instance.stateIndexCheck = deferred.previousStateIndexCheck;
216
+ instance.errorBoundaryState = deferred.previousErrorBoundaryState;
217
+ instance.target = deferred.previousTarget;
218
+ instance.stateValues = deferred.previousStateValues;
219
+ instance.cleanupFns = deferred.previousCleanupFns;
220
+ instance._ownedChildScopes = deferred.previousOwnedChildScopes;
221
+ instance.abortController = deferred.previousAbortController;
222
+ instance.mountOperations = deferred.previousMountOperations;
223
+ instance.commitOperations = deferred.previousCommitOperations;
224
+ instance.lifecycleSlots = deferred.previousLifecycleSlots;
225
+ instance.lifecycleGeneration = deferred.previousLifecycleGeneration;
226
+ instance.evaluationGeneration = deferred.previousEvaluationGeneration;
227
+ instance.hasPendingUpdate = deferred.previousHasPendingUpdate;
228
+ instance.notifyUpdate = deferred.previousNotifyUpdate;
229
+ instance._placeholder = deferred.previousPlaceholder;
230
+ instance.mounted = deferred.previousMounted;
231
+ instance._currentRenderToken = deferred.previousCurrentRenderToken;
232
+ instance.lastRenderToken = deferred.previousLastRenderToken;
233
+ instance._pendingReadSources = deferred.previousPendingReadSources;
234
+ instance._pendingReadSourceVersions = deferred.previousPendingReadSourceVersions;
235
+ instance._lastReadSources = deferred.previousLastReadSources;
236
+ return errors;
237
+ }
238
+ function restoreDeferredRouteInstances(deferredCleanups) {
239
+ const errors = [];
240
+ for (let index = deferredCleanups.length - 1; index >= 0; index -= 1) errors.push(...restoreDeferredRouteInstance(deferredCleanups[index]));
241
+ if (errors.length > 0) reportRouteCleanupErrors(errors);
242
+ }
243
+ function cleanupDeferredRouteInstance(deferred) {
244
+ const errors = [];
245
+ const instance = deferred.instance;
246
+ const current = {
247
+ stateValues: instance.stateValues,
248
+ cleanupFns: instance.cleanupFns,
249
+ ownedChildScopes: instance._ownedChildScopes,
250
+ abortController: instance.abortController,
251
+ mountOperations: instance.mountOperations,
252
+ commitOperations: instance.commitOperations,
253
+ lifecycleSlots: instance.lifecycleSlots,
254
+ lifecycleGeneration: instance.lifecycleGeneration,
255
+ evaluationGeneration: instance.evaluationGeneration,
256
+ hasPendingUpdate: instance.hasPendingUpdate,
257
+ notifyUpdate: instance.notifyUpdate,
258
+ placeholder: instance._placeholder,
259
+ mounted: instance.mounted,
260
+ currentRenderToken: instance._currentRenderToken,
261
+ lastRenderToken: instance.lastRenderToken,
262
+ pendingReadSources: instance._pendingReadSources,
263
+ pendingReadSourceVersions: instance._pendingReadSourceVersions,
264
+ lastReadSources: instance._lastReadSources
265
+ };
266
+ instance.stateValues = deferred.previousStateValues;
267
+ instance.cleanupFns = deferred.previousCleanupFns;
268
+ instance._ownedChildScopes = deferred.previousOwnedChildScopes;
269
+ instance.abortController = deferred.previousAbortController;
270
+ instance.mountOperations = deferred.previousMountOperations;
271
+ instance.commitOperations = deferred.previousCommitOperations;
272
+ instance.lifecycleSlots = deferred.previousLifecycleSlots;
273
+ instance.lifecycleGeneration = deferred.previousLifecycleGeneration;
274
+ instance.evaluationGeneration = deferred.previousEvaluationGeneration;
275
+ instance.hasPendingUpdate = deferred.previousHasPendingUpdate;
276
+ instance.notifyUpdate = deferred.previousNotifyUpdate;
277
+ instance._placeholder = deferred.previousPlaceholder;
278
+ instance.mounted = deferred.previousMounted;
279
+ instance._currentRenderToken = deferred.previousCurrentRenderToken;
280
+ instance.lastRenderToken = deferred.previousLastRenderToken;
281
+ instance._pendingReadSources = deferred.previousPendingReadSources;
282
+ instance._pendingReadSourceVersions = deferred.previousPendingReadSourceVersions;
283
+ instance._lastReadSources = deferred.previousLastReadSources;
88
284
  try {
89
285
  cleanupComponent(instance);
90
286
  } catch (error) {
91
- cleanupErrors.push(error);
287
+ errors.push(error);
288
+ } finally {
289
+ instance.stateValues = current.stateValues;
290
+ instance.cleanupFns = current.cleanupFns;
291
+ instance._ownedChildScopes = current.ownedChildScopes;
292
+ instance.abortController = current.abortController;
293
+ instance.mountOperations = current.mountOperations;
294
+ instance.commitOperations = current.commitOperations;
295
+ instance.lifecycleSlots = current.lifecycleSlots;
296
+ instance.lifecycleGeneration = current.lifecycleGeneration;
297
+ instance.evaluationGeneration = current.evaluationGeneration;
298
+ instance.hasPendingUpdate = current.hasPendingUpdate;
299
+ instance.notifyUpdate = current.notifyUpdate;
300
+ instance._placeholder = current.placeholder;
301
+ instance.mounted = current.mounted;
302
+ instance._currentRenderToken = current.currentRenderToken;
303
+ instance.lastRenderToken = current.lastRenderToken;
304
+ instance._pendingReadSources = current.pendingReadSources;
305
+ instance._pendingReadSourceVersions = current.pendingReadSourceVersions;
306
+ instance._lastReadSources = current.lastReadSources;
92
307
  }
93
- if (cleanupErrors.length > 0) throw new AggregateError(cleanupErrors, "Route cleanup failed");
308
+ const root = instance.target;
309
+ const liveInstances = root ? new Set(collectHostInstances(root)) : /* @__PURE__ */ new Set();
310
+ for (let index = deferred.previousInstances.length - 1; index >= 0; index--) {
311
+ const previous = deferred.previousInstances[index];
312
+ if (previous === instance || liveInstances.has(previous)) continue;
313
+ try {
314
+ cleanupComponent(previous);
315
+ } catch (error) {
316
+ errors.push(error);
317
+ }
318
+ }
319
+ return errors;
94
320
  }
95
- function remountResolvedRoute(instance, resolved, pathname, href) {
321
+ function remountResolvedRoute(instance, resolved, pathname, href, existingSnapshot) {
322
+ const deferredCleanup = existingSnapshot ?? captureDeferredRouteCleanup(instance);
96
323
  clearDefaultPortalForInstance(instance);
97
- cleanupRouteOwnership(instance);
98
324
  instance.fn = wrapRootRouteHandler(bindResolvedRouteHandler(resolved));
99
325
  instance.props = {};
100
326
  instance.stateValues = [];
@@ -107,6 +333,7 @@ function remountResolvedRoute(instance, resolved, pathname, href) {
107
333
  instance.commitOperations = [];
108
334
  instance.lifecycleSlots = [];
109
335
  instance.cleanupFns = [];
336
+ instance._ownedChildScopes = /* @__PURE__ */ new Set();
110
337
  instance._placeholder = void 0;
111
338
  instance.hasPendingUpdate = false;
112
339
  instance._currentRenderToken = void 0;
@@ -116,7 +343,7 @@ function remountResolvedRoute(instance, resolved, pathname, href) {
116
343
  instance.abortController = null;
117
344
  mountComponent(instance);
118
345
  setCurrentRouteLocation(pathname, href);
119
- return true;
346
+ return deferredCleanup;
120
347
  }
121
348
  function rerenderResolvedRoute(instance, pathname, href) {
122
349
  setCurrentRouteLocation(pathname, href);
@@ -143,6 +370,15 @@ function resolveAppRouteRequest(app, pathname, href, signal) {
143
370
  signal
144
371
  });
145
372
  }
373
+ function getResolvedRouteHandler(resolved) {
374
+ if (!resolved) throw new Error("[Askr] cannot prepare an unmatched navigation target");
375
+ if (resolved.kind === "deny") return createDeniedResolvedRoute(resolved.status);
376
+ if (!isRenderResult(resolved)) throw new Error("[Askr] cannot prepare a redirect as a destination root");
377
+ return {
378
+ handler: resolved.handler,
379
+ params: resolved.params
380
+ };
381
+ }
146
382
  function resolveNavigationTargetsForApps(pathname, href, signal) {
147
383
  const apps = getRegisteredAppsSnapshot();
148
384
  if (apps.length === 1) {
@@ -176,8 +412,10 @@ function resolveNavigationTargetsForApps(pathname, href, signal) {
176
412
  if (pendingTargets.length === 0) return syncTargets;
177
413
  return Promise.all([...syncTargets.map((target) => Promise.resolve(target)), ...pendingTargets]);
178
414
  }
179
- function applyNavigationTargets(path, options, redirectState, pathname, href, targets, navigateWithRedirectState) {
415
+ function applyNavigationTargets(requestId, path, options, redirectState, pathname, href, targets, navigateWithRedirectState) {
416
+ if (isStaleRouteRequest(requestId)) return;
180
417
  const previousPathname = getCurrentPathname();
418
+ const previousHref = getCurrentHref();
181
419
  for (const target of targets) {
182
420
  const resolved = target.resolved;
183
421
  if (!resolved || resolved.kind !== "redirect") continue;
@@ -199,27 +437,96 @@ function applyNavigationTargets(path, options, redirectState, pathname, href, ta
199
437
  if (isDevelopmentEnvironment()) logger.warn(`No route found for path: ${path}`);
200
438
  return;
201
439
  }
202
- saveScrollPosition(getCurrentHref());
203
- const historyMethod = getNavigationHistoryMode(options) === "replace" ? "replaceState" : "pushState";
204
- window.history[historyMethod]({ path: href }, "", href);
205
- syncRegisteredRouteSnapshot();
440
+ if (isStaleRouteRequest(requestId)) return;
441
+ const samePathTargets = [];
442
+ const rootsToPrepare = [];
206
443
  for (const target of matchedTargets) {
207
444
  const resolved = target.resolved;
208
445
  if (resolved.kind === "redirect") continue;
209
446
  if (pathname === target.app.pathname && isRenderResult(resolved)) {
210
- rerenderResolvedRoute(target.app.instance, pathname, href);
211
- syncAppRegistrationLocation(target.app, pathname, href);
447
+ samePathTargets.push(target);
212
448
  continue;
213
449
  }
214
- remountResolvedRoute(target.app.instance, resolved.kind === "deny" ? createDeniedResolvedRoute(resolved.status) : {
215
- handler: resolved.handler,
216
- params: resolved.params
217
- }, pathname, href);
218
- syncAppRegistrationLocation(target.app, pathname, href);
450
+ rootsToPrepare.push(target);
451
+ }
452
+ const rollbackSnapshots = matchedTargets.map((target) => captureDeferredRouteCleanup(target.app.instance));
453
+ const rollbackSnapshotByInstance = new Map(rollbackSnapshots.map((snapshot) => [snapshot.instance, snapshot]));
454
+ const deferredCleanups = [];
455
+ const cleanupErrors = [];
456
+ const previousAppLocations = matchedTargets.map((target) => ({
457
+ app: target.app,
458
+ pathname: target.app.pathname,
459
+ href: target.app.href
460
+ }));
461
+ const restoreOnExit = () => {
462
+ if (!navigationBatchClosed) {
463
+ discardLifecycleCommitBatch(navigationBatch);
464
+ navigationBatchClosed = true;
465
+ }
466
+ restoreDeferredRouteInstances(rollbackSnapshots);
467
+ for (const previous of previousAppLocations) {
468
+ previous.app.pathname = previous.pathname;
469
+ previous.app.href = previous.href;
470
+ }
471
+ setCurrentRouteLocation(previousPathname, previousHref);
472
+ };
473
+ const navigationBatch = beginLifecycleCommitBatch();
474
+ let navigationBatchClosed = false;
475
+ try {
476
+ for (const target of rootsToPrepare) {
477
+ if (isStaleRouteRequest(requestId)) {
478
+ restoreOnExit();
479
+ return;
480
+ }
481
+ const deferredCleanup = remountResolvedRoute(target.app.instance, getResolvedRouteHandler(target.resolved), pathname, href, rollbackSnapshotByInstance.get(target.app.instance));
482
+ deferredCleanups.push(deferredCleanup);
483
+ }
484
+ if (isStaleRouteRequest(requestId)) {
485
+ restoreOnExit();
486
+ return;
487
+ }
488
+ flushRuntimeScheduler();
489
+ cleanupErrors.push(...drainLifecycleCommitErrors());
490
+ if (isStaleRouteRequest(requestId)) {
491
+ restoreOnExit();
492
+ return;
493
+ }
494
+ for (const target of samePathTargets) {
495
+ if (isStaleRouteRequest(requestId)) {
496
+ restoreOnExit();
497
+ return;
498
+ }
499
+ rerenderResolvedRoute(target.app.instance, pathname, href);
500
+ }
501
+ flushRuntimeScheduler();
502
+ cleanupErrors.push(...drainLifecycleCommitErrors());
503
+ if (isStaleRouteRequest(requestId)) {
504
+ restoreOnExit();
505
+ return;
506
+ }
507
+ flushLifecycleCommitBatch(navigationBatch);
508
+ navigationBatchClosed = true;
509
+ cleanupErrors.push(...drainLifecycleCommitErrors());
510
+ for (const target of matchedTargets) if (target.resolved && target.resolved.kind !== "redirect") syncAppRegistrationLocation(target.app, pathname, href);
511
+ if (isStaleRouteRequest(requestId)) {
512
+ restoreOnExit();
513
+ return;
514
+ }
515
+ saveScrollPosition(previousHref);
516
+ const historyMethod = getNavigationHistoryMode(options) === "replace" ? "replaceState" : "pushState";
517
+ window.history[historyMethod]({ path: href }, "", href);
518
+ setCurrentRouteLocation(pathname, href);
519
+ syncRegisteredRouteSnapshot();
520
+ if (pathname !== previousPathname) applyNavigationScroll(options.scroll);
521
+ for (const deferredCleanup of deferredCleanups) cleanupErrors.push(...cleanupDeferredRouteInstance(deferredCleanup));
522
+ for (const error of cleanupErrors) reportRouteCleanupErrors([error]);
523
+ } catch (error) {
524
+ restoreOnExit();
525
+ logger.error("[Askr] navigation failed:", error);
526
+ throw error;
219
527
  }
220
- if (pathname !== previousPathname) applyNavigationScroll(options.scroll);
221
528
  }
222
- function applyPopStateNavigationTargets(requestId, pathname, href, state, targets, navigate) {
529
+ function applyPopStateNavigationTargets(requestId, previousHref, previousState, pathname, href, state, targets, navigate) {
223
530
  if (isStaleRouteRequest(requestId)) return;
224
531
  const matchedTargets = targets.filter((target) => target.resolved !== null);
225
532
  if (matchedTargets.length === 0) {
@@ -232,24 +539,96 @@ function applyPopStateNavigationTargets(requestId, pathname, href, state, target
232
539
  navigate(resolved.to, { history: getRedirectHistoryMode(resolved.replace) });
233
540
  return;
234
541
  }
235
- syncRegisteredRouteSnapshot();
542
+ const samePathTargets = [];
543
+ const rootsToPrepare = [];
236
544
  for (const target of matchedTargets) {
237
545
  const resolved = target.resolved;
238
546
  if (pathname === target.app.pathname && isRenderResult(resolved)) {
239
- rerenderResolvedRoute(target.app.instance, pathname, href);
240
- syncAppRegistrationLocation(target.app, pathname, href);
547
+ samePathTargets.push(target);
241
548
  continue;
242
549
  }
243
550
  if (resolved.kind === "redirect") continue;
244
- remountResolvedRoute(target.app.instance, resolved.kind === "deny" ? createDeniedResolvedRoute(resolved.status) : {
245
- handler: resolved.handler,
246
- params: resolved.params
247
- }, pathname, href);
248
- syncAppRegistrationLocation(target.app, pathname, href);
551
+ rootsToPrepare.push(target);
552
+ }
553
+ const previousPathname = getCurrentPathname();
554
+ const rollbackSnapshots = matchedTargets.map((target) => captureDeferredRouteCleanup(target.app.instance));
555
+ const rollbackSnapshotByInstance = new Map(rollbackSnapshots.map((snapshot) => [snapshot.instance, snapshot]));
556
+ const deferredCleanups = [];
557
+ const cleanupErrors = [];
558
+ const previousAppLocations = matchedTargets.map((target) => ({
559
+ app: target.app,
560
+ pathname: target.app.pathname,
561
+ href: target.app.href
562
+ }));
563
+ const restoreOnExit = () => {
564
+ if (!navigationBatchClosed) {
565
+ discardLifecycleCommitBatch(navigationBatch);
566
+ navigationBatchClosed = true;
567
+ }
568
+ restoreDeferredRouteInstances(rollbackSnapshots);
569
+ for (const previous of previousAppLocations) {
570
+ previous.app.pathname = previous.pathname;
571
+ previous.app.href = previous.href;
572
+ }
573
+ setCurrentRouteLocation(previousPathname, previousHref);
574
+ };
575
+ const navigationBatch = beginLifecycleCommitBatch();
576
+ let navigationBatchClosed = false;
577
+ try {
578
+ for (const target of rootsToPrepare) {
579
+ if (isStaleRouteRequest(requestId)) {
580
+ restoreOnExit();
581
+ return;
582
+ }
583
+ const deferredCleanup = remountResolvedRoute(target.app.instance, getResolvedRouteHandler(target.resolved), pathname, href, rollbackSnapshotByInstance.get(target.app.instance));
584
+ deferredCleanups.push(deferredCleanup);
585
+ }
586
+ if (isStaleRouteRequest(requestId)) {
587
+ restoreOnExit();
588
+ return;
589
+ }
590
+ flushRuntimeScheduler();
591
+ cleanupErrors.push(...drainLifecycleCommitErrors());
592
+ if (isStaleRouteRequest(requestId)) {
593
+ restoreOnExit();
594
+ return;
595
+ }
596
+ for (const target of samePathTargets) {
597
+ if (isStaleRouteRequest(requestId)) {
598
+ restoreOnExit();
599
+ return;
600
+ }
601
+ rerenderResolvedRoute(target.app.instance, pathname, href);
602
+ }
603
+ flushRuntimeScheduler();
604
+ cleanupErrors.push(...drainLifecycleCommitErrors());
605
+ if (isStaleRouteRequest(requestId)) {
606
+ restoreOnExit();
607
+ return;
608
+ }
609
+ flushLifecycleCommitBatch(navigationBatch);
610
+ navigationBatchClosed = true;
611
+ cleanupErrors.push(...drainLifecycleCommitErrors());
612
+ for (const target of matchedTargets) if (target.resolved && target.resolved.kind !== "redirect") syncAppRegistrationLocation(target.app, pathname, href);
613
+ if (isStaleRouteRequest(requestId)) {
614
+ restoreOnExit();
615
+ return;
616
+ }
617
+ setCurrentRouteLocation(pathname, href);
618
+ syncRegisteredRouteSnapshot();
619
+ applyHistoryScroll(href, state);
620
+ for (const deferredCleanup of deferredCleanups) cleanupErrors.push(...cleanupDeferredRouteInstance(deferredCleanup));
621
+ for (const error of cleanupErrors) reportRouteCleanupErrors([error]);
622
+ } catch (error) {
623
+ restoreOnExit();
624
+ try {
625
+ window.history.replaceState(previousState, "", previousHref);
626
+ syncRegisteredRouteSnapshot();
627
+ } catch (rollbackError) {
628
+ logger.error("[Askr] failed to restore URL after popstate failure:", rollbackError);
629
+ }
630
+ throw error;
249
631
  }
250
- applyHistoryScroll(href, state);
251
632
  }
252
633
  //#endregion
253
634
  export { applyNavigationTargets, applyPopStateNavigationTargets, beginRouteRequest, cancelRouteRequests, getRedirectHistoryMode, isStaleRouteRequest, resolveNavigationTargetsForApps };
254
-
255
- //# sourceMappingURL=navigation-targets.js.map
@@ -24,5 +24,4 @@ declare function requireRole(role: string): RoutePolicy;
24
24
  declare function requirePermission(permission: string): RoutePolicy;
25
25
  declare function evaluateRoutePolicy(policy: RoutePolicy, context: RouteContext): Promise<AccessDecision>;
26
26
  //#endregion
27
- export { BuiltInRoutePolicyKind, BuiltInRoutePolicyMetadata, allow, deny, forbidden, notFound, redirect, requireAuth, requirePermission, requireRole, unauthorized };
28
- //# sourceMappingURL=policy.d.ts.map
27
+ export { BuiltInRoutePolicyKind, BuiltInRoutePolicyMetadata, allow, deny, forbidden, notFound, redirect, requireAuth, requirePermission, requireRole, unauthorized };
@@ -128,5 +128,3 @@ function requirePermission(permission) {
128
128
  }
129
129
  //#endregion
130
130
  export { _getBuiltInRoutePolicy, allow, deny, forbidden, notFound, redirect, requireAuth, requireGuest, requirePermission, requireRole, unauthorized, withRouteAuthOptions };
131
-
132
- //# sourceMappingURL=policy.js.map
@@ -6,5 +6,4 @@ declare function Outlet(): JSXElement;
6
6
  declare function createRouteHandler(component: RouteComponent, pageChain: readonly PageScopeRecord[], layoutChain: readonly LayoutScopeRecord[], deferComponents?: boolean): RouteHandler;
7
7
  declare function getRenderHandler(record: RouteRecord): RouteHandler;
8
8
  //#endregion
9
- export { Outlet };
10
- //# sourceMappingURL=rendering.d.ts.map
9
+ export { Outlet };
@@ -33,7 +33,10 @@ function createRouteHandler(component, pageChain, layoutChain, deferComponents =
33
33
  return (params) => {
34
34
  let content = deferComponents ? createRouteComponentVNode(component, params, true) : component(params);
35
35
  content = applyPageChain(pageChain, params, content, deferComponents);
36
- for (let i = layoutChain.length - 1; i >= 0; i--) content = layoutChain[i].component({ children: content });
36
+ for (let i = layoutChain.length - 1; i >= 0; i--) {
37
+ const layout = layoutChain[i].component;
38
+ content = layout({ children: content });
39
+ }
37
40
  return content;
38
41
  };
39
42
  }
@@ -42,5 +45,3 @@ function getRenderHandler(record) {
42
45
  }
43
46
  //#endregion
44
47
  export { Outlet, createRouteHandler, getRenderHandler };
45
-
46
- //# sourceMappingURL=rendering.js.map
@@ -1,4 +1,3 @@
1
1
  import { RouteRequestOptions, RouteRequestResult } from "../common/router.js";
2
2
  //#region src/router/resolution.d.ts
3
- declare function resolveRouteRequest(target: string, options?: RouteRequestOptions): RouteRequestResult | Promise<RouteRequestResult>;
4
- //# sourceMappingURL=resolution.d.ts.map
3
+ declare function resolveRouteRequest(target: string, options?: RouteRequestOptions): RouteRequestResult | Promise<RouteRequestResult>;
@@ -82,5 +82,3 @@ function resolveRouteRequest(target, options = {}) {
82
82
  }
83
83
  //#endregion
84
84
  export { computeMatchesFromRoutes, computeRouteActivityMatches, resolveRouteFromRoutes, resolveRouteRequest };
85
-
86
- //# sourceMappingURL=resolution.js.map
@@ -75,5 +75,3 @@ function buildRouteContext(target, params, options) {
75
75
  }
76
76
  //#endregion
77
77
  export { buildRouteContext, buildRouteContextBase, deepFreeze, makeQuery, parseLocation };
78
-
79
- //# sourceMappingURL=route-context.js.map
@@ -16,5 +16,4 @@ declare function resolveRouteFromRoutes(pathname: string, routeList: readonly Ro
16
16
  declare function _resolveRouteMatchFromRoutes(pathname: string, routeList: readonly Route[]): {
17
17
  route: Route;
18
18
  params: Record<string, string>;
19
- } | null;
20
- //# sourceMappingURL=route-matching.d.ts.map
19
+ } | null;
@@ -171,5 +171,3 @@ function _resolveRouteMatchFromRoutes(pathname, routeList) {
171
171
  }
172
172
  //#endregion
173
173
  export { _resolveRouteMatchFromRoutes, computeMatchesFromRouteRecords, computeMatchesFromRoutes, computeRouteActivityMatches, getMatchingRouteRecord, resolveRoute, resolveRouteFromRoutes };
174
-
175
- //# sourceMappingURL=route-matching.js.map
@@ -13,5 +13,4 @@ type UpdateRouteQueryOptions = {
13
13
  };
14
14
  declare function updateRouteQuery(updates: RouteQueryUpdates | RouteQueryUpdater, options?: UpdateRouteQueryOptions): void;
15
15
  //#endregion
16
- export { RouteQueryParamInput, RouteQueryParamValue, RouteQueryUpdater, RouteQueryUpdates, UpdateRouteQueryOptions, updateRouteQuery };
17
- //# sourceMappingURL=route-query.d.ts.map
16
+ export { RouteQueryParamInput, RouteQueryParamValue, RouteQueryUpdater, RouteQueryUpdates, UpdateRouteQueryOptions, updateRouteQuery };