@kayjs/kay 1.108.0 → 1.110.0

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 (595) hide show
  1. package/dist/eslint.js +2093 -3774
  2. package/editors/zed/extension.toml +2 -2
  3. package/llms/action-protection.md +1 -1
  4. package/llms/actions-from-islands.md +5 -5
  5. package/llms/actions-refused-fields.md +4 -4
  6. package/llms/api-from-islands.md +6 -6
  7. package/llms/browser-only.md +2 -2
  8. package/llms/cdn-caching.md +1 -1
  9. package/llms/checks.md +1 -1
  10. package/llms/code-lints.md +1 -2
  11. package/llms/component-library-conventions.md +1 -1
  12. package/llms/components.md +5 -5
  13. package/llms/deprecated-lints.md +2 -7
  14. package/llms/effects.md +1 -1
  15. package/llms/errors.md +2 -2
  16. package/llms/events.md +1 -1
  17. package/llms/guards.md +1 -1
  18. package/llms/head.md +1 -1
  19. package/llms/hooks.md +2 -2
  20. package/llms/images.md +1 -1
  21. package/llms/island-and-form-lints.md +4 -2
  22. package/llms/island-sources.md +1 -1
  23. package/llms/islands-state-to-ids.md +2 -2
  24. package/llms/islands.md +8 -4
  25. package/llms/lints.md +1 -1
  26. package/llms/live-values.md +4 -4
  27. package/llms/local-collections.md +1 -1
  28. package/llms/locales.md +1 -1
  29. package/llms/mcp.md +2 -2
  30. package/llms/metrics.md +1 -1
  31. package/llms/navigation-from-code.md +7 -7
  32. package/llms/navigation.md +4 -2
  33. package/llms/prerendering.md +1 -0
  34. package/llms/production.md +2 -2
  35. package/llms/project-new-and-add.md +1 -1
  36. package/llms/project.md +4 -4
  37. package/llms/proxy-and-security.md +1 -1
  38. package/llms/queues.md +1 -1
  39. package/llms/rate-limits.md +4 -4
  40. package/llms/rendering.md +1 -1
  41. package/llms/server-islands.md +2 -2
  42. package/llms/server.md +1 -1
  43. package/llms/stores.md +1 -1
  44. package/llms/styles-and-assets.md +1 -1
  45. package/llms/templates-elements-slots-snippets.md +2 -2
  46. package/llms/testing-mount.md +49 -0
  47. package/llms/testing.md +4 -45
  48. package/llms/upgrading-1-105-config.md +13 -13
  49. package/llms/upgrading-archive.md +64 -74
  50. package/llms/upgrading.md +92 -70
  51. package/llms/whats-new.md +24 -0
  52. package/llms.txt +5 -6
  53. package/package.json +6 -10
  54. package/src/build/route-sizes.ts +2 -3
  55. package/src/build/variants.ts +132 -18
  56. package/src/check/browser-global-reads.ts +2 -2
  57. package/src/check/config-objects.ts +1 -1
  58. package/src/check/diagnose.ts +0 -22
  59. package/src/check/env-types.ts +1 -1
  60. package/src/check/export-homes.ts +1 -1
  61. package/src/check/guards.ts +3 -3
  62. package/src/check/index.ts +2 -7
  63. package/src/check/moved-keys.ts +1 -1
  64. package/src/check/project.ts +6 -7
  65. package/src/check/schema-builders.ts +125 -26
  66. package/src/check/shadow-types.ts +0 -86
  67. package/src/commands/check.ts +2 -2
  68. package/src/commands/env.ts +25 -3
  69. package/src/commands/upgrade.ts +2 -1
  70. package/src/compiler/allow-comments.ts +38 -2
  71. package/src/compiler/ast.ts +21 -19
  72. package/src/compiler/browser.ts +2 -14
  73. package/src/compiler/class-items.ts +16 -0
  74. package/src/compiler/codegen.ts +10 -10
  75. package/src/compiler/deprecated-library.ts +0 -12
  76. package/src/compiler/deprecated-lints-1-106.ts +2 -2
  77. package/src/compiler/deprecated-lints.ts +3 -495
  78. package/src/compiler/deprecated-ui-props.ts +5 -5
  79. package/src/compiler/errors.ts +2 -2
  80. package/src/compiler/fence-checks.ts +2 -121
  81. package/src/compiler/hand-parts.ts +83 -0
  82. package/src/compiler/helper-imports.ts +2 -2
  83. package/src/compiler/image-attributes.ts +1 -3
  84. package/src/compiler/index.ts +23 -23
  85. package/src/compiler/island-arguments.ts +17 -95
  86. package/src/compiler/island-cause.ts +7 -7
  87. package/src/compiler/island-declaration.ts +2 -8
  88. package/src/compiler/island-lints.ts +19 -0
  89. package/src/compiler/island-marker.ts +3 -3
  90. package/src/compiler/island-problems.ts +25 -0
  91. package/src/compiler/items.ts +12 -0
  92. package/src/compiler/jsx-class.ts +1 -25
  93. package/src/compiler/jsx.ts +7 -6
  94. package/src/compiler/kay-exports.ts +0 -2
  95. package/src/compiler/link-flags.ts +9 -38
  96. package/src/compiler/lints.ts +10 -18
  97. package/src/compiler/markup.ts +33 -41
  98. package/src/compiler/module-signals.ts +2 -2
  99. package/src/compiler/names.ts +1 -1
  100. package/src/compiler/page-settings.ts +11 -0
  101. package/src/compiler/parser.ts +6 -8
  102. package/src/compiler/plan.ts +1 -3
  103. package/src/compiler/removed-lints.ts +90 -0
  104. package/src/compiler/rewrite.ts +3 -18
  105. package/src/compiler/script-server.ts +8 -3
  106. package/src/compiler/signal-from-prop.ts +141 -0
  107. package/src/compiler/template-reads.ts +16 -0
  108. package/src/compiler/validate.ts +3 -8
  109. package/src/config-loader.ts +14 -4
  110. package/src/config-resolve.ts +18 -142
  111. package/src/config-shape.ts +44 -34
  112. package/src/config.ts +10 -114
  113. package/src/dev/preload.ts +4 -1
  114. package/src/lsp/server.ts +4 -0
  115. package/src/migrate/markup.ts +4 -1
  116. package/src/runtime/action-call.ts +0 -8
  117. package/src/runtime/action-encode.ts +26 -0
  118. package/src/runtime/action-error.ts +3 -11
  119. package/src/runtime/action-protection.ts +2 -2
  120. package/src/runtime/action-run.ts +2 -27
  121. package/src/runtime/action-shared.ts +14 -37
  122. package/src/runtime/action-stream.ts +0 -1
  123. package/src/runtime/action.ts +1 -1
  124. package/src/runtime/call-result.ts +2 -10
  125. package/src/runtime/checks.ts +25 -13
  126. package/src/runtime/client.ts +7 -11
  127. package/src/runtime/core.ts +5 -23
  128. package/src/runtime/dom.ts +1 -1
  129. package/src/runtime/html.ts +1 -1
  130. package/src/runtime/i18n.client.ts +1 -4
  131. package/src/runtime/i18n.server.ts +1 -4
  132. package/src/runtime/i18n.ts +3 -3
  133. package/src/runtime/image.ts +2 -19
  134. package/src/runtime/index.ts +3 -3
  135. package/src/runtime/island.server.ts +56 -13
  136. package/src/runtime/live-resource.server.ts +0 -1
  137. package/src/runtime/live-value.server.ts +2 -2
  138. package/src/runtime/live-value.shared.ts +7 -20
  139. package/src/runtime/live.ts +1 -12
  140. package/src/runtime/local-types.ts +1 -11
  141. package/src/runtime/local.ts +4 -14
  142. package/src/runtime/navigate-api.ts +2 -5
  143. package/src/runtime/navigate.ts +9 -0
  144. package/src/runtime/navigation-state.ts +0 -12
  145. package/src/runtime/navigation.ts +5 -1
  146. package/src/runtime/page-swap.ts +8 -8
  147. package/src/runtime/persist.ts +11 -3
  148. package/src/runtime/persisted.ts +4 -30
  149. package/src/runtime/presence.ts +6 -7
  150. package/src/runtime/query-param.ts +20 -12
  151. package/src/runtime/reactive.ts +3 -1
  152. package/src/runtime/refuse.ts +3 -17
  153. package/src/runtime/store-base.ts +4 -6
  154. package/src/runtime/swap-fetch.ts +1 -1
  155. package/src/runtime/swap-flight.ts +10 -10
  156. package/src/runtime/swap-kept.ts +69 -29
  157. package/src/runtime/swap-morph.ts +49 -9
  158. package/src/runtime/text-hash.ts +17 -0
  159. package/src/runtime/uid.server.ts +6 -4
  160. package/src/runtime/values.ts +52 -23
  161. package/src/runtime/with-query.ts +9 -0
  162. package/src/server/action-hooks.ts +8 -8
  163. package/src/server/actions.ts +13 -14
  164. package/src/server/api-modules.ts +2 -3
  165. package/src/server/app-stages.ts +15 -33
  166. package/src/server/app.ts +10 -5
  167. package/src/server/auth-mails.ts +0 -2
  168. package/src/server/env-state.ts +40 -10
  169. package/src/server/flash.ts +1 -1
  170. package/src/server/guard-requirement.ts +4 -4
  171. package/src/server/image.ts +2 -2
  172. package/src/server/index.ts +0 -2
  173. package/src/server/job-context.ts +3 -3
  174. package/src/server/jobs-page.ts +1 -1
  175. package/src/server/jobs.ts +5 -9
  176. package/src/server/kept-exports.ts +0 -2
  177. package/src/server/kv.ts +11 -14
  178. package/src/server/library.ts +1 -3
  179. package/src/server/live.ts +2 -2
  180. package/src/server/mcp.ts +3 -9
  181. package/src/server/metrics.ts +2 -4
  182. package/src/server/page-settings.ts +10 -19
  183. package/src/server/prerender.ts +19 -2
  184. package/src/server/protection.ts +15 -18
  185. package/src/server/queue.ts +3 -6
  186. package/src/server/rate-limit.ts +0 -3
  187. package/src/server/render-document.ts +9 -7
  188. package/src/server/render.ts +1 -1
  189. package/src/server/routes.ts +7 -3
  190. package/src/server/scope.ts +3 -2
  191. package/src/server/session.ts +5 -6
  192. package/src/server/setup.ts +1 -1
  193. package/src/server/signals.ts +17 -7
  194. package/src/server/signed.ts +1 -3
  195. package/src/server/source.ts +20 -4
  196. package/src/server/speculation.ts +1 -1
  197. package/src/server/storage.ts +3 -8
  198. package/src/server/validate.ts +1 -1
  199. package/src/server/vitals.ts +1 -3
  200. package/src/server/work-scope.ts +2 -4
  201. package/src/server/work.ts +1 -1
  202. package/src/server/workflow.ts +1 -1
  203. package/src/test/index.ts +2 -1
  204. package/src/test/site-actions.ts +16 -6
  205. package/src/test/site-keys.ts +10 -15
  206. package/src/test/site-socket.ts +1 -2
  207. package/src/test/site-types.ts +0 -8
  208. package/types/build/route-sizes.d.ts.map +1 -1
  209. package/types/build/variants.d.ts +9 -1
  210. package/types/build/variants.d.ts.map +1 -1
  211. package/types/check/diagnose.d.ts.map +1 -1
  212. package/types/check/index.d.ts +1 -2
  213. package/types/check/index.d.ts.map +1 -1
  214. package/types/check/project.d.ts.map +1 -1
  215. package/types/check/schema-builders.d.ts.map +1 -1
  216. package/types/check/shadow-types.d.ts.map +1 -1
  217. package/types/commands/env.d.ts.map +1 -1
  218. package/types/commands/upgrade.d.ts.map +1 -1
  219. package/types/compiler/allow-comments.d.ts +2 -0
  220. package/types/compiler/allow-comments.d.ts.map +1 -1
  221. package/types/compiler/ast.d.ts +1 -2
  222. package/types/compiler/ast.d.ts.map +1 -1
  223. package/types/compiler/browser.d.ts.map +1 -1
  224. package/types/compiler/class-items.d.ts +7 -0
  225. package/types/compiler/class-items.d.ts.map +1 -0
  226. package/types/compiler/deprecated-library.d.ts.map +1 -1
  227. package/types/compiler/deprecated-lints-1-106.d.ts +2 -2
  228. package/types/compiler/deprecated-lints-1-106.d.ts.map +1 -1
  229. package/types/compiler/deprecated-lints.d.ts +2 -553
  230. package/types/compiler/deprecated-lints.d.ts.map +1 -1
  231. package/types/compiler/deprecated-ui-props.d.ts +1 -8
  232. package/types/compiler/deprecated-ui-props.d.ts.map +1 -1
  233. package/types/compiler/errors.d.ts +2 -2
  234. package/types/compiler/errors.d.ts.map +1 -1
  235. package/types/compiler/fence-checks.d.ts +0 -1
  236. package/types/compiler/fence-checks.d.ts.map +1 -1
  237. package/types/compiler/hand-parts.d.ts +10 -0
  238. package/types/compiler/hand-parts.d.ts.map +1 -0
  239. package/types/compiler/image-attributes.d.ts +0 -1
  240. package/types/compiler/image-attributes.d.ts.map +1 -1
  241. package/types/compiler/index.d.ts.map +1 -1
  242. package/types/compiler/island-arguments.d.ts +7 -11
  243. package/types/compiler/island-arguments.d.ts.map +1 -1
  244. package/types/compiler/island-cause.d.ts +1 -1
  245. package/types/compiler/island-cause.d.ts.map +1 -1
  246. package/types/compiler/island-declaration.d.ts +1 -3
  247. package/types/compiler/island-declaration.d.ts.map +1 -1
  248. package/types/compiler/island-lints.d.ts +17 -0
  249. package/types/compiler/island-lints.d.ts.map +1 -0
  250. package/types/compiler/island-problems.d.ts +7 -0
  251. package/types/compiler/island-problems.d.ts.map +1 -0
  252. package/types/compiler/items.d.ts +1 -0
  253. package/types/compiler/items.d.ts.map +1 -1
  254. package/types/compiler/jsx-class.d.ts +1 -2
  255. package/types/compiler/jsx-class.d.ts.map +1 -1
  256. package/types/compiler/jsx.d.ts.map +1 -1
  257. package/types/compiler/kay-exports.d.ts.map +1 -1
  258. package/types/compiler/link-flags.d.ts +0 -6
  259. package/types/compiler/link-flags.d.ts.map +1 -1
  260. package/types/compiler/lints.d.ts +21 -566
  261. package/types/compiler/lints.d.ts.map +1 -1
  262. package/types/compiler/markup.d.ts +1 -1
  263. package/types/compiler/markup.d.ts.map +1 -1
  264. package/types/compiler/module-signals.d.ts.map +1 -1
  265. package/types/compiler/names.d.ts.map +1 -1
  266. package/types/compiler/page-settings.d.ts +4 -0
  267. package/types/compiler/page-settings.d.ts.map +1 -1
  268. package/types/compiler/parser.d.ts.map +1 -1
  269. package/types/compiler/plan.d.ts.map +1 -1
  270. package/types/compiler/removed-lints.d.ts +3 -0
  271. package/types/compiler/removed-lints.d.ts.map +1 -0
  272. package/types/compiler/script-server.d.ts.map +1 -1
  273. package/types/compiler/signal-from-prop.d.ts +4 -0
  274. package/types/compiler/signal-from-prop.d.ts.map +1 -0
  275. package/types/compiler/template-reads.d.ts +1 -0
  276. package/types/compiler/template-reads.d.ts.map +1 -1
  277. package/types/compiler/validate.d.ts.map +1 -1
  278. package/types/config-loader.d.ts.map +1 -1
  279. package/types/config-resolve.d.ts.map +1 -1
  280. package/types/config-shape.d.ts +1 -1
  281. package/types/config-shape.d.ts.map +1 -1
  282. package/types/config.d.ts +5 -105
  283. package/types/config.d.ts.map +1 -1
  284. package/types/dev/preload.d.ts.map +1 -1
  285. package/types/lsp/server.d.ts.map +1 -1
  286. package/types/migrate/markup.d.ts.map +1 -1
  287. package/types/runtime/action-call.d.ts.map +1 -1
  288. package/types/runtime/action-encode.d.ts +1 -0
  289. package/types/runtime/action-encode.d.ts.map +1 -1
  290. package/types/runtime/action-error.d.ts +1 -2
  291. package/types/runtime/action-error.d.ts.map +1 -1
  292. package/types/runtime/action-run.d.ts.map +1 -1
  293. package/types/runtime/action-shared.d.ts +1 -27
  294. package/types/runtime/action-shared.d.ts.map +1 -1
  295. package/types/runtime/action-stream.d.ts.map +1 -1
  296. package/types/runtime/action.d.ts +1 -1
  297. package/types/runtime/action.d.ts.map +1 -1
  298. package/types/runtime/call-result.d.ts +0 -10
  299. package/types/runtime/call-result.d.ts.map +1 -1
  300. package/types/runtime/checks.d.ts +14 -11
  301. package/types/runtime/checks.d.ts.map +1 -1
  302. package/types/runtime/client.d.ts.map +1 -1
  303. package/types/runtime/core.d.ts +2 -20
  304. package/types/runtime/core.d.ts.map +1 -1
  305. package/types/runtime/dom.d.ts +1 -1
  306. package/types/runtime/dom.d.ts.map +1 -1
  307. package/types/runtime/html.d.ts +1 -1
  308. package/types/runtime/html.d.ts.map +1 -1
  309. package/types/runtime/i18n.client.d.ts +0 -1
  310. package/types/runtime/i18n.client.d.ts.map +1 -1
  311. package/types/runtime/i18n.d.ts +1 -1
  312. package/types/runtime/i18n.d.ts.map +1 -1
  313. package/types/runtime/i18n.server.d.ts +0 -1
  314. package/types/runtime/i18n.server.d.ts.map +1 -1
  315. package/types/runtime/image.d.ts.map +1 -1
  316. package/types/runtime/index.d.ts +3 -3
  317. package/types/runtime/index.d.ts.map +1 -1
  318. package/types/runtime/island.server.d.ts +2 -0
  319. package/types/runtime/island.server.d.ts.map +1 -1
  320. package/types/runtime/live-resource.server.d.ts.map +1 -1
  321. package/types/runtime/live-value.shared.d.ts +7 -15
  322. package/types/runtime/live-value.shared.d.ts.map +1 -1
  323. package/types/runtime/live.d.ts +0 -11
  324. package/types/runtime/live.d.ts.map +1 -1
  325. package/types/runtime/local-types.d.ts +0 -14
  326. package/types/runtime/local-types.d.ts.map +1 -1
  327. package/types/runtime/navigate-api.d.ts +0 -4
  328. package/types/runtime/navigate-api.d.ts.map +1 -1
  329. package/types/runtime/navigate.d.ts.map +1 -1
  330. package/types/runtime/navigation-state.d.ts +0 -4
  331. package/types/runtime/navigation-state.d.ts.map +1 -1
  332. package/types/runtime/navigation.d.ts +2 -0
  333. package/types/runtime/navigation.d.ts.map +1 -1
  334. package/types/runtime/page-swap.d.ts.map +1 -1
  335. package/types/runtime/persist.d.ts +1 -0
  336. package/types/runtime/persist.d.ts.map +1 -1
  337. package/types/runtime/persisted.d.ts +0 -15
  338. package/types/runtime/persisted.d.ts.map +1 -1
  339. package/types/runtime/presence.d.ts +0 -2
  340. package/types/runtime/presence.d.ts.map +1 -1
  341. package/types/runtime/query-param.d.ts.map +1 -1
  342. package/types/runtime/reactive.d.ts +2 -1
  343. package/types/runtime/reactive.d.ts.map +1 -1
  344. package/types/runtime/refuse.d.ts +0 -7
  345. package/types/runtime/refuse.d.ts.map +1 -1
  346. package/types/runtime/store-base.d.ts +1 -2
  347. package/types/runtime/store-base.d.ts.map +1 -1
  348. package/types/runtime/swap-flight.d.ts +1 -1
  349. package/types/runtime/swap-flight.d.ts.map +1 -1
  350. package/types/runtime/swap-kept.d.ts.map +1 -1
  351. package/types/runtime/swap-morph.d.ts.map +1 -1
  352. package/types/runtime/text-hash.d.ts +2 -0
  353. package/types/runtime/text-hash.d.ts.map +1 -0
  354. package/types/runtime/uid.server.d.ts.map +1 -1
  355. package/types/runtime/values.d.ts +6 -1
  356. package/types/runtime/values.d.ts.map +1 -1
  357. package/types/runtime/with-query.d.ts +2 -0
  358. package/types/runtime/with-query.d.ts.map +1 -1
  359. package/types/server/action-hooks.d.ts +4 -4
  360. package/types/server/action-hooks.d.ts.map +1 -1
  361. package/types/server/actions.d.ts.map +1 -1
  362. package/types/server/api-modules.d.ts +0 -1
  363. package/types/server/api-modules.d.ts.map +1 -1
  364. package/types/server/app-stages.d.ts +5 -13
  365. package/types/server/app-stages.d.ts.map +1 -1
  366. package/types/server/app.d.ts +3 -8
  367. package/types/server/app.d.ts.map +1 -1
  368. package/types/server/auth-mails.d.ts +0 -5
  369. package/types/server/auth-mails.d.ts.map +1 -1
  370. package/types/server/env-state.d.ts +1 -0
  371. package/types/server/env-state.d.ts.map +1 -1
  372. package/types/server/guard-requirement.d.ts +0 -1
  373. package/types/server/guard-requirement.d.ts.map +1 -1
  374. package/types/server/image.d.ts +0 -1
  375. package/types/server/image.d.ts.map +1 -1
  376. package/types/server/index.d.ts +0 -2
  377. package/types/server/index.d.ts.map +1 -1
  378. package/types/server/job-context.d.ts +1 -1
  379. package/types/server/job-context.d.ts.map +1 -1
  380. package/types/server/jobs.d.ts +0 -4
  381. package/types/server/jobs.d.ts.map +1 -1
  382. package/types/server/kept-exports.d.ts.map +1 -1
  383. package/types/server/kv.d.ts +4 -4
  384. package/types/server/kv.d.ts.map +1 -1
  385. package/types/server/library.d.ts +1 -3
  386. package/types/server/library.d.ts.map +1 -1
  387. package/types/server/mcp.d.ts +0 -1
  388. package/types/server/mcp.d.ts.map +1 -1
  389. package/types/server/metrics.d.ts +0 -5
  390. package/types/server/metrics.d.ts.map +1 -1
  391. package/types/server/page-settings.d.ts +3 -3
  392. package/types/server/page-settings.d.ts.map +1 -1
  393. package/types/server/prerender.d.ts.map +1 -1
  394. package/types/server/protection.d.ts +6 -6
  395. package/types/server/protection.d.ts.map +1 -1
  396. package/types/server/queue.d.ts +1 -3
  397. package/types/server/queue.d.ts.map +1 -1
  398. package/types/server/rate-limit.d.ts +0 -2
  399. package/types/server/rate-limit.d.ts.map +1 -1
  400. package/types/server/render-document.d.ts +1 -1
  401. package/types/server/render-document.d.ts.map +1 -1
  402. package/types/server/routes.d.ts +1 -1
  403. package/types/server/routes.d.ts.map +1 -1
  404. package/types/server/scope.d.ts.map +1 -1
  405. package/types/server/session.d.ts +1 -1
  406. package/types/server/session.d.ts.map +1 -1
  407. package/types/server/signals.d.ts.map +1 -1
  408. package/types/server/signed.d.ts +0 -2
  409. package/types/server/signed.d.ts.map +1 -1
  410. package/types/server/source.d.ts +1 -1
  411. package/types/server/source.d.ts.map +1 -1
  412. package/types/server/storage.d.ts +0 -4
  413. package/types/server/storage.d.ts.map +1 -1
  414. package/types/server/vitals.d.ts +0 -1
  415. package/types/server/vitals.d.ts.map +1 -1
  416. package/types/server/work-scope.d.ts +0 -2
  417. package/types/server/work-scope.d.ts.map +1 -1
  418. package/types/server/workflow.d.ts +1 -1
  419. package/types/server/workflow.d.ts.map +1 -1
  420. package/types/test/index.d.ts.map +1 -1
  421. package/types/test/site-actions.d.ts +1 -1
  422. package/types/test/site-actions.d.ts.map +1 -1
  423. package/types/test/site-keys.d.ts +1 -1
  424. package/types/test/site-keys.d.ts.map +1 -1
  425. package/types/test/site-socket.d.ts +1 -1
  426. package/types/test/site-socket.d.ts.map +1 -1
  427. package/types/test/site-types.d.ts +0 -8
  428. package/types/test/site-types.d.ts.map +1 -1
  429. package/llms/deprecated-lints-1-105-libraries.md +0 -32
  430. package/llms/deprecated-lints-1-105.md +0 -58
  431. package/src/check/action-readers.ts +0 -115
  432. package/src/check/action-type.ts +0 -44
  433. package/src/check/ai-language.ts +0 -56
  434. package/src/check/app-hooks.ts +0 -90
  435. package/src/check/auth-methods.ts +0 -85
  436. package/src/check/auth-rate-limits.ts +0 -99
  437. package/src/check/call-result.ts +0 -242
  438. package/src/check/client-keys.ts +0 -10
  439. package/src/check/cms-options.ts +0 -81
  440. package/src/check/config-groups.ts +0 -22
  441. package/src/check/config-switches.ts +0 -38
  442. package/src/check/context-import.ts +0 -51
  443. package/src/check/env-files.ts +0 -31
  444. package/src/check/format-duration.ts +0 -75
  445. package/src/check/guard-options.ts +0 -58
  446. package/src/check/handler-events.ts +0 -149
  447. package/src/check/hook-context.ts +0 -94
  448. package/src/check/hook-names.ts +0 -104
  449. package/src/check/i18n-keys.ts +0 -50
  450. package/src/check/images-keys.ts +0 -54
  451. package/src/check/job-shapes.ts +0 -273
  452. package/src/check/link-flag-tests.ts +0 -130
  453. package/src/check/live-api.ts +0 -137
  454. package/src/check/mail-api.ts +0 -67
  455. package/src/check/one-state-api.ts +0 -357
  456. package/src/check/pages-options.ts +0 -35
  457. package/src/check/rate-enforce.ts +0 -53
  458. package/src/check/refusal-calls.ts +0 -185
  459. package/src/check/retired-lints.ts +0 -49
  460. package/src/check/route-keys.ts +0 -166
  461. package/src/check/secret-keys.ts +0 -83
  462. package/src/check/socket-frames.ts +0 -102
  463. package/src/check/source-readers.ts +0 -257
  464. package/src/check/store-ms.ts +0 -72
  465. package/src/check/store-names.ts +0 -88
  466. package/src/check/test-helpers.ts +0 -98
  467. package/src/check/ttl-names.ts +0 -142
  468. package/src/compiler/deprecated-ai-labels.ts +0 -97
  469. package/src/compiler/deprecated-ai-links.ts +0 -63
  470. package/src/compiler/deprecated-allow.ts +0 -50
  471. package/src/compiler/deprecated-auth-lints.ts +0 -14
  472. package/src/compiler/deprecated-auth-signed.ts +0 -29
  473. package/src/compiler/deprecated-children.ts +0 -66
  474. package/src/compiler/deprecated-image.ts +0 -116
  475. package/src/compiler/deprecated-island.ts +0 -155
  476. package/src/compiler/deprecated-lints-1-105.ts +0 -41
  477. package/src/compiler/deprecated-page.ts +0 -125
  478. package/src/compiler/deprecated-parts.ts +0 -22
  479. package/src/compiler/deprecated-typed-lints.ts +0 -23
  480. package/src/compiler/deprecated-ui-callbacks.ts +0 -66
  481. package/src/compiler/deprecated-ui-input.ts +0 -97
  482. package/src/compiler/deprecated-ui-items.ts +0 -47
  483. package/src/compiler/old-parts.ts +0 -84
  484. package/src/runtime/mount.compat.ts +0 -8
  485. package/src/server/moved-exports.ts +0 -17
  486. package/types/check/action-readers.d.ts +0 -3
  487. package/types/check/action-readers.d.ts.map +0 -1
  488. package/types/check/action-type.d.ts +0 -3
  489. package/types/check/action-type.d.ts.map +0 -1
  490. package/types/check/ai-language.d.ts +0 -3
  491. package/types/check/ai-language.d.ts.map +0 -1
  492. package/types/check/app-hooks.d.ts +0 -3
  493. package/types/check/app-hooks.d.ts.map +0 -1
  494. package/types/check/auth-methods.d.ts +0 -3
  495. package/types/check/auth-methods.d.ts.map +0 -1
  496. package/types/check/auth-rate-limits.d.ts +0 -3
  497. package/types/check/auth-rate-limits.d.ts.map +0 -1
  498. package/types/check/call-result.d.ts +0 -7
  499. package/types/check/call-result.d.ts.map +0 -1
  500. package/types/check/client-keys.d.ts +0 -3
  501. package/types/check/client-keys.d.ts.map +0 -1
  502. package/types/check/cms-options.d.ts +0 -3
  503. package/types/check/cms-options.d.ts.map +0 -1
  504. package/types/check/config-groups.d.ts +0 -3
  505. package/types/check/config-groups.d.ts.map +0 -1
  506. package/types/check/config-switches.d.ts +0 -3
  507. package/types/check/config-switches.d.ts.map +0 -1
  508. package/types/check/context-import.d.ts +0 -3
  509. package/types/check/context-import.d.ts.map +0 -1
  510. package/types/check/env-files.d.ts +0 -3
  511. package/types/check/env-files.d.ts.map +0 -1
  512. package/types/check/format-duration.d.ts +0 -5
  513. package/types/check/format-duration.d.ts.map +0 -1
  514. package/types/check/guard-options.d.ts +0 -3
  515. package/types/check/guard-options.d.ts.map +0 -1
  516. package/types/check/handler-events.d.ts +0 -9
  517. package/types/check/handler-events.d.ts.map +0 -1
  518. package/types/check/hook-context.d.ts +0 -3
  519. package/types/check/hook-context.d.ts.map +0 -1
  520. package/types/check/hook-names.d.ts +0 -3
  521. package/types/check/hook-names.d.ts.map +0 -1
  522. package/types/check/i18n-keys.d.ts +0 -3
  523. package/types/check/i18n-keys.d.ts.map +0 -1
  524. package/types/check/images-keys.d.ts +0 -3
  525. package/types/check/images-keys.d.ts.map +0 -1
  526. package/types/check/job-shapes.d.ts +0 -6
  527. package/types/check/job-shapes.d.ts.map +0 -1
  528. package/types/check/link-flag-tests.d.ts +0 -4
  529. package/types/check/link-flag-tests.d.ts.map +0 -1
  530. package/types/check/live-api.d.ts +0 -3
  531. package/types/check/live-api.d.ts.map +0 -1
  532. package/types/check/mail-api.d.ts +0 -3
  533. package/types/check/mail-api.d.ts.map +0 -1
  534. package/types/check/one-state-api.d.ts +0 -9
  535. package/types/check/one-state-api.d.ts.map +0 -1
  536. package/types/check/pages-options.d.ts +0 -3
  537. package/types/check/pages-options.d.ts.map +0 -1
  538. package/types/check/rate-enforce.d.ts +0 -3
  539. package/types/check/rate-enforce.d.ts.map +0 -1
  540. package/types/check/refusal-calls.d.ts +0 -3
  541. package/types/check/refusal-calls.d.ts.map +0 -1
  542. package/types/check/retired-lints.d.ts +0 -3
  543. package/types/check/retired-lints.d.ts.map +0 -1
  544. package/types/check/route-keys.d.ts +0 -3
  545. package/types/check/route-keys.d.ts.map +0 -1
  546. package/types/check/secret-keys.d.ts +0 -3
  547. package/types/check/secret-keys.d.ts.map +0 -1
  548. package/types/check/socket-frames.d.ts +0 -3
  549. package/types/check/socket-frames.d.ts.map +0 -1
  550. package/types/check/source-readers.d.ts +0 -3
  551. package/types/check/source-readers.d.ts.map +0 -1
  552. package/types/check/store-ms.d.ts +0 -3
  553. package/types/check/store-ms.d.ts.map +0 -1
  554. package/types/check/store-names.d.ts +0 -3
  555. package/types/check/store-names.d.ts.map +0 -1
  556. package/types/check/test-helpers.d.ts +0 -3
  557. package/types/check/test-helpers.d.ts.map +0 -1
  558. package/types/check/ttl-names.d.ts +0 -3
  559. package/types/check/ttl-names.d.ts.map +0 -1
  560. package/types/compiler/deprecated-ai-labels.d.ts +0 -5
  561. package/types/compiler/deprecated-ai-labels.d.ts.map +0 -1
  562. package/types/compiler/deprecated-ai-links.d.ts +0 -5
  563. package/types/compiler/deprecated-ai-links.d.ts.map +0 -1
  564. package/types/compiler/deprecated-allow.d.ts +0 -5
  565. package/types/compiler/deprecated-allow.d.ts.map +0 -1
  566. package/types/compiler/deprecated-auth-lints.d.ts +0 -12
  567. package/types/compiler/deprecated-auth-lints.d.ts.map +0 -1
  568. package/types/compiler/deprecated-auth-signed.d.ts +0 -5
  569. package/types/compiler/deprecated-auth-signed.d.ts.map +0 -1
  570. package/types/compiler/deprecated-children.d.ts +0 -4
  571. package/types/compiler/deprecated-children.d.ts.map +0 -1
  572. package/types/compiler/deprecated-image.d.ts +0 -5
  573. package/types/compiler/deprecated-image.d.ts.map +0 -1
  574. package/types/compiler/deprecated-island.d.ts +0 -9
  575. package/types/compiler/deprecated-island.d.ts.map +0 -1
  576. package/types/compiler/deprecated-lints-1-105.d.ts +0 -39
  577. package/types/compiler/deprecated-lints-1-105.d.ts.map +0 -1
  578. package/types/compiler/deprecated-page.d.ts +0 -4
  579. package/types/compiler/deprecated-page.d.ts.map +0 -1
  580. package/types/compiler/deprecated-parts.d.ts +0 -3
  581. package/types/compiler/deprecated-parts.d.ts.map +0 -1
  582. package/types/compiler/deprecated-typed-lints.d.ts +0 -21
  583. package/types/compiler/deprecated-typed-lints.d.ts.map +0 -1
  584. package/types/compiler/deprecated-ui-callbacks.d.ts +0 -5
  585. package/types/compiler/deprecated-ui-callbacks.d.ts.map +0 -1
  586. package/types/compiler/deprecated-ui-input.d.ts +0 -5
  587. package/types/compiler/deprecated-ui-input.d.ts.map +0 -1
  588. package/types/compiler/deprecated-ui-items.d.ts +0 -5
  589. package/types/compiler/deprecated-ui-items.d.ts.map +0 -1
  590. package/types/compiler/old-parts.d.ts +0 -9
  591. package/types/compiler/old-parts.d.ts.map +0 -1
  592. package/types/runtime/mount.compat.d.ts +0 -7
  593. package/types/runtime/mount.compat.d.ts.map +0 -1
  594. package/types/server/moved-exports.d.ts +0 -12
  595. package/types/server/moved-exports.d.ts.map +0 -1
