@askrjs/askr 0.0.50 → 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 (594) 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 +5 -6
  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 +21 -11
  11. package/dist/boot/root-lifecycle.d.ts +6 -3
  12. package/dist/boot/root-lifecycle.js +18 -14
  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 +15 -0
  22. package/dist/common/invariant.js +15 -0
  23. package/dist/common/jsx.d.ts +1 -2
  24. package/dist/common/jsx.js +0 -2
  25. package/dist/{dev → common}/logger.js +5 -8
  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 +2 -16
  39. package/dist/components/error-boundary.js +2 -76
  40. package/dist/components/index.d.ts +2 -1
  41. package/dist/components/link.d.ts +2 -2
  42. package/dist/components/link.js +2 -2
  43. package/dist/control/case.d.ts +1 -2
  44. package/dist/control/case.js +1 -2
  45. package/dist/control/for.d.ts +3 -4
  46. package/dist/control/for.js +2 -4
  47. package/dist/control/shared.d.ts +1 -2
  48. package/dist/control/shared.js +0 -2
  49. package/dist/control/show.d.ts +1 -2
  50. package/dist/control/show.js +1 -2
  51. package/dist/data/data-runtime.d.ts +1 -2
  52. package/dist/data/data-runtime.js +3 -5
  53. package/dist/data/invalidation-listeners.js +0 -2
  54. package/dist/data/invalidation.d.ts +1 -2
  55. package/dist/data/invalidation.js +2 -4
  56. package/dist/data/mutation-cell.d.ts +1 -2
  57. package/dist/data/mutation-cell.js +7 -6
  58. package/dist/data/query-cell.d.ts +3 -2
  59. package/dist/data/query-cell.js +45 -11
  60. package/dist/data/query-key.js +0 -2
  61. package/dist/data/shared.js +3 -3
  62. package/dist/data/testing.js +2 -0
  63. package/dist/data/types.d.ts +1 -2
  64. package/dist/foundations/icon/icon.d.ts +1 -2
  65. package/dist/foundations/icon/icon.js +0 -2
  66. package/dist/foundations/icon/icon.types.d.ts +1 -2
  67. package/dist/foundations/index.d.ts +1 -1
  68. package/dist/foundations/index.js +1 -1
  69. package/dist/foundations/interactions/dismissable.d.ts +1 -2
  70. package/dist/foundations/interactions/dismissable.js +0 -2
  71. package/dist/foundations/interactions/focusable.d.ts +1 -2
  72. package/dist/foundations/interactions/focusable.js +0 -2
  73. package/dist/foundations/interactions/hoverable.d.ts +1 -2
  74. package/dist/foundations/interactions/hoverable.js +0 -2
  75. package/dist/foundations/interactions/interaction-policy.d.ts +1 -2
  76. package/dist/foundations/interactions/interaction-policy.js +0 -2
  77. package/dist/foundations/interactions/pressable.d.ts +1 -2
  78. package/dist/foundations/interactions/pressable.js +0 -2
  79. package/dist/foundations/interactions/roving-focus.d.ts +1 -2
  80. package/dist/foundations/interactions/roving-focus.js +0 -2
  81. package/dist/foundations/state/controllable.d.ts +1 -3
  82. package/dist/foundations/state/controllable.js +1 -2
  83. package/dist/foundations/structures/collection.d.ts +1 -2
  84. package/dist/foundations/structures/collection.js +0 -2
  85. package/dist/foundations/structures/index.d.ts +1 -1
  86. package/dist/foundations/structures/index.js +2 -1
  87. package/dist/foundations/structures/layer.d.ts +1 -2
  88. package/dist/foundations/structures/layer.js +0 -2
  89. package/dist/foundations/structures/layout.d.ts +1 -2
  90. package/dist/foundations/structures/layout.js +0 -2
  91. package/dist/foundations/structures/portal.d.ts +2 -24
  92. package/dist/foundations/structures/portal.js +3 -187
  93. package/dist/foundations/structures/presence.d.ts +1 -2
  94. package/dist/foundations/structures/presence.js +0 -2
  95. package/dist/foundations/structures/slot.d.ts +1 -2
  96. package/dist/foundations/structures/slot.js +0 -2
  97. package/dist/foundations/utilities/aria.d.ts +1 -2
  98. package/dist/foundations/utilities/aria.js +0 -2
  99. package/dist/foundations/utilities/compose-handlers.d.ts +1 -2
  100. package/dist/foundations/utilities/compose-handlers.js +0 -2
  101. package/dist/foundations/utilities/compose-ref.d.ts +1 -2
  102. package/dist/foundations/utilities/compose-ref.js +0 -2
  103. package/dist/foundations/utilities/event-types.d.ts +1 -2
  104. package/dist/foundations/utilities/merge-props.d.ts +1 -2
  105. package/dist/foundations/utilities/merge-props.js +0 -2
  106. package/dist/foundations/utilities/use-id.d.ts +1 -2
  107. package/dist/foundations/utilities/use-id.js +0 -2
  108. package/dist/fx/fx.d.ts +1 -2
  109. package/dist/fx/fx.js +2 -4
  110. package/dist/fx/index.js +1 -0
  111. package/dist/fx/noop.js +0 -2
  112. package/dist/fx/timing.d.ts +1 -2
  113. package/dist/fx/timing.js +0 -2
  114. package/dist/index.d.ts +4 -4
  115. package/dist/index.js +4 -6
  116. package/dist/jsx/types.d.ts +1 -2
  117. package/dist/jsx/utils.d.ts +1 -2
  118. package/dist/jsx/utils.js +0 -2
  119. package/dist/jsx-dev-runtime.d.ts +16 -2
  120. package/dist/jsx-dev-runtime.js +4 -12
  121. package/dist/jsx-runtime.d.ts +16 -2
  122. package/dist/jsx-runtime.js +16 -24
  123. package/dist/jsx-runtime2.d.ts +1 -1
  124. package/dist/renderer/attributes.js +29 -6
  125. package/dist/renderer/boundaries.js +50 -174
  126. package/dist/renderer/boundary-materialization.js +72 -0
  127. package/dist/renderer/boundary-range-adoption.js +76 -0
  128. package/dist/renderer/boundary-range-sync.js +101 -0
  129. package/dist/renderer/boundary-state.js +50 -0
  130. package/dist/renderer/child-shape.js +2 -4
  131. package/dist/renderer/children-fastpath.js +149 -0
  132. package/dist/renderer/children.js +3 -140
  133. package/dist/renderer/cleanup.js +72 -15
  134. package/dist/renderer/component-host-cleanup.js +124 -49
  135. package/dist/renderer/component-host-instances.js +60 -9
  136. package/dist/renderer/component-host-replacement.js +105 -0
  137. package/dist/renderer/component-host-results.js +138 -0
  138. package/dist/renderer/component-host.js +95 -170
  139. package/dist/renderer/dom-host.js +0 -2
  140. package/dist/renderer/dom-internal.js +115 -57
  141. package/dist/renderer/dom-range.js +161 -0
  142. package/dist/renderer/dom.js +7 -5
  143. package/dist/renderer/element-children.js +112 -32
  144. package/dist/renderer/error-boundary-dom.js +70 -13
  145. package/dist/renderer/evaluate-dom-range.js +3 -4
  146. package/dist/renderer/evaluate-reconcile.js +18 -42
  147. package/dist/renderer/evaluate.js +14 -3
  148. package/dist/renderer/fastpath.js +7 -14
  149. package/dist/renderer/for-commit-dom-map.js +6 -18
  150. package/dist/renderer/for-commit-removal.js +8 -17
  151. package/dist/renderer/for-commit-reorder.js +2 -4
  152. package/dist/renderer/for-commit.js +173 -45
  153. package/dist/renderer/hydration-boundaries.js +60 -0
  154. package/dist/renderer/hydration-listener-transaction.js +49 -0
  155. package/dist/renderer/index.js +11 -8
  156. package/dist/renderer/intrinsic-blueprint-analysis.js +202 -0
  157. package/dist/renderer/intrinsic-blueprint-bindings.js +152 -0
  158. package/dist/renderer/intrinsic-blueprint-materialization.js +100 -0
  159. package/dist/renderer/intrinsic-blueprint.js +30 -0
  160. package/dist/renderer/intrinsic-hydration-adoption.js +66 -0
  161. package/dist/renderer/keyed-children.js +3 -9
  162. package/dist/renderer/keyed.js +10 -10
  163. package/dist/renderer/namespaces.js +0 -2
  164. package/dist/renderer/prop-bindings.js +59 -24
  165. package/dist/renderer/reactive-child-dom.js +10 -4
  166. package/dist/renderer/reactive-child-sources.js +0 -2
  167. package/dist/renderer/reactive-children.js +33 -24
  168. package/dist/renderer/reconcile-commit.js +0 -2
  169. package/dist/renderer/reconcile-fastpaths.js +6 -12
  170. package/dist/renderer/reconcile-resolution.js +32 -56
  171. package/dist/renderer/reconcile.js +0 -2
  172. package/dist/renderer/retained-element-rollback.js +161 -149
  173. package/dist/renderer/stable-patch.js +5 -7
  174. package/dist/renderer/static-reuse.js +0 -2
  175. package/dist/renderer/utils.js +20 -10
  176. package/dist/resources/index.js +1 -2
  177. package/dist/router/access.js +0 -2
  178. package/dist/router/activity.d.ts +1 -2
  179. package/dist/router/activity.js +20 -24
  180. package/dist/router/authoring.d.ts +1 -2
  181. package/dist/router/authoring.js +1 -3
  182. package/dist/router/index.d.ts +1 -1
  183. package/dist/router/internal-types.d.ts +1 -2
  184. package/dist/router/lazy.d.ts +1 -2
  185. package/dist/router/lazy.js +0 -2
  186. package/dist/router/manifest.d.ts +1 -2
  187. package/dist/router/manifest.js +0 -2
  188. package/dist/router/match.js +0 -2
  189. package/dist/router/navigate.d.ts +1 -2
  190. package/dist/router/navigate.js +5 -8
  191. package/dist/router/navigation-registry.d.ts +1 -2
  192. package/dist/router/navigation-registry.js +1 -3
  193. package/dist/router/navigation-scroll.d.ts +1 -2
  194. package/dist/router/navigation-scroll.js +0 -2
  195. package/dist/router/navigation-targets.d.ts +3 -4
  196. package/dist/router/navigation-targets.js +425 -44
  197. package/dist/router/policy.d.ts +1 -2
  198. package/dist/router/policy.js +0 -2
  199. package/dist/router/rendering.d.ts +1 -2
  200. package/dist/router/rendering.js +5 -3
  201. package/dist/router/resolution.d.ts +2 -16
  202. package/dist/router/resolution.js +6 -175
  203. package/dist/router/route-context.js +0 -2
  204. package/dist/router/route-matching.d.ts +19 -0
  205. package/dist/router/route-matching.js +173 -0
  206. package/dist/router/route-query.d.ts +1 -2
  207. package/dist/router/route-query.js +1 -3
  208. package/dist/router/route.js +4 -2
  209. package/dist/router/store.d.ts +1 -2
  210. package/dist/router/store.js +0 -2
  211. package/dist/router/testing.js +4 -0
  212. package/dist/runtime/access.d.ts +19 -0
  213. package/dist/runtime/access.js +0 -2
  214. package/dist/runtime/child-scope.d.ts +21 -2
  215. package/dist/runtime/child-scope.js +101 -54
  216. package/dist/runtime/component-cleanup.d.ts +1 -2
  217. package/dist/runtime/component-cleanup.js +3 -5
  218. package/dist/runtime/component-commit.js +26 -24
  219. package/dist/runtime/component-facade.js +5 -3
  220. package/dist/runtime/component-internal.d.ts +12 -7
  221. package/dist/runtime/component-internal.js +64 -46
  222. package/dist/runtime/component-lifecycle.d.ts +2 -41
  223. package/dist/runtime/component-lifecycle.js +6 -149
  224. package/dist/runtime/component-scope.d.ts +4 -5
  225. package/dist/runtime/component-scope.js +27 -8
  226. package/dist/runtime/component.js +4 -3
  227. package/dist/runtime/context.d.ts +5 -2
  228. package/dist/runtime/context.js +29 -3
  229. package/dist/runtime/control.d.ts +22 -3
  230. package/dist/runtime/control.js +168 -55
  231. package/dist/runtime/derive.d.ts +1 -2
  232. package/dist/runtime/derive.js +0 -2
  233. package/dist/runtime/dev-namespace.d.ts +30 -0
  234. package/dist/runtime/dev-namespace.js +32 -25
  235. package/dist/runtime/effect.d.ts +8 -5
  236. package/dist/runtime/effect.js +158 -75
  237. package/dist/runtime/error-boundary.d.ts +4 -0
  238. package/dist/runtime/error-boundary.js +29 -0
  239. package/dist/runtime/events.d.ts +58 -0
  240. package/dist/runtime/events.js +67 -70
  241. package/dist/runtime/execution-model.d.ts +6 -0
  242. package/dist/runtime/execution-model.js +0 -2
  243. package/dist/runtime/fastlane.d.ts +33 -0
  244. package/dist/runtime/fastlane.js +0 -2
  245. package/dist/runtime/for-bench.d.ts +1 -2
  246. package/dist/runtime/for-bench.js +9 -167
  247. package/dist/runtime/for-internal.d.ts +73 -10
  248. package/dist/runtime/for-internal.js +201 -14
  249. package/dist/runtime/for-reconcile.d.ts +1 -2
  250. package/dist/runtime/for-reconcile.js +76 -23
  251. package/dist/runtime/for-scopes.d.ts +5 -5
  252. package/dist/runtime/for-scopes.js +168 -48
  253. package/dist/runtime/for-signals.d.ts +14 -5
  254. package/dist/runtime/for-signals.js +157 -83
  255. package/dist/runtime/for-types.d.ts +8 -0
  256. package/dist/runtime/for.d.ts +2 -2
  257. package/dist/runtime/for.js +3 -3
  258. package/dist/runtime/index.d.ts +24 -0
  259. package/dist/runtime/index.js +33 -0
  260. package/dist/runtime/lifecycle-batch.d.ts +59 -0
  261. package/dist/runtime/lifecycle-batch.js +178 -0
  262. package/dist/runtime/lifecycle-operation-settlement.d.ts +5 -0
  263. package/dist/runtime/lifecycle-operation-settlement.js +51 -0
  264. package/dist/runtime/lifecycle-operations.d.ts +1 -2
  265. package/dist/runtime/lifecycle-operations.js +5 -6
  266. package/dist/runtime/perf-metrics.d.ts +27 -0
  267. package/dist/runtime/perf-metrics.js +4 -68
  268. package/dist/runtime/portal.d.ts +21 -0
  269. package/dist/runtime/portal.js +305 -0
  270. package/dist/runtime/readable.d.ts +9 -4
  271. package/dist/runtime/readable.js +41 -17
  272. package/dist/runtime/resource-cell.js +3 -5
  273. package/dist/runtime/resource-operation.d.ts +1 -2
  274. package/dist/runtime/resource-operation.js +38 -35
  275. package/dist/runtime/runtime.d.ts +2 -3
  276. package/dist/runtime/runtime.js +0 -2
  277. package/dist/runtime/scheduler.d.ts +1 -2
  278. package/dist/runtime/scheduler.js +10 -13
  279. package/dist/runtime/selector-store.js +22 -0
  280. package/dist/runtime/selector.d.ts +1 -2
  281. package/dist/runtime/selector.js +6 -29
  282. package/dist/runtime/snapshot-source.d.ts +1 -2
  283. package/dist/runtime/snapshot-source.js +0 -2
  284. package/dist/runtime/state.d.ts +1 -2
  285. package/dist/runtime/state.js +1 -3
  286. package/dist/ssg/batch-render.js +0 -2
  287. package/dist/ssg/create-static-gen.d.ts +4 -2
  288. package/dist/ssg/create-static-gen.js +66 -14
  289. package/dist/ssg/generate-metadata.js +0 -2
  290. package/dist/ssg/generation-plan.js +0 -2
  291. package/dist/ssg/incremental-manifest.js +1 -3
  292. package/dist/ssg/resolve-ssg-data.js +0 -2
  293. package/dist/ssg/route-utils.js +0 -2
  294. package/dist/ssg/static-routes.js +1 -2
  295. package/dist/ssg/types.d.ts +2 -3
  296. package/dist/ssg/write-static-files.js +16 -12
  297. package/dist/ssr/attrs.js +0 -2
  298. package/dist/ssr/boundaries.js +17 -6
  299. package/dist/ssr/component-runtime.js +4 -30
  300. package/dist/ssr/context.d.ts +1 -2
  301. package/dist/ssr/context.js +0 -2
  302. package/dist/ssr/errors.d.ts +1 -2
  303. package/dist/ssr/errors.js +0 -2
  304. package/dist/ssr/escape.js +0 -2
  305. package/dist/ssr/hydration-data.js +0 -2
  306. package/dist/ssr/hydration-verify.d.ts +1 -2
  307. package/dist/ssr/hydration-verify.js +34 -7
  308. package/dist/ssr/index-internal.d.ts +1 -2
  309. package/dist/ssr/index-internal.js +0 -2
  310. package/dist/ssr/render-keys.js +0 -2
  311. package/dist/ssr/render-resolved.d.ts +1 -2
  312. package/dist/ssr/render-resolved.js +1 -3
  313. package/dist/ssr/render-sync.d.ts +1 -2
  314. package/dist/ssr/render-sync.js +28 -20
  315. package/dist/ssr/route-policy-resolution.js +2 -3
  316. package/dist/ssr/route-render.d.ts +1 -2
  317. package/dist/ssr/route-render.js +2 -3
  318. package/dist/ssr/sink.d.ts +1 -2
  319. package/dist/ssr/sink.js +0 -2
  320. package/dist/ssr/types.d.ts +1 -2
  321. package/dist/ssr/verify-hydration.js +0 -2
  322. package/dist/testing/index.d.ts +1 -2
  323. package/dist/testing/index.js +3 -4
  324. package/package.json +60 -47
  325. package/dist/bench/components/benchmark-row.d.ts.map +0 -1
  326. package/dist/bench/components/benchmark-row.js.map +0 -1
  327. package/dist/bench/components/benchmark-table.js.map +0 -1
  328. package/dist/benchmark.d.ts.map +0 -1
  329. package/dist/benchmark.js.map +0 -1
  330. package/dist/bin/askr-ssg.d.ts.map +0 -1
  331. package/dist/bin/askr-ssg.js.map +0 -1
  332. package/dist/boot/hydration.js.map +0 -1
  333. package/dist/boot/index.d.ts.map +0 -1
  334. package/dist/boot/index.js.map +0 -1
  335. package/dist/boot/root-lifecycle.d.ts.map +0 -1
  336. package/dist/boot/root-lifecycle.js.map +0 -1
  337. package/dist/boot/route-startup.js.map +0 -1
  338. package/dist/boot/types.d.ts.map +0 -1
  339. package/dist/common/attr-names.js.map +0 -1
  340. package/dist/common/component.d.ts.map +0 -1
  341. package/dist/common/control.d.ts.map +0 -1
  342. package/dist/common/control.js.map +0 -1
  343. package/dist/common/env.js.map +0 -1
  344. package/dist/common/jsx.d.ts.map +0 -1
  345. package/dist/common/jsx.js.map +0 -1
  346. package/dist/common/promise.js.map +0 -1
  347. package/dist/common/props.d.ts.map +0 -1
  348. package/dist/common/render-context.js.map +0 -1
  349. package/dist/common/route-activity.js.map +0 -1
  350. package/dist/common/router-internal.js.map +0 -1
  351. package/dist/common/router.d.ts.map +0 -1
  352. package/dist/common/ssr-errors.d.ts.map +0 -1
  353. package/dist/common/ssr-errors.js.map +0 -1
  354. package/dist/common/ssr.d.ts.map +0 -1
  355. package/dist/common/ssr.js.map +0 -1
  356. package/dist/common/vnode.d.ts.map +0 -1
  357. package/dist/common/vnode.js.map +0 -1
  358. package/dist/components/error-boundary.d.ts.map +0 -1
  359. package/dist/components/error-boundary.js.map +0 -1
  360. package/dist/components/link.d.ts.map +0 -1
  361. package/dist/components/link.js.map +0 -1
  362. package/dist/control/case.d.ts.map +0 -1
  363. package/dist/control/case.js.map +0 -1
  364. package/dist/control/for.d.ts.map +0 -1
  365. package/dist/control/for.js.map +0 -1
  366. package/dist/control/shared.d.ts.map +0 -1
  367. package/dist/control/shared.js.map +0 -1
  368. package/dist/control/show.d.ts.map +0 -1
  369. package/dist/control/show.js.map +0 -1
  370. package/dist/data/data-runtime.d.ts.map +0 -1
  371. package/dist/data/data-runtime.js.map +0 -1
  372. package/dist/data/invalidation-listeners.js.map +0 -1
  373. package/dist/data/invalidation.d.ts.map +0 -1
  374. package/dist/data/invalidation.js.map +0 -1
  375. package/dist/data/mutation-cell.d.ts.map +0 -1
  376. package/dist/data/mutation-cell.js.map +0 -1
  377. package/dist/data/query-cell.d.ts.map +0 -1
  378. package/dist/data/query-cell.js.map +0 -1
  379. package/dist/data/query-key.js.map +0 -1
  380. package/dist/data/shared.js.map +0 -1
  381. package/dist/data/types.d.ts.map +0 -1
  382. package/dist/dev/invariant.js +0 -29
  383. package/dist/dev/invariant.js.map +0 -1
  384. package/dist/dev/logger.js.map +0 -1
  385. package/dist/foundations/icon/icon.d.ts.map +0 -1
  386. package/dist/foundations/icon/icon.js.map +0 -1
  387. package/dist/foundations/icon/icon.types.d.ts.map +0 -1
  388. package/dist/foundations/interactions/dismissable.d.ts.map +0 -1
  389. package/dist/foundations/interactions/dismissable.js.map +0 -1
  390. package/dist/foundations/interactions/focusable.d.ts.map +0 -1
  391. package/dist/foundations/interactions/focusable.js.map +0 -1
  392. package/dist/foundations/interactions/hoverable.d.ts.map +0 -1
  393. package/dist/foundations/interactions/hoverable.js.map +0 -1
  394. package/dist/foundations/interactions/interaction-policy.d.ts.map +0 -1
  395. package/dist/foundations/interactions/interaction-policy.js.map +0 -1
  396. package/dist/foundations/interactions/pressable.d.ts.map +0 -1
  397. package/dist/foundations/interactions/pressable.js.map +0 -1
  398. package/dist/foundations/interactions/roving-focus.d.ts.map +0 -1
  399. package/dist/foundations/interactions/roving-focus.js.map +0 -1
  400. package/dist/foundations/state/controllable.d.ts.map +0 -1
  401. package/dist/foundations/state/controllable.js.map +0 -1
  402. package/dist/foundations/structures/collection.d.ts.map +0 -1
  403. package/dist/foundations/structures/collection.js.map +0 -1
  404. package/dist/foundations/structures/layer.d.ts.map +0 -1
  405. package/dist/foundations/structures/layer.js.map +0 -1
  406. package/dist/foundations/structures/layout.d.ts.map +0 -1
  407. package/dist/foundations/structures/layout.js.map +0 -1
  408. package/dist/foundations/structures/portal.d.ts.map +0 -1
  409. package/dist/foundations/structures/portal.js.map +0 -1
  410. package/dist/foundations/structures/presence.d.ts.map +0 -1
  411. package/dist/foundations/structures/presence.js.map +0 -1
  412. package/dist/foundations/structures/slot.d.ts.map +0 -1
  413. package/dist/foundations/structures/slot.js.map +0 -1
  414. package/dist/foundations/utilities/aria.d.ts.map +0 -1
  415. package/dist/foundations/utilities/aria.js.map +0 -1
  416. package/dist/foundations/utilities/compose-handlers.d.ts.map +0 -1
  417. package/dist/foundations/utilities/compose-handlers.js.map +0 -1
  418. package/dist/foundations/utilities/compose-ref.d.ts.map +0 -1
  419. package/dist/foundations/utilities/compose-ref.js.map +0 -1
  420. package/dist/foundations/utilities/event-types.d.ts.map +0 -1
  421. package/dist/foundations/utilities/merge-props.d.ts.map +0 -1
  422. package/dist/foundations/utilities/merge-props.js.map +0 -1
  423. package/dist/foundations/utilities/use-id.d.ts.map +0 -1
  424. package/dist/foundations/utilities/use-id.js.map +0 -1
  425. package/dist/fx/fx.d.ts.map +0 -1
  426. package/dist/fx/fx.js.map +0 -1
  427. package/dist/fx/noop.js.map +0 -1
  428. package/dist/fx/timing.d.ts.map +0 -1
  429. package/dist/fx/timing.js.map +0 -1
  430. package/dist/index.js.map +0 -1
  431. package/dist/jsx/types.d.ts.map +0 -1
  432. package/dist/jsx/utils.d.ts.map +0 -1
  433. package/dist/jsx/utils.js.map +0 -1
  434. package/dist/jsx-dev-runtime.d.ts.map +0 -1
  435. package/dist/jsx-dev-runtime.js.map +0 -1
  436. package/dist/jsx-runtime.d.ts.map +0 -1
  437. package/dist/jsx-runtime.js.map +0 -1
  438. package/dist/renderer/attributes.js.map +0 -1
  439. package/dist/renderer/boundaries.js.map +0 -1
  440. package/dist/renderer/child-shape.js.map +0 -1
  441. package/dist/renderer/children.js.map +0 -1
  442. package/dist/renderer/cleanup.js.map +0 -1
  443. package/dist/renderer/component-host-cleanup.js.map +0 -1
  444. package/dist/renderer/component-host-instances.js.map +0 -1
  445. package/dist/renderer/component-host.js.map +0 -1
  446. package/dist/renderer/dom-host.js.map +0 -1
  447. package/dist/renderer/dom-internal.js.map +0 -1
  448. package/dist/renderer/element-children.js.map +0 -1
  449. package/dist/renderer/error-boundary-dom.js.map +0 -1
  450. package/dist/renderer/evaluate-dom-range.js.map +0 -1
  451. package/dist/renderer/evaluate-reconcile.js.map +0 -1
  452. package/dist/renderer/evaluate.js.map +0 -1
  453. package/dist/renderer/fastpath.js.map +0 -1
  454. package/dist/renderer/for-commit-dom-map.js.map +0 -1
  455. package/dist/renderer/for-commit-removal.js.map +0 -1
  456. package/dist/renderer/for-commit-reorder.js.map +0 -1
  457. package/dist/renderer/for-commit.js.map +0 -1
  458. package/dist/renderer/index.js.map +0 -1
  459. package/dist/renderer/keyed-children.js.map +0 -1
  460. package/dist/renderer/keyed.js.map +0 -1
  461. package/dist/renderer/namespaces.js.map +0 -1
  462. package/dist/renderer/prop-bindings.js.map +0 -1
  463. package/dist/renderer/reactive-child-dom.js.map +0 -1
  464. package/dist/renderer/reactive-child-sources.js.map +0 -1
  465. package/dist/renderer/reactive-children.js.map +0 -1
  466. package/dist/renderer/reconcile-commit.js.map +0 -1
  467. package/dist/renderer/reconcile-fastpaths.js.map +0 -1
  468. package/dist/renderer/reconcile-resolution.js.map +0 -1
  469. package/dist/renderer/reconcile.js.map +0 -1
  470. package/dist/renderer/retained-element-rollback.js.map +0 -1
  471. package/dist/renderer/stable-patch.js.map +0 -1
  472. package/dist/renderer/static-reuse.js.map +0 -1
  473. package/dist/renderer/utils.js.map +0 -1
  474. package/dist/router/access.js.map +0 -1
  475. package/dist/router/activity.d.ts.map +0 -1
  476. package/dist/router/activity.js.map +0 -1
  477. package/dist/router/authoring.d.ts.map +0 -1
  478. package/dist/router/authoring.js.map +0 -1
  479. package/dist/router/internal-types.d.ts.map +0 -1
  480. package/dist/router/lazy.d.ts.map +0 -1
  481. package/dist/router/lazy.js.map +0 -1
  482. package/dist/router/manifest.d.ts.map +0 -1
  483. package/dist/router/manifest.js.map +0 -1
  484. package/dist/router/match.js.map +0 -1
  485. package/dist/router/navigate.d.ts.map +0 -1
  486. package/dist/router/navigate.js.map +0 -1
  487. package/dist/router/navigation-registry.d.ts.map +0 -1
  488. package/dist/router/navigation-registry.js.map +0 -1
  489. package/dist/router/navigation-scroll.d.ts.map +0 -1
  490. package/dist/router/navigation-scroll.js.map +0 -1
  491. package/dist/router/navigation-targets.d.ts.map +0 -1
  492. package/dist/router/navigation-targets.js.map +0 -1
  493. package/dist/router/policy.d.ts.map +0 -1
  494. package/dist/router/policy.js.map +0 -1
  495. package/dist/router/rendering.d.ts.map +0 -1
  496. package/dist/router/rendering.js.map +0 -1
  497. package/dist/router/resolution.d.ts.map +0 -1
  498. package/dist/router/resolution.js.map +0 -1
  499. package/dist/router/route-context.js.map +0 -1
  500. package/dist/router/route-query.d.ts.map +0 -1
  501. package/dist/router/route-query.js.map +0 -1
  502. package/dist/router/store.d.ts.map +0 -1
  503. package/dist/router/store.js.map +0 -1
  504. package/dist/runtime/access.js.map +0 -1
  505. package/dist/runtime/child-scope.d.ts.map +0 -1
  506. package/dist/runtime/child-scope.js.map +0 -1
  507. package/dist/runtime/component-cleanup.d.ts.map +0 -1
  508. package/dist/runtime/component-cleanup.js.map +0 -1
  509. package/dist/runtime/component-commit.js.map +0 -1
  510. package/dist/runtime/component-contracts.js +0 -5
  511. package/dist/runtime/component-internal.d.ts.map +0 -1
  512. package/dist/runtime/component-internal.js.map +0 -1
  513. package/dist/runtime/component-lifecycle.d.ts.map +0 -1
  514. package/dist/runtime/component-lifecycle.js.map +0 -1
  515. package/dist/runtime/component-scope.d.ts.map +0 -1
  516. package/dist/runtime/component-scope.js.map +0 -1
  517. package/dist/runtime/context.d.ts.map +0 -1
  518. package/dist/runtime/context.js.map +0 -1
  519. package/dist/runtime/control.d.ts.map +0 -1
  520. package/dist/runtime/control.js.map +0 -1
  521. package/dist/runtime/derive.d.ts.map +0 -1
  522. package/dist/runtime/derive.js.map +0 -1
  523. package/dist/runtime/dev-namespace.js.map +0 -1
  524. package/dist/runtime/effect.d.ts.map +0 -1
  525. package/dist/runtime/effect.js.map +0 -1
  526. package/dist/runtime/events.js.map +0 -1
  527. package/dist/runtime/execution-model.js.map +0 -1
  528. package/dist/runtime/fastlane.js.map +0 -1
  529. package/dist/runtime/for-bench.d.ts.map +0 -1
  530. package/dist/runtime/for-bench.js.map +0 -1
  531. package/dist/runtime/for-internal.d.ts.map +0 -1
  532. package/dist/runtime/for-internal.js.map +0 -1
  533. package/dist/runtime/for-reconcile.d.ts.map +0 -1
  534. package/dist/runtime/for-reconcile.js.map +0 -1
  535. package/dist/runtime/for-scopes.d.ts.map +0 -1
  536. package/dist/runtime/for-scopes.js.map +0 -1
  537. package/dist/runtime/for-signals.d.ts.map +0 -1
  538. package/dist/runtime/for-signals.js.map +0 -1
  539. package/dist/runtime/lifecycle-operations.d.ts.map +0 -1
  540. package/dist/runtime/lifecycle-operations.js.map +0 -1
  541. package/dist/runtime/perf-metrics.js.map +0 -1
  542. package/dist/runtime/readable.d.ts.map +0 -1
  543. package/dist/runtime/readable.js.map +0 -1
  544. package/dist/runtime/resource-cell.js.map +0 -1
  545. package/dist/runtime/resource-operation.d.ts.map +0 -1
  546. package/dist/runtime/resource-operation.js.map +0 -1
  547. package/dist/runtime/runtime.d.ts.map +0 -1
  548. package/dist/runtime/runtime.js.map +0 -1
  549. package/dist/runtime/scheduler.d.ts.map +0 -1
  550. package/dist/runtime/scheduler.js.map +0 -1
  551. package/dist/runtime/selector.d.ts.map +0 -1
  552. package/dist/runtime/selector.js.map +0 -1
  553. package/dist/runtime/snapshot-source.d.ts.map +0 -1
  554. package/dist/runtime/snapshot-source.js.map +0 -1
  555. package/dist/runtime/state.d.ts.map +0 -1
  556. package/dist/runtime/state.js.map +0 -1
  557. package/dist/ssg/batch-render.js.map +0 -1
  558. package/dist/ssg/create-static-gen.d.ts.map +0 -1
  559. package/dist/ssg/create-static-gen.js.map +0 -1
  560. package/dist/ssg/generate-metadata.js.map +0 -1
  561. package/dist/ssg/generation-plan.js.map +0 -1
  562. package/dist/ssg/incremental-manifest.js.map +0 -1
  563. package/dist/ssg/resolve-ssg-data.js.map +0 -1
  564. package/dist/ssg/route-utils.js.map +0 -1
  565. package/dist/ssg/static-routes.js.map +0 -1
  566. package/dist/ssg/types.d.ts.map +0 -1
  567. package/dist/ssg/write-static-files.js.map +0 -1
  568. package/dist/ssr/attrs.js.map +0 -1
  569. package/dist/ssr/boundaries.js.map +0 -1
  570. package/dist/ssr/component-runtime.js.map +0 -1
  571. package/dist/ssr/context.d.ts.map +0 -1
  572. package/dist/ssr/context.js.map +0 -1
  573. package/dist/ssr/errors.d.ts.map +0 -1
  574. package/dist/ssr/errors.js.map +0 -1
  575. package/dist/ssr/escape.js.map +0 -1
  576. package/dist/ssr/hydration-data.js.map +0 -1
  577. package/dist/ssr/hydration-verify.d.ts.map +0 -1
  578. package/dist/ssr/hydration-verify.js.map +0 -1
  579. package/dist/ssr/index-internal.d.ts.map +0 -1
  580. package/dist/ssr/index-internal.js.map +0 -1
  581. package/dist/ssr/render-keys.js.map +0 -1
  582. package/dist/ssr/render-resolved.d.ts.map +0 -1
  583. package/dist/ssr/render-resolved.js.map +0 -1
  584. package/dist/ssr/render-sync.d.ts.map +0 -1
  585. package/dist/ssr/render-sync.js.map +0 -1
  586. package/dist/ssr/route-policy-resolution.js.map +0 -1
  587. package/dist/ssr/route-render.d.ts.map +0 -1
  588. package/dist/ssr/route-render.js.map +0 -1
  589. package/dist/ssr/sink.d.ts.map +0 -1
  590. package/dist/ssr/sink.js.map +0 -1
  591. package/dist/ssr/types.d.ts.map +0 -1
  592. package/dist/ssr/verify-hydration.js.map +0 -1
  593. package/dist/testing/index.d.ts.map +0 -1
  594. package/dist/testing/index.js.map +0 -1
