@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
@@ -1,14 +1,14 @@
1
1
  id = "kay"
2
2
  name = "Kay"
3
3
  description = "Highlighting and the kay language server for .kay components"
4
- version = "1.108.0"
4
+ version = "1.110.0"
5
5
  schema_version = 1
6
6
  authors = [ "Kaynooo" ]
7
7
  repository = "https://github.com/Kayno0o/kayjs"
8
8
 
9
9
  [grammars.kay]
10
10
  repository = "https://github.com/Kayno0o/kayjs"
11
- rev = "v1.108.0"
11
+ rev = "v1.110.0"
12
12
  path = "editors/tree-sitter-kay"
13
13
 
14
14
  [language_servers.kay]
@@ -107,7 +107,7 @@ See [Rate limits](rate-limits.md#limit-attempts-in-a-guard-or-an-api-route).
107
107
 
108
108
  #### Proof of work checked in code
109
109
 
110
- - `workChallenge(scope, { difficulty, ttl })`, `ttl` a day by default, from `kay/server` signs a challenge bound to `scope` rather than to an action, for code checking it itself, as kayjs-auth's CAPTCHA does: `input(type="hidden" name="proof" data-kay-work={workChallenge('contact')})` posts its solution as the field's value, kay's script solving it from the moment the form takes focus.
110
+ - `workChallenge(scope, { difficulty, ttl })` from `kay/server`, `ttl` a day by default, signs a challenge bound to `scope` rather than to an action, for code checking it itself, as kayjs-auth's CAPTCHA does: `input(type="hidden" name="proof" data-kay-work={workChallenge('contact')})` posts its solution as the field's value, kay's script solving it from the moment the form takes focus.
111
111
  - `await verifyWork(input.proof, 'contact', { difficulty, store })` from `kay/server` answers `undefined` once for each solution, else `missing`, `expired` (past `maxAge`, another scope's, signed before a restart, or easier than `difficulty`) or `wrong`. The solutions used are kept in `store`, else the app store's `rates`, else this process's memory.
112
112
  - The difficulty is signed into the challenge, so a scope asking more refuses one handed out before, the page then signing a harder one; `difficulty` is 100,000 by default and `ttl` a day.
113
113
  - A prerendered page gets a fresh challenge in the field on every visit, as a stamp; `site.submit` solves the field unless the test gives its value.
@@ -36,7 +36,7 @@ A page or layout with a `--- server` fence passes an action it declares or impor
36
36
 
37
37
  A production build carries the code reviving an action only when the app's own sources call `action(` (or import it as another name) or use a kay library. A page handing an island an action created only in a package outside the app fails with an error naming this; call `action(` in one of the app's files, as `export const greet = action(...)` in a route, to keep it.
38
38
 
39
- Type the prop with `Action` from `kay` (`ServerAction` counts too): `Action`, with no parameters, takes any action, `NoInputAction<unknown>` any declared without a schema, and `Action<{ name: string }, string>` keeps its input and output types (`Action<never, unknown>`, the old spelling of the bare one, works until 1.108 and `deprecated-action-type` rewrites it) (the output is the success one, so a handler that can `ctx.fail` fits: `Action<{ dossier: string }, AsyncGenerator<string>>`). The type is only for the types: an island typing the prop as a plain function, `(input: { name: string }) => Promise<string>`, is handed the action all the same, the code reviving it loading in the browser only for a page that passes an island one, and shipped only by an app that calls `action(` in its own sources or uses a kay library: an action declared by a package outside the app that is no kay library makes the page fail, as above. The action crosses as its URL, so it must be an export of a route module, declared in the page or imported; one no route exports fails the render. `move.with({ id })` crosses with its fields: the island's calls and its `track()` send them over the input they are given, as a form posting to it does, while its `pending()`, `error()` and every other reading are those of the action, as is its queue: `queue: 'latest'` on a call of `move.with({ id: 1 })` drops one of `move.with({ id: 2 })` still running. Typed `Action` as any other.
39
+ Type the prop with `Action` from `kay` (`ServerAction` counts too): `Action`, with no parameters, takes any action, `NoInputAction<unknown>` any declared without a schema, and `Action<{ name: string }, string>` keeps its input and output types (the output is the success one, so a handler that can `ctx.deny` fits: `Action<{ dossier: string }, AsyncGenerator<string>>`). The type is only for the types: an island typing the prop as a plain function, `(input: { name: string }) => Promise<string>`, is handed the action all the same, the code reviving it loading in the browser only for a page that passes an island one, and shipped only by an app that calls `action(` in its own sources or uses a kay library: an action declared by a package outside the app that is no kay library makes the page fail, as above. The action crosses as its URL, so it must be an export of a route module, declared in the page or imported; one no route exports fails the render. `move.with({ id })` crosses with its fields: the island's calls and its `track()` send them over the input they are given, as a form posting to it does, while its `pending()`, `error()` and every other reading are those of the action, as is its queue: `queue: 'latest'` on a call of `move.with({ id: 1 })` drops one of `move.with({ id: 2 })` still running. Typed `Action` as any other.
40
40
 
41
41
  ```kay
42
42
  ---
@@ -119,7 +119,7 @@ p {column()}
119
119
 
120
120
  - An island imports the action from the page and calls it, as in [Call an action from an island](#call-an-action-from-an-island): `const { ok, data, error } = await add({ title })`, or `const id = await add({ title }).orThrow()` to throw the failure.
121
121
  - An optional field (`optional: true`) takes `undefined` as the field left out, `exactOptionalPropertyTypes` or not: `resize({ file, width: max ?? undefined })`. A wrong field is reported at that field, not against the `FormData` form of the call.
122
- - Once a call went through, the page shows what it changed, its loads run again as `refresh()` runs them, where the page swap runs: islands whose props did not change keep their state. A page with `liveRefresh: true` in its [settings](routing.md#page-settings) is left alone when every cached key the handler invalidated (`cached(..., { live: true })`) is one the page or a `resource()` follows: its live connection, once open, shows them a moment after the answer (`x-kay-invalidated` names the keys on the answer; a streaming action's end event names them, as it goes on invalidating until the stream ends). One key not followed, more than 20 keys or a connection that is down load the page as before, and `refresh: true` always does.
122
+ - Once a call went through, the page shows what it changed, its loads run again as `refresh()` runs them, where the page swap runs: every island stays with its state and takes its new props in place, and what the visitor typed in a static field or opened in a `details` stays unless the server changed it ([navigation](navigation.md#islands-kept-across-pages)). A page with `liveRefresh: true` in its [settings](routing.md#page-settings) is left alone when every cached key the handler invalidated (`cached(..., { live: true })`) is one the page or a `resource()` follows: its live connection, once open, shows them a moment after the answer (`x-kay-invalidated` names the keys on the answer; a streaming action's end event names them, as it goes on invalidating until the stream ends). One key not followed, more than 20 keys or a connection that is down load the page as before, and `refresh: true` always does.
123
123
  - `add({ title }, { refresh: false })` leaves the page as it is, so a frequent write from an island (a vote, an undo) needs no API route to avoid the refresh; `add` answers a refusal as a result, as `await add(input, { refresh: false })` does.
124
124
  - `await add.settled()` resolves once no call to `add` is in flight, whichever way they went (a stream counts until it ends; it never rejects), so an island that fired writes without awaiting them waits for them there; `save.settled()` does the same for the calls made through a `track()` handle.
125
125
  - `add.pending()` reads, reactively, whether a call the page made is still in flight, and `add.progress()` how much of a call carrying files the browser sent, from 0 to 1: `button(disabled={add.pending()})`.
@@ -132,7 +132,7 @@ p {column()}
132
132
  - `onStart({ input })`, `onSuccess({ data })`, `onError({ error })` (an `ApiError`) and `onSettled({ data, error })` observe a call; none runs `onError` for an abort or a redirect, `onSettled` runs for every ending but a call whose code never loaded (an abort's `error` is the abort), `onSuccess` of a stream runs as it starts, `latest` never aborts a stream already started, and a hook that throws or rejects is logged and never fails the call.
133
133
  - `refresh` also takes a `resource()` or a list of them (anything with a `refresh()`): those are refreshed in place of the page's loads, with or without the page swap.
134
134
  - `refresh: 'cart'` names a load of the page instead, the binding of a top-level `const cart = await ...` in the page's or a layout's server fence (a destructuring names each of its bindings; a `const total = cart.total * 2` names the load it reads): the page runs as a whole, but only the elements reading that load are sent and swapped, and what shows the others stays as it is. `refresh: ['cart', wishlist]` mixes names and `resource()`s, and `refresh()` from `kay` takes the same names: [rendering](rendering.md#refreshing-some-loads).
135
- - A `form(action={add})` posting in place tells an island how it goes with the hooks of the action: `add.onStart(({ input }) => ...)` before the post (`input` the fields as `FormData`), then `add.onData(({ input }) => ...)` once it went through or `add.onError(({ error, input }) => ...)` when it did not (`error` an `ApiError` with the `status` and the `errors` per field, status 0 and none for a failure with no answer), while the form is still on the page. Each returns what removes it and ends with the island; they hear the posts of every form of that action, `.with()` ones included, and not the calls of `add(...)`, which take `onStart`, `onSuccess` and `onError` as options. An island shows a change with `add.onStart` and `optimistic(change)` from `kay`, which gives `{ undo, keep }`, and calls `undo()` on the error and `keep()` on success. They are the function form of the `kay:action-start`, `kay:action-success` and `kay:action-error` events the form fires on itself (bubbling, `detail: { action, data }`, then `{ action, data }` and `{ action, status, errors, data }`), which a plain script listens to; `listen(() => form, 'kay:action-start', ...)` in an island is `deprecated-island-events`. [Events](events.md) maps each event to its hook.
135
+ - A `form(action={add})` posting in place tells an island how it goes with the hooks of the action: `add.onStart(({ input }) => ...)` before the post (`input` the fields as `FormData`), then `add.onData(({ input }) => ...)` once it went through or `add.onError(({ error, input }) => ...)` when it did not (`error` an `ApiError` with the `status` and the `errors` per field, status 0 and none for a failure with no answer), while the form is still on the page. Each returns what removes it and ends with the island; they hear the posts of every form of that action, `.with()` ones included, and not the calls of `add(...)`, which take `onStart`, `onSuccess` and `onError` as options. An island shows a change with `add.onStart` and `optimistic(change)` from `kay`, which gives `{ undo, keep }`, and calls `undo()` on the error and `keep()` on success. They are the function form of the `kay:action-start`, `kay:action-success` and `kay:action-error` events the form fires on itself (bubbling, `detail: { action, data }`, then `{ action, data }` and `{ action, status, errors, data }`), which a plain script listens to. [Events](events.md) maps each event to its hook.
136
136
  - Once it went through, the refresh brings what the server kept, which a `linked` signal then takes.
137
137
  - `{ signal }` aborts a call: it rejects with the signal's reason, what `optimistic` showed goes back, and the action records no outcome.
138
138
  - `{ headers }` sends extra request headers with the call, which the handler reads from `ctx.request`; the ones kay sets itself win.
@@ -142,7 +142,7 @@ p {column()}
142
142
  - `const save = add.track()` is a handle for one component, row or button: `save.pending()` reads, reactively, only the calls made through it, where `add.pending()` reads every call of the page; `save.status()` (`idle`, `loading`, `ready`, `failed`), `save.error()` (the last failure as an `ApiError`, a call that got no answer included, kept until a call succeeds) and `save.retry()` (repeats the call that failed, with the same arguments as they were, gives no result back, and ignores a redirect) read the same way ([Island sources](island-sources.md)). `add.track({ onData: ({ value, input }) => ..., onError: ({ error, input }) => ... })` takes callbacks for every call of the handle, and the handle has them as methods too (`save.onError(({ error }) => toast.error(error.message))`, returning what stops it): `onData` runs when a call succeeds, `value` what it answered (for a stream, once it is open; `onSuccess({ data })` works until 1.108), `onError` when it fails, a call that got no answer included, never for an abort or a redirect; `input` is what the call was given ([Island sources](island-sources.md#hooks)). `call.track(module, path, hooks)` takes the same two.
143
143
  - `await save(input, options)` takes what `add` does and answers the same result, a handle's calls only counting in its own `pending()`; an action with no input is called `save()`.
144
144
  - The same `{ ok, status, message, errors, data }` (an `ErrorShape` when not ok) is what `call(module, path)` and `call.track(module, path)` give for an API route ([API from islands](api-from-islands.md)), so one result handler serves both.
145
- - `add.refused(error)` tells a refusal of a call to `add` from any other error, a redirect's included, and types its `data` as the handler passes it to `ctx.fail`, with no cast: `if (add.refused(error)) shown = error.data?.message`.
145
+ - `add.refused(error)` tells a refusal of a call to `add` from any other error, a redirect's included, and types its `data` as the handler passes it to `ctx.deny`, with no cast: `if (add.refused(error)) shown = error.data?.message`.
146
146
  - `data` is undefined for a call refused before the handler ran, by the schema or a limit.
147
147
  - Its input, its result and that `data` cross as island props do, Dates, Maps, Sets and bigints included; a result holding a function or a class instance answers 500, logging where it sits.
148
148
  - When the handler or a guard redirects, the browser goes there, swapping the page in as a link would (a full load for another origin or a site without the swap), and the call rejects with `ActionRedirectError` carrying `location`, so `pending()` clears, `settled()` resolves and a `finally` after the call runs while the page goes away.
@@ -159,5 +159,5 @@ p {column()}
159
159
  - `close()` stops the handler's iterable, its `finally` running, as does the visitor going away; a stream called from an island's setup, an element's event handler or a `listen` callback closes with the enclosing block or component (the nearest still alive for a row playing its leave phase, or for a block the call's own result removes, as `reply = await ask()` flipping the `if` its button sits in, as long as the block goes in the task the answer arrived in), so a `persist` island's stays open across pages, and an effect running again closes the one it called; a stream called under no owner (after an `await` in a handler, or from a timer, or from a handler of an element whose whole owner chain is already disposed) closes once the visitor goes to another path, not at once. An `effect()` or `onCleanup()` called in a `listen` callback attaches to the island's owner and builds up per event, as in an element's handler, so keep them out of it; the callback is called with no `this`, so a `function` callback reads the target as `event.currentTarget`.
160
160
  - `rateLimit` with `count: 'succeeded'` counts a stream once its first value is there, and a drained post once its iterable ended.
161
161
  - A `pretend` bot protection answering an island's `FormData` call resolves `undefined`, not an `ActionStream`, as the handler never ran.
162
- - `on()` added right after the call resolves gets every value, `last()` only the latest: a reply yields the text so far rather than the piece added, so `last()` is all an island reads.
162
+ - `on()` added right after the call resolves gets every value, `data()` only the latest: a reply yields the text so far rather than the piece added, so `data()` is all an island reads.
163
163
  - A plain form post, a page swap's post and an MCP tool call read the iterable to its end and get its last value, as from a handler returning it: `reply.data()`.
@@ -28,7 +28,7 @@
28
28
 
29
29
  ### Refused posts
30
30
 
31
- - `ctx.deny(status, { message, errors, data })` is the one refusal of a guard, a page, an action and an endpoint, `refuse(status, { ... })` throws it from anywhere; `return` it so `form.failed()` types `data`. `ctx.fail` is its old spelling until 1.108 (`unreturned-fail`).
31
+ - `ctx.deny(status, { message, errors, data })` is the one refusal of a guard, a page, an action and an endpoint, `refuse(status, { ... })` throws it from anywhere; `return` it so `form.failed()` types `data`.
32
32
  - A post the schema refuses, or whose handler denies with `ctx.deny(status, { data })`, is answered with the page it came from, rendered with the failure's status, rather than with a redirect.
33
33
  - There `add.form.failed()` returns `{ status, message, values, errors, data }`, typed from the action, or `undefined`.
34
34
  - `values` is what the form posted (fields named like a password left out).
@@ -50,14 +50,14 @@
50
50
 
51
51
  ### Reading the outcome
52
52
 
53
- - `add.form.failed()`, `add.data()`, `add.status()` and `add.form.error('title')` read the outcome from any template, layout, component or island, and from the server fence. What a form shows is read from `add.form` (`failed()`, `error(field)`, `validate(form, field)`), apart from the call state on `add` itself (`pending()`, `status()`, `data()`, `progress()`, `settled()`, `track()`); `failed()`, `error()` and `validate()` on `add` work until 1.108 and `deprecated-action-readers` rewrites them.
53
+ - `add.form.failed()`, `add.data()`, `add.status()` and `add.form.error('title')` read the outcome from any template, layout, component or island, and from the server fence. What a form shows is read from `add.form` (`failed()`, `error(field)`, `validate(form, field)`), apart from the call state on `add` itself (`pending()`, `status()`, `data()`, `progress()`, `settled()`, `track()`); `failed()`, `error()` and `validate()` on `add` itself are gone since 1.109.
54
54
  - `form.error()` without a field is the form-wide message, `errors['']`.
55
55
  - The field name is typed from the schema.
56
56
  - An island reads them in the browser too, as its server render did, but for `values`, which stay on the server, so no field the server cannot tell is a secret reaches the page's source: the fields hold what was sent.
57
57
  - Once the page shown called the action, they read how its last call went instead, reactively, a call clearing them as it starts: an island calling `add({ title })` gets `{ ok: false }` and `add.form.error('title')` shows the message, the field marked invalid.
58
58
  - `await add.form.validate(form, field?)` checks a form against the action's schema, writing what it refuses into `add.form.error(field)` and `add.form.failed()` in place of the last outcome (`data()` too), for every field or `field` alone; it resolves whether it is accepted, posts nothing, and accepts a form with no schema on the page (a client-only island's). kayjs-ui's `Form`, `SaveForm` and `FormDialog` take `validate="submit" | "blur"`.
59
- - A post that succeeds goes back to the page with what the handler returned: `add.data()` returns it, typed from the action, or `undefined`, on that one render only; `add.status()` is `ready` then. `succeeded()`, which wrapped it in `{ data }`, works until 1.108 and `kay check` rewrites it.
59
+ - A post that succeeds goes back to the page with what the handler returned: `add.data()` returns it, typed from the action, or `undefined`, on that one render only; `add.status()` is `ready` then.
60
60
  - `data` travels in a cookie, sealed (AES-GCM under a key derived from [the app secret](environment.md#the-app-secret), else a key of the process, which a restart changes), so a secret shown once, such as a new API token, can be neither read nor altered in it.
61
61
  - Data too big for it, over about 3.5 KB sealed, is left out with a warning, and `data()` returns `undefined`, as it does for a cookie that does not open, forged or sealed before a restart.
62
62
  - A prerendered page reads both too: the request carrying that cookie renders it afresh, see [Prerendering](prerendering.md#prerendering).
63
- - The cookie carrying `succeeded()` back is `HttpOnly`, `SameSite=Lax`, and `Secure` when the request came over https, `X-Forwarded-Proto` included, as is every request in production when `site` is https.
63
+ - The cookie carrying the result back is `HttpOnly`, `SameSite=Lax`, and `Secure` when the request came over https, `X-Forwarded-Proto` included, as is every request in production when `site` is https.
@@ -108,16 +108,16 @@ button(onClick={() => messages.send({ text: text() })}) Send
108
108
  ```
109
109
 
110
110
  - `socket(module, path, options)` opens one of the module's websocket routes, the path written as the module writes it, `params` and `query` filling it in, all typed from the route.
111
- - `send` takes the route's `body`, `last()` reads the last message reactively, typed from its `response`, `onData(({ value }) => ...)` gets each one and returns what stops it, and `status()` is `connecting`, `open`, `failed` or `closed`: a server closing with a code from 4000 to 4999 (`ws.close(4403, 'Not yours')`) fails it, `error()` an `ApiError` with the code minus 4000 as `status` (403; 4000 gives 0, 4001 to 4099 give a status below 100, so refuse with 4400 and up) and the reason as `message`, and it does not reconnect.
111
+ - `send` takes the route's `body`, `data()` reads the last message reactively, typed from its `response`, `onData(({ value }) => ...)` gets each one and returns what stops it, and `status()` is `connecting`, `open`, `failed` or `closed`: a server closing with a code from 4000 to 4999 (`ws.close(4403, 'Not yours')`) fails it, `error()` an `ApiError` with the code minus 4000 as `status` (403; 4000 gives 0, 4001 to 4099 give a status below 100, so refuse with 4400 and up) and the reason as `message`, and it does not reconnect.
112
112
  - Messages travel as JSON both ways, a string, number, boolean or `null` read back as what it was. A message the route refuses is answered `{ error: { key, fields } }`, which `onRefused({ key, fields })` (a method and an option) reads: `fields` holds the words for each field, `''` the message as a whole.
113
- - A route sending through `rooms()` takes `response: chats.response` to type `last()` and `onData()` as the rooms' `Message` ([Rooms](rooms.md)); without a `response` they are `unknown`, which `kay check` reports on a route with a `body` (`untyped-socket`).
113
+ - A route sending through `rooms()` takes `response: chats.response` to type `data()` and `onData()` as the rooms' `Message` ([Rooms](rooms.md)); without a `response` they are `unknown`, which `kay check` reports on a route with a `body` (`untyped-socket`).
114
114
  - What is sent before the connection opens goes once it does, the last 50 messages kept while it is down; after `close()` nothing is.
115
115
  - A connection that drops reconnects, waiting longer each time up to 30 seconds, less up to half of that at random so the clients a restart dropped come back apart, and not while the tab is hidden or offline, unless the server closed it with code 1000; a visible tab the browser calls offline still tries each minute, as `navigator.onLine` can be wrong, and the clients a network coming back wakes together reconnect up to half a second apart.
116
116
  - `close()` closes it for good.
117
117
  - `onOpen(listener)` is called each time the connection opens, a reconnect included, before what was queued goes; it is told `{ reconnected }`, true after the first open, so `onOpen(({ reconnected }) => reconnected && refetch())` catches up on what the drop lost. `stream()` has the same `onOpen`.
118
118
  - A client joining rooms by message joins them there, `messages.onOpen(() => messages.send({ type: 'join', room }))`, so it is back in them after a drop.
119
119
  - Hooks: a socket, a stream (a route or an iterable) and a streaming action's answer take `onOpen`, `onData`, `onError` and `onClose` as methods, and `socket(module, path, options)` and `stream(...)` take the same four as options (`stream(source, hooks)` for an iterable): `socket(chat, '/:room', { params, onData: ({ value }) => add(value), onError: ({ error }) => toast.error(error.message) })`. What each means is in [Island sources](island-sources.md#hooks). `onClose({ status: 'closed' })` also runs when the component ends and closes the source, even one that never started; the answer of a streaming action is open before a listener can attach, so its `onOpen` runs only after a `retry()`.
120
- - `stream(module, path, options)` reads one of its routes answering with `eventStream()`, with `last()`, `onData(({ value }) => ...)` (which returns what stops it) and `status()` the same way. A stream and the stream a streaming action answers with are both a `Connection` from `kay`, and `stream()` gives a `Stream`, a `Connection` with `start()`.
120
+ - `stream(module, path, options)` reads one of its routes answering with `eventStream()`, with `data()`, `onData(({ value }) => ...)` (which returns what stops it) and `status()` the same way. A stream and the stream a streaming action answers with are both a `Connection` from `kay`, and `stream()` gives a `Stream`, a `Connection` with `start()`.
121
121
  - `await feed.ended()` resolves with the last value once the stream ran to its end (undefined for none) and rejects with the `ApiError` it failed with, or an `AbortError` when `close()` came first.
122
122
  - Its `status()` is `done` once the stream ran to its end and `failed` when a guard or the route refused it or its source threw, `error()` then an `ApiError` with the refusal's `status`, `message` and `data`.
123
123
  - Every source an island reads, `resource`, `stream`, `socket`, `track()` and `call.track` here, shares `status()`, `pending()`, `error()` and `retry()`, and the same hooks; [Island sources](island-sources.md) describes that shape once, with each source's statuses and hooks.
@@ -125,17 +125,17 @@ button(onClick={() => messages.send({ text: text() })}) Send
125
125
  - A GET stream that drops reconnects; any other ends as failed.
126
126
  - `stream()` sends `Last-Event-ID` when it reconnects to a route whose `eventStream(source, { id })` gave ids, and has `onOpen(listener)` as `socket()` does ([resume after a drop](#resume-after-a-drop)); it takes the hooks of a socket as options too.
127
127
  - `stream(module, path, { start: false })` stays `idle` until a handler calls `start(options)`, typed by the route; every stream has `start()`, which a stream that starts by itself ignores unless it is given options.
128
- - Each start opens a run with those params, query and body, which may hold a `File` or be a `FormData`, closing the one going and forgetting its `last()`.
128
+ - Each start opens a run with those params, query and body, which may hold a `File` or be a `FormData`, closing the one going and forgetting its `data()`.
129
129
  - `close()` aborts the request, which stops the route's source; a later `start()` opens it again.
130
130
  - `resource(module, path, options)` from `kay` reads one of its GET routes answering a value, typed from the route's `response` as JSON leaves it, a Date as its ISO text.
131
131
  - `onData({ value })` and `onError({ error })` are options of a resource and methods of it: `onData` runs each time the route answers, a quiet reload and `mutate()` included, not for `initial` or the value the server rendered, nor when a changed key joins a value another resource already holds, and `onError` each time a request fails, not for a quiet reload that keeps the value it has; a hook that throws is logged.
132
- - `value()` is the last answer, kept while the route is asked again, `status()` is `loading`, `ready` or `failed`, `error()` is the `ApiError` a route refused with, status 0 when no answer came, `refresh()` asks again even when ready, `retry()` only after a failure, and `pending()` also reads a quiet reload that keeps `ready`.
132
+ - `data()` is the last answer, kept while the route is asked again, `status()` is `loading`, `ready` or `failed`, `error()` is the `ApiError` a route refused with, status 0 when no answer came, `refresh()` asks again even when ready, `retry()` only after a failure, and `pending()` also reads a quiet reload that keeps `ready`.
133
133
  - Options given as a function, `() => ({ query: { prefix: search() } })`, are read reactively: a signal they read changing asks the route again, and an answer a newer request overtook is dropped.
134
134
  - The server renders the island with the route's answer: it asks the route in process as the visitor (their cookies and headers, so the route's guards run), and the island is `ready` in the HTML and hydrates `ready` without a request. A route that refuses, throws or takes over 5 seconds leaves the island `loading` for the browser to ask, with nothing of the refusal in the page. A page that reads a cookie or an `Authorization` header with a `resource()` is not shared by a cache. A route answering `cache-control: private`/`no-store` or a `set-cookie`, or an answer over 64 KB as JSON (`SEED_LIMIT`), is not seeded and stays `loading`. `seed: false` keeps the server from asking a route at all (`loading`, the browser asks), for one whose read has an effect of its own, such as admitting an editor to a room; every resource of that route or key on the page needs it, and it applies to routes only, read from the first options. A prerendered page and a server island render `loading` as before (give a server island's resources their own `key`); an `await` block reads the page's seeds. Finding the routes takes a discarded first render, so an `await` expression runs once per render (three at most) on a page with a `resource()`.
135
135
  - `resource()` reading one route and arguments share one request and one value; `key: 'rooms'` names another, so routes with the same key share. `initial: value` is a value the app already has, shown `ready` on the server and in the browser with no request until `refresh()` (a `load` function runs once, quietly, to follow its signals). `revalidate: 'focus' | 'reconnect' | '30s'` (or an array) asks again quietly, the value and `ready` kept, and stops with the component; with no `revalidate` a resource asks again only for `refresh()`, an invalidation of a key its route read or a changed option, never on focus or reconnect, and `stale` is 0. `stale: '30s'` counts an answer as fresh that long: `focus` and `reconnect` ask nothing inside the window (an interval, `refresh()` and an invalidation do), so a tab switched back and forth asks once per window. Identical reads in flight are one request through the shared key; an action that invalidated a tag the route's handler read refetches the resource through its live connection (see below), with nothing written. A route that reads no `cached(..., { live: true })` key names the keys itself: `resource(api, '/posts', { tags: ['posts'] })` asks again, quietly, when a call of this page invalidated `posts` (`invalidate('posts')` in the handler, a `cached('posts', ...)` key); an invalidation made elsewhere reaches only a route following live keys. The call sends the tags of the page's resources in an `x-kay-tags` header and the answer names only those the handler invalidated (a key the page never named stays out), so `invalidate(fn)` with a function names no key and reaches no tagged resource. A page with `liveRefresh: true` is left alone when every key the call invalidated is named by a resource or followed.
136
136
  - `list.mutate(value)` (or `mutate(current => next)`) sets the value for every resource sharing the key and asks the route again to settle it, dropping a request still in flight so an older answer never overwrites it; `mutate(value, { refresh: false })` keeps the value as set.
137
137
  - `resource(load)` reads anything else the same way, such as a WebSocket call or a `fetch` to another server: `load(signal)` returns a value or a promise, the signals it reads before its first await are tracked so it runs again when one changes, `signal` aborts when a newer run supersedes it or the component is gone, and a throw is `error()` with status 0 unless it is an `ApiError`.
138
- - `stream(source)` reads an async iterable, `source(signal)` returning it, with `last()`, `onData()`, `status()` and `close()`: `done` once it ends, `failed` when it throws, and it opens once the island is in the page, and `source` stops on its `signal`.
138
+ - `stream(source)` reads an async iterable, `source(signal)` returning it, with `data()`, `onData()`, `status()` and `close()`: `done` once it ends, `failed` when it throws, and it opens once the island is in the page, and `source` stops on its `signal`.
139
139
  - `call(module, path, options)` from `kay` calls any of its routes over HTTP from an event handler, or any code running in the browser, a module several islands share included: `const { ok, data } = await call(notes, '/', { method: 'post', body: { title } })`, or `await call(notes, '/', { method: 'post', body: { title } }).orThrow()` for the data, throwing the failure.
140
140
  - `method` is GET unless named, and named where the path answers no GET.
141
141
  - `params`, `query` and `body` are typed from the route, and the answer as `resource()` reads it, a number or a boolean arriving as the text Elysia sends, `null` as `null` and nothing (`undefined`, a 204) as `''`, so `run !== null` is a check the type allows.
@@ -30,9 +30,9 @@ onMount(() => drawMap(center))
30
30
  - An island importing a package that throws on a browser-only global as it loads renders in the browser only, with nothing to write.
31
31
  - Each package is imported once, in a Bun process of its own, and the answer is kept per package version in `.kay/cache`.
32
32
  - The server never loads such a package: an island's server module carries none of its script.
33
- - A component declaring `island({ render: 'client' })` always renders in the browser only, and is an island even without state. It was the `--- client` fence line, which `kay upgrade` rewrites (`deprecated-island-fence`) and which works until 1.108.
33
+ - A component declaring `island({ render: 'client' })` always renders in the browser only, and is an island even without state.
34
34
  - Pages, layouts and special pages render on the server, so they cannot declare it.
35
- - `render="client"` renders one use of an island in the browser only: `Map(center={center} render="client")`. It was `hydrate="client"` (`deprecated-island-attributes`): `hydrate` says only when an island hydrates.
35
+ - `render="client"` renders one use of an island in the browser only: `Map(center={center} render="client")`. `hydrate` says only when an island hydrates.
36
36
 
37
37
  ### Fallback while the browser renders
38
38
 
@@ -21,5 +21,5 @@ h1 Blog
21
21
  - A page never gets the shared header when it is behind a guard, rendered for the visitor (a context, a flash cookie, the dev tool), or the lighter copy sent to a `Save-Data` visitor: those keep `private, no-cache`, `private, no-store` or `public, max-age=0, must-revalidate`. A response that sets any cookie, from the session, kayjs-auth or kayjs-cms, or from a route of the app, is made `private, no-cache` as well (`keepCookiesPrivate` from `kay/library` does it for a plugin of your own).
22
22
  - A page that sets a `cache-control` of its own (`ctx.headers.set(...)`) keeps it, a page answering another status than 200 gets none, and a background render that stores its own header keeps it.
23
23
  - `cache: { browser, shared, swr }` in `page` sets each part of the header (`public, max-age=<browser>, s-maxage=<shared>, stale-while-revalidate=<swr>`, a part left out left out of it, `max-age` 0), and `shared` is also how long the server serves the page before it renders it again. `'private'` sends `private`, `false` keeps `public, max-age=0, must-revalidate` whatever a layout says. A layout's `cache` applies to every page under it, the innermost winning, and a part given as no duration fails the build with `page-settings-invalid`.
24
- - `ttl` and `cacheControl` are the 1.104 names (`deprecated-page-cache`): `ttl: '1h'` is `cache: '1h'`, a `cacheControl` text is written as the `cache` object, until 1.108.
24
+ - `ttl` and `cacheControl` are the 1.104 names, no longer read: `ttl: '1h'` is `cache: '1h'`, a `cacheControl` text is written as the `cache` object.
25
25
  - `kay build --static` writes the same value to `_headers`, for each such page at its path under the `base`, with and without the trailing slash (the root as `/base` and `/base/`). A path holding a `*`, a `:` or a space is left out, no `_headers` is written when it would be empty, and a `public/_headers` keeps its rules, kay's block following them without a header the file names. `headers.nginx.conf` carries no `cache-control`, as an nginx `include` cannot say a header per path.
package/llms/checks.md CHANGED
@@ -53,7 +53,7 @@ kay lint --cache
53
53
  - A name starting with `_` is unused on purpose, and so is a prop destructured beside `...rest`, which it leaves out.
54
54
  - The editor reports them too, greyed out, and offers to remove an unread prop.
55
55
  - A file with a compile error is not searched for them until it compiles, as the code the error stopped may read them.
56
- - Literal values the server would refuse when it runs: a `ctx.fail` status outside 400 to 599, a redirect target with a scheme other than http(s), such as `javascript:`, or with a line break, and a `cached()` ttl that is not positive. A computed one is checked when it runs.
56
+ - Literal values the server would refuse when it runs: a `ctx.deny` status outside 400 to 599, a redirect target with a scheme other than http(s), such as `javascript:`, or with a line break, and a `cached()` ttl that is not positive. A computed one is checked when it runs.
57
57
  - Island props a layout or a page with a `--- server` fence passes can be serialized, those of a `{...spread}` included: no functions (an action excepted, which goes as its URL), blocks with parameters or class instances.
58
58
  - `secret-prop` reads the same props for fields named like a secret (`password`, `token`, `apiKey`, `email`...): an island's props are in the page source, so hand it the fields it shows, `user={{ name: user.name }}`, or allow a public one with `// kay-allow secret-prop`.
59
59
  - A static component passing one is the `island-prop` error: it declares `island()` or passes the island data (see [Islands](islands.md#islands)), and children pass from anywhere.
@@ -16,8 +16,7 @@
16
16
  | `brace-in-attribute` | deny | code | A quoted attribute of an HTML element holding `{name}`, `{user.name}` or `{count(1)}`: only text interpolates, so the braces ship as written. The quick fix writes `title={name}`, or a template literal for mixed text, and is safe for a name in scope; `\{` keeps a literal brace. A component's quoted prop is left alone. |
17
17
  | `unknown-link-flag` | deny | code | A `data-` attribute one letter from a navigation flag of a link (`data-scroll`, `data-transition`, `data-prefetch`, `data-reload`), as `data-prefech` or `data-scrol`: it would do nothing. The fix, which is not safe, writes the flag meant. |
18
18
  | `async-reply` | warn | code | An `async` function returning kayjs-ai's `ask()`, which awaits the reply so nothing streams; a local `const` holding the reply counts; the fix removes `async` where every returned value is the reply, a function awaiting first returns `ask(...).stream()`. |
19
- | `unreturned-fail` | deny | code | A `ctx.fail(...)` statement (or a destructured `fail(...)`) in an action's handler that is not returned, which does nothing as `fail` returns the failure where `deny`, `notFound` and `redirect` throw; an expression-bodied arrow and a nested function are left alone, the fix prepends `return`. |
20
- | `once-read-prop` | deny | code | A destructured prop read into a top-level `let`, a destructured `const`, one that awaits or a declaration nested in a block, that a function or the template reads later, in a component that runs in the browser: the declaration runs once, so the value keeps the prop's first value after the parent changes it. A top-level `const` naming one value is a memo and follows the prop, so it is no case. A prop read as the test of an `if` or a ternary, an argument of a call or `new`, a write target, in a class, or inside `signal(...)`, `persisted(...)` or `posted...(...)`, `id ?? uid()`, a callback prop, a prop named `initial*` or `default*` are choices made once; otherwise compute the value where it is used or in a `memo`, or allow it with `// kay-allow once-read-prop: why the first value is meant`. |
19
+ | `once-read-prop` | deny | code | A destructured prop read into a top-level `let`, a destructured `const`, one that awaits or a declaration nested in a block, that a function or the template reads later, in a component that runs in the browser: the declaration runs once, so the value keeps the prop's first value after the parent changes it. A top-level `const` naming one value is a memo and follows the prop, so it is no case. A prop read as the test of an `if` or a ternary, an argument of a call or `new`, a write target, in a class, or inside `signal(...)`, `persisted.cookie(...)` or `posted...(...)`, `id ?? uid()`, a callback prop, a prop named `initial*` or `default*` are choices made once; otherwise compute the value where it is used or in a `memo`, or allow it with `// kay-allow once-read-prop: why the first value is meant`. |
21
20
  | `literal-tag` | deny | code | Template text holding an HTML tag, `p Press <kbd>Ctrl</kbd>`: text is escaped, so readers see the tag as written. Text inside `code`, `pre`, `kbd` and `samp`, an entity such as `&lt;kbd&gt;` and a name that is no element, as in `Array<string>`, are left alone. The quick fix writes a pair around plain text, or a void element, as `#[kbd Ctrl]`. |
22
21
  | `unkept-page` | warn | code | A page saying `keep: true` that `kay build` does not keep prerendered, as it reads the request or the clock, imports a package, holds module state or renders differently each time: reported by `kay build` at the file and line that decided it, never by `kay check`, and no `// kay-allow` comment reaches it. |
23
22
  | `removed-ui-token` | warn | code | A kayjs-ui theme token or utility under its old `kui-` name, such as `--color-kui-canvas` or `bg-kui-surface2`, which stopped working in 1.75: a utility builds nothing and a `var()` of it resolves to nothing. `kay check --fix` rewrites it to the app's own name where one stands for it, and the report says where to set the rest: a `--kui-border-*` knob and a `kui-` utility with no new form are reported without a fix. Names quoted in a comment are not reported |
@@ -29,7 +29,7 @@ How kay and its libraries name the same idea, written before the renames land: a
29
29
  - A component's transition callback takes one event object, however many things it reports: `onOpenChange({ open })`, `onChange({ value, option })`, `onSortChange({ sort })`. Never positional arguments, never a bare value (`onChange({ value })`). The fields are camelCase names of what they hold, the same on every component of a kind: `open`, `value`, `checked`, `selected`, `item`, `key`, `index`, `page`, `size`, `files`, `rows`, `options` and `query` for a source that answered. A native event rides as `event` (`onPage({ page, event })`), and `onError` keeps its failure shape.
30
30
  - State a prop can hold reports through `on<Prop>Change({ <prop> })`, the field being the prop's name: `open` with `onOpenChange({ open })`, `value` with `onValueChange({ value })` (Accordion, Tabs, ThemeToggle), `collapsed` with `onCollapsedChange({ collapsed })`. What the app holds as a key but the callback reports richer (`selected` with `onSelectedChange({ keys, rows })`) reports those richer fields in place of the prop's own (Table, TreeView and Timeline `selected`, AudioPlayer `position`, MarkdownEditor `preview`), a deliberate exception listed as `ALIASED` in `tests/callbacks.test.ts`, and `bind:` does not apply to it. The press of an item with no prop behind it is `on<Verb>`: `onSelect({ item })`, `onRowClick({ row, event })`, `onCopy({ text })`. One name per meaning: never `onToggle`, `onClose`, `onPick` or `onUpdate`.
31
31
  - A source that answers (a list, a promise or an action) reports through `onLoad({ options, query })` (`{ rows }` on a Table, `{ items }` on a VirtualList) and `onError({ error, query })`.
32
- - `onChange` on Accordion, Tabs and ThemeToggle is `onValueChange`, ZoomPane's is `onPlateChange`, Table's `onSort` is `onSortChange` and a chart's `onActive` is `onActiveChange`. The old names keep working with their old arguments until 1.108, and `kay upgrade` rewrites them (`deprecated-ui-callbacks`).
32
+ - `onChange` on Accordion, Tabs and ThemeToggle is `onValueChange`, ZoomPane's is `onPlateChange`, Table's `onSort` is `onSortChange` and a chart's `onActive` is `onActiveChange`. The old names went in 1.109.
33
33
 
34
34
  **Hooks and switches**
35
35
  - An `on*` hook of a server extension takes one event object, `onSave({ ... })`, and returns nothing; the `on*` prop of a component takes one event object too, holding what it reports (`onSave({ data })`, `onSend({ data })`, `onCopy({ text })`, `onError({ error })`), with no `context` ([hooks](hooks.md), Callbacks below). A callback that returns data is named for what it returns (`profileFields`, `exportData`), not `on*` (#1694).
@@ -141,8 +141,8 @@ ul
141
141
 
142
142
  - `---` holds the component script: imports, props, signals, functions. It runs wherever the component renders.
143
143
  - `--- server` runs on the server for each request and never reaches the browser. A component has none: it takes its values as props, which the page or layout computes in its own `--- server`. A page that hydrates, which a handler in it makes it, runs its template in the browser without that fence, so a function the template calls and the server fence imports (`formatFileSize(share.size)`) is the error `server-import-in-island`: import it in the script fence too, or move what reads it into a component.
144
- - `island({ render, hydrate, persist, interactive })` first in the script says how the component is an island: it renders in the browser only (`render: 'client'`), is an island though nothing in it needs the browser (`island()`), or is held to staying none (`render: 'static'`); see [Islands](islands.md#islands). It replaces the `--- client`, `--- island` and `--- static` fence lines, deprecated since 1.105 (`deprecated-island-fence`).
145
- - `--- module` holds module-level code, run once per bundle rather than per render: `export const visits = signal(0)` or `export function label(n: number)` there are values other files import from the `.kay` file, typed as written (`import { label } from './counter.kay'`). It takes no props and no default export, and a `--- client` component has none. Module state is per bundle: the server's copy and the browser's are not shared. A signal exported from it is read by an importer as `visits()` and written as `visits = 1`, as one a `.ts` module exports.
144
+ - `island({ render, hydrate, persist, interactive })` first in the script says how the component is an island: it renders in the browser only (`render: 'client'`), is an island though nothing in it needs the browser (`island()`), or is held to staying none (`render: 'static'`); see [Islands](islands.md#islands).
145
+ - `--- module` holds module-level code, run once per bundle rather than per render: `export const visits = signal(0)` or `export function label(n: number)` there are values other files import from the `.kay` file, typed as written (`import { label } from './counter.kay'`). It takes no props and no default export, and a component declaring `island({ render: 'client' })` has none. Module state is per bundle: the server's copy and the browser's are not shared. A signal exported from it is read by an importer as `visits()` and written as `visits = 1`, as one a `.ts` module exports.
146
146
  - `--- style` holds CSS scoped to the component: kay adds a `data-k-<id>` attribute to every element the template writes and ends each selector on it (before a pseudo-element, which keeps its place), so `.card { color: red }` reaches this file's `.card` alone, and the rule weighs one attribute more. `:global(.x)` is the escape, `:global(body) .card` scoping `.card`, a list `:global(.a, .b) .card` global in each entry, and `@media`, `@supports`, `@layer` and `@container` bodies are scoped alike; a rule nested inside another is scoped on its own selector, and a `@keyframes` name is scoped to the component with the `animation` and `animation-name` values that use it (`@keyframes :global(spin)` keeps `spin` for other components to use). A component called from the template keeps its root unscoped, reached through `class` and parts, and slotted content carries its writer's attribute. The CSS joins the page stylesheet as an imported one does (Tailwind's `@apply` works, unused classes are cut).
147
147
  - `kay check` reads the style fence for `unused-selector` (warn: a rule no element of the template can match) and `unreachable-selector` (error, `:global(...)` its offered fix: a rule ending on `:root`, `html` or `body`).
148
148
  - A fence ends on a `---` line, or on a `--- server`, `--- script`, `--- module` or `--- style` line, which opens the next fence.
@@ -162,7 +162,7 @@ ul
162
162
  - Defaults go in the destructuring. A default applies only to an `undefined` prop (`null` stays `null`), and runs only then, once per component, the first time the prop is read (a literal one is written at each read instead, as it has no identity to keep).
163
163
  - Props stay reactive: the compiler turns each destructured name into a live read. A top-level `const` computed from a prop or a signal is live in the browser: `const last = items.length - 1` or `const twice = count() * 2` is read as a value and follows what it reads, the compiler making it a memo (a `const` built from another one too). The server renders once and keeps it plain. The test of a condition or a ternary, the arguments of a call or `new`, an `initial*` or `default*` prop, a callback prop, `id ?? uid()` and a function or class body choose or build something once, so a `const` reading only those keeps its first value; so does one under `// kay-allow once-read-prop: why`, and a `let`, a destructured `const`, one with an `await` and a declaration inside a block (`once-read-prop` says so for a prop): there write `memo(() => ...)` or compute it where it is read. Such a `const` cannot be reassigned.
164
164
  - Props are read-only.
165
- - `slot` and `slot name` type the children and the blocks a call may pass, from the template: declare no `children`, and no `name?: Snippet` for a `slot name` the template reads, and a call passing a block the component has no `slot` for is a `kay check` error. A block read with values, `slot item(row, i)`, takes a function whatever its arguments, so declare `item: Snippet<[Row, number]>` to type them. To require children or a block, declare it required: `const {} = props<{ children: Snippet }>()`, as a destructured name nothing reads is `unread-name`; `deprecated-children-prop` removes a `children?: Snippet` beside a bare `slot`.
165
+ - `slot` and `slot name` type the children and the blocks a call may pass, from the template: declare no `children`, and no `name?: Snippet` for a `slot name` the template reads, and a call passing a block the component has no `slot` for is a `kay check` error. A block read with values, `slot item(row, i)`, takes a function whatever its arguments, so declare `item: Snippet<[Row, number]>` to type them. To require children or a block, declare it required: `const {} = props<{ children: Snippet }>()`, as a destructured name nothing reads is `unread-name`.
166
166
  - A prop holding an action is typed `Action`, or `NoInputAction<unknown>` for one without input; see [Pass an action to a component](actions-from-islands.md#pass-an-action-to-a-component).
167
167
  - A prop holding a component is typed `Component<Props>` from `kay` and drawn by its capitalised name, one holding an icon with `svg({...icon})`; see [Draw an icon or a component chosen by a value](templates.md#draw-an-icon-or-a-component-chosen-by-a-value).
168
168
  - A page has no props: its data comes from its `--- server` fence.
@@ -183,7 +183,7 @@ ul
183
183
  - Assigning writes a signal wherever it sits: one a `const`, an import, a `let` or `var` set to `signal(...)` holds, and also one in an object's property or an array element, `box.count = 1`, `list[2]++`, or in a `let` set from a function's result. The compiler cannot tell those from a plain write, so the runtime does: a signal there is written, anything else assigned, and `kay check` types the write by what the target holds, `box.count = 'x'` being a type error for a `Signal<number>`. A function assigned there, a signal included, replaces what was held. A target kay sees holds no signal, a literal or `new Map()`, is assigned as written, and so is a field of `this`, a write beside another write, a `let` written with an `await`, a compound write holding an `await`, and a `let` update whose value is read: use `.set` there. A `readonly` property or array element holding no signal, written this way, is a `kay check` error, as in plain code.
184
184
  - `bind:name={signal}` on a component needs a signal and a prop typed `Bindable<T>` or with an `on<Name>Change` callback beside it; a child hands it on with `bind:name={name}`, through any number of levels. `bind:` on a component makes the parent an island. `...rest` and a props spread hand a `Bindable` prop on whole; a member of `rest` is a value and `bind:` refuses it. `kay check` reports a prop with neither, and a memo or a value that is no signal.
185
185
  - A prop is always a value: a parent hands a signal's or a memo's value, `Toggle(open={open()})`, kept current through a getter, or binds the prop with `bind:`.
186
- - Assign every state primitive: `persisted`, `queryParam`, `linked` and `selection` write as a `signal` does (`selected = id`). `live` writes with `.set(value)`, or `.set(key, value)` for a keyed one, on the server only, and assigning it is a compile error that says so. A `resource` or a `socket` is called or read through its members.
186
+ - Assign every state primitive: `persisted`, `queryParam`, `linked` and `selection` write as a `signal` does (`selected = id`). `live` writes with `.set(value)`, or `.set(value, { key })` for a keyed one, on the server only, and assigning it is a compile error that says so. A `resource` or a `socket` is called or read through its members.
187
187
  - `kay check` narrows a signal or memo a template expression calls within that expression: `{error() && error().message}`, with `error` a `signal<Error>()`, checks.
188
188
  - A write in between, as by a function the expression calls, is not seen by that narrowing.
189
189
  - Reads inside a function the template writes, a handler or a `.map` callback, run later and are not narrowed at all: copy the value into a `const` in the script, or assert it, `sent()!`.
@@ -221,7 +221,7 @@ p {game.miners[0].ore}
221
221
  - `linked(() => board.tiers)` from `kay` is a writable signal that follows its source: an island edits it locally, and it takes its source's value again whenever that changes: `tiers = moved` shows the edit, and once a refresh or the next page gives a new `board`, `tiers()` reads its tiers.
222
222
  - A `linked` signal drops its edit when its source changes, even when the source comes back to the value it was edited over.
223
223
  - `linked` reads a prop of a component inside an island, or of an island marked `persist`, the ones whose props change in place, a prop given unchanged keeping its edit.
224
- - A top-level island whose props changed on a refresh renders afresh from them, its dialogs and focus lost: one whose state should outlive a refresh, such as an editor, is marked `persist`, so it stays and takes the new props.
224
+ - An island stays on a refresh and takes the new props in place, its dialogs, focus and signals kept: what it reads from `props` in its template or an effect follows them, a `signal(light)` seeded from a prop keeps the first value, and `linked(() => light)` is the form that follows. A list whose items move is kept by `persist={id}`.
225
225
  - `selection<Key>(initial?)` from `kay` holds one selected string or number key among many rows, or none. It is a signal: it reads as `selected()` and writes as `selected = id`.
226
226
  - `selected.is(row.id)` re-runs only for the rows a change selects or unselects, not every row: `tr(class={{ danger: selected.is(row.id) }})`.
227
227
 
@@ -13,10 +13,5 @@ The lints of the `deprecated` group, each the old form a minor replaced, reporte
13
13
  | Lint | Default | Group | Reports |
14
14
  | --- | --- | --- | --- |
15
15
  | `deprecated-action-options` | warn | deprecated | The arguments of `action` before 1.107, `action(schema, handler, options)` and `action(handler, options)`: the options come first, with the input in them, as an API route's do, `action({ input: schema, ...options }, handler)` and `action(options, handler)`. `input` is a plain record of fields or any schema. The old forms work until 2.0. Found on the `action` a file imports from `kay`, in the TypeScript files and the fences of `.kay` files; the fix moves the arguments and keeps their text. |
16
- | `deprecated-schema-builders` | warn | deprecated | The PascalCase builders of `s` before 1.106, which kay's own lowercase builders replace, each taking the same field options (`optional`, `default`, `error`, `label`, `description`, `example`) and short names for the rest: `s.String` is `s.string` (`min`, `max`), `s.Integer` `s.int`, `s.Number` and `s.Numeric` `s.number`, `s.Boolean` and `s.BooleanString` `s.boolean`, `s.Array` `s.list`, `s.UnionEnum` and `s.UnionKeys` `s.enum`, and `s.Date`, `s.Literal`, `s.Union`, `s.Object`, `s.File`, `s.Files`, `s.Secret` and `s.Public` their lowercase names; `s.Optional(field)` is `optional: true` in the options of the field; an `s.Object({ ... })` that is the schema of an `action` or a `defineEnv` is the record of fields alone; and a file size written `'2m'` is `'2mb'`. The old names work until 2.0. Found on the `s` a file imports from `kay`, in the TypeScript files and the fences of `.kay` files. The fix renames the builder and the options that changed; an `s.Optional` around anything but one of these builders, such as a helper of `kay/content`, is left as it is. A lowercase `s.object` refuses a key its shape lacks where kay reads the schema itself (an action's input, an API route's body, `defineEnv`, collection frontmatter), where `s.Object` let it by: write `{ extra: 'strip' }` where the old way is wanted. A query, the headers and the cookies of a request carry keys no schema names, so their unknown keys are dropped whatever the schema says. |
17
- | `deprecated-uncaught-await` | warn | deprecated | A `// kay-allow uncaught-await` comment or a `lints: { 'uncaught-await': ... }` entry of kay.config.ts, since 1.105: the `uncaught-await` lint is gone, as an `await` with no `catch` renders the `catch` of the `try` around it, else an alert (`data-kay-await-failed`, worded by the `kay.await.failed` message) in its place, the rejection reported either way. The fix removes the comment, or the name from a list of lints, or the config entry. |
18
- | `deprecated-children-prop` | warn | deprecated | `children?: Snippet` in a props type beside a bare `slot`, since 1.105: the template types the children, so a component declares none. `children: Snippet` still requires them. The old declaration works until 1.108. The fix removes the member. |
19
- | `deprecated-link-flags` | warn | deprecated | `data-keep-scroll`, `data-no-transition` and `data-no-prefetch`, since 1.105 `data-scroll="keep"`, `data-transition="false"` and `data-prefetch="false"`, named as the options of `navigate()`. The old names work until 1.108. The fix writes the new attribute; a dynamic `data-no-transition` or `data-no-prefetch` has none. The app's test files (`*.test.*`, `*.spec.*`) are checked too: a selector `[data-keep-scroll]` is written `[data-scroll=keep]` by the fix, an attribute read by name (`getAttribute('data-keep-scroll')`) has a fix that is not safe, a read of `dataset.keepScroll` (and `noTransition`, `noPrefetch`) has one too, and a write of it and any other string naming an old flag have none. |
20
- | `deprecated-parts-class` | warn | deprecated | The parts of a component given as its `class`, `parts` since 1.105: `Card(class={{ head: 'p-6' }})` is `Card(parts={{ head: 'p-6' }})`. The old form, an object literal of strings by part name, works until 1.108, the compiler handing it on as `parts`. The fix writes `parts` for `class`. |
21
-
22
- The rows of the lints that came in 1.105 are in [Deprecated lints of 1.105](deprecated-lints-1-105.md).
16
+ | `deprecated-schema-builders` | warn | deprecated | The PascalCase builders of `s` before 1.106, which kay's own lowercase builders replace, each taking the same field options (`optional`, `default`, `error`, `label`, `description`, `example`) and short names for the rest: `s.String` is `s.string` (`min`, `max`), `s.Integer` `s.int`, `s.Number` and `s.Numeric` `s.number`, `s.Boolean` and `s.BooleanString` `s.boolean`, `s.Array` `s.list`, `s.UnionEnum` and `s.UnionKeys` `s.enum`, and `s.Date`, `s.Literal`, `s.Union`, `s.Object`, `s.File`, `s.Files`, `s.Secret` and `s.Public` their lowercase names; `s.Optional(field)` is `optional: true` in the options of the field; an `s.Object({ ... })` that is the schema of a `defineEnv` is the record of fields alone, as an env reads only the names it declares; and a file size written `'2m'` is `'2mb'`. The old names work until 2.0. Found on the `s` a file imports from `kay`, in the TypeScript files and the fences of `.kay` files. The fix renames the builder and the options that changed, and keeps what each did: an `s.Array` takes `max: Number.MAX_SAFE_INTEGER` (the lowercase list stops at 1,000 items) and an `s.Object` `extra: 'strip'`, a rewrite whose options are not an object literal being reported without a fix; an `s.Union` of `Object.keys(R).map(key => s.Literal(key))` is `s.enum(R)`, and any other `s.Union` of a mapped array is reported without a fix; an `s.Optional` around anything but one of these builders, such as a helper of `kay/content`, is left as it is. A lowercase `s.object` refuses a key its shape lacks where kay reads the schema itself (an action's input, an API route's body, `defineEnv`, collection frontmatter), where `s.Object` let it by, so the fix writes `{ extra: 'strip' }`. A query, the headers and the cookies of a request carry keys no schema names, so their unknown keys are dropped whatever the schema says. |
17
+ | `deprecated-ui-props` | warn | deprecated | A kayjs-ui or kayjs-ai prop under its name before 1.98. `heading` on a Dialog, SidePanel or FormDialog is `title`, which takes a string or a `@title` block as a Card's does, and the string that named the dialog for screen readers is `label`. `variant` on a Stat, Chat or ChatLauncher is `layout`, `variant` naming only the frame of a control. The old names work until 2.0. The fix renames the prop or the block, and the `title` string beside a `heading` to `label`; it offers none where the new name is already written. |
package/llms/effects.md CHANGED
@@ -95,4 +95,4 @@ p {seconds()}s on the page, last key {key()}
95
95
  - `throttled(source, delay)` from `kay` is its twin for a value that must keep up while it changes: it gives `source`'s value at most once per `delay`, the first change at once and the last one when the wait ends; it is read by calling it, keeps its first value on the server and drops its timer with the island.
96
96
  - `watch` and `debounced` run nothing while the server renders an island, as `effect` does; at a module's top level they run in the server's process too, as `effect` does there.
97
97
  - `listen(() => window, 'keydown', event => ...)` from `kay` listens to an event of `window`, `document` or any other target while the island lives, the handler typed by the target's events and the fourth argument passed to `addEventListener`.
98
- - The target is a function returning it, the one form: it is never read on the server, in a `.ts` module as in a `.kay` file, and a `ref` or a signal it reads is followed, `listen(() => panel, 'scroll', ...)` listening to its new value as it changes, none while it is undefined. A target given as a value, `listen(window, ...)`, works until 1.108, `kay upgrade` wrapping it (`deprecated-listen-target`).
98
+ - The target is a function returning it, the one form: it is never read on the server, in a `.ts` module as in a `.kay` file, and a `ref` or a signal it reads is followed, `listen(() => panel, 'scroll', ...)` listening to its new value as it changes, none while it is undefined. A target given as a value, `listen(window, ...)`, is a type error, and in a `.kay` file a read of `window` in an island.
package/llms/errors.md CHANGED
@@ -45,7 +45,7 @@ kay explain template-syntax
45
45
  | `fence-syntax` | compile | Code in a fence that does not parse, or code the template generates that does not. | [File layout](components.md#file-layout) |
46
46
  | `page-settings-invalid` | compile | A page setting exported under its own name instead of inside `page`, such as `export const prerender = true`, or a `guards` or `layouts` that an endpoint or an API module sets to anything but a literal `true` or `false`, or a `query` declared outside a page or a layout. | [Page settings](routing.md#page-settings) |
47
47
  | `signal-misuse` | compile | A signal or memo written the wrong way: a memo assigned, a name declared twice, a `bind:` to a name holding no signal. | [Signals](components.md#signals) |
48
- | `client-route-fence` | compile | A page, layout or special page declaring `island({ render: 'client' })` or with a `--- client` fence: they render on the server. | [Islands](islands.md#islands) |
48
+ | `client-route-fence` | compile | A page, layout or special page declaring `island({ render: 'client' })`: they render on the server. | [Islands](islands.md#islands) |
49
49
  | `server-import-in-island` | compile | A page whose template reads a name imported only in its `--- server` fence, where the page hydrates (a handler makes it an island): the browser runs the template without that fence, so the read throws and every island of the page stays inert. Reported by the type check, at the read; the fix, offered, imports it in the script fence too. | [File layout](components.md#file-layout) |
50
50
  | `static-pin` | compile | A component pinned static, with `island({ render: 'static' })`, that something makes an island: an `on*`, `bind:` or `ref`, a browser value of `kay` or a live value. The error stands at that thing; a function it hands an island is `island-prop`. | [Islands](islands.md#islands) |
51
51
  | `browser-only-read` | compile | A browser-only name such as `window` read while a component renders on the server too; reported by the type check, so a page still runs. | [Browser globals on the server](browser-only.md#browser-globals-on-the-server) |
@@ -63,7 +63,7 @@ kay explain template-syntax
63
63
  | `executable-incomplete` | build | A compiled executable that lacks a part of what it needs: the build of a collection, the client build, its fonts or a share card key. | [Build one executable](build-and-start.md#build-one-executable) |
64
64
  | `route-invalid` | build | A route file the router cannot serve: a name with characters it cannot mount, a matcher, guard, endpoint or API module that exports the wrong thing, two files exporting the same action, or two extensions each giving an editor. | [Pages and routing](routing.md#pages-and-routing) |
65
65
  | `redirect-invalid` | build | A redirect in `redirects` that does not start with `/`, holds something other than a `:param` or a final `*`, or goes to a path using a part its source lacks. | [Redirects](routing-endpoints-and-base.md#redirects) |
66
- | `locales-invalid` | build | An `i18n` config that does not hold together: no locales, a tag that is none, a default outside the locales, domains and `prefixDefault` together, `paths` naming a page that does not exist, a catalog that exports no messages or not as `defineMessages`, or `writeDraftMessages` given a locale the config does not translate. | [Configuring locales](locales.md#configuring-locales) |
66
+ | `locales-invalid` | build | An `i18n` config that does not hold together: no locales, a tag that is none, a default outside the locales, `paths` naming a page that does not exist, a catalog that exports no messages or not as `defineMessages`, or `writeDraftMessages` given a locale the config does not translate. | [Configuring locales](locales.md#configuring-locales) |
67
67
  | `font-invalid` | build | A font in `fonts` that is no font file, no installed Fontsource package, or lacks the weight, style or subset asked for. | [Fonts](sitemap-search-fonts.md#fonts) |
68
68
  | `favicon-invalid` | build | A favicon, manifest icon or SVG that is no SVG kay can draw, has no size, is not square, or a manifest path outside its scope. | [Favicon and web manifest](sitemap-search-fonts.md#favicon-and-web-manifest) |
69
69
  | `share-card-invalid` | build | A share card drawn with no font, a logo that is missing, not square or not an image kay draws, a colour that is no #rrggbb, an empty title, or a `_card.kay` with no Chrome to draw it or a card on an image it cannot show. | [Draw a share card for a page](images.md#draw-a-share-card-for-a-page) |
package/llms/events.md CHANGED
@@ -11,7 +11,7 @@ kay and its libraries tell an app what happened with DOM events, and keep what a
11
11
 
12
12
  ### Events
13
13
 
14
- - A public event is `<lib>:<verb>` (`kay:`, `kai:` for kayjs-ai, `kui:` for kayjs-ui) fired on `document`, with an object `detail`. A plain script (an analytics tag, a lightbox) listens with `document.addEventListener('kay:renew', ...)`, an island with the function hook of the table below, which ends with the island and hands an object of its own where the event hands `detail`; `listen(() => document, 'kay:navigate', ...)` in an island is `deprecated-island-events`. An event with no hook in the table (`kay:renew`, the dev events, the chat's) stays a `listen(() => document, ...)` for an island too. An event an app sends to a component is dispatched on `document` too, `new CustomEvent('kai:chat-send', { detail: { text } })`.
14
+ - A public event is `<lib>:<verb>` (`kay:`, `kai:` for kayjs-ai, `kui:` for kayjs-ui) fired on `document`, with an object `detail`. A plain script (an analytics tag, a lightbox) listens with `document.addEventListener('kay:renew', ...)`, an island with the function hook of the table below, which ends with the island and hands an object of its own where the event hands `detail`. An event with no hook in the table (`kay:renew`, the dev events, the chat's) stays a `listen(() => document, ...)` for an island too. An event an app sends to a component is dispatched on `document` too, `new CustomEvent('kai:chat-send', { detail: { text } })`.
15
15
  - An event about one element (`kay:action-*` on a form, `kui:hold-defaults` on a form) bubbles, so `document` hears it as well.
16
16
 
17
17
  | Event | Fires | `detail` | Hook of an island |
package/llms/guards.md CHANGED
@@ -57,7 +57,7 @@ A `path` is one route, a `prefix` a subtree, and every `guards` option takes a g
57
57
  - A route with guards of its own is covered: `unguarded-route` and `guards.default` leave it out, and `kay build --static` refuses to write it, as for one a `_guard.ts` covers.
58
58
  - `false` is read from the source as written, as `layouts: false` is, so `kay check` and `kay dev` report a `guards` set to `(false)`, `!open`, `false || open`, a method, a getter, and a `layouts` or a spread held in a variable or an expression, rather than ignore it. A variable holding `false` is no guard: the route answers 500 when asked, naming the file. Guards the source does not show where kay reads them, in a `page` typed `: PageSettings` or an `api(options)` call holding a variable, stop the boot or answer 500 and a static export refuses them, never serve the route with none.
59
59
  - `guards: { default }` left unset, on a site with at least one guard of its own, answers 403 for each page, endpoint or API module of the app that no guard covers (a library's routes, layouts and action modules excepted), and `kay check` reports each as an `unguarded-route` error; a site with no guard at all stays open, and `default: 'open'` keeps a site that mixes them open.
60
- - `guards: { default: 'closed' }` in kay.config.ts (`requireGuards: true` until 1.108) fails closed everywhere, a layout's and an `_actions.kay`'s actions included: every page, action, endpoint and API module of the app that no guard covers and that does not set `guards: false` answers 403, the OpenAPI document too unless a guard covers every module not setting `guards: false`, and `kay build --static` refuses to write such a page or endpoint.
60
+ - `guards: { default: 'closed' }` in kay.config.ts fails closed everywhere, a layout's and an `_actions.kay`'s actions included: every page, action, endpoint and API module of the app that no guard covers and that does not set `guards: false` answers 403, the OpenAPI document too unless a guard covers every module not setting `guards: false`, and `kay build --static` refuses to write such a page or endpoint.
61
61
  - A layout a library mounts asks no guard of its actions, which still run the guards above it, and the OpenAPI document is served when every module is open.
62
62
  - `kay check` reports each one as `unguarded-route`.
63
63
  - A library's routes keep the guards it gives them.
package/llms/head.md CHANGED
@@ -238,6 +238,6 @@ export default defineConfig({
238
238
  - The site is the one the last `pages()` or build of the process read, one site per process.
239
239
  - `seo: { noindex: true }` in the `page` object a page's server fence exports asks search engines to leave it out, `<meta name="robots" content="noindex">` in its head, a `robots` tag of its own still winning.
240
240
  - `seo.noindex` also leaves the page out of the sitemap, as legal pages often are.
241
- - `seo` of `page` also takes `sitemap`, `lastmod`, `search` and `feed`, which were top-level keys of `page` before 1.105 (`deprecated-page-seo`), and `ttl` and `cacheControl` are `cache` (`deprecated-page-cache`).
241
+ - `seo` of `page` also takes `sitemap`, `lastmod`, `search` and `feed`, which were top-level keys of `page` before 1.105 and are no longer read there, as `ttl` and `cacheControl` are `cache`.
242
242
  - Without `site` and `seo`, a page's head holds only the tags it and its layouts set.
243
243
  - `kay build` reads the prerendered pages against one another and warns of shared titles and descriptions, a title over 60 characters, an orphan page, a canonical link or redirect leading to a redirect or a missing page and alternates that do not point back: the `seo` lints in [Lints](lints.md#seo-lints).
package/llms/hooks.md CHANGED
@@ -65,7 +65,7 @@ This release ships the helpers (`dispatch()`, `decide()`, `hookContext()`, `Hook
65
65
 
66
66
  ### The rule
67
67
 
68
- - `afterX` runs after X happened and only observes: what it returns is ignored. X is the verb of the transition in its base form: `afterSave`, `afterSend`, `afterDelete`, `afterSubscribe`. Never a participle (`afterSaved`). Before 1.105 it was `onX`, which the old names keep working as until 1.108 (`deprecated-hook-names`); `onX` is now the name of a component's callback and of a lifecycle (below).
68
+ - `afterX` runs after X happened and only observes: what it returns is ignored. X is the verb of the transition in its base form: `afterSave`, `afterSend`, `afterDelete`, `afterSubscribe`. Never a participle (`afterSaved`). Before 1.105 it was `onX`, which is no longer read; `onX` is the name of a component's callback and of a lifecycle (below).
69
69
  - `beforeX` runs before X and is the only hook that changes or refuses it.
70
70
  - Anything with a start and an outcome (a job, a schedule run, a workflow run, an ask, an action) uses `onStart`, `onSuccess` and `onError`, plus steps of its own (`onRetry`; kayjs-ai's `afterStep` and `afterToolCall` observe the ask). It is `onError`, never `onFail` or `onFailed`.
71
71
  - One object argument: the transition's fields plus `context`. A hook gets `{ user, context }`, not `(user, context)`.
@@ -106,7 +106,7 @@ export default defineConfig({
106
106
  - `onResponse({ request, url, locals, status, duration })` is told after the answer is made, `duration` in milliseconds, up to the first byte for a streamed answer. A throw is reported with source `onResponse`.
107
107
  - `onListen({ url })` runs when the server listens and `onStop()` when it stops, after the open requests finished and after the `onStop` hooks of the plugins and extensions; a throw is reported and the others still run.
108
108
  - `onError({ error, request, source, code })` receives every error kay logs ([Error reporting](routing-special-pages.md#error-reporting)); it was `observe.onError` before 1.105.
109
- - `actions.beforeRun({ action, file, input, context })` runs before every action's handler, once the guards and the schema let the post through; `false` or `refuse()` fails the post. It cannot change the input. `onSuccess` adds `result`, `onError` adds `status`, `message`, `errors`, `data` and `error` (undefined for `ctx.fail`). Every hook event carries one `context`, an action's being its own context (`request`, `locals`, `cookies`, `params`, `locale`) with `ip`, `userAgent` and `userId` beside: `({ context }) => context.locals`. `ctx` in the event works until 1.108 and `deprecated-hook-context` rewrites it; `onStart` of the config, which ran when the server listens, is `onListen` the same way (`deprecated-app-hooks`), `onStart` naming where a job, a queue or a workflow run begins.
109
+ - `actions.beforeRun({ action, file, input, context })` runs before every action's handler, once the guards and the schema let the post through; `false` or `refuse()` fails the post. It cannot change the input. `onSuccess` adds `result`, `onError` adds `status`, `message`, `errors`, `data` and `error`. Every hook event carries one `context`, an action's being its own context (`request`, `locals`, `cookies`, `params`, `locale`) with `ip`, `userAgent` and `userId` beside: `({ context }) => context.locals`. `ctx` is no longer in the event; `onStart` of the config, which ran when the server listens, is `onListen`, `onStart` naming where a job, a queue or a workflow run begins.
110
110
  - A redirect the handler throws is a success (the action did its work, as in post-redirect-get): `onSuccess` is told it with `result` undefined, and `onError` is not. `onSuccess` of a streaming action is told as the stream starts, before it is read.
111
111
  - The app's action hooks run before the action's own (`action(schema, handler, { onSuccess })`), both observing, a throw reported and never failing the action.
112
112
 
package/llms/images.md CHANGED
@@ -107,7 +107,7 @@ img(src={hero} sizes="(min-width: 60rem) 50vw, 100vw" alt="The workshop")
107
107
  - An image with any transparency, even a corner, gets no color (it would show through), nor do an SVG, an animated GIF, an AVIF from `assets.images.dirs` or `assets.images.remote`, a stored file whose key holds none (`files.url(key)`: `files.put` keeps the colour in the key of a still, opaque image, [Stored files](files.md)) or an image `assets.images.resolve` looks up, which may be private.
108
108
  - The color stays behind the loaded image, hidden by it, so `object-fit: contain` shows it beside the picture; an image an island creates in the browser has none, and the server's is left as it is when the island hydrates.
109
109
  - `placeholder={false}` on an `img` (`img(src={hero} placeholder={false} alt="")`, also after a spread, where it drops a `style` the spread brings as well), `image(src, { placeholder: false })` and an `img` with a `style` of its own, which is kept alone, leave the color out; `images: { placeholder: false }` in `kay.config.ts` does for every image, reading none for its color at build, and so does a site `security.csp` or `security.reportOnly` whose `style-src` (or `style-src-attr`) lacks `'unsafe-inline'`, as the browser would drop the attribute: a page's own `security` is not read for this.
110
- - An `img` takes the options of its imported or stored image as attributes: `sizes`, `aspect`, `quality` and `placeholder={false}`, written beside its `src`, `img(src={hero} sizes="50vw" aspect="1/1" quality={90} alt="")`; none is written to the page. Before 1.105 they went through `image(src, options)` from `kay/image`, `img({...image(hero, { aspect: '1/1' })})` and `no-placeholder`, which `kay upgrade` rewrites (`deprecated-image-options`).
110
+ - An `img` takes the options of its imported or stored image as attributes: `sizes`, `aspect`, `quality` and `placeholder={false}`, written beside its `src`, `img(src={hero} sizes="50vw" aspect="1/1" quality={90} alt="")`; none is written to the page. `no-placeholder` and `img({...image(hero, { aspect: '1/1' })})` of before 1.105 are no longer read.
111
111
  - `image(src, options)` from `kay/image` gives the same props to spread, for an element that is no `img` or an image kay did not import, which an `img` leaves as it is and so needs its `width` and `height` given to `image()`: `img({...image(post.photo, { width: post.photoWidth, height: post.photoHeight, sizes: '100vw' })} alt="")`.
112
112
  - `aspect="1/1"` on an `img` (`image(hero, { aspect: '1/1' })` for a spread) cuts the image to that shape, its middle kept, each variant cut on the server so a phone loads none of the pixels cut away, instead of CSS `object-fit: cover`: `width` and `height` are the largest box of that shape inside the image, and the variants stop at its width.
113
113
  - The ratio is two whole numbers from 1 to 100, read in lowest terms.
@@ -20,9 +20,11 @@
20
20
  | `uncalled-signal` | deny | islands | A signal or memo the template names without calling it where its value goes, `{count}` or `if count > 1`: a signal is read by calling it, in the template as in the script, `{count()}`. Handed on whole, as a component prop or a function argument, it passes the signal itself, which a parameter typed `Signal<T>`, `Memo<T>`, a function type or a generic `T` takes; one typed `unknown` or `any` is reported too, `String(count)`. `--fix` calls the signal named where its value goes. |
21
21
  | `constant-signal` | deny | islands | A signal the component script declares and only ever reads: it never changes, so a plain `const` renders the same without the reactivity. |
22
22
  | `signal-set-call` | deny | islands | A signal written `count.set(value)`, as a statement or an arrow's body, where assigning it, `count = value`, compiles to the same call; an updater written inline, `count.set(c => c * 2)`, and a `.set` whose value an expression uses are left. `--fix` assigns it. |
23
+ | `signal-from-prop` | warn | islands | A `signal` seeded from a destructured prop at the top of an island's script, `signal(light)` or `signal(todo.title)` that the island never writes: the island stays when the page gives it new props, as after an action or a refresh, so the signal keeps the first value. `linked(() => light)` follows the prop; `--fix` writes it, adding `linked` to the `kay` import. A signal the island writes (a counter starting from a prop) is its own state and is left alone, as is a prop named `initial...` or `default...`. |
23
24
  | `server-only-import` | deny | islands | `invalidatePage` or `sqliteCache` imported from `kay/cache` by an island's script, a browser-only component, a component only islands render, or a `.ts` module they import: the browser's `kay/cache` has `cached` and `invalidate` alone, so the build fails on the import. |
24
25
  | `missing-captcha` | warn | forms | A call of `password.register`, `password.requestReset`, `magicLink.request` or `password.signIn` on a receiver named `*auth` with no `captcha` option, where neither the file nor a module's `authCore` sets `captcha: false`: kayjs-auth's default proof of work refuses it as `{ ok: false, error: 'captcha' }`. Pass `{ captcha: input.captcha }` from a form carrying `input(type="hidden" name="captcha" data-kay-work={await auth.captcha.challenge('register')})`. In `.kay` fences and `.ts` modules alike. |
25
- | `island-marker` | deny | islands | An `island()` declaration (or a `--- island` fence) on a page, layout or special page, which are never islands. |
26
- | `island-prop` | deny | islands | A component that is not an island passing one a value its type says cannot be sent: a function, a block with parameters, a symbol, an object holding one. `island()` is the fix, offered, never applied by `--fix`. Found by the type check. |
26
+ | `island-marker` | deny | islands | An `island()` declaration on a page, layout or special page, which are never islands. |
27
+ | `page-island` | deny | islands | A page without a `--- server` fence that needs the browser (an `on*`, `bind:` or `ref`, a browser value of `kay`, a live or persisted import), which a page never does: move it into a component the page renders. |
28
+ | `island-prop` | deny | islands | A component that is not an island passing one a value its type says cannot be sent: a function, a block with parameters, a symbol, an object holding one. A function or a block with parameters is no error for an island that lists `interactive` props when the use writes none of them. `island()` is the fix, offered, never applied by `--fix`. Found by the type check. |
27
29
  | `hydration-mismatch` | deny | islands | An island reading the clock, `Math.random()` or a `toLocale*String` or `Intl` format with no locale (or, for dates, no `timeZone`) while it renders, which the server and the browser compute apart; `// kay-allow hydration-mismatch` allows a deliberate read. |
28
30
  | `unowned-effect` | warn | islands | `effect`, `watch`, `every`, `listen`, `debounced`, `throttled`, `onMount` or `onCleanup` called in a timer, a promise callback or after an `await`, where no owner stops them and each call lives until the page goes, or in an inline event handler or `listen` handler, where each event adds one stopped only when the component goes. Call them in the component script, or inside `root()`. Only inline handlers are seen: a named handler, a conditional handler and an `await` inside a loop are not. |
@@ -71,7 +71,7 @@ A hook is an option of the source and a method of the same name, takes one objec
71
71
 
72
72
  `socket(chat, '/:room', { params, onData: ({ value }) => add(value), onError: ({ error }) => toast.error(error.message) })` takes them as options; `messages.onClose(({ status }) => ...)` adds one later.
73
73
 
74
- The names before 1.105 work until 1.108 and `kay check` rewrites them (`deprecated-source-readers`): `value()` of a `resource`, `last()` of a stream or a socket, `rows()` of a collection, `onSuccess({ data })` of a `track()` handle and `onSync({ rows })` of a collection, whose events hand `value` now, `unsynced()` and `syncStatus()` (`sync.queued()` and `sync.status()`), and an action's `succeeded()` (`data()` and `status()`).
74
+ Every source reads alike: `data()`, `status()`, `pending()`, `error()` and `retry()`, and `onData({ value })` and `onError`; a collection adds `sync.queued()` and `sync.status()`.
75
75
 
76
76
  ### kayjs-ui components
77
77
 
@@ -15,8 +15,8 @@
15
15
  - A page's `--- server` fence, which loads its data before the render, reads a `persisted.cookie()` signal by calling it: `open()` there is the request's value, decoded and checked against `values` as the render does, the default when the cookie is missing or refused, so the fence needs no `ctx.cookies` and no knowledge of the cookie's encoding. The page then answers with `Vary: Cookie`.
16
16
  - A page `kay build` prerendered renders a `persisted` signal's default, in its server fence too, and the island corrects it as it hydrates.
17
17
  - The cookie is named as it is given, so it never reuses the name of a cookie the app sets itself.
18
- - `persisted` has one entry per storage, `persisted.cookie()`, `persisted.local()` and `persisted.session()`, each taking the options its storage can use, and a call always names its storage: a bare `persisted(name, value)`, which kept a cookie without saying so, works until 1.108 and `kay upgrade` writes `.cookie` for it (`deprecated-persisted-call`). The `storage` option is gone since 1.105.
19
- - A query param is not persisted but `queryParam`, below: `persisted.query(name, value, options)` is `queryParam(name, { default: value, ...options })`, works until 1.108 and `kay upgrade` rewrites it (`deprecated-persisted-query`).
18
+ - `persisted` has one entry per storage, `persisted.cookie()`, `persisted.local()` and `persisted.session()`, each taking the options its storage can use, and a call always names its storage: there is no bare `persisted(name, value)`.
19
+ - A query param is not persisted but `queryParam`, below.
20
20
  - `queryParam<number>('page')` from `kay` is a signal holding one query param of the page, read as the page's `query` schema reads `ctx.query` (see routing): a number, a boolean, one of an enum, a list from a repeated param, the schema's `default` when the param is left out.
21
21
  - The server writes the schema's rules for its params into the page, which the island reads them by, so an island works on any page and Elysia's `t` never reaches the browser; the server renders the same value from the first paint.
22
22
  - A value the rules refuse reads as the default rather than throwing.
package/llms/islands.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Islands
2
2
 
3
- A component is an island when its own code needs the browser: an `on*`, `bind:` or `ref` in its template, a browser value of `kay` in its script (a `live` or `persisted` value a module exports included, whether the component imports it from that module, from one re-exporting it or from one importing it and handing it on; a component with a `--- server` fence stays on the server; a function of that module reading the value inside does not count, only the value itself being imported), or an `island()` declaration (`island({ render: 'client' })` for one that renders in the browser only); what an island renders is part of it, and nothing a component passes makes it one. It is decided at compile time, from the file and its imports. A page of the routes directory should never be one: a handler, a `bind:`, a `ref`, a signal or a live or persisted import in a page without a `--- server` fence still makes it an island through 1.107, `kay check` warns with `deprecated-page-island`, and 1.108 refuses it. Move what needs the browser into a component of its own that the page renders.
3
+ A component is an island when its own code needs the browser: an `on*`, `bind:` or `ref` in its template, a browser value of `kay` in its script (a `live` or `persisted` value a module exports included, whether the component imports it from that module, from one re-exporting it or from one importing it and handing it on; a component with a `--- server` fence stays on the server; a function of that module reading the value inside does not count, only the value itself being imported), or an `island()` declaration (`island({ render: 'client' })` for one that renders in the browser only); what an island renders is part of it, and nothing a component passes makes it one. It is decided at compile time, from the file and its imports. A page of the routes directory should never be one: a handler, a `bind:`, a `ref`, a signal or a live or persisted import in a page without a `--- server` fence is the `kay check` error `page-island`. Move what needs the browser into a component of its own that the page renders.
4
4
 
5
5
  ## Common tasks
6
6
 
@@ -64,6 +64,8 @@ const q = queryParam('q', { default: '' })
64
64
  input(type="search" bind:value={q} aria-label="Search")
65
65
  ```
66
66
 
67
+ A link or a component navigating to the same path with another query (`a(href="?tab=b")`, `Segmented(param="range")`), Back and Forward all reach every `queryParam` signal, one shared by islands included, whether its island is rendered on the server or in the browser.
68
+
67
69
  ### Hydrate an island later
68
70
 
69
71
  `hydrate="visible"` waits until it scrolls near the viewport, `hydrate="idle"` until the browser is idle, `hydrate="interaction"` until the first pointer, focus, key or touch event inside it, and `hydrate="media(max-width: 40rem)"` until the media query matches, at once when it does and later when it starts to:
@@ -88,9 +90,9 @@ const { label } = props<{ label: string }>()
88
90
  button {label}
89
91
  ```
90
92
 
91
- `island()` alone says the component is an island though nothing in it needs the browser, and `render` says how it renders: `'island'` (the default), `'client'` for one that renders in the browser only (`island({ render: 'client' })`, see [Browser-only code](browser-only.md)), `'static'` to hold it to staying no island, so anything in it that needs the browser is the compile error `static-pin`. They were the `--- island`, `--- client` and `--- static` fence lines, and `export const island = { ... }` in a `--- module` fence, which `kay upgrade` rewrites (`deprecated-island-fence`) and which work until 1.108.
93
+ `island()` alone says the component is an island though nothing in it needs the browser, and `render` says how it renders: `'island'` (the default), `'client'` for one that renders in the browser only (`island({ render: 'client' })`, see [Browser-only code](browser-only.md)), `'static'` to hold it to staying no island, so anything in it that needs the browser is the compile error `static-pin`. A `--- island`, `--- client` or `--- static` fence line is an unknown fence, and a `--- module` fence exports no `island`.
92
94
 
93
- A component can also list the props that make a use of it an island: `island({ interactive: { selectable: false, pageSize: false } })`, each prop with whether it is on when a use leaves it out. A page or a server component whose use turns none of them on, passes no function, no promise and nothing `island` could not send, and writes no `hydrate` or `persist`, gets the component as plain markup: no island, and no script for the page when nothing else on it needs one. Its children and blocks render in the page as an island's do, and an island inside it stays an island of its own. A use inside another island is part of that island as before, and the props the use is given decide, so a spread counts. A route that is not prerendered still counts the island in `kay build`'s size estimate, an upper bound. `kay explain island` lists the props.
95
+ A component can also list the props that make a use of it an island: `island({ interactive: { selectable: false, pageSize: false } })`, each prop with whether it is on when a use leaves it out. A page or a server component whose use turns none of them on, passes no promise and nothing `island` could not send, and writes no `hydrate` or `persist`, gets the component as plain markup: no island, and no script for the page when nothing else on it needs one. A function it is handed, a block taking parameters among them, is called by the server and is no `island-prop` while the use writes none of the listed props, `hydrate`, `persist` or `render` (a spread, or a function inside an object or array, still is). Its children and blocks render in the page as an island's do, and an island inside it stays an island of its own. A use inside another island is part of that island as before, and the props the use is given decide, so a spread counts. A route that is not prerendered still counts the island in `kay build`'s size estimate, an upper bound. `kay explain island` lists the props.
94
96
 
95
97
  ### Animate an element in and out
96
98
 
@@ -245,7 +247,7 @@ if !connected()
245
247
  - A button opens a popover or a dialog with no handler, so the component stays static: `button(popovertarget="menu")` toggles `ul#menu(popover)`, and `button(commandfor="settings" command="show-modal")` opens `dialog#settings`. `command` is `show-modal`, `close`, `request-close`, `show-popover`, `hide-popover`, `toggle-popover` or a `--custom` name the target hears as a `command` event, and `kay check` types it. `popovertarget` needs Chrome and Edge 114, Firefox 125, Safari 17; `commandfor` and `command` Chrome and Edge 135, Firefox 144, Safari 26.2, past the floor below, so an app keeping older browsers uses `popovertarget` or an `onClick`.
246
248
  - kay's browser code runs on Chrome and Edge 98, Firefox 104 and Safari 16.4 or later; kayjs-ui's popovers, tooltips, toasts and site nav menu need the Popover API, Chrome and Edge 114, Firefox 125, Safari 17, and its popovers, tooltips and site nav lists sit beside their trigger through CSS anchor positioning, Chrome and Edge 129, Firefox 147, Safari 26, so an older browser opens them away from their trigger; its colours use `light-dark()` and its carousel `inert`, which every browser with anchor positioning has. Bun bundles an island's code as written, newer syntax and APIs included, so an app keeping those browsers stays off what they lack, such as `Map.groupBy` or `Promise.withResolvers`.
247
249
  - `kay build` lists each island under its JavaScript with what makes it one, the first `on*`, `bind:`, `ref`, value from `kay` or `island()` declaration as `onClick, line 4`; `--format json` gives them as `why` and `cause` (`kind`, `name`, `line`) on each island of `built.sizes.islands` (a route's `islands` under `built.routes` only lists their files); `why` stays for tools reading it and `cause` is the data. `kay explain island <file>` says a component's role and cause and the rule, and `kay explain island` lists every island of the project (`--format json` for both).
248
- - `kay check` reads from the types what a static component hands an island, not from how the call looks: a value typed as a function, a symbol, a class instance or an object holding one (a `Column` with a `sortValue` function), or a block with parameters, is the error `island-prop` at the prop, and a value that is data says nothing, an action, a Date, a list a `map` built, a call returning a string, nor does one typed `any` or `unknown`. `island()` first in the component's script is the fix: `kay check --fix` writes it where the value is always a function, and only offers it where the type is a union holding one, as the component may be static on some pages. A page, layout or special page is never an island, so it passes the island data or goes through a component of its own. Rendering throws an `IslandPropsError` naming the prop and the same fix, as no component is made an island for what it passes. `island({ render: 'static' })` pins the other way: anything that makes the component an island is the compile error `static-pin`, standing at the `on*`, import or call that does it, and a function it hands an island is `island-prop`. A pin on a page, layout or special page is `island-marker`, as they are never islands, and a static pin on one says nothing. A `// kay-island` or `// kay-static` comment pins nothing: the declaration does. The editor shows a lens on a component's first line saying whether it is an island and why, and a click on it reveals the `on*`, import or declaration that decides it; under `kay dev` the Islands tab of the dev tool shows the same cause on each island, from a `data-why` attribute on its slot that a production build never writes.
250
+ - `kay check` reads from the types what a static component hands an island, not from how the call looks: a value typed as a function, a symbol, a class instance or an object holding one (a `Column` with a `sortValue` function), or a block with parameters, is the error `island-prop` at the prop (a function or a block with parameters is no error for an island listing `interactive` props, when the use writes none of them), and a value that is data says nothing, an action, a Date, a list a `map` built, a call returning a string, nor does one typed `any` or `unknown`. `island()` first in the component's script is the fix: `kay check --fix` writes it where the value is always a function, and only offers it where the type is a union holding one, as the component may be static on some pages. A page, layout or special page is never an island, so it passes the island data or goes through a component of its own. Rendering throws an `IslandPropsError` naming the prop and the same fix, as no component is made an island for what it passes. `island({ render: 'static' })` pins the other way: anything that makes the component an island is the compile error `static-pin`, standing at the `on*`, import or call that does it, and a function it hands an island is `island-prop`. A pin on a page, layout or special page is `island-marker`, as they are never islands, and a static pin on one says nothing. A `// kay-island` or `// kay-static` comment pins nothing: the declaration does. The editor shows a lens on a component's first line saying whether it is an island and why, and a click on it reveals the `on*`, import or declaration that decides it; under `kay dev` the Islands tab of the dev tool shows the same cause on each island, from a `data-why` attribute on its slot that a production build never writes.
249
251
  - A component the server renders per request inside an otherwise prerendered page, such as a form carrying a fresh token, is a server island instead: see [Server islands](server-islands.md#server-islands).
250
252
 
251
253
  ### Props to an island
@@ -289,4 +291,6 @@ if !connected()
289
291
  - A name inside a string or a whole-line comment of the file is no use of the component: only a tag or other code naming it keeps its import eager (a Table's `'Select all'` once kept its Select in every island). kayjs-ui's `Form`, `FormDialog` and `SaveForm` load the code that sends and reports a form (`forms-send`, with the toast it reports through) with the first send or blur check, tried once more when the chunk fails, so a page with a closed form-dialog does not carry it.
290
292
  - `kay/dom-lazy` is the compiler's output contract for it, not API. `kay build --analyze` lists the modules of every island, a lazy component's apart from the eager ones.
291
293
 
294
+ A refresh, or a visit keeping its layout, keeps an island and gives it the new props in place; seed from a prop with `linked(() => prop)` ([Navigation](navigation.md#islands-kept-across-pages)).
295
+
292
296
  Shared and persisted state, transitions, error fallbacks, element size, context and unique ids are in [Islands: state to unique ids](islands-state-to-ids.md).