@@ -235,7 +235,7 @@ function inert<Row, Key extends keyof Row>(): Local<Row, Key> {
235
235
 
236
236
  const stop = () => () => undefined
237
237
 
238
- return { data: () => [], rows: () => [], get: () => undefined, put: refuse, remove: refuse, unsynced: () => 0, syncStatus: () => 'loading', error: () => undefined, retry: () => undefined, onData: stop, onSync: stop, onIssue: stop, onError: stop, pending: () => true, status: () => 'loading', issues: () => [], dismiss: nothing, sync: Object.assign(nothing, { status: () => 'loading' as const, queued: () => 0 }), clear: nothing }
238
+ return { data: () => [], get: () => undefined, put: refuse, remove: refuse, error: () => undefined, retry: () => undefined, onData: stop, onIssue: stop, onError: stop, pending: () => true, status: () => 'loading', issues: () => [], dismiss: nothing, sync: Object.assign(nothing, { status: () => 'loading' as const, queued: () => 0 }), clear: nothing }
239
239
  }
240
240
 
241
241
  // A collection the island reads and writes at once, kept in IndexedDB so it works offline: a write is applied in the browser and queued, then replayed through the collection's action, once, when the server can be reached.
@@ -252,8 +252,7 @@ class Collection<Row extends object, Key extends keyof Row & string> {
252
252
  private readonly problems = createSignal<LocalIssue<Row>[]>([])
253
253
  private readonly state = createSignal<LocalSyncStatus>('loading')
254
254
  private readonly failure = createSignal<ApiError | undefined>(undefined)
255
- // Tells `value` to `onData` and the same rows as `rows` to the deprecated `onSync`.
256
- private readonly synced = listenerSet<{ value: readonly Row[], rows: readonly Row[] }>()
255
+ private readonly synced = listenerSet<{ value: readonly Row[] }>()
257
256
  private readonly raised = listenerSet<{ issue: LocalIssue<Row> }>()
258
257
  private readonly failed = listenerSet<{ error: ApiError }>()
259
258
  // The issues already told, by id; undefined until the first read, which tells none of those kept from an earlier visit.
@@ -281,9 +280,6 @@ class Collection<Row extends object, Key extends keyof Row & string> {
281
280
  if (options.onData)
282
281
  this.synced.on(options.onData)
283
282
 
284
- if (options.onSync)
285
- this.synced.on(options.onSync)
286
-
287
283
  if (options.onIssue)
288
284
  this.raised.on(options.onIssue)
289
285
 
@@ -307,16 +303,12 @@ class Collection<Row extends object, Key extends keyof Row & string> {
307
303
  api(): Local<Row, Key> {
308
304
  return {
309
305
  data: () => this.view[0]().list,
310
- rows: () => this.view[0]().list,
311
306
  get: key => this.view[0]().byKey.get(String(key)),
312
307
  put: async row => this.write('put', row),
313
308
  remove: async key => this.write('remove', { [this.options.key]: key } as Row),
314
- unsynced: this.count[0],
315
- syncStatus: this.state[0],
316
309
  error: this.failure[0],
317
310
  retry: () => this.again(),
318
311
  onData: this.synced.on,
319
- onSync: this.synced.on,
320
312
  onIssue: this.raised.on,
321
313
  onError: this.failed.on,
322
314
  pending: () => this.state[0]() === 'loading',
@@ -535,7 +527,7 @@ class Collection<Row extends object, Key extends keyof Row & string> {
535
527
  clearTimeout(this.timer)
536
528
  this.paused = false
537
529
 
538
- // Whether this run sent a write or took the server's rows in, so `onSync` has something to tell.
530
+ // Whether this run sent a write or took the server's rows in, so `onData` has something to tell.
539
531
  let moved = false
540
532
 
541
533
  await quiet(async () => locked(async () => {
@@ -552,9 +544,7 @@ class Collection<Row extends object, Key extends keyof Row & string> {
552
544
  this.schedule()
553
545
 
554
546
  if (moved && !this.ended && this.state[0]() === 'synced') {
555
- const rows = this.view[0]().list
556
-
557
- this.synced.emit({ value: rows, rows })
547
+ this.synced.emit({ value: this.view[0]().list })
558
548
  }
559
549
  }
560
550
 
@@ -40,15 +40,12 @@ export function mergeQuery(params: URLSearchParams, changes: QueryChanges): void
40
40
  // Both resolve to `false` when a leave guard was declined, so the page stayed, and `true` otherwise.
41
41
  // kept: free
42
42
  interface Navigate {
43
- /** @deprecated Call `navigate.query(changes)`, so one name does one job. Removed in 1.108.0; `deprecated-navigate-query` rewrites it. */
44
- (to: { query: QueryChanges }, options?: NavigateOptions): Promise<boolean>
45
- // Last, so a path no page serves is reported against it.
46
43
  <const Href extends string>(href: Href & CheckedHref<Href>, options?: NavigateOptions): Promise<boolean>
47
44
  query: (changes: QueryChanges, options?: NavigateOptions) => Promise<boolean>
48
45
  }
49
46
 
50
- async function visit(to: string | { query: QueryChanges }, options: NavigateOptions = {}): Promise<boolean> {
51
- return navigateTo(typeof to === 'string' && navigation.localize ? navigation.localize(to) : to, options, true)
47
+ async function visit(to: string, options: NavigateOptions = {}): Promise<boolean> {
48
+ return navigateTo(navigation.localize ? navigation.localize(to) : to, options, true)
52
49
  }
53
50
 
54
51
  // kept: free
@@ -72,6 +72,7 @@ export function startNavigation(given: NavigationHooks): void {
72
72
  window.addEventListener('click', onClick)
73
73
  ;(document as { _$kf?: typeof onClick })._$kf = onClick
74
74
  document.addEventListener('focusin', onFocus)
75
+ document.addEventListener('toggle', onToggle, true)
75
76
  window.addEventListener('popstate', onPopState)
76
77
  // `pagehide` saves the scroll for a full load only: back or forward between entries of this document fires `popstate` once the entry already changed, too late to save the one left, so the entry is kept up to date as the page scrolls.
77
78
  window.addEventListener('scroll', onScroll, { passive: true })
@@ -90,6 +91,14 @@ async function loadFormSubmits(): Promise<typeof import('./form-submits')> {
90
91
  return typeof KAY_NAV_ENTRY === 'undefined' ? formsModule ??= import('./form-submits') : Promise.reject(new Error('unreachable'))
91
92
  }
92
93
 
94
+ // Notes what a `details` showed before its visitor first toggled it, which a refresh compares with the server's.
95
+ function onToggle(event: Event): void {
96
+ const details = event.target
97
+
98
+ if (details instanceof HTMLDetailsElement && !navigation.written.delete(details) && !navigation.opened.has(details))
99
+ navigation.opened.set(details, !details.open)
100
+ }
101
+
93
102
  // Until the forms' listener runs, which then takes the forms a swap brings or a focus lands in itself.
94
103
  function wakeShownForms(): void {
95
104
  if (!formsListen && document.forms.length > 0)
@@ -147,15 +147,3 @@ async function logged<A, T>(fn: (argument: A) => T, argument: A): Promise<Awaite
147
147
  return undefined
148
148
  }
149
149
  }
150
-
151
- // kept: free
152
- /** @deprecated Call `navigation.onBeforeNavigate(fn)`, the hooks of a source being its methods. Removed in 1.108.0; `deprecated-navigation-hooks` rewrites it. */
153
- export function onBeforeNavigate(fn: (event: BeforeNavigate) => boolean | void | Promise<boolean | void>): () => void {
154
- return beforeNavigate(fn)
155
- }
156
-
157
- // kept: free
158
- /** @deprecated Call `navigation.onNavigate(fn)`, the hooks of a source being its methods. Removed in 1.108.0; `deprecated-navigation-hooks` rewrites it. */
159
- export function onNavigate(fn: (event: NavigateEvent) => unknown): () => void {
160
- return afterNavigate(fn)
161
- }
@@ -117,7 +117,11 @@ export const navigation: {
117
117
  traversed?: (state: unknown) => boolean
118
118
  // Development: set while `kay dev` refreshes the page for an edit, where a field the edit leaves as it was keeps what was typed into it.
119
119
  typed?: boolean
120
- } = { shown: '', at: 0, page: 0, current: 0, released: false, loads: 0 }
120
+ // What a `details` the visitor toggled showed as `open` in the render the server gave, noted at its first toggle: a refresh leaves its state to the visitor while the server's stays that.
121
+ opened: WeakMap<Element, boolean>
122
+ // The `details` whose `open` a swap just wrote, so the `toggle` it fires is not taken for the visitor's.
123
+ written: WeakSet<Element>
124
+ } = { shown: '', at: 0, page: 0, current: 0, released: false, loads: 0, opened: new WeakMap(), written: new WeakSet() }
121
125
 
122
126
  // Run once a swap to another path is shown: what an action streams to a caller no island owns closes there.
123
127
  export const leaving = new Set<() => void>()
@@ -12,14 +12,14 @@ import { mergeHead, runnable, scriptMarkup, swapRoot } from './swap-head'
12
12
  import { checkKept, heldLate, holding, swapBody } from './swap-kept'
13
13
  import { MISSING } from './swap-morph'
14
14
  import { transitioned, viewTransitions } from './swap-transition'
15
- import { addressChanged } from './with-query'
15
+ import { addressChanged, followAddress } from './with-query'
16
16
 
17
17
  export { HTML, PAGE_TIMEOUT_MS, prefetch } from './swap-fetch'
18
18
  export { CHUNK_TIMEOUT_MS } from './swap-flight'
19
19
  export { TRANSITION_TIMEOUT_MS } from './swap-transition'
20
20
 
21
21
  // The page swap itself, which `./navigate` loads once a visitor is about to follow a link, and `./forms` once a form is posted.
22
- // The body's content becomes the next page's, morphed so what renders again stays the same element, islands kept only by `persist` or a refresh.
22
+ // The body's content becomes the next page's, morphed so what renders again stays the same element, islands kept by `persist`, a match in the same place, or a refresh.
23
23
  // Everything else follows one rule: what the server served changes as the next page serves it, what a script changed or added since stays the script's. The served state is `served` for `<html>`, read from the server's meta, each head element's own `_$s` for the head, and none for `<body>`, which the server writes bare.
24
24
  // Its parts: the fetch in `./swap-fetch`, `<html>` and the head in `./swap-head`, the body's islands and what they keep in `./swap-kept` (a deferred server island's render in the lazy `./swap-held`), the morph in `./swap-morph`, the focus in `./swap-focus`, view transitions in `./swap-transition`, and the policy and what the swaps under way share in `./swap-flight`.
25
25
 
@@ -93,13 +93,12 @@ function markPending(link: Element | undefined): void {
93
93
  link?.setAttribute('data-pending', '')
94
94
  }
95
95
 
96
- // The nearest `data-scroll` decides, `"top"` meaning a plain scroll to the top, and the nearest `data-transition`, `"false"` meaning none; `data-keep-scroll` and `data-no-transition` are their names before 1.105, read until 1.108.
96
+ // The nearest `data-scroll` decides, `"top"` meaning a plain scroll to the top, and the nearest `data-transition`, `"false"` meaning none.
97
97
  function linkOptions(link: Element): Pick<Swap, 'scroll' | 'transition'> {
98
- const keeper = link.closest('[data-scroll],[data-keep-scroll]')
99
- const changer = link.closest('[data-transition],[data-no-transition]')
100
- const kept = keeper?.getAttribute('data-scroll') ?? keeper?.getAttribute('data-keep-scroll')
98
+ const keeper = link.closest('[data-scroll]')
99
+ const changer = link.closest('[data-transition]')
101
100
 
102
- return { scroll: keeper && kept !== 'top' && kept !== 'false' ? 'keep' : undefined, transition: !changer || (!changer.hasAttribute('data-no-transition') && changer.getAttribute('data-transition') !== 'false') }
101
+ return { scroll: keeper && keeper.getAttribute('data-scroll') !== 'top' ? 'keep' : undefined, transition: changer?.getAttribute('data-transition') !== 'false' }
103
102
  }
104
103
 
105
104
  async function swapTo(url: URL, swap: Swap): Promise<void> {
@@ -440,7 +439,7 @@ async function showPage(page: FetchedPage, hash: string, swap: Swap, isCurrent:
440
439
 
441
440
  root()
442
441
  head.commit()
443
- inFlight.typing = process.env.NODE_ENV !== 'production' && navigation.typed === true
442
+ inFlight.typing = swap.intent === 'refresh' || (process.env.NODE_ENV !== 'production' && navigation.typed === true)
444
443
 
445
444
  try {
446
445
  swapBody(next, policy, held, left)
@@ -452,6 +451,7 @@ async function showPage(page: FetchedPage, hash: string, swap: Swap, isCurrent:
452
451
 
453
452
  forgetPageData()
454
453
  writeHistory(policy, target)
454
+ followAddress()
455
455
  addressChanged()
456
456
 
457
457
  if (pageKey(target) !== navigation.shown)
@@ -29,6 +29,8 @@ export type Stored<T> = { found: true, value: T } | { found: false }
29
29
  // Where a kept signal's value lives: what the request being rendered holds, which the server renders with, none for a store only the browser sees; what the browser holds, and how it keeps a new value.
30
30
  export interface Store<T> {
31
31
  request?: ((scope: LoadScope) => Stored<T>) | undefined
32
+ // A store kept in the query: each read of it tells the render, which notes the island as reading the address.
33
+ query?: true | undefined
32
34
  stored: () => Stored<T>
33
35
  save: (value: T) => void
34
36
  // A store the server never sees: an island claiming its markup reads the value it rendered with, the kept one applying once it has hydrated.
@@ -116,7 +118,7 @@ export function keep<T>(store: Store<T>, read: () => T, write: (value: T) => voi
116
118
  return inBrowser(store, read, write)
117
119
 
118
120
  // Outside a browser build the page is told apart on use, not on creation: a module made before a test registers its DOM keeps its signal then.
119
- const server = serverSide(store.request, read)
121
+ const server = serverSide(store.request, read, store.query)
120
122
  let browser: Persisted<T> | undefined
121
123
  const current = () => typeof document === 'undefined' ? server : browser ??= inBrowser(store, read, write)
122
124
 
@@ -175,7 +177,7 @@ function inBrowser<T>(store: Store<T>, read: () => T, write: (value: T) => void)
175
177
  }
176
178
 
177
179
  // The server reads the request being rendered once per request, until a render of it writes the signal.
178
- function serverSide<T>(request: Store<T>['request'], read: () => T): Persisted<T> {
180
+ function serverSide<T>(request: Store<T>['request'], read: () => T, query?: true): Persisted<T> {
179
181
  const fromRequest = new WeakMap<LoadScope, Stored<T>>()
180
182
  const written = new WeakSet<LoadScope>()
181
183
 
@@ -183,7 +185,13 @@ function serverSide<T>(request: Store<T>['request'], read: () => T): Persisted<T
183
185
  read: () => {
184
186
  const scope = currentRequestScope()
185
187
 
186
- if (!scope || !request || written.has(scope))
188
+ if (!scope || !request)
189
+ return read()
190
+
191
+ if (query)
192
+ scope.read?.()
193
+
194
+ if (written.has(scope))
187
195
  return read()
188
196
 
189
197
  let stored = fromRequest.get(scope)
@@ -14,7 +14,7 @@ interface KeptOptions<T> extends SignalOptions<T> {
14
14
  values?: readonly T[] | undefined
15
15
  }
16
16
 
17
- // `persisted()` and `persisted.cookie()`: the value lives in a cookie the server reads too, so pages render with it.
17
+ // `persisted.cookie()`: the value lives in a cookie the server reads too, so pages render with it.
18
18
  export interface PersistedCookieOptions<T> extends KeptOptions<T> {
19
19
  // How long the cookie is kept after the last write, a year by default: `'30d'`.
20
20
  maxAge?: Duration | undefined
@@ -28,12 +28,6 @@ export interface PersistedStorageOptions<T> extends KeptOptions<T> {
28
28
  sync?: boolean | undefined
29
29
  }
30
30
 
31
- // `persisted.query()`, which is `queryParam(name, { default })` since 1.105: the value lives in the URL, the value given standing for the param left out, after the default of a `query` schema naming it.
32
- export interface PersistedQueryOptions<T> extends KeptOptions<T> {
33
- // `replace`, the default, takes the current entry's place, throttled; `push` adds an entry, written at once, which Back and Forward step through and the signal follows.
34
- history?: 'push' | 'replace' | undefined
35
- }
36
-
37
31
  // The signals of a page by storage and name, so islands persisting one name hold one value.
38
32
  const sharedSignals = new Map<string, { signal: object, refresh?: (() => void) | undefined }>()
39
33
 
@@ -67,31 +61,15 @@ function session<T>(name: string, value: PlainValue<T>, options?: PersistedStora
67
61
  return keptSignal('session', name, value, options)
68
62
  }
69
63
 
70
- // A signal kept in the URL under the query param `name`, which the default leaves out; a string unless `T` says otherwise, for a param the page's `query` schema reads as another type: the URL holds text.
71
- function query<T = string>(name: string, value: NoInfer<PlainValue<T>>, options?: Omit<PersistedQueryOptions<NoInfer<T>>, 'values'>): Signal<T>
72
- // `values` types the signal as their union, and the default must be one of them.
73
- function query<const T extends string | number | boolean>(name: string, value: NoInfer<T>, options: PersistedQueryOptions<T> & { values: readonly T[] }): Signal<T>
74
-
75
- function query<T>(name: string, value: PlainValue<T>, options?: PersistedQueryOptions<T>): Signal<T> {
76
- return queryParamOf<T>(name, { default: value, values: options?.values, history: options?.history }, options)
77
- }
78
-
79
- // `persisted(name, value, options)` is `persisted.cookie(...)`: the cookie is what a bare call kept, and a call names its storage since 1.105.
64
+ // One entry per storage, each named by the call: `persisted.cookie()`, `persisted.local()`, `persisted.session()`; a query param is `queryParam()`.
80
65
  interface Persisted {
81
- /** @deprecated Call `persisted.cookie()`, so the storage is named; `persisted.local()`, `persisted.session()` and `queryParam()` keep a value elsewhere. Removed in 1.108.0; `deprecated-persisted-call` rewrites it. */
82
- <const T extends string | number | boolean>(name: string, value: NoInfer<T>, options: PersistedCookieOptions<T> & { values: readonly T[] }): Signal<T>
83
- /** @deprecated Call `persisted.cookie()`, so the storage is named; `persisted.local()`, `persisted.session()` and `queryParam()` keep a value elsewhere. Removed in 1.108.0; `deprecated-persisted-call` rewrites it. */
84
- <T>(name: string, value: PlainValue<T>, options?: Omit<PersistedCookieOptions<T>, 'values'>): Signal<T>
85
66
  cookie: typeof cookie
86
67
  local: typeof local
87
68
  session: typeof session
88
- /** @deprecated Call `queryParam(name, { default })`, the one signal of a query param. Removed in 1.108.0; `deprecated-persisted-query` rewrites it. */
89
- query: typeof query
90
69
  }
91
70
 
92
71
  // kept: local, it reads the request's cookie, so it is free only where every call is `persisted.local()` or `persisted.session()`, kept in the browser's storage and read once the page has hydrated.
93
- // The entries are attached in a pure call, so a page that never reads `persisted` drops it with every storage's code.
94
- export const persisted: Persisted = /* @__PURE__ */ Object.assign((name: string, value: unknown, options?: PersistedCookieOptions<unknown>) => cookie(name, value as never, options), { cookie, local, session, query })
72
+ export const persisted: Persisted = { cookie, local, session }
95
73
 
96
74
  function keptSignal<T>(storage: Exclude<PersistStorage, 'query'>, name: string, value: PlainValue<T>, options: PersistedCookieOptions<T> | undefined): Signal<T> {
97
75
  const id = `${storage}:${name}`
@@ -137,11 +115,7 @@ export function queryParam<const T extends string | number | boolean>(name: stri
137
115
  export function queryParam<T = string>(name: string, options: QueryParamOptions<NoInfer<T>> & { default: NoInfer<PlainValue<T>>, values?: undefined }): Signal<T>
138
116
  export function queryParam<T = string | undefined>(name: string, options?: QueryHistoryOptions): Signal<T>
139
117
  export function queryParam<T>(name: string, options?: QueryParamOptions<T>): Signal<T> {
140
- return queryParamOf<T>(name, options)
141
- }
142
-
143
- function queryParamOf<T>(name: string, options: QueryParamOptions<T> | undefined, own?: SignalOptions<T>): Signal<T> {
144
- const [read, write] = createSignal<T>(options?.default as PlainValue<T>, own)
118
+ const [read, write] = createSignal<T>(options?.default as PlainValue<T>)
145
119
  const kept = keepParam(name, read, write, options?.default as T | undefined, options?.values, options?.history)
146
120
 
147
121
  return withSetter(kept.read, (next) => {
@@ -61,12 +61,11 @@ function holdConnection(): void {
61
61
  // The page proves the room and the member as it does any live read, so what a visitor is listed as comes from the server fence that passed it, and the page is rendered per request.
62
62
  // A member is any value that crosses as island props do, compared as JSON; a room and its member take at most 256 characters as JSON.
63
63
  // kept: request
64
- export function presence<Member = null>(options?: PresenceOptions<Member>): Presence<Member>
65
- /** @deprecated Written `presence(room, member)`; `deprecated-live-api` rewrites it. Removed in 1.108. */
66
- export function presence<Member = null>(room: string, member?: Member, options?: Pick<PresenceOptions, 'signal'>): Presence<Member>
67
- export function presence(first?: string | PresenceOptions<unknown>, second?: unknown, extra?: PresenceOptions): Presence<unknown> {
68
- const options = typeof first === 'object' ? first : { room: first, member: second, signal: extra?.signal }
69
- const { room, member } = options
64
+ export function presence<Member = null>(options?: PresenceOptions<Member>): Presence<Member> {
65
+ if (options !== undefined && (typeof options !== 'object' || options === null))
66
+ throw new KayError('argument-invalid', 'kay: presence({ room, member, signal }) takes one options object, not the room and member as arguments')
67
+
68
+ const { room, member } = options ?? {}
70
69
  const key = JSON.stringify([room ?? pagePath(), member ?? null])
71
70
 
72
71
  if (key.length > MAX_PRESENCE_KEY)
@@ -93,7 +92,7 @@ export function presence(first?: string | PresenceOptions<unknown>, second?: unk
93
92
  const end = lasting('presence', presence, () => onCleanup(() => stop(true)), options?.signal)
94
93
 
95
94
  return Object.assign(end, {
96
- others: () => [...new Set(read().filter(text => text !== own))].map(text => JSON.parse(text) as unknown),
95
+ others: () => [...new Set(read().filter(text => text !== own))].map(text => JSON.parse(text) as Member),
97
96
  count: () => read().length,
98
97
  })
99
98
  }
@@ -3,7 +3,7 @@ import { historyState, navigation, pageKey } from './navigation'
3
3
  import { pageData } from './page-data'
4
4
  import { keep } from './persist'
5
5
  import { onCleanup } from './reactive'
6
- import { addressChanged } from './with-query'
6
+ import { addressChanged, followAddress, followers } from './with-query'
7
7
 
8
8
  // What the server sends of one param of the page's `query` schema, enough to read its text as the schema does without the schema itself.
9
9
  export interface ParamRule {
@@ -35,7 +35,7 @@ export function readParam(rules: QueryRules | undefined, name: string, search: U
35
35
  return texts[0]
36
36
 
37
37
  if (rule.type === 'array') {
38
- // A blank text is the empty list, as `persisted.query` writes it.
38
+ // A blank text is the empty list, as `queryParam` writes it.
39
39
  if (texts.length === 1 && texts[0] === '')
40
40
  return []
41
41
 
@@ -80,11 +80,11 @@ function fromText(rule: ParamRule, text: string): unknown {
80
80
  return rule.enum === undefined || rule.enum.includes(value) ? value : REFUSED
81
81
  }
82
82
 
83
- // The signals kept in the query, each reading its param again from the address a traversal reached between entries kay wrote.
84
- const followed = new Set<() => void>()
83
+ // The values set and not yet written to the address, by param, with the fallback each leaves out of it.
84
+ const pending = new Map<string, [value: unknown, fallback: unknown]>()
85
85
 
86
86
  // What `queryParam` reads and keeps, around the signal's own `read`: the server reads the request's param, the browser the page's address once, then each write takes the current history entry's place.
87
- // A param left out reads as the signal's own value, `fallback` for `persisted.query(name, fallback)`, which writing it leaves out too.
87
+ // A param left out reads as the signal's own value, `fallback` for `queryParam(name, { default: fallback })`, which writing it leaves out too.
88
88
  // A value outside `values` reads as the param left out.
89
89
  // `history: 'push'` adds an entry for each write instead, which Back and Forward step through, the signal following.
90
90
  export function keepParam<T>(name: string, read: () => T, write: (value: T) => void, fallback?: T, values?: readonly unknown[], history?: 'push' | 'replace'): Persisted<T> {
@@ -93,13 +93,23 @@ export function keepParam<T>(name: string, read: () => T, write: (value: T) => v
93
93
 
94
94
  if (typeof document !== 'undefined') {
95
95
  const reread = () => {
96
+ // A write still waiting is the signal's own, ahead of the address: it lands on it, and a refresh of the page leaves it be.
97
+ if (pending.has(name))
98
+ return
99
+
96
100
  const now = stored()
97
101
 
98
- write(now.found ? now.value : fallback as T)
102
+ const next = now.found ? now.value : fallback as T
103
+
104
+ // A list is read afresh from the address: left alone when it holds the same items, so its effects are not told again.
105
+ if (Array.isArray(next) && JSON.stringify(next) === JSON.stringify(read()))
106
+ return
107
+
108
+ write(next)
99
109
  }
100
110
 
101
- followed.add(reread)
102
- onCleanup(() => followed.delete(reread))
111
+ followers.add(reread)
112
+ onCleanup(() => followers.delete(reread))
103
113
 
104
114
  if (push)
105
115
  watch()
@@ -107,6 +117,7 @@ export function keepParam<T>(name: string, read: () => T, write: (value: T) => v
107
117
 
108
118
  return keep<T>({
109
119
  request: scope => found(scope.param?.(name), values, fallback),
120
+ query: true,
110
121
  stored,
111
122
  save: value => saveParam(name, value, fallback, push),
112
123
  }, read, write)
@@ -131,7 +142,6 @@ function pageRules(): QueryRules | undefined {
131
142
  // Every param shares one gap, a throttle with a leading write: one goes through at once, then at most one per 200 ms while values keep coming, the latest ones landing in a single `replaceState`.
132
143
  // The page flushes them before it is left or navigated, one found on another page than it was set on is dropped, and a refused write never throws out of `set()`.
133
144
  const WRITE_GAP = 200
134
- const pending = new Map<string, [value: unknown, fallback: unknown]>()
135
145
  let timer: ReturnType<typeof setTimeout> | undefined
136
146
  let lastWrite = 0
137
147
  let retrying = false
@@ -169,9 +179,7 @@ function traversed(state: unknown): boolean {
169
179
  retrying = false
170
180
  navigation.shown = pageKey(new URL(location.href))
171
181
 
172
- for (const reread of followed)
173
- reread()
174
-
182
+ followAddress()
175
183
  addressChanged()
176
184
 
177
185
  return true
@@ -38,6 +38,8 @@ export interface ServerScope {
38
38
  cookie: (name: string) => string | undefined
39
39
  // A query param as the page's `query` schema reads it, for `queryParam` and a persisted signal kept in the query.
40
40
  param: (name: string) => unknown
41
+ // Told each time a signal kept in the request reads it, which a render answering for a page built once notes as the island's dependence on the address.
42
+ read?: () => void
41
43
  report: (error: unknown) => void
42
44
  // The path of the page being rendered, percent-encoded as requested.
43
45
  path: string
@@ -365,7 +367,7 @@ export function currentServerScope(): ServerScope | undefined {
365
367
  }
366
368
 
367
369
  // What a page's server fence reads of its request while it loads: its cookies, which a persisted signal answers with; a query param is the render's alone.
368
- export type LoadScope = Pick<ServerScope, 'cookie'> & Partial<Pick<ServerScope, 'param'>>
370
+ export type LoadScope = Pick<ServerScope, 'cookie'> & Partial<Pick<ServerScope, 'param' | 'read'>>
369
371
 
370
372
  let requestCookieScope: (() => LoadScope | undefined) | undefined
371
373
 
@@ -10,16 +10,6 @@ export interface DenyOptions<Data = unknown, Field extends string = string> {
10
10
  data?: Data | undefined
11
11
  }
12
12
 
13
- // The options of `refuse(message, options)` before 1.105, `refuse(status, { message, errors, data })` since.
14
- export interface RefuseOptions {
15
- // An error status, from 400 to 599: 422 when `errors` names fields, else 403.
16
- status?: number | undefined
17
- // A message per field, as a schema's.
18
- errors?: Record<string, string> | undefined
19
- // What the app reads from the answer.
20
- data?: unknown
21
- }
22
-
23
13
  // An error carrying this is answered as a refusal rather than a server error: `{ status, message, errors?, data?, retryAfter? }`.
24
14
  const REFUSED = Symbol.for('kay.refused')
25
15
 
@@ -36,14 +26,10 @@ export class RefusedError extends Error {
36
26
 
37
27
  // Throws to stop what a `before` hook guards, with that status (an error one, from 400 to 599) and the `{ message, errors, data }` of `ctx.deny`: an action and every other place answering `Symbol.for('kay.refused')` answers it as it answers `ctx.deny` in an action.
38
28
  // kept: free
39
- export function refuse(status?: number, options?: DenyOptions): never
40
- /** @deprecated `refuse(status, { message, errors, data })`. Removed in 1.108; `deprecated-refuse-call` rewrites it. */
41
- export function refuse(message?: string, options?: RefuseOptions): never
42
- export function refuse(first?: number | string, options: { message?: string | undefined, status?: number | undefined, errors?: Partial<Record<string, string>> | undefined, data?: unknown } = {}): never {
43
- const named = typeof first === 'string'
29
+ export function refuse(status?: number, options: DenyOptions = {}): never {
44
30
  const { errors = {}, data } = options
45
- const code = (named ? options.status : first) ?? (Object.keys(errors).length > 0 ? 422 : 403)
46
- const message = (named ? first : options.message) ?? 'Refused'
31
+ const code = status ?? (Object.keys(errors).length > 0 ? 422 : 403)
32
+ const message = options.message ?? 'Refused'
47
33
 
48
34
  if (!Number.isInteger(code) || code < 400 || code > 599)
49
35
  throw new KayError('argument-invalid', `kay: refuse() takes an error status, from 400 to 599, not ${code}`)
@@ -8,15 +8,13 @@ export type MaybePromise<T> = T | Promise<T>
8
8
  // What every store an app plugs in may have, whatever it keeps: `ping` and `close`, both optional and either may return a promise, so a store with neither costs nothing. Callers only await the result, so `close: () => redis.quit()` fits.
9
9
  // `AppStore` extends it too, so a store keeping every kind (`pgData`) pings and closes them all with one method.
10
10
  export interface StoreBase {
11
- // `true` for a store that receives every length as a `Duration` (`'30s'`) where the contract has one: `RateStore.hit`'s window, `KvStore`'s ttl, `SessionStore.set`'s max age, `LiveStore.endAll`'s ttl. A store without it was written before 1.105 and receives milliseconds as a number, which kay keeps handing it until 1.108.
12
- durations?: true | undefined
13
11
  // Rejects, or throws, when the store cannot be reached: `health` runs it beside the app's own `check`, under the same `health.timeout`.
14
12
  ping?: (() => unknown) | undefined
15
13
  // Stops what the store runs in the background and lets go of its file or connection: the server calls it once when it stops, and `await store.close()` does the same for a store opened in a script or a test. Closing twice is the same as once.
16
14
  close?: (() => unknown) | undefined
17
15
  }
18
16
 
19
- // The milliseconds of a length a store was given as a `Duration` or, by a store written before 1.105, as milliseconds: what a store of your own reads its window, ttl or max age with. `what` names the argument in the error a bad value throws.
17
+ // The milliseconds of a length a store was given as a `Duration`: what a store of your own reads its window, ttl or max age with. `what` names the argument in the error a bad value throws.
20
18
  // kept: free
21
19
  export function lengthMs(value: Duration | number, what = 'a store length'): number {
22
20
  const ms = typeof value === 'number' ? value : durationMs(value)
@@ -27,7 +25,7 @@ export function lengthMs(value: Duration | number, what = 'a store length'): num
27
25
  return ms
28
26
  }
29
27
 
30
- // What kay hands `store` for a length of `ms`: a `Duration` when it declares `durations: true`, else the milliseconds a store written before 1.105 expects.
31
- export function lengthFor(store: StoreBase, ms: number): Duration | number {
32
- return store.durations === true ? `${Math.round(ms)}ms` : ms
28
+ // What kay hands a store for a length of `ms`: a `Duration`.
29
+ export function lengthFor(ms: number): Duration {
30
+ return `${Math.round(ms)}ms`
33
31
  }
@@ -23,7 +23,7 @@ const POLICY_PARAMS = /;.*/
23
23
  // A link opting out, or a `rel=nofollow` one such as a sign-out, which may do something once fetched, is followed when clicked, never ahead.
24
24
  export function prefetch(url: URL, link: Element): void {
25
25
  // The nearest `data-prefetch` decides, so an inner `eager` link stays prefetched under a container saying `false`.
26
- if (link.closest('[data-no-prefetch],[rel~=nofollow]') || link.closest('[data-prefetch]')?.getAttribute('data-prefetch') === 'false')
26
+ if (link.closest('[rel~=nofollow]') || link.closest('[data-prefetch]')?.getAttribute('data-prefetch') === 'false')
27
27
  return
28
28
 
29
29
  const key = pageKey(url)
@@ -8,20 +8,20 @@ export interface Policy {
8
8
  scroll: 'top' | 'saved' | 'keep'
9
9
  // What gets focus: the new page's autofocus field or heading, its title announced, the element focused before, or the refused form's field.
10
10
  focus: 'page' | 'kept' | 'refused'
11
- // The islands kept: those marked `persist`, or besides them every one whose component and props did not change.
12
- islands: 'persist' | 'unchanged'
11
+ // The islands kept: those marked `persist`, besides them those of a layout the next page has too (`layout`) or any island of the same component in the same place (`all`), each taking the next page's props in place.
12
+ islands: 'layout' | 'all'
13
13
  // Whether the page changes through a view transition, once its stylesheets opt in.
14
14
  transition: boolean
15
15
  }
16
16
 
17
17
  const POLICIES: Record<Intent, Policy> = {
18
- visit: { history: 'push', scroll: 'top', focus: 'page', islands: 'persist', transition: true },
19
- query: { history: 'push', scroll: 'keep', focus: 'kept', islands: 'persist', transition: true },
20
- traverse: { history: 'none', scroll: 'saved', focus: 'page', islands: 'persist', transition: true },
21
- refresh: { history: 'none', scroll: 'keep', focus: 'kept', islands: 'unchanged', transition: false },
22
- redirect: { history: 'replace', scroll: 'keep', focus: 'kept', islands: 'persist', transition: true },
23
- refusal: { history: 'none', scroll: 'keep', focus: 'refused', islands: 'persist', transition: true },
24
- error: { history: 'none', scroll: 'top', focus: 'page', islands: 'persist', transition: true },
18
+ visit: { history: 'push', scroll: 'top', focus: 'page', islands: 'layout', transition: true },
19
+ query: { history: 'push', scroll: 'keep', focus: 'kept', islands: 'layout', transition: true },
20
+ traverse: { history: 'none', scroll: 'saved', focus: 'page', islands: 'layout', transition: true },
21
+ refresh: { history: 'none', scroll: 'keep', focus: 'kept', islands: 'all', transition: false },
22
+ redirect: { history: 'replace', scroll: 'keep', focus: 'kept', islands: 'layout', transition: true },
23
+ refusal: { history: 'none', scroll: 'keep', focus: 'refused', islands: 'layout', transition: true },
24
+ error: { history: 'none', scroll: 'top', focus: 'page', islands: 'layout', transition: true },
25
25
  }
26
26
 
27
27
  // What the swaps under way share, which each one reads before it acts: `navigation.current` is the token of the latest one started, which every swap that is not it gives way to.
@@ -36,7 +36,7 @@ export const inFlight: {
36
36
  late?: LateParts | undefined
37
37
  // The click listener of the view transition running, at most one.
38
38
  transition?: ((event: MouseEvent) => void) | undefined
39
- // Whether the commit under way keeps what was typed into the fields the next page renders as they were, which `kay dev` asks of a refresh for an edit.
39
+ // Whether the commit under way keeps what the visitor changed (a field's value, a `details`' `open`) where the server's render did not change it: a refresh does, and so does `kay dev` for an edit.
40
40
  typing: boolean
41
41
  // The selects the commit under way found renamed, whose options show what the next page renders.
42
42
  renamed: Set<Element>