@@ -1,27 +1,35 @@
1
- import { markReactivePropsDirtySource, markReadableDerivedSubscribersDirty, notifyReadableReaders, recordReadableRead } from "./readable.js";
1
+ import { markReactivePropsDirtySource, markReadableDerivedSubscribersDirty, notifyReadableReaders, recordReadableRead, shouldCoalesceFineGrainedItemReads } from "./readable.js";
2
2
  //#region src/runtime/for-signals.ts
3
- function notifyForSignalReaders(source, skipInstance) {
3
+ function peekForSignal() {
4
+ return this._value;
5
+ }
6
+ function setForValueSignal(newValue, notifyReaders = true) {
7
+ if (Object.is(this._value, newValue)) return;
8
+ this._value = newValue;
9
+ if (notifyReaders) notifyForSignalReaders(this);
10
+ }
11
+ function setForIndexValue(newValue, notifyReaders = true) {
12
+ const nextValue = typeof newValue === "function" ? newValue(this._value) : newValue;
13
+ if (nextValue === this._value) return;
14
+ this._value = nextValue;
15
+ if (notifyReaders) notifyForSignalReaders(this);
16
+ }
17
+ function notifyForSignalReaders(source, skipInstance, skipOwnedBy) {
4
18
  markReadableDerivedSubscribersDirty(source);
5
19
  markReactivePropsDirtySource(source);
6
- notifyReadableReaders(source, skipInstance);
20
+ notifyReadableReaders(source, skipInstance, skipOwnedBy);
7
21
  }
8
22
  function createForIndexSignal(initialIndex) {
9
- let indexValue = initialIndex;
10
- const readers = /* @__PURE__ */ new Map();
11
- const indexSignal = (() => {
12
- indexSignal._hasBeenRead = true;
13
- recordReadableRead(indexSignal);
14
- return indexValue;
15
- });
16
- indexSignal._readers = readers;
17
- indexSignal.peek = () => indexValue;
18
- indexSignal.set = (newValue, notifyReaders = true) => {
19
- const nextValue = typeof newValue === "function" ? newValue(indexValue) : newValue;
20
- if (nextValue !== indexValue) {
21
- indexValue = nextValue;
22
- if (notifyReaders) notifyForSignalReaders(indexSignal);
23
- }
24
- };
23
+ function readIndexSignal() {
24
+ const signal = readIndexSignal;
25
+ signal._hasBeenRead = true;
26
+ recordReadableRead(signal);
27
+ return signal._value;
28
+ }
29
+ const indexSignal = readIndexSignal;
30
+ indexSignal._value = initialIndex;
31
+ indexSignal.peek = peekForSignal;
32
+ indexSignal.set = setForIndexValue;
25
33
  indexSignal._hasBeenRead = false;
26
34
  return indexSignal;
27
35
  }
@@ -31,38 +39,30 @@ function syncForIndexSignal(indexSignal, nextIndex) {
31
39
  return indexSignal._hasBeenRead === true;
32
40
  }
33
41
  function createForItemSignal(initialItem) {
34
- let itemValue = initialItem;
35
- const readers = /* @__PURE__ */ new Map();
36
- const itemSignal = (() => {
37
- itemSignal._hasBeenRead = true;
38
- recordReadableRead(itemSignal);
39
- return itemValue;
40
- });
41
- itemSignal._readers = readers;
42
- itemSignal.peek = () => itemValue;
43
- itemSignal.set = (newValue, notifyReaders = true) => {
44
- if (Object.is(itemValue, newValue)) return;
45
- itemValue = newValue;
46
- if (notifyReaders) notifyForSignalReaders(itemSignal);
47
- };
42
+ function readItemSignal() {
43
+ const signal = readItemSignal;
44
+ signal._hasBeenRead = true;
45
+ recordReadableRead(signal);
46
+ return signal._value;
47
+ }
48
+ const itemSignal = readItemSignal;
49
+ itemSignal._value = initialItem;
50
+ itemSignal.peek = peekForSignal;
51
+ itemSignal.set = setForValueSignal;
48
52
  itemSignal._hasBeenRead = false;
49
53
  return itemSignal;
50
54
  }
51
55
  function createForItemPropertySignal(initialValue) {
52
- let propertyValue = initialValue;
53
- const readers = /* @__PURE__ */ new Map();
54
- const propertySignal = (() => {
55
- propertySignal._hasBeenRead = true;
56
- recordReadableRead(propertySignal);
57
- return propertyValue;
58
- });
59
- propertySignal._readers = readers;
60
- propertySignal.peek = () => propertyValue;
61
- propertySignal.set = (newValue, notifyReaders = true) => {
62
- if (Object.is(propertyValue, newValue)) return;
63
- propertyValue = newValue;
64
- if (notifyReaders) notifyForSignalReaders(propertySignal);
65
- };
56
+ function readPropertySignal() {
57
+ const signal = readPropertySignal;
58
+ signal._hasBeenRead = true;
59
+ recordReadableRead(signal);
60
+ return signal._value;
61
+ }
62
+ const propertySignal = readPropertySignal;
63
+ propertySignal._value = initialValue;
64
+ propertySignal.peek = peekForSignal;
65
+ propertySignal.set = setForValueSignal;
66
66
  propertySignal._hasBeenRead = false;
67
67
  return propertySignal;
68
68
  }
@@ -77,6 +77,18 @@ function haveSameOwnKeys(previousItem, nextItem) {
77
77
  return true;
78
78
  }
79
79
  function scopeReadsSource(scope, source) {
80
+ const readers = source._readers;
81
+ if (!readers || readers.size === 0) return false;
82
+ for (const reader of readers.keys()) {
83
+ let current = reader;
84
+ while (current) {
85
+ if (current === scope.componentInstance) return true;
86
+ current = current.parentInstance;
87
+ }
88
+ }
89
+ return false;
90
+ }
91
+ function scopeDirectlyReadsSource(scope, source) {
80
92
  return source._readers?.has(scope.componentInstance) ?? false;
81
93
  }
82
94
  function isForParentReader(parentInstance, reader) {
@@ -92,7 +104,9 @@ function removeForParentReaders(parentInstance, source) {
92
104
  if (!readers || readers.size === 0) return;
93
105
  for (const reader of readers.keys()) if (isForParentReader(parentInstance, reader)) readers.delete(reader);
94
106
  }
95
- function getOrCreateForItemPropertySignal(item, propertySignals, prop) {
107
+ function getOrCreateForItemPropertySignal(state, prop) {
108
+ const item = state.currentItem;
109
+ const propertySignals = state.propertySignals ?? (state.propertySignals = /* @__PURE__ */ new Map());
96
110
  const existingSignal = propertySignals.get(prop);
97
111
  if (existingSignal) return existingSignal;
98
112
  const propertySignal = createForItemPropertySignal(readForItemProperty(item, prop));
@@ -100,40 +114,100 @@ function getOrCreateForItemPropertySignal(item, propertySignals, prop) {
100
114
  return propertySignal;
101
115
  }
102
116
  function canProxyForItem(item) {
103
- return typeof item === "object" && item !== null || typeof item === "function";
104
- }
105
- function createReactiveForItem(itemSignal, propertySignals) {
106
- return new Proxy(Object.create(null), {
107
- get(target, prop, receiver) {
108
- if (Reflect.getOwnPropertyDescriptor(target, prop)) return Reflect.get(target, prop, receiver);
109
- const currentItem = itemSignal.peek();
110
- if (typeof prop !== "symbol") return getOrCreateForItemPropertySignal(currentItem, propertySignals, prop)();
111
- recordReadableRead(itemSignal);
112
- return Reflect.get(Object(currentItem), prop, receiver);
113
- },
114
- has(target, prop) {
115
- recordReadableRead(itemSignal);
116
- return prop in target || prop in Object(itemSignal.peek());
117
- },
118
- ownKeys(target) {
119
- recordReadableRead(itemSignal);
120
- const keys = new Set(Reflect.ownKeys(target));
121
- for (const key of Reflect.ownKeys(Object(itemSignal.peek()))) keys.add(key);
122
- return Array.from(keys);
123
- },
124
- getOwnPropertyDescriptor(target, prop) {
125
- recordReadableRead(itemSignal);
126
- const ownDescriptor = Reflect.getOwnPropertyDescriptor(target, prop);
127
- if (ownDescriptor) return ownDescriptor;
128
- return Object.getOwnPropertyDescriptor(Object(itemSignal.peek()), prop);
129
- },
130
- getPrototypeOf() {
131
- recordReadableRead(itemSignal);
132
- return Object.getPrototypeOf(Object(itemSignal.peek()));
133
- }
134
- });
117
+ return typeof item === "function" || typeof item === "object" && item !== null && !Array.isArray(item);
118
+ }
119
+ function createReactiveForItem(item) {
120
+ const target = Object.create(null);
121
+ const state = {
122
+ currentItem: item,
123
+ itemSignal: null,
124
+ propertySignals: null,
125
+ coalescedProperties: null,
126
+ coalescedProperty2: null,
127
+ wholeItemRead: false,
128
+ proxy: void 0
129
+ };
130
+ target[REACTIVE_FOR_ITEM_STATE] = state;
131
+ state.proxy = new Proxy(target, REACTIVE_FOR_ITEM_PROXY_HANDLER);
132
+ return state;
135
133
  }
134
+ const REACTIVE_FOR_ITEM_STATE = Symbol("askr.reactive-for-item-state");
135
+ function getReactiveForItemState(target) {
136
+ return target[REACTIVE_FOR_ITEM_STATE];
137
+ }
138
+ function getWholeItemSignal(state) {
139
+ let signal = state.itemSignal;
140
+ if (!signal) {
141
+ signal = createForItemSignal(state.currentItem);
142
+ state.itemSignal = signal;
143
+ }
144
+ return signal;
145
+ }
146
+ const REACTIVE_FOR_ITEM_PROXY_HANDLER = {
147
+ get(target, prop, receiver) {
148
+ if (prop !== REACTIVE_FOR_ITEM_STATE && prop in target) return Reflect.get(target, prop, receiver);
149
+ const metadata = getReactiveForItemState(target);
150
+ const currentItem = metadata.currentItem;
151
+ if (typeof prop !== "symbol") {
152
+ if (shouldCoalesceFineGrainedItemReads()) {
153
+ const properties = metadata.coalescedProperties;
154
+ if (properties === null) metadata.coalescedProperties = prop;
155
+ else if (Array.isArray(properties)) {
156
+ if (!properties.includes(prop)) properties.push(prop);
157
+ } else if (properties !== prop && metadata.coalescedProperty2 !== prop) if (metadata.coalescedProperty2 === null) metadata.coalescedProperty2 = prop;
158
+ else {
159
+ metadata.coalescedProperties = [
160
+ properties,
161
+ metadata.coalescedProperty2,
162
+ prop
163
+ ];
164
+ metadata.coalescedProperty2 = null;
165
+ }
166
+ let itemSignal = metadata.itemSignal;
167
+ if (!itemSignal) {
168
+ itemSignal = createForItemSignal(currentItem);
169
+ metadata.itemSignal = itemSignal;
170
+ }
171
+ itemSignal();
172
+ return readForItemProperty(currentItem, prop);
173
+ }
174
+ return getOrCreateForItemPropertySignal(metadata, prop)();
175
+ }
176
+ metadata.wholeItemRead = true;
177
+ recordReadableRead(getWholeItemSignal(metadata));
178
+ return Reflect.get(Object(currentItem), prop, receiver);
179
+ },
180
+ has(target, prop) {
181
+ if (prop === REACTIVE_FOR_ITEM_STATE) return false;
182
+ const metadata = getReactiveForItemState(target);
183
+ metadata.wholeItemRead = true;
184
+ recordReadableRead(getWholeItemSignal(metadata));
185
+ return prop in target || prop in Object(metadata.currentItem);
186
+ },
187
+ ownKeys(target) {
188
+ const metadata = getReactiveForItemState(target);
189
+ metadata.wholeItemRead = true;
190
+ recordReadableRead(getWholeItemSignal(metadata));
191
+ const keys = /* @__PURE__ */ new Set();
192
+ for (const key of Reflect.ownKeys(target)) if (key !== REACTIVE_FOR_ITEM_STATE) keys.add(key);
193
+ for (const key of Reflect.ownKeys(Object(metadata.currentItem))) keys.add(key);
194
+ return Array.from(keys);
195
+ },
196
+ getOwnPropertyDescriptor(target, prop) {
197
+ if (prop === REACTIVE_FOR_ITEM_STATE) return;
198
+ const metadata = getReactiveForItemState(target);
199
+ metadata.wholeItemRead = true;
200
+ recordReadableRead(getWholeItemSignal(metadata));
201
+ const ownDescriptor = Reflect.getOwnPropertyDescriptor(target, prop);
202
+ if (ownDescriptor) return ownDescriptor;
203
+ return Object.getOwnPropertyDescriptor(Object(metadata.currentItem), prop);
204
+ },
205
+ getPrototypeOf(target) {
206
+ const metadata = getReactiveForItemState(target);
207
+ metadata.wholeItemRead = true;
208
+ recordReadableRead(getWholeItemSignal(metadata));
209
+ return Object.getPrototypeOf(Object(metadata.currentItem));
210
+ }
211
+ };
136
212
  //#endregion
137
- export { canProxyForItem, createForIndexSignal, createForItemSignal, createReactiveForItem, haveSameOwnKeys, notifyForSignalReaders, readForItemProperty, removeForParentReaders, scopeReadsSource, syncForIndexSignal };
138
-
139
- //# sourceMappingURL=for-signals.js.map
213
+ export { canProxyForItem, createForIndexSignal, createForItemSignal, createReactiveForItem, haveSameOwnKeys, notifyForSignalReaders, readForItemProperty, removeForParentReaders, scopeDirectlyReadsSource, scopeReadsSource, syncForIndexSignal };
@@ -0,0 +1,8 @@
1
+ import { VNode } from "../common/vnode.js";
2
+
3
+ //#region src/runtime/for-types.d.ts
4
+ type ForEachSource<T> = T[] | (() => T[]);
5
+ type ForKeySelector<T> = (item: T, index: number) => string | number;
6
+ type ForRenderItem<T> = (item: T, index: () => number) => VNode;
7
+ //#endregion
8
+ export { ForEachSource, ForKeySelector, ForRenderItem };
@@ -1,4 +1,4 @@
1
1
  import { ForItemInstance } from "./for-scopes.js";
2
2
  import { reconcileForItems } from "./for-reconcile.js";
3
- import { ForCommitStrategy, ForState } from "./for-internal.js";
4
- export { ForCommitStrategy, ForState, reconcileForItems };
3
+ import { ForCommitStrategy, ForItemTransactionSnapshot, ForState, ForTransaction } from "./for-internal.js";
4
+ export { ForCommitStrategy, ForItemTransactionSnapshot, ForState, ForTransaction, reconcileForItems };
@@ -1,5 +1,5 @@
1
1
  import { isBenchMetricScopeActive, recordBenchCounter, recordBenchEvent, recordBenchTiming, withBenchMetricScope } from "./for-bench.js";
2
- import "./for-scopes.js";
2
+ import { captureForFallbackTransactionSnapshot, captureForItemTransactionSnapshot } from "./for-scopes.js";
3
3
  import { reconcileForItems } from "./for-reconcile.js";
4
- import { clearForDomUpdateState, createForState, evaluateForState, useForState } from "./for-internal.js";
5
- export { clearForDomUpdateState, createForState, evaluateForState, isBenchMetricScopeActive, reconcileForItems, recordBenchCounter, recordBenchEvent, recordBenchTiming, useForState, withBenchMetricScope };
4
+ import { beginForStateTransaction, clearForDomUpdateState, commitForStateTransaction, createForState, evaluateForState, registerForStateTransaction, rollbackForStateTransaction, useForState } from "./for-internal.js";
5
+ export { beginForStateTransaction, captureForFallbackTransactionSnapshot, captureForItemTransactionSnapshot, clearForDomUpdateState, commitForStateTransaction, createForState, evaluateForState, isBenchMetricScopeActive, reconcileForItems, recordBenchCounter, recordBenchEvent, recordBenchTiming, registerForStateTransaction, rollbackForStateTransaction, useForState, withBenchMetricScope };
@@ -0,0 +1,24 @@
1
+ import { State, StateSetter, StateTuple, state } from "./state.js";
2
+ import { Context, ContextFrame, ContextKey, defineContext, readContext } from "./context.js";
3
+ import { cleanupComponent, registerOwnedChildScope, unregisterOwnedChildScope } from "./component-cleanup.js";
4
+ import { ComponentInstance } from "./component-internal.js";
5
+ import { getSignal } from "./component-scope.js";
6
+ import { DerivedSubscriber, FineGrainedReadCollector, ReadableSource } from "./readable.js";
7
+ import { Scheduler, SchedulerLane, scheduleEventHandler } from "./scheduler.js";
8
+ import { AskrRuntime, AskrRuntimeOptions, RuntimeKeyedReorderDecision, RuntimeRendererHost, createRuntime, getDefaultRuntime } from "./runtime.js";
9
+ import { ChildScope, ChildScopeTransactionSnapshot } from "./child-scope.js";
10
+ import { ForItemInstance } from "./for-scopes.js";
11
+ import { CreateFineGrainedEffectOptions, FineGrainedEffectHandle } from "./effect.js";
12
+ import { ForEachSource, ForKeySelector, ForRenderItem } from "./for-types.js";
13
+ import { reconcileForItems } from "./for-reconcile.js";
14
+ import { ForCommitStrategy, ForItemTransactionSnapshot, ForState, ForTransaction } from "./for-internal.js";
15
+ import { CaseState, ControlBoundaryState, ControlTransaction, MatchBranch, ShowState } from "./control.js";
16
+ import { Derived, derive } from "./derive.js";
17
+ import { DelegatedEventMap } from "./events.js";
18
+ import { ExecutionModel } from "./execution-model.js";
19
+ import { ResourceResult, resource } from "./resource-operation.js";
20
+ import { ActivityPredicate, TimerOptions, capture, documentVisible, on, routeActive, stream, task, timer, windowFocused } from "./lifecycle-operations.js";
21
+ import { DefaultPortal, Portal, PortalProps, definePortal } from "./portal.js";
22
+ import { Selector, selector } from "./selector.js";
23
+ import { ComponentFunction } from "../common/component.js";
24
+ export { type ActivityPredicate, AskrRuntime, AskrRuntimeOptions, CaseState, ChildScope, ChildScopeTransactionSnapshot, type ComponentFunction, type ComponentInstance, Context, ContextFrame, ContextKey, ControlBoundaryState, ControlTransaction, CreateFineGrainedEffectOptions, DefaultPortal, DelegatedEventMap, Derived, DerivedSubscriber, ExecutionModel, FineGrainedEffectHandle, FineGrainedReadCollector, ForCommitStrategy, type ForEachSource, ForItemTransactionSnapshot, ForState, ForTransaction, MatchBranch, Portal, PortalProps, ReadableSource, type ResourceResult, RuntimeKeyedReorderDecision, RuntimeRendererHost, Selector, ShowState, State, StateSetter, StateTuple, type TimerOptions, capture, createRuntime, defineContext, definePortal, derive, documentVisible, getDefaultRuntime, getSignal, on, readContext, reconcileForItems, resource, routeActive, scheduleEventHandler, selector, state, stream, task, timer, windowFocused };
@@ -0,0 +1,33 @@
1
+ import { addPerfDuration, getPerfMetricsStore, incrementPerfMetric, recordSchedulerFlushTaskCount } from "./perf-metrics.js";
2
+ import { scheduleEventHandler } from "./scheduler.js";
3
+ import { AskrRuntime, configureRuntimeRenderer, createRuntime, defaultRuntime, getDefaultRuntime } from "./runtime.js";
4
+ import { enqueueRuntimeLane, enqueueRuntimeTask, flushRuntimeScheduler, getDefaultRuntimeInstance, getRuntimeFlushVersion, getRuntimeRenderer, getRuntimeScheduler, getRuntimeSchedulerState, isRuntimeSchedulerExecuting, markRuntimeReactivePropsDirtySource, runRuntimeHandlerScope, runRuntimeWithSyncProgress, setRuntimeBulkCommitProbe } from "./access.js";
5
+ import { CONTEXT_FRAME_SYMBOL, callWithContext, defineContext, getCurrentContextFrame, getExecutionContextFrame, getVNodeContextFrame, markVNodeTreeWithContextFrame, markVNodeWithContextFrame, readContext, withAsyncResourceContext, withContext } from "./context.js";
6
+ import { cleanupReadableSubscriptions, clearDerivedDependencySubscriptions, finalizeReadableSubscriptions, finalizeReadableSubscriptionsFromSnapshot, markReactivePropsDirtySource, markReadableDerivedSubscribersDirty, markReadableUsage, notifyReadableReaders, recordReadableRead, shouldCoalesceFineGrainedItemReads, syncDerivedDependencySubscriptions, withDerivedReadTracking, withFineGrainedReadTracking } from "./readable.js";
7
+ import { getDevNamespace, getDevValue, incDevCounter, setDevValue } from "./dev-namespace.js";
8
+ import { claimHookIndex, enterDomCommitScope, getCurrentComponentInstance, getCurrentInstance, getCurrentPortalScope, getCurrentStateIndex, getSignal, restoreDomCommitScope, setCurrentComponentInstance } from "./component-scope.js";
9
+ import { cleanupComponent, registerOwnedChildScope, unregisterOwnedChildScope } from "./component-cleanup.js";
10
+ import { classifyUpdate, commitReorderOnly, enterBulkCommit, exitBulkCommit, isBulkCommitActive, markFastPathApplied, tryRuntimeFastLaneSync } from "./fastlane.js";
11
+ import { beginLifecycleCommitBatch, discardLifecycleCommitBatch, drainLifecycleCommitErrors, flushLifecycleCommitBatch, getCurrentLifecycleCommitBatch, registerLifecycleRollback, registerLifecycleTransaction } from "./lifecycle-batch.js";
12
+ import "./component-lifecycle.js";
13
+ import { captureInlineRenderSnapshot, createComponentInstance, mountComponent, mountInstanceInline, registerCommitOperation, renderComponentInline, renderScopedComponent, warnUnusedStateReads } from "./component-internal.js";
14
+ import "./component.js";
15
+ import { captureChildScopeTransactionSnapshot, createChildScope, disposeChildScope, rerenderChildScope, restoreChildScopeTransactionSnapshot } from "./child-scope.js";
16
+ import { clearCaseDomUpdateState, clearShowDomUpdateState, createCaseState, createShowState, evaluateCaseState, evaluateShowState } from "./control.js";
17
+ import { derive } from "./derive.js";
18
+ import { createFineGrainedEffect, createOwnedFineGrainedEffect, markFineGrainedEffectsDirtySource } from "./effect.js";
19
+ import { createBoundaryReset, reportBoundaryError } from "./error-boundary.js";
20
+ import { addDelegatedListener, addFreshDelegatedListener, clearDelegatedHandlersForElement, getDelegatedHandlerForElement, getDelegatedHandlersForElement, isDelegatedEvent, isEventDelegationEnabled, removeDelegatedListener, updateDelegatedListener } from "./events.js";
21
+ import { assertExecutionModel, getExecutionModel } from "./execution-model.js";
22
+ import { isBenchMetricScopeActive, recordBenchCounter, recordBenchEvent, recordBenchTiming, withBenchMetricScope } from "./for-bench.js";
23
+ import { captureForFallbackTransactionSnapshot, captureForItemTransactionSnapshot } from "./for-scopes.js";
24
+ import { reconcileForItems } from "./for-reconcile.js";
25
+ import { beginForStateTransaction, clearForDomUpdateState, commitForStateTransaction, createForState, evaluateForState, registerForStateTransaction, rollbackForStateTransaction, useForState } from "./for-internal.js";
26
+ import "./for.js";
27
+ import { state } from "./state.js";
28
+ import { resource } from "./resource-operation.js";
29
+ import { capture, documentVisible, on, routeActive, stream, task, timer, windowFocused } from "./lifecycle-operations.js";
30
+ import "./operations.js";
31
+ import { DefaultPortal, Portal, clearDefaultPortalForInstance, definePortal, disposeDefaultPortalScope } from "./portal.js";
32
+ import { selector } from "./selector.js";
33
+ export { AskrRuntime, CONTEXT_FRAME_SYMBOL, DefaultPortal, Portal, addDelegatedListener, addFreshDelegatedListener, addPerfDuration, assertExecutionModel, beginForStateTransaction, beginLifecycleCommitBatch, callWithContext, capture, captureChildScopeTransactionSnapshot, captureForFallbackTransactionSnapshot, captureForItemTransactionSnapshot, captureInlineRenderSnapshot, claimHookIndex, classifyUpdate, cleanupComponent, cleanupReadableSubscriptions, clearCaseDomUpdateState, clearDefaultPortalForInstance, clearDelegatedHandlersForElement, clearDerivedDependencySubscriptions, clearForDomUpdateState, clearShowDomUpdateState, commitForStateTransaction, commitReorderOnly, configureRuntimeRenderer, createBoundaryReset, createCaseState, createChildScope, createComponentInstance, createFineGrainedEffect, createForState, createOwnedFineGrainedEffect, createRuntime, createShowState, defaultRuntime, defineContext, definePortal, derive, discardLifecycleCommitBatch, disposeChildScope, disposeDefaultPortalScope, documentVisible, drainLifecycleCommitErrors, enqueueRuntimeLane, enqueueRuntimeTask, enterBulkCommit, enterDomCommitScope, evaluateCaseState, evaluateForState, evaluateShowState, exitBulkCommit, finalizeReadableSubscriptions, finalizeReadableSubscriptionsFromSnapshot, flushLifecycleCommitBatch, flushRuntimeScheduler, getCurrentComponentInstance, getCurrentContextFrame, getCurrentInstance, getCurrentLifecycleCommitBatch, getCurrentPortalScope, getCurrentStateIndex, getDefaultRuntime, getDefaultRuntimeInstance, getDelegatedHandlerForElement, getDelegatedHandlersForElement, getDevNamespace, getDevValue, getExecutionContextFrame, getExecutionModel, getPerfMetricsStore, getRuntimeFlushVersion, getRuntimeRenderer, getRuntimeScheduler, getRuntimeSchedulerState, getSignal, getVNodeContextFrame, incDevCounter, incrementPerfMetric, isBenchMetricScopeActive, isBulkCommitActive, isDelegatedEvent, isEventDelegationEnabled, isRuntimeSchedulerExecuting, markFastPathApplied, markFineGrainedEffectsDirtySource, markReactivePropsDirtySource, markReadableDerivedSubscribersDirty, markReadableUsage, markRuntimeReactivePropsDirtySource, markVNodeTreeWithContextFrame, markVNodeWithContextFrame, mountComponent, mountInstanceInline, notifyReadableReaders, on, readContext, reconcileForItems, recordBenchCounter, recordBenchEvent, recordBenchTiming, recordReadableRead, recordSchedulerFlushTaskCount, registerCommitOperation, registerForStateTransaction, registerLifecycleRollback, registerLifecycleTransaction, registerOwnedChildScope, removeDelegatedListener, renderComponentInline, renderScopedComponent, reportBoundaryError, rerenderChildScope, resource, restoreChildScopeTransactionSnapshot, restoreDomCommitScope, rollbackForStateTransaction, routeActive, runRuntimeHandlerScope, runRuntimeWithSyncProgress, scheduleEventHandler, selector, setCurrentComponentInstance, setDevValue, setRuntimeBulkCommitProbe, shouldCoalesceFineGrainedItemReads, state, stream, syncDerivedDependencySubscriptions, task, timer, tryRuntimeFastLaneSync, unregisterOwnedChildScope, updateDelegatedListener, useForState, warnUnusedStateReads, windowFocused, withAsyncResourceContext, withBenchMetricScope, withContext, withDerivedReadTracking, withFineGrainedReadTracking };
@@ -0,0 +1,59 @@
1
+ import { Props } from "../common/props.js";
2
+ import { ContextFrame } from "./context.js";
3
+ import { ComponentInstance } from "./component-internal.js";
4
+ import { ReadableSource } from "./readable.js";
5
+
6
+ //#region src/runtime/lifecycle-batch.d.ts
7
+ type LifecycleOperation = () => void | (() => void) | PromiseLike<void | (() => void)>;
8
+ type LifecycleCommitBatchEntry = {
9
+ instance: ComponentInstance;
10
+ wasFirstMount: boolean;
11
+ };
12
+ type ReadSubscriptionCommit = {
13
+ instance: ComponentInstance;
14
+ token: number;
15
+ pendingReadSources: Set<ReadableSource<unknown>> | undefined;
16
+ pendingReadSourceVersions: Map<ReadableSource<unknown>, number> | undefined;
17
+ };
18
+ type InlineRenderSnapshot = {
19
+ instance: ComponentInstance;
20
+ props: Props;
21
+ ownerFrame: ContextFrame | null;
22
+ portalScope: object | null;
23
+ parentInstance: ComponentInstance | null;
24
+ isRoot: boolean | undefined;
25
+ };
26
+ type LifecycleTransaction = {
27
+ key: object;
28
+ commit(): void;
29
+ rollback(): void;
30
+ merge?(parentTransaction: LifecycleTransaction): void;
31
+ };
32
+ type LifecycleRollback = () => void;
33
+ type LifecycleTransactionEntry = LifecycleTransaction | LifecycleRollback;
34
+ type LifecycleCommitBatch = {
35
+ parent: LifecycleCommitBatch | null;
36
+ entries: LifecycleCommitBatchEntry[];
37
+ entriesByInstance: Map<ComponentInstance, LifecycleCommitBatchEntry>;
38
+ readCommits: ReadSubscriptionCommit[];
39
+ readCommitsByInstance: Map<ComponentInstance, ReadSubscriptionCommit>;
40
+ renderSnapshots: InlineRenderSnapshot[];
41
+ renderSnapshotsByInstance: Map<ComponentInstance, InlineRenderSnapshot>;
42
+ transactions: LifecycleTransactionEntry[];
43
+ transactionsByKey: Map<object, LifecycleTransaction>;
44
+ retainedElementSnapshots: Map<Element, unknown>;
45
+ active: boolean;
46
+ };
47
+ /** @internal Drain commit-time cleanup errors for transaction owners such as the router. */
48
+ declare function drainLifecycleCommitErrors(): unknown[];
49
+ declare function beginLifecycleCommitBatch(): LifecycleCommitBatch;
50
+ declare function getCurrentLifecycleCommitBatch(): LifecycleCommitBatch | null;
51
+ declare function registerLifecycleTransaction(key: object, commit: () => void, rollback: () => void, merge?: (parentTransaction: LifecycleTransaction) => void): boolean;
52
+ declare function registerLifecycleRollback(rollback: LifecycleRollback): boolean;
53
+ declare function enqueueLifecycleCommitForInstance(instance: ComponentInstance, wasFirstMount: boolean): boolean;
54
+ declare function captureInlineRenderSnapshot(instance: ComponentInstance): void;
55
+ declare function finalizeInlineReadSubscriptions(instance: ComponentInstance, token: number, pendingReadSources: Set<ReadableSource<unknown>> | undefined, pendingReadSourceVersions: Map<ReadableSource<unknown>, number> | undefined): void;
56
+ declare function flushLifecycleCommitBatch(batch: LifecycleCommitBatch): void;
57
+ declare function discardLifecycleCommitBatch(batch: LifecycleCommitBatch): void;
58
+ //#endregion
59
+ export { LifecycleCommitBatch, LifecycleOperation, LifecycleTransaction };
@@ -0,0 +1,178 @@
1
+ import { logger } from "../common/logger.js";
2
+ import { finalizeReadableSubscriptionsFromSnapshot } from "./readable.js";
3
+ import { discardCommitOperations, executeCommittedLifecycleOperations } from "./lifecycle-operation-settlement.js";
4
+ //#region src/runtime/lifecycle-batch.ts
5
+ let currentLifecycleCommitBatch = null;
6
+ const pendingLifecycleCommitErrors = [];
7
+ /** @internal Drain commit-time cleanup errors for transaction owners such as the router. */
8
+ function drainLifecycleCommitErrors() {
9
+ if (pendingLifecycleCommitErrors.length === 0) return [];
10
+ return pendingLifecycleCommitErrors.splice(0);
11
+ }
12
+ function beginLifecycleCommitBatch() {
13
+ const batch = {
14
+ parent: currentLifecycleCommitBatch,
15
+ entries: [],
16
+ entriesByInstance: /* @__PURE__ */ new Map(),
17
+ readCommits: [],
18
+ readCommitsByInstance: /* @__PURE__ */ new Map(),
19
+ renderSnapshots: [],
20
+ renderSnapshotsByInstance: /* @__PURE__ */ new Map(),
21
+ transactions: [],
22
+ transactionsByKey: /* @__PURE__ */ new Map(),
23
+ retainedElementSnapshots: /* @__PURE__ */ new Map(),
24
+ active: true
25
+ };
26
+ currentLifecycleCommitBatch = batch;
27
+ return batch;
28
+ }
29
+ function getCurrentLifecycleCommitBatch() {
30
+ return currentLifecycleCommitBatch?.active ? currentLifecycleCommitBatch : null;
31
+ }
32
+ function enqueueLifecycleTransaction(batch, transaction) {
33
+ if (batch.transactionsByKey.has(transaction.key)) return;
34
+ batch.transactionsByKey.set(transaction.key, transaction);
35
+ batch.transactions.push(transaction);
36
+ }
37
+ function registerLifecycleTransaction(key, commit, rollback, merge) {
38
+ if (!currentLifecycleCommitBatch?.active) return false;
39
+ enqueueLifecycleTransaction(currentLifecycleCommitBatch, {
40
+ key,
41
+ commit,
42
+ rollback,
43
+ merge
44
+ });
45
+ return true;
46
+ }
47
+ function registerLifecycleRollback(rollback) {
48
+ if (!currentLifecycleCommitBatch?.active) return false;
49
+ currentLifecycleCommitBatch.transactions.push(rollback);
50
+ return true;
51
+ }
52
+ function closeLifecycleCommitBatch(batch) {
53
+ if (!batch.active) return false;
54
+ batch.active = false;
55
+ currentLifecycleCommitBatch = batch.parent;
56
+ return true;
57
+ }
58
+ function enqueueLifecycleCommit(batch, instance, wasFirstMount) {
59
+ const existing = batch.entriesByInstance.get(instance);
60
+ if (existing) {
61
+ existing.wasFirstMount = existing.wasFirstMount || wasFirstMount;
62
+ return;
63
+ }
64
+ const entry = {
65
+ instance,
66
+ wasFirstMount
67
+ };
68
+ batch.entriesByInstance.set(instance, entry);
69
+ batch.entries.push(entry);
70
+ }
71
+ function enqueueLifecycleCommitForInstance(instance, wasFirstMount) {
72
+ if (!currentLifecycleCommitBatch?.active) return false;
73
+ enqueueLifecycleCommit(currentLifecycleCommitBatch, instance, wasFirstMount);
74
+ return true;
75
+ }
76
+ function enqueueReadSubscriptionCommit(batch, instance, token, pendingReadSources, pendingReadSourceVersions) {
77
+ const existing = batch.readCommitsByInstance.get(instance);
78
+ const commit = existing ?? {
79
+ instance,
80
+ token,
81
+ pendingReadSources,
82
+ pendingReadSourceVersions
83
+ };
84
+ commit.token = token;
85
+ commit.pendingReadSources = pendingReadSources ? new Set(pendingReadSources) : void 0;
86
+ commit.pendingReadSourceVersions = pendingReadSourceVersions ? new Map(pendingReadSourceVersions) : void 0;
87
+ if (!existing) {
88
+ batch.readCommitsByInstance.set(instance, commit);
89
+ batch.readCommits.push(commit);
90
+ }
91
+ }
92
+ function enqueueInlineRenderSnapshot(batch, snapshot) {
93
+ if (batch.renderSnapshotsByInstance.has(snapshot.instance)) return;
94
+ batch.renderSnapshotsByInstance.set(snapshot.instance, snapshot);
95
+ batch.renderSnapshots.push(snapshot);
96
+ }
97
+ function captureInlineRenderSnapshot(instance) {
98
+ if (!currentLifecycleCommitBatch?.active) return;
99
+ enqueueInlineRenderSnapshot(currentLifecycleCommitBatch, {
100
+ instance,
101
+ props: instance.props,
102
+ ownerFrame: instance.ownerFrame,
103
+ portalScope: instance.portalScope,
104
+ parentInstance: instance.parentInstance,
105
+ isRoot: instance.isRoot
106
+ });
107
+ }
108
+ function finalizeInlineReadSubscriptions(instance, token, pendingReadSources, pendingReadSourceVersions) {
109
+ if ((!pendingReadSources || pendingReadSources.size === 0) && (!instance._lastReadSources || instance._lastReadSources.size === 0)) return;
110
+ if (currentLifecycleCommitBatch?.active) {
111
+ enqueueReadSubscriptionCommit(currentLifecycleCommitBatch, instance, token, pendingReadSources, pendingReadSourceVersions);
112
+ return;
113
+ }
114
+ finalizeReadableSubscriptionsFromSnapshot(instance, token, pendingReadSources, pendingReadSourceVersions);
115
+ }
116
+ function flushLifecycleCommitBatch(batch) {
117
+ if (!closeLifecycleCommitBatch(batch)) return;
118
+ if (batch.parent?.active) {
119
+ for (const [element, snapshot] of batch.retainedElementSnapshots) if (!batch.parent.retainedElementSnapshots.has(element)) batch.parent.retainedElementSnapshots.set(element, snapshot);
120
+ for (const entry of batch.transactions) if (typeof entry === "function") batch.parent.transactions.push(entry);
121
+ else {
122
+ const existing = batch.parent.transactionsByKey.get(entry.key);
123
+ if (existing && entry.merge) entry.merge(existing);
124
+ else enqueueLifecycleTransaction(batch.parent, entry);
125
+ }
126
+ for (const snapshot of batch.renderSnapshots) enqueueInlineRenderSnapshot(batch.parent, snapshot);
127
+ for (const commit of batch.readCommits) enqueueReadSubscriptionCommit(batch.parent, commit.instance, commit.token, commit.pendingReadSources, commit.pendingReadSourceVersions);
128
+ for (const entry of batch.entries) enqueueLifecycleCommit(batch.parent, entry.instance, entry.wasFirstMount);
129
+ return;
130
+ }
131
+ const commitErrors = [];
132
+ for (const commit of batch.readCommits) try {
133
+ finalizeReadableSubscriptionsFromSnapshot(commit.instance, commit.token, commit.pendingReadSources, commit.pendingReadSourceVersions);
134
+ } catch (error) {
135
+ commitErrors.push(error);
136
+ }
137
+ for (const transaction of batch.transactions) {
138
+ if (typeof transaction === "function") continue;
139
+ try {
140
+ transaction.commit();
141
+ } catch (error) {
142
+ commitErrors.push(error);
143
+ }
144
+ }
145
+ for (const entry of batch.entries) try {
146
+ executeCommittedLifecycleOperations(entry.instance, entry.wasFirstMount);
147
+ } catch (error) {
148
+ commitErrors.push(error);
149
+ }
150
+ if (commitErrors.length > 0) {
151
+ pendingLifecycleCommitErrors.push(...commitErrors);
152
+ logger.error("[Askr] committed lifecycle work failed:", new AggregateError(commitErrors, "Committed lifecycle work failed"));
153
+ }
154
+ }
155
+ function discardLifecycleCommitBatch(batch) {
156
+ if (!closeLifecycleCommitBatch(batch)) return;
157
+ for (let index = batch.transactions.length - 1; index >= 0; index -= 1) try {
158
+ const transaction = batch.transactions[index];
159
+ if (typeof transaction === "function") transaction();
160
+ else transaction.rollback();
161
+ } catch (error) {
162
+ logger.error("[Askr] transaction rollback failed:", error);
163
+ }
164
+ for (let index = batch.renderSnapshots.length - 1; index >= 0; index -= 1) {
165
+ const snapshot = batch.renderSnapshots[index];
166
+ snapshot.instance.props = snapshot.props;
167
+ snapshot.instance.ownerFrame = snapshot.ownerFrame;
168
+ snapshot.instance.portalScope = snapshot.portalScope;
169
+ snapshot.instance.parentInstance = snapshot.parentInstance;
170
+ snapshot.instance.isRoot = snapshot.isRoot;
171
+ }
172
+ for (const entry of batch.entries) {
173
+ if (entry.wasFirstMount) entry.instance.mountOperations = [];
174
+ discardCommitOperations(entry.instance);
175
+ }
176
+ }
177
+ //#endregion
178
+ export { beginLifecycleCommitBatch, captureInlineRenderSnapshot, discardLifecycleCommitBatch, drainLifecycleCommitErrors, enqueueLifecycleCommitForInstance, finalizeInlineReadSubscriptions, flushLifecycleCommitBatch, getCurrentLifecycleCommitBatch, registerLifecycleRollback, registerLifecycleTransaction };
@@ -0,0 +1,5 @@
1
+ import { ComponentInstance } from "./component-internal.js";
2
+
3
+ //#region src/runtime/lifecycle-operation-settlement.d.ts
4
+ declare function discardCommitOperations(instance: ComponentInstance): void;
5
+ declare function executeCommittedLifecycleOperations(instance: ComponentInstance, wasFirstMount: boolean): void;