@kayjs/kay 1.109.0 → 1.111.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 (199) hide show
  1. package/dist/eslint.js +488 -75
  2. package/editors/zed/extension.toml +2 -2
  3. package/llms/actions-from-islands.md +1 -1
  4. package/llms/build-and-start.md +1 -1
  5. package/llms/checks.md +1 -0
  6. package/llms/component-libraries.md +1 -1
  7. package/llms/components.md +1 -1
  8. package/llms/deprecated-lints.md +1 -1
  9. package/llms/dev-tool.md +1 -1
  10. package/llms/effects.md +1 -0
  11. package/llms/head.md +1 -1
  12. package/llms/images.md +2 -0
  13. package/llms/island-and-form-lints.md +2 -1
  14. package/llms/islands-lazy-components.md +23 -0
  15. package/llms/islands.md +4 -14
  16. package/llms/lints.md +1 -1
  17. package/llms/live-values.md +1 -1
  18. package/llms/navigation-from-code.md +1 -1
  19. package/llms/navigation.md +5 -3
  20. package/llms/performance-lints.md +1 -0
  21. package/llms/prerendering.md +1 -1
  22. package/llms/project-new-and-add.md +1 -1
  23. package/llms/project.md +1 -1
  24. package/llms/templates-elements-slots-snippets.md +4 -4
  25. package/llms/upgrading-archive.md +121 -42
  26. package/llms/upgrading.md +17 -133
  27. package/llms/whats-new-archive.md +31 -31
  28. package/llms/whats-new.md +45 -30
  29. package/llms.txt +3 -2
  30. package/package.json +11 -11
  31. package/src/build/client.ts +10 -8
  32. package/src/build/island-images.ts +277 -0
  33. package/src/build/pipeline.ts +10 -4
  34. package/src/build/static.ts +99 -24
  35. package/src/build/variants.ts +132 -18
  36. package/src/check/env-types.ts +1 -1
  37. package/src/check/project.ts +4 -0
  38. package/src/check/schema-builders.ts +230 -26
  39. package/src/check/shadow-types.ts +3 -3
  40. package/src/commands/upgrade.ts +2 -1
  41. package/src/compiler/allow-comments.ts +38 -2
  42. package/src/compiler/ast.ts +4 -4
  43. package/src/compiler/codegen.ts +4 -4
  44. package/src/compiler/deprecated-lints-1-106.ts +2 -2
  45. package/src/compiler/dom.ts +4 -3
  46. package/src/compiler/hand-parts.ts +36 -8
  47. package/src/compiler/handed-data.ts +15 -0
  48. package/src/compiler/helper-imports.ts +2 -2
  49. package/src/compiler/html.ts +3 -7
  50. package/src/compiler/index.ts +7 -4
  51. package/src/compiler/island-arguments.ts +9 -0
  52. package/src/compiler/island-lints.ts +7 -0
  53. package/src/compiler/items.ts +174 -0
  54. package/src/compiler/jsx.ts +10 -11
  55. package/src/compiler/kay-exports.ts +1 -0
  56. package/src/compiler/lints.ts +6 -7
  57. package/src/compiler/markup.ts +26 -24
  58. package/src/compiler/names.ts +1 -1
  59. package/src/compiler/removed-lints.ts +90 -0
  60. package/src/compiler/rewrite-types.ts +2 -0
  61. package/src/compiler/rewrite.ts +4 -2
  62. package/src/compiler/route-lints.ts +8 -0
  63. package/src/compiler/signal-from-prop.ts +141 -0
  64. package/src/compiler/template-reads.ts +16 -0
  65. package/src/compiler/template-walk.ts +2 -1
  66. package/src/config-shape.ts +4 -1
  67. package/src/config.ts +2 -2
  68. package/src/new.ts +16 -4
  69. package/src/project.ts +3 -3
  70. package/src/runtime/await.server.ts +4 -2
  71. package/src/runtime/checks.ts +14 -2
  72. package/src/runtime/client.ts +5 -9
  73. package/src/runtime/dev-tab-env.ts +28 -3
  74. package/src/runtime/dom-loop.ts +2 -4
  75. package/src/runtime/dom.ts +2 -2
  76. package/src/runtime/html.ts +53 -7
  77. package/src/runtime/image.ts +24 -23
  78. package/src/runtime/index.ts +2 -2
  79. package/src/runtime/island.server.ts +41 -11
  80. package/src/runtime/navigate.ts +14 -0
  81. package/src/runtime/navigation.ts +9 -1
  82. package/src/runtime/page-swap.ts +6 -3
  83. package/src/runtime/reactive.ts +72 -0
  84. package/src/runtime/row-key.ts +4 -0
  85. package/src/runtime/swap-flight.ts +10 -10
  86. package/src/runtime/swap-focus.ts +56 -9
  87. package/src/runtime/swap-kept.ts +97 -29
  88. package/src/runtime/swap-morph.ts +49 -9
  89. package/src/runtime/text-hash.ts +17 -0
  90. package/src/runtime/uid.server.ts +6 -4
  91. package/src/runtime/values.ts +12 -0
  92. package/src/server/client.ts +3 -0
  93. package/src/server/dev.ts +2 -0
  94. package/src/server/image.ts +1 -1
  95. package/src/server/kept-exports.ts +1 -0
  96. package/src/server/render-document.ts +11 -8
  97. package/src/server/render.ts +3 -3
  98. package/types/build/client.d.ts +6 -0
  99. package/types/build/client.d.ts.map +1 -1
  100. package/types/build/island-images.d.ts +45 -0
  101. package/types/build/island-images.d.ts.map +1 -0
  102. package/types/build/pipeline.d.ts.map +1 -1
  103. package/types/build/static.d.ts.map +1 -1
  104. package/types/build/variants.d.ts +9 -1
  105. package/types/build/variants.d.ts.map +1 -1
  106. package/types/check/project.d.ts.map +1 -1
  107. package/types/check/schema-builders.d.ts.map +1 -1
  108. package/types/commands/upgrade.d.ts.map +1 -1
  109. package/types/compiler/allow-comments.d.ts +2 -0
  110. package/types/compiler/allow-comments.d.ts.map +1 -1
  111. package/types/compiler/ast.d.ts +1 -1
  112. package/types/compiler/ast.d.ts.map +1 -1
  113. package/types/compiler/deprecated-lints-1-106.d.ts +2 -2
  114. package/types/compiler/deprecated-lints-1-106.d.ts.map +1 -1
  115. package/types/compiler/deprecated-lints.d.ts +2 -2
  116. package/types/compiler/dom.d.ts.map +1 -1
  117. package/types/compiler/hand-parts.d.ts +6 -3
  118. package/types/compiler/hand-parts.d.ts.map +1 -1
  119. package/types/compiler/handed-data.d.ts +5 -0
  120. package/types/compiler/handed-data.d.ts.map +1 -0
  121. package/types/compiler/html.d.ts.map +1 -1
  122. package/types/compiler/index.d.ts.map +1 -1
  123. package/types/compiler/island-arguments.d.ts +5 -0
  124. package/types/compiler/island-arguments.d.ts.map +1 -1
  125. package/types/compiler/island-lints.d.ts +7 -0
  126. package/types/compiler/island-lints.d.ts.map +1 -1
  127. package/types/compiler/items.d.ts +14 -0
  128. package/types/compiler/items.d.ts.map +1 -1
  129. package/types/compiler/jsx.d.ts.map +1 -1
  130. package/types/compiler/kay-exports.d.ts.map +1 -1
  131. package/types/compiler/lints.d.ts +20 -5
  132. package/types/compiler/lints.d.ts.map +1 -1
  133. package/types/compiler/markup.d.ts +3 -1
  134. package/types/compiler/markup.d.ts.map +1 -1
  135. package/types/compiler/names.d.ts.map +1 -1
  136. package/types/compiler/removed-lints.d.ts +3 -0
  137. package/types/compiler/removed-lints.d.ts.map +1 -0
  138. package/types/compiler/rewrite-types.d.ts +1 -0
  139. package/types/compiler/rewrite-types.d.ts.map +1 -1
  140. package/types/compiler/route-lints.d.ts +8 -0
  141. package/types/compiler/route-lints.d.ts.map +1 -1
  142. package/types/compiler/signal-from-prop.d.ts +4 -0
  143. package/types/compiler/signal-from-prop.d.ts.map +1 -0
  144. package/types/compiler/template-reads.d.ts +1 -0
  145. package/types/compiler/template-reads.d.ts.map +1 -1
  146. package/types/compiler/template-walk.d.ts.map +1 -1
  147. package/types/config-shape.d.ts.map +1 -1
  148. package/types/config.d.ts +3 -1
  149. package/types/config.d.ts.map +1 -1
  150. package/types/new.d.ts.map +1 -1
  151. package/types/project.d.ts +2 -2
  152. package/types/project.d.ts.map +1 -1
  153. package/types/runtime/await.server.d.ts.map +1 -1
  154. package/types/runtime/checks.d.ts +8 -2
  155. package/types/runtime/checks.d.ts.map +1 -1
  156. package/types/runtime/client.d.ts.map +1 -1
  157. package/types/runtime/dev-tab-env.d.ts.map +1 -1
  158. package/types/runtime/dom-loop.d.ts +2 -1
  159. package/types/runtime/dom-loop.d.ts.map +1 -1
  160. package/types/runtime/dom.d.ts +2 -2
  161. package/types/runtime/dom.d.ts.map +1 -1
  162. package/types/runtime/html.d.ts +6 -3
  163. package/types/runtime/html.d.ts.map +1 -1
  164. package/types/runtime/image.d.ts.map +1 -1
  165. package/types/runtime/index.d.ts +2 -2
  166. package/types/runtime/index.d.ts.map +1 -1
  167. package/types/runtime/island.server.d.ts +1 -0
  168. package/types/runtime/island.server.d.ts.map +1 -1
  169. package/types/runtime/navigate.d.ts.map +1 -1
  170. package/types/runtime/navigation.d.ts +4 -0
  171. package/types/runtime/navigation.d.ts.map +1 -1
  172. package/types/runtime/reactive.d.ts +5 -0
  173. package/types/runtime/reactive.d.ts.map +1 -1
  174. package/types/runtime/row-key.d.ts +2 -0
  175. package/types/runtime/row-key.d.ts.map +1 -0
  176. package/types/runtime/swap-flight.d.ts +1 -1
  177. package/types/runtime/swap-flight.d.ts.map +1 -1
  178. package/types/runtime/swap-focus.d.ts +2 -0
  179. package/types/runtime/swap-focus.d.ts.map +1 -1
  180. package/types/runtime/swap-kept.d.ts.map +1 -1
  181. package/types/runtime/swap-morph.d.ts.map +1 -1
  182. package/types/runtime/text-hash.d.ts +2 -0
  183. package/types/runtime/text-hash.d.ts.map +1 -0
  184. package/types/runtime/uid.server.d.ts.map +1 -1
  185. package/types/runtime/values.d.ts +4 -0
  186. package/types/runtime/values.d.ts.map +1 -1
  187. package/types/server/app-stages.d.ts +3 -1
  188. package/types/server/app-stages.d.ts.map +1 -1
  189. package/types/server/app.d.ts +3 -1
  190. package/types/server/app.d.ts.map +1 -1
  191. package/types/server/client.d.ts +2 -0
  192. package/types/server/client.d.ts.map +1 -1
  193. package/types/server/dev.d.ts +1 -0
  194. package/types/server/dev.d.ts.map +1 -1
  195. package/types/server/kept-exports.d.ts.map +1 -1
  196. package/types/server/render-document.d.ts +1 -1
  197. package/types/server/render-document.d.ts.map +1 -1
  198. package/types/server/render.d.ts +2 -2
  199. package/types/server/render.d.ts.map +1 -1
@@ -1,84 +1,163 @@
1
1
  # Upgrading, older releases
2
2
 
3
- What each minor release before 1.106 broke, and what an app changed to move to it. The newer releases are in [Upgrading](upgrading.md).
3
+ What each minor release before 1.110 broke, and what an app changed to move to it. The newer releases are in [Upgrading](upgrading.md).
4
4
 
5
- ## 1.105.0
5
+ ## 1.109.0
6
6
 
7
- The changes to kay.config.ts, the hooks, the stores and the guards of features are in [Upgrading to 1.105: kay.config.ts and library options](upgrading-1-105-config.md).
7
+ ### The 1.105 config, page, server and store forms are gone
8
8
 
9
- ### `UserMenu` links a visitor to sign in
9
+ The twenty-four lints that reported them are gone too. `kay upgrade` on 1.108 rewrote each one written inline; what it could not reach is a type error or a refusal at boot naming the new form. The full 1.105 rules are in [Upgrading to 1.105: kay.config.ts and library options](upgrading-1-105-config.md).
10
10
 
11
- `UserMenu` now draws a sign-in link for a visitor, where it drew nothing: remove the `SignedOut` link you kept beside it, or pass `signIn={false}`. `SignOutButton` and `SignInLink` ([components](../../auth/llms/signed-in-components.md)) replace a hand-written sign-out form and sign-in link.
12
- ### `SignedIn` takes `require` and an `@else` block
11
+ - Config keys at the top of kay.config.ts: `links`, `offline` and `search` are `client.*`; `images`, `fonts`, `favicon`, `manifest` and `publicCache` are `assets.*`; `observe`, `health`, `metrics` and `jobs` are `ops.*`; `env` is `envFiles`; `onStart` is `onListen`. The config refuses them, naming where each moved.
12
+ - `i18n`'s `defaultLocale` is `default`, `prefixDefault: true` is `mode: 'always'` and `domains` is `mode: { domains }`; the old keys are refused.
13
+ - `serve.apiPrefix` and the `path` of `openapi`, `mcp`, `health`, `metrics` and `jobs` are `endpoints.*`; `openapi.referencePath` is `openapi: { reference: { path } }`.
14
+ - `/mcp` and `/metrics`, where those endpoints were before 1.105, answer 404: use `/_kay/mcp` and `/_kay/metrics`, or what `endpoints` sets.
15
+ - `mcp: { key }` is `mcp: { token }`, `proxy: { key: 'x-upstream-key' }` is `proxy: { key: { header } }`, and `proxy: 2` is `proxy: { hops: 2 }`; `observe.log: 'json'` and a bare function are `ops: { observe: { log: { format: 'json' } } }` and `{ sink }`.
16
+ - `images` takes `remote`, `formats` and `limits` only: `remoteMaxSize`, `remoteTimeout`, `quality`, `webp`, `avif`, `maxVariants` and `queue` are refused.
17
+ - `pages({ root, client: { ... } })` and `testSite({ root, mcp: true })` refuse a config key beside `root`: write it in `config`. `testSite({ mcpKey })` is `config: { mcp: { token } }` and `testSite({ proxyKey })` is `config: { proxy: { key: { header, secret } } }`.
18
+ - The `onSave`, `onUpload`, `onSend`, `onSuppress`, `onSubscribe`, `onConfirm`, `onUnsubscribe`, `onBroadcast`, `onSignUp`, `onStep`, `onToolCall` and `onSuccess` of kayjs-ai, -auth, -cms and -mail are their `after` names (`afterSave`, `afterSend`, `afterSignUp`, `afterStep`, `afterToolCall`, `afterRequest`...), and an action hook event has `context` where it had `ctx`.
19
+ - `maxAge` is `ttl` in `signed.sign`, `files.url`, workChallenge, kayjs-auth's `proofOfWork` and `captcha`, an action's `protect.minTime` and `protect.proofOfWork`, and the data of a kayjs-auth mail (`ttl: { link, code }`).
20
+ - A store is handed a `Duration` for every length, `durations: true` is no member of a store, `lengthFor` takes milliseconds only and `kv(ns).set(key, value, 60_000)` is `'60000ms'`; `formatDuration(7_500_000)` is `formatDuration('125m')`.
21
+ - Library stores: `ai({ conversations })` is `ai({ store })`; `pgConversations`, `sqliteConversations`, `createConversationTable` and `conversationTable` are `pgAi`, `sqliteAi`, `createAiTables` and `aiTables`; `openLists`, `createMailListTables` and `mailListTableNames` are `sqliteLists`, `createMailTables` and `mailTables`; `mailer({ listStore, suppressionStore })` is `store: { lists, suppressions }`; `pgLoader` and `sqliteLoader` of kayjs-cms are `pgCms` and `sqliteCms`.
22
+ - Jobs: a handler is `(input, ctx)`, its signal and job being `ctx.signal` and `ctx.job` and no longer the second and third arguments, and `lostAfter` is `timeout`; `schedule('@hourly', job, options)` is `schedule({ cron: '@hourly', ...options }, job)`, `schedule('30s', job)` is `schedule({ every: '30s' }, job)`; `diskFiles(dir, hooks)` is `diskFiles({ dir, ...hooks })`; `ws.send(JSON.stringify(value))` of an `api()` socket is `ws.send(value)`.
23
+ - A page's `noindex`, `sitemap`, `lastmod`, `search` and `feed` are written in `seo`, and `ttl` and `cacheControl` are `cache`: the build refuses a top-level key of `page`, naming the new one. An `img` takes `placeholder={false}` where it took `no-placeholder`.
24
+ ### What `kay upgrade` on 1.108 did not reach
13
25
 
14
- `SignedIn(role="admin")` is `SignedIn(require="admin")`, which takes what `auth.guard({ require })` does (a role, a list of which any one passes, a predicate answering at once), and `SignedOut` is the `@else` block of a `SignedIn`: `SignedIn` holds what a user sees and `@else` what anyone else does. The old forms went in 1.109.
26
+ The lints only saw the forms written inline, so an app that reported nothing on 1.108 can still hold these; `kay check` on 1.109 shows each as a type error, and each is a hand edit.
15
27
 
16
- ### kayjs-auth's methods share one set of verbs
28
+ - A removed lint named in `lints` (`'deprecated-package-names': 'allow'`, any `deprecated-*` of 1.105 to 1.108, `unreturned-fail`, `uncaught-await`) is accepted: `kay check` warns that the lint is gone and the entry changes nothing, so delete it when convenient; a `// kay-allow` comment naming one gets the same warning, and `kay check --fix` drops the name (the comment when it was the only one).
29
+ - `.rows()` of an `infiniteList(...)`, in a template or a script, is `.data()`, wherever the list was built; and `site.refusal(action, input)` in a test is `site.expectRefused(action, input)`.
30
+ - `ctx.deny(status, message)` with the message in a variable (`ctx.deny(503, failure.message)`) is `ctx.deny(503, { message: failure.message })`.
31
+ - `maxAge` in the options handed to `files.url(key, { maxAge: '1d' })` is `ttl`.
32
+ - `schedule(cron, job, { enabled })` with the cron held in a const or a variable is `schedule({ cron, enabled }, job)`: look for a `schedule(` whose first argument is not a literal.
33
+ - `formatDuration(ms)` of `kay/i18n` with a number held in a variable takes a `Duration`: write `` formatDuration(`${ms}ms`) ``.
34
+ - A `s.Union(Object.keys(R).map(key => s.Literal(key)))` is `s.enum(R)`: `kay check --fix` now writes it, where `s.union` of a mapped array is a type error.
35
+ - The `kay check --fix` of 1.106 to 1.108 wrote `s.list(...)` and `s.object(...)` with no options, so an app already rewritten holds lists capped at 1,000 items and objects that refuse a key their shape lacks, where the old builders did neither. Search the app for `s.list(` without a `max` and `s.object(` without `extra`, and add `max` or `extra: 'strip'` where the old limit or the old leniency is wanted. A string outside an action's input and an API route's `body` (a job's payload, a socket message, collection frontmatter, `validate`, a store) was written as a bare `s.string()` too, which stops at 10,000 characters where `s.String` had no limit: search for `s.string()` and `s.string({` without a `max` there, and add `max: Number.MAX_SAFE_INTEGER` where longer text is wanted. `kay check --fix` writes that `max` itself from the next release.
17
36
 
18
- Every group lists with `list`, reads with `get`, writes with `create` and `update`, removes with `delete` and takes back with `revoke`, and a method that sat on `auth` itself went into its group. `organizations.members()`, `invitations()`, `myInvitations()` and `invitation()` are `listMembers()`, `listInvitations()`, `listMyInvitations()` and `getInvitation()`; `setMemberRoles()` and `removeMember()` are `updateMemberRoles()` and `deleteMember()`; `admin.roles()` and `admin.auditLog()` are `listRoles()` and `listAuditLog()`; `oauthServer.clients()` is `listClients()`; `passkeys.rename()` is `passkeys.update()`; `account.changeUsername()`, `profile()` and `saveProfile()` are `updateUsername()`, `getProfile()` and `updateProfile()`; `oauth.identities()` and `providerToken()` are `listIdentities()` and `getProviderToken()`; `magicLink.signInWithCode()` is `email.signInWithCode()`. On `auth`: `requireAdmin()` is `admin.require()`, `captchaRequired()` and `captchaChallenge()` are `captcha.required()` and `captcha.challenge()`, `provedLately()` and `reprove()` are `proof.recent()` and `proof.renew()`, `scopes()` and `hasScope()` are `tokens.scopes()` and `tokens.hasScope()`, and `oauthResource()`, `oauthOrigin()` and `oauthFixed()` are `oauthServer.resource()`, `origin()` and `fixed()`. The old names went in 1.109. `admin.deleteUser()` and `password.change()` keep their names, a verb followed by what it acts on.
37
+ ### The island and template forms of 1.105 are gone
19
38
 
20
- ### An island's call answers a result
39
+ The `deprecated-page-island`, `deprecated-island-fence`, `deprecated-island-attributes`, `deprecated-island-events`, `deprecated-link-flags`, `deprecated-children-prop`, `deprecated-uncaught-await`, `deprecated-import-path`, `deprecated-context-import` and `deprecated-listen-target` lints are gone with the forms they reported; run `kay upgrade` on 1.108 first, which rewrote each but the page island.
21
40
 
22
- `await add(input)` and `await call(api, '/path')` from an island resolved with the data and threw `ActionError` or `ApiError` for a refusal. They resolve `{ ok: true, data }` or `{ ok: false, status, message, errors, data, error }` now, and throw for no visitor's mistake: a refusal, a handler that threw, a network failure and a timeout (status 0) are results; an abort and a redirect still reject. The `deprecated-call-result` lint that reported the old use went in 1.109, so the type error on the result's field is what shows it. Write `const { ok, data } = await add(input)`, or append `.orThrow()` to keep the throwing style: `const id = await add(input).orThrow()` resolves the data and throws what the call threw (an `ActionError`, or an `ApiError` of status 0 for a call with no answer). A `try` around a call whose `catch` shows the refusal now never runs: read `result.error`, `result.message` or `add.form.error('field')`. A call awaited with its result left out (`await add(input)` in a `try` to know it failed) needs `.orThrow()` or a look at `result.ok`. `track()` handles answer the same, a call with no answer included. A call awaited with its result left out has no read to find and stays by hand. kayjs-ui's `attempt` and `toast.promise` take a call's result as they took what it threw, and `site.call` of a test site is unchanged.
41
+ - A page without a `--- server` fence that needs the browser is the `page-island` error: move what needs the browser into a component and render it from the page.
42
+ - `--- island`, `--- client` and `--- static` are unknown fences, and `export const island = { ... }` in a `--- module` fence is a `fence-invalid` error: write `island({ render, hydrate, persist, interactive })` first in the component's script.
43
+ - `hydrate="client"` on a use is `render="client"`, and `server="defer"` is `server defer`: `server="defer"` is a `server-island-invalid` error and `hydrate="client"` an `attribute-invalid` one.
44
+ - `data-keep-scroll`, `data-no-transition` and `data-no-prefetch` are read by nothing and are an `unknown-link-flag` error: write `data-scroll="keep"`, `data-transition="false"` and `data-prefetch="false"`.
45
+ - A `// kay-allow uncaught-await` comment and a `lints: { 'uncaught-await': ... }` entry name a removed lint: `kay check` warns, and `--fix` drops the name from the comment, which allows nothing now.
46
+ - `listen(window, ...)` is `listen(() => window, ...)`: `listen` takes a function returning its target, and a value is a type error, and in a `.kay` file a server read of `window`.
47
+ - Import `mount`, `Mounted`, `s`, `RateLimit` and `RateLimitRefusal` from `kay` and `sqliteCache` from `kay/cache`: `kay/mount` is no entry any more and `kay/server` no longer exports them.
48
+ - `defineContext` is imported from `kay/server`: `kay/library` no longer exports it.
49
+ - `children?: Snippet` beside a bare `slot` and `listen(() => document, 'kay:navigate', ...)` in an island are reported no more: both still work, and the function hook is the form to write.
50
+ ### An action's form readers are only under `form`
23
51
 
24
- ### A callback of a library component takes one event object
52
+ `add.failed()`, `add.error(field)` and `add.validate(form, field)` are gone from an action: write `add.form.failed()`, `add.form.error(field)` and `add.form.validate(form, field)`, which the 1.105 upgrade had already moved to. The `deprecated-action-readers` lint is gone with them, and `.error('field')` on an action in a template no longer describes its field.
25
53
 
26
- A function handed by name to a callback of a kayjs-ui, kayjs-ai or kayjs-cms component (`onValueChange={query.set}`, `onChange={toggle}` with `toggle(on: boolean)`, `onFiles={upload}`) was called with the value and now gets `{ value }`, `{ checked }` or `{ files }`, so it fails the type check, and would be handed the event where it took the value. The `deprecated-callback-handler` lint that named it went in 1.109: write `onChange={event => toggle(event.checked)}` yourself, passing the fields the handler took.
54
+ ### `Action<never, unknown>` is `Action`
27
55
 
28
- ### An action's form readers sit under `form`
56
+ Write `Action` for a prop that takes any action: both parameters default to it. The `deprecated-action-type` lint is gone.
29
57
 
30
- `add.failed()`, `add.error(field)` and `add.validate(form, field)` are `add.form.failed()`, `add.form.error(field)` and `add.form.validate(form, field)`: what a form shows is read apart from the call state (`pending()`, `status()`, `data()`, `track()`) the action keeps, and a `track()` handle's own `error()` (an `ApiError`) no longer shares a name with the field message. The old names went in 1.109 with the `deprecated-action-readers` lint.
58
+ ### An island's call answers only a result
31
59
 
32
- ### An auth call answers one `Result`, and a rejection's `errors` are strings
60
+ A call read as its data (`const list = await call(notes, '/')` then `list.items`) is a type error, as the 1.105 call result made it; write `.orThrow()` after the call, or read `ok` and `data`. The `deprecated-call-result` lint that found it is gone.
33
61
 
34
- kayjs-auth's sixty `*Result` aliases (`PasswordSignInResult`, `RevokeTokenResult`...) are one `Result<Ok, Code, Fields>`: `Result<{ redirect: string }, 'invalid' | 'limited'>` is `{ ok: true, redirect }` or a failure of those kinds. A failure is also a kay `Failure`, so an action returns `auth.password.signIn(...)` as it is and its island call reads `{ ok: false, status, data: { code, message } }`. A rejected input's `errors` holds one string per field (the code for `'taken'` or `'too-short'`, the message of a profile field's `{ message }`), so a profile page reads `errors.<field>` as the text; the old names no longer exist, write `Result<...>` or let the method's return type be inferred.
62
+ ### A callback of a library component takes only the event object
35
63
 
36
- ### A refusal is one call
64
+ `onChange={toggle}` with `toggle(on: boolean)` is a type error on a kayjs component: write `onChange={event => toggle(event.checked)}`, `{ value }` or `{ files }` for the others. The `deprecated-callback-handler` lint is gone.
37
65
 
38
- `ctx.deny(status, { message, errors, data })` refuses in a guard, a page, an action and an endpoint, and `refuse(status, { message, errors, data })` throws the same from anywhere; `deny(403, 'text', data)`, `return ctx.fail(status, data, errors)` and `refuse('text', { status, errors, data })` went in 1.109 with the `deprecated-deny-call`, `deprecated-ctx-fail` and `deprecated-refuse-call` lints. In an action, `ctx.deny(status, { message, data, errors })` fails the post as `ctx.fail` did (the page again with the message and the fields, an `ActionError` for a call), while a deny with no options stops with plain text as `deny(status, 'text')` did; a helper called in a handler with its `ctx`, such as a guard's or `limit.check(ctx)`, therefore fails the form with its message now; a `ctx.fail('text')` text is the `message`. The argument checks of `webPush.send`, `rooms`, `signed` and notifications throw a `KayError` with code `argument-invalid`, not a `RangeError` or `TypeError`.
66
+ ### A refusal is only `ctx.deny(status, { message, errors, data })`
39
67
 
40
- ### A top-level `const` follows the prop or signal it reads
68
+ `deny(403, 'text')` and `deny(403, 'text', data)` take a status and options only, `ctx.fail(...)` is gone, and `refuse('text', { status })` is `refuse(status, { message })`: write `ctx.deny(status, { message, errors, data })`. `RefuseOptions` is no longer exported from `kay/library`. The `deprecated-deny-call`, `deprecated-ctx-fail` and `deprecated-refuse-call` lints are gone, and with them the `unreturned-fail` lint of a `ctx.fail` left unreturned.
41
69
 
42
- In the browser, `const last = items.length - 1` or `const twice = count() * 2` at the top of a script was computed once and now follows what it reads, so a `memo(() => ...)` or a function written for it can go. A `const` that meant the first value of a prop is written `// kay-allow once-read-prop: why` (`kay check` asks for it as before), and of a signal `untrack(() => count())`; it cannot be assigned. Nothing to rewrite otherwise.
70
+ ### `guard` and `requireGuards` are `guards`
43
71
 
44
- ### Eight mistakes that ship a broken page refuse
72
+ `vitals({ guard })`, `jobs: { guard }` and `images: { guard }` are `guards`, and `requireGuards: true` (in kay.config.ts, `pages()` and `testSite`) is `guards: { default: 'closed' }`, `false` `guards: { default: 'open' }`. `VitalsOptions.guard`, `KayConfig.requireGuards` and `PagesOptions.requireGuards` are gone, and so is the `deprecated-guard-option` lint.
45
73
 
46
- `unreturned-fail`, `brace-in-attribute`, `signal-set-call`, `constant-signal`, `literal-tag`, `positional-key`, `unkeyed-rows` and `once-read-prop` were warnings and are now `deny`: `kay check` reports each as an error, so the `check` script of an app fails on one it still has. `kay check --fix` applies the fixes of `unreturned-fail`, `brace-in-attribute`, `signal-set-call` and `positional-key`; for the others write what the lint's message says, or `// kay-allow <lint> -- why` where the form is meant. `lints: { 'constant-signal': 'warn' }` in kay.config.ts brings one back to a warning.
74
+ ### `limit.enforce(ctx)` is `limit.check(ctx)`
47
75
 
48
- ### An `await` with no `catch` shows an alert
76
+ `rateLimit()`'s `enforce(ctx, message?)` is gone: write `check(ctx, message?)`; `limiter().enforce(key)` keeps its name. The `deprecated-rate-enforce` lint is gone.
77
+ ### The parts object of `class` is gone
49
78
 
50
- A rejected `await` block with no `catch` and no `try` around it used to remove its pending block and show nothing; it renders `<span class="kay-await-failed" role="alert" data-kay-await-failed>` now (the `kay.await.failed` message), so the `uncaught-await` lint is gone, and in 1.109 a `// kay-allow uncaught-await` comment or a `lints` entry naming it is an unknown lint. `AwaitProps` of `kay` no longer has `fallback`, the compiler's own channel for a `try`'s `catch`.
79
+ A component's parts are its `parts` attribute: `Card(class={{ head: 'p-6' }})` is `Card(parts={{ head: 'p-6' }})`, as `kay upgrade` on 1.108 wrote it. `class` is a string, an array or an object of conditions, so `{ head: 'p-6' }` in it is the class `head`: a type error on a component with parts, unreported when a shorthand or a spread sits beside it. The `deprecated-parts-class` lint is gone with it.
80
+ ### `persisted(...)` and `persisted.query` are `persisted.cookie(...)` and `queryParam`
51
81
 
52
- ### A `for` over rows with no `id` needs a `key` in every component
82
+ A bare `persisted(name, value)` is `persisted.cookie(name, value)`, and `persisted.query(name, value, options)` is `queryParam(name, { default: value, ...options })`. The `deprecated-persisted-call` and `deprecated-persisted-query` lints are gone, and `PersistedQueryOptions` with them.
53
83
 
54
- `unkeyed-rows` reported a keyless `for` in islands only; it reports one in any component, a page or a layout excepted, as a component may render in the browser whichever page imports it. Name the rows with `key={row.slug}` or give them an `id`; `key={i}` (the fix `kay check` offers) matches them by position.
84
+ ### `navigate({ query })`, `onNavigate` and `onBeforeNavigate` are gone
55
85
 
56
- ### `slot` types the children and blocks of a component
86
+ `navigate({ query: changes })` is `navigate.query(changes)`, and the imported `onNavigate(fn)` and `onBeforeNavigate(fn)` are `navigation.onNavigate(fn)` and `navigation.onBeforeNavigate(fn)`. The `deprecated-navigate-query` and `deprecated-navigation-hooks` lints are gone.
57
87
 
58
- A component no longer declares `children?: Snippet`, nor an optional block it renders with `slot name`: its template types them, so a call passing a block the component has no `slot` for is a `kay check` error. Its lint went in 1.109; declare `children: Snippet` to require the children.
88
+ ### `set(key, next)` and `presence(room, member)` are refused
59
89
 
60
- ### A link's flags are named as `navigate()`'s options
90
+ `room.set(next, { key })` of a live value per key and `unread.set(next, { user })` of one per user take the next value first; the old order throws. `presence({ room, member, signal })` takes one object. The `deprecated-live-api` lint is gone.
61
91
 
62
- `data-keep-scroll` is `data-scroll="keep"` (`data-keep-scroll="false"` is `data-scroll="top"`), `data-no-transition` is `data-transition="false"` and `data-no-prefetch` is `data-prefetch="false"`, typed on every element, so a wrong value is a `kay check` error; a wrapper another library marks `data-scroll` now keeps its links' scroll. The old names went in 1.109. A `data-` name one letter from a flag, as `data-prefech`, is the `unknown-link-flag` error.
92
+ ### The old readers of a source are gone
63
93
 
64
- ### A component's parts are the `parts` attribute
94
+ `value()`, `last()`, `rows()` (of a `resource`, `stream`, `socket`, `local()` and `infiniteList()`, and a list of your own given to `LoadMore`, `Table` or `VirtualList`), `unsynced()`, `syncStatus()`, `onSuccess` and `onSync` of a source or a `track()` handle, and an action's `succeeded()` are `data()`, `sync.queued()`, `sync.status()` and `onData({ value })` (an action's `succeeded()` is `data()`). The `deprecated-source-readers` lint is gone.
95
+ ### kayjs-auth drops its 1.105 names
65
96
 
66
- `Card(class={{ head: 'p-6' }})` is `Card(parts={{ head: 'p-6' }})`: `class` keeps strings, arrays and objects of conditions, and `parts` holds an entry per part, `root` included, so a shorthand or a spread can sit beside it, and a component declaring its own `parts` prop is refused as one declaring `class` is (`Card.mt-4(parts={{ head: 'p-6' }})`). A component with parts takes both props, and `parts` leaves `...rest` as `class` does. A component with parts takes `class` as a string, an array or an object of conditions.
97
+ - `organizations.members()`, `setMemberRoles()`, `removeMember()`, `invitations()`, `myInvitations()` and `invitation()`, `admin.roles()` and `auditLog()`, `oauthServer.clients()`, `passkeys.rename()`, `account.changeUsername()`, `profile()` and `saveProfile()`, `oauth.identities()` and `providerToken()`, `magicLink.signInWithCode()`, and the methods that sat on `auth` (`requireAdmin()`, `captchaRequired()`, `captchaChallenge()`, `provedLately()`, `reprove()`, `scopes()`, `hasScope()`, `oauthResource()`, `oauthOrigin()`, `oauthFixed()`) no longer exist: write the names of the 1.105.0 section below. `deprecated-auth-methods` is gone, so run `kay upgrade` on 1.108 first, which renames the calls.
98
+ - `rateLimit` takes the grouped form only: the flat keys `signInAccount`, `signInAccountAll`, `resendAccount`, `forgotAccount`, `magicLinkAccount`, `emailChangeAccount`, `twoFactorAccount`, `emailCodeAccount`, `inviteAddress`, `oauthRegister`, `oauthRegisterAll`, `oauthDocument` and `oauthToken` throw at startup, naming the group to write (`signIn: { account }`, `oauth: { token }`). `deprecated-auth-rate-limits` is gone.
99
+ - `SignedIn(role=...)` is `SignedIn(require=...)`, and the `SignedOut` component and kayjs-auth's `isSignedOut` are removed: put the children in an `@else` block of a `SignedIn`. `deprecated-auth-signed` is gone.
67
100
 
68
- ### Websocket frames are always JSON
101
+ ### kayjs-mail drops `send`, `enqueue` and its own `SubscribeForm`
69
102
 
70
- On an `api()` module, `ws.send(value)` now sends `JSON.stringify(value)` for a string too, and a frame a client sends must be JSON text, so a binary frame from a client is refused too, and one that is not is answered `{ error: { key: 'kay.socket.notJson', fields } }`, and a message failing `body` `{ error: { key: 'kay.socket.invalid', fields } }` where it was dropped before. `deprecated-socket-frames` (`kay check --fix`) rewrites `ws.send(JSON.stringify(x))` to `ws.send(x)`, which sends what it did; a raw `WebSocket` client of your own parses each frame with `JSON.parse` and sends `JSON.stringify(message)`, and `socket()` does both. `rooms().publish` goes out as JSON the same way, a string included.
103
+ - `send` and `enqueue` are no longer exported from `@kayjs/mail` (`registeredMailer` went in 1.105): a page, an action or a guard sends through `ctx.locals.mail.send(...)` or `.enqueue(...)`, a job or a script through the mailer of `src/mail.ts`. `deprecated-mail-send` is gone.
104
+ - `@kayjs/mail/subscribe-form.kay` does not resolve: import `SubscribeForm` from `@kayjs/ui/subscribe-form.kay`, which takes the same props. `deprecated-mail-form` is gone, so run `kay upgrade` on 1.108 first to have the import rewritten.
71
105
 
72
- ### An endpoint's declared context is checked
106
+ ### kayjs-ai drops its 1.105 props and options
73
107
 
74
- An endpoint's `ctx: EndpointContext` and an `api()` module's `ctx.guard` are now typed from the file tree without a generic, so `ctx.params.x` for a param the file's name lacks, a `ctx.guard` field no guard above returns and a `ctx.query` field outside `page.query` are type errors in `kay check`.
108
+ - The `<key>Label` props of `Chat`, `ChatLauncher` and `ChatPanel` (`sendLabel`, `stopLabel`, `openLabel`, `attachTooBigLabel`...) are not read: write one `labels` object keyed as the `ai.chat.<key>` messages are, `labels={{ send: 'Go' }}`; `waitingLabel` and `failureLabel` are `labels.thinking` and `labels.error`. The `ChatLabelProps` and `ChatLauncherLabelProps` types are removed. `deprecated-ai-labels` is gone.
109
+ - `Chat`'s `links` and `Sources`' `here` are not read: `links="apart"` is `newTab={true}` (the default), `links="here"` and `here` are `newTab="auto"`. `deprecated-ai-links` is gone.
110
+ - `language` in the options of `transcribe()` and `describeImage()` is not read: write `locale`, a BCP 47 tag. `deprecated-ai-language` is gone.
75
111
 
76
- `kay check` holds the `EndpointContext<Params, Guard>` a handler declares to its file's params and the `_guard.ts` files above it: a param the file has not, or a guard field no guard returns, is a type error. Declare what the guards return, or `any` as the guard type, where a guard fills `locals` instead; a file listing `guards` of its own is not checked.
112
+ ### kayjs-cms drops `role`, `member` and a list `uploads`
77
113
 
78
- ### Test helpers share one shape
114
+ - `cms({ role: 'editor' })` is `cms({ access: 'editor' })`, and `cms({ member })` is folded into an `access` function, which admits and names the person in one: `access: ({ locals }) => locals.user && { name: locals.user.email, roles: locals.user.roles }`. Both throw as unknown options now. A `guard` of your own stays, for what `access` cannot say, and holds no role. `deprecated-cms-options` is gone, so `guard: passwordGuard(password)` is `access: { password }` by hand.
115
+ - `uploads: ['image/*']` is `uploads: { types: ['image/*'] }`.
79
116
 
80
- `aiTest`, `mailTest`, `cmsTest` and `authTest` of the libraries' `/test` entries are `test(site)` in each, taking the `TestSite` and with a `reset()`; `aiTest()` needed no site, `test(site)` takes it and works without. `site.refusal(action, ...)` is `site.expectRefused(action, ...)` and `site.socketRefusal(...)` is `site.socket.refused(...)`. The old names went in 1.109; import `test as mailTest` to keep the local name, so `bun:test`'s own `test` is not shadowed.
117
+ ### kayjs-ui drops its 1.105 names
81
118
 
82
- A call to another host with `fetch` that no `site.fetchStub` answers now fails a test once `testSite()` made a site: stub it, or give `testSite({ outgoing: 'allow' })`. Calls to loopback (a `fakeService`) are unaffected. The clock `site.advance` moved goes back to real time after each test, not only after the file.
119
+ - `onChange` on an Accordion, a Tabs and a ThemeToggle is `onValueChange({ value })`, a ZoomPane's is `onPlateChange({ plate })`, a Table's `onSort` is `onSortChange({ sort })` and a chart's `onActive` is `onActiveChange({ index })`: each takes one event object, and the old names are not called. `deprecated-ui-callbacks` is gone.
120
+ - The list a component draws is `items`: `tabs`, `avatars`, `entries`, `links`, `steps`, `icons` and `slides` are not read on Tabs, AvatarGroup, CommandPalette, Timeline, SideNav, SiteNav, AppHeader, Steps, IconPicker and Carousel, nor the `list` of an infinite source on Table, Carousel, Masonry, MediaGallery, VirtualList and LoadMore. `deprecated-ui-items` is gone.
121
+ - `deprecated-ui-input` is gone: a Toggle, Checkbox, Slider, ColorInput, Combobox or DateInput keeps its `id`, `title` and `data-*` on its root, as since 1.105, and `inputProps` is the way to reach the input.
83
122
 
84
- Releases before 1.105 are in the notes of their releases, at https://git.kaynooo.fr/kaynooo/kayjs/releases.
123
+ ### The old test helper names are gone
124
+
125
+ - `aiTest`, `mailTest`, `cmsTest` and `authTest` are not exported by the libraries' `/test` entries: import `test` (`import { test as mailTest } from '@kayjs/mail/test'`). `site.refusal(...)` is `site.expectRefused(...)` and `site.socketRefusal(...)` is `site.socket.refused(...)`. `deprecated-test-helpers` is gone.
126
+
127
+ ## 1.108.0
128
+
129
+ ### The `deprecated-package-names` lint is gone
130
+
131
+ A project still importing `@kaynooo/kayjs*` is not reported any more, and `kay check --fix` no longer rewrites it: write `@kayjs/kay` and `@kayjs/<library>` (`ui`, `auth`, `mail`, `cms`, `ai`) in the imports, config keys, stylesheets and `package.json` yourself, or run `kay upgrade`, which still moves an app off the old names, stopping at 1.107 first.
132
+
133
+ ## 1.107.0
134
+
135
+ ### `TSchema` is gone from `kay/library`
136
+
137
+ Import `Schema` from `kay/library` instead, kay's own name for what `s` builds; `kay upgrade` on 1.106 rewrote the import and its uses. The `deprecated-schema-type` lint is gone with it.
138
+
139
+ ### `--- script` opening a file is an error
140
+
141
+ A file opens its script with `---`; `--- script` is only for a script that follows a `--- server`, `--- module` or `--- style` fence. The `deprecated-script-fence` lint is gone, and `--- script` first in a file is a `fence-invalid` error whose safe fix `kay check --fix` applies.
142
+
143
+ ### `action({ input, ...options }, handler)`
144
+
145
+ An action takes its options first, with its input in them, as an API route does: `action({ input: { title: s.string() }, maxSize: '1mb' }, handler)`. `action(schema, handler, options)` and `action(handler, options)` work until 2.0; `kay upgrade` rewrites them (`deprecated-action-options`).
146
+
147
+ ### One validation for every input
148
+
149
+ Actions, API routes, sockets and `defineEnv` read their input through one `validate(schema, value, { source })`. Text sources (a form, a query, path params, the environment) are read as the numbers, booleans and lists they spell, and a JSON body never is: an action called from an island, a socket message and an API route's JSON body that sent `'3'` for an int, or `'true'` for a boolean, are refused where Elysia's schemas let them by. An object refuses a key its shape lacks in JSON (`extra: 'strip'` drops it, as `s.Object` of the old builders still does); a query, the headers and the cookies of a request still drop theirs. A form post drops the fields the schema does not name (a named submit button, a widget), as a browser sends controls the app does not own. `validate` answers `{ errors: [{ path, key, params, message }], status: 422 }` worded in the request's locale and independent of `NODE_ENV`; an action's or API route's answer still carries `errors` as a `{ field: message }` map. An API route's refusal reaches an `onError` as an error with code `VALIDATION` whose `all` lists `path`, `message` and `summary`. No lint can find the app that sends such a key or such a JSON value, as it depends on what a request carries.
150
+
151
+ ## 1.106.0
152
+
153
+ ### `s` is kay's own builder, in lowercase
154
+
155
+ `s.string({ min, max })`, `s.int()`, `s.enum()`, `s.object()` and the rest replace the PascalCase builders of Elysia, each taking the same field options (`optional: true`, `default`, `error`, `label`, `description`, `example`); `s.Optional(field)` is `optional: true` in the field's options, `s.UnionEnum` and `s.UnionKeys` are `s.enum`, `s.Numeric` is `s.number`, and `s.typebox` is gone: `s` builds a schema of its own, over TypeBox, and a schema built with Elysia's `t` is still taken. The old names work until 2.0, and `kay upgrade` rewrites them (`deprecated-schema-builders`, [schemas](schemas.md#schemas)). A file size of a file field is `'2mb'`, never `'2m'`. Two things differ in the new builders: `s.object` refuses a key its shape lacks, where `s.Object` let it by (`{ extra: 'strip' }` keeps the old way; see [schemas](schemas.md#schemas) for where it refuses), and `s.list` is at most 1,000 items unless `max` says more; the fix of 1.109 writes both options, the one of 1.106 to 1.108 did not. An unknown key of a query, the headers or the cookies is dropped, whatever the schema says, as a link or a proxy adds some; `s.Object` of a collection's frontmatter now refuses a key its shape lacks, so an entry with an extra key fails the build until the schema says `{ extra: 'strip' }`. An `action` takes a record of fields, which refuses a key its shape lacks: `s.object(shape, { extra: 'strip' })` keeps the old way. A `defineEnv` takes the record of fields where it took `s.Object({ ... })`, and the fix writes it, as an env reads only the names it declares.
156
+ ### `@kaynooo/eslint` 8
157
+
158
+ kay and `kay new` use `@kaynooo/eslint` 8, which has no formatters (Prettier, oxfmt and dprint, about 30 MB, are no longer installed): run `bun add -d @kaynooo/eslint@^8`, and drop a `formatters` option from `eslint.config.ts` if it sets one. `kay fmt` formats as before.
159
+ ### `sanitizeHtml` keeps only `language-*` classes on `code`
160
+
161
+ A call with `attributes: { code: ['class'] }` now keeps a `code` element's class only when it is `language-` and a language name (`language-ts`, `language-c++`); any other class is dropped. Style the element by its parent or by `[class^='language-']` instead of a class of your own on `code`.
162
+
163
+ Releases before 1.106 are in the notes of their releases, at https://git.kaynooo.fr/kaynooo/kayjs/releases.
package/llms/upgrading.md CHANGED
@@ -2,149 +2,33 @@
2
2
 
3
3
  What each release breaks, and what an app changes to move to it. kay and its libraries share one version, so one section covers them all; a patch breaks nothing, and a version missing here broke nothing. Through 1.x a breaking change ships in a minor; from 2.0.0 it ships in a major, and a minor or a patch breaks nothing.
4
4
 
5
- ## 1.109.0
5
+ ## 1.111.0
6
6
 
7
- ### The 1.105 config, page, server and store forms are gone
7
+ ### kay needs Bun 1.4.5
8
8
 
9
- The twenty-four lints that reported them are gone too. `kay upgrade` on 1.108 rewrote each one written inline; what it could not reach is a type error or a refusal at boot naming the new form. The full 1.105 rules are in [Upgrading to 1.105: kay.config.ts and library options](upgrading-1-105-config.md).
9
+ Bun 1.4.5 fixes security issues in HTTP/3, HTTP/1.1, TLS, DNS and Zstandard, which reach `Bun.serve`, `fetch` and `Bun.dns`, so kay and its libraries ask for `bun >=1.4.5` and refuse 1.4.4. Run `bun upgrade`, then `bun update bun` in a project on `bun-plugin-tailwind`, whose peer installs the npm `bun` package that package scripts run ahead of the system Bun, and move CI and images to 1.4.5: `kay upgrade`'s last `kay check --fix` moves a root Dockerfile's `oven/bun` tag (`old-bun-image`).
10
10
 
11
- - Config keys at the top of kay.config.ts: `links`, `offline` and `search` are `client.*`; `images`, `fonts`, `favicon`, `manifest` and `publicCache` are `assets.*`; `observe`, `health`, `metrics` and `jobs` are `ops.*`; `env` is `envFiles`; `onStart` is `onListen`. The config refuses them, naming where each moved.
12
- - `i18n`'s `defaultLocale` is `default`, `prefixDefault: true` is `mode: 'always'` and `domains` is `mode: { domains }`; the old keys are refused.
13
- - `serve.apiPrefix` and the `path` of `openapi`, `mcp`, `health`, `metrics` and `jobs` are `endpoints.*`; `openapi.referencePath` is `openapi: { reference: { path } }`.
14
- - `/mcp` and `/metrics`, where those endpoints were before 1.105, answer 404: use `/_kay/mcp` and `/_kay/metrics`, or what `endpoints` sets.
15
- - `mcp: { key }` is `mcp: { token }`, `proxy: { key: 'x-upstream-key' }` is `proxy: { key: { header } }`, and `proxy: 2` is `proxy: { hops: 2 }`; `observe.log: 'json'` and a bare function are `ops: { observe: { log: { format: 'json' } } }` and `{ sink }`.
16
- - `images` takes `remote`, `formats` and `limits` only: `remoteMaxSize`, `remoteTimeout`, `quality`, `webp`, `avif`, `maxVariants` and `queue` are refused.
17
- - `pages({ root, client: { ... } })` and `testSite({ root, mcp: true })` refuse a config key beside `root`: write it in `config`. `testSite({ mcpKey })` is `config: { mcp: { token } }` and `testSite({ proxyKey })` is `config: { proxy: { key: { header, secret } } }`.
18
- - The `onSave`, `onUpload`, `onSend`, `onSuppress`, `onSubscribe`, `onConfirm`, `onUnsubscribe`, `onBroadcast`, `onSignUp`, `onStep`, `onToolCall` and `onSuccess` of kayjs-ai, -auth, -cms and -mail are their `after` names (`afterSave`, `afterSend`, `afterSignUp`, `afterStep`, `afterToolCall`, `afterRequest`...), and an action hook event has `context` where it had `ctx`.
19
- - `maxAge` is `ttl` in `signed.sign`, `files.url`, workChallenge, kayjs-auth's `proofOfWork` and `captcha`, an action's `protect.minTime` and `protect.proofOfWork`, and the data of a kayjs-auth mail (`ttl: { link, code }`).
20
- - A store is handed a `Duration` for every length, `durations: true` is no member of a store, `lengthFor` takes milliseconds only and `kv(ns).set(key, value, 60_000)` is `'60000ms'`; `formatDuration(7_500_000)` is `formatDuration('125m')`.
21
- - Library stores: `ai({ conversations })` is `ai({ store })`; `pgConversations`, `sqliteConversations`, `createConversationTable` and `conversationTable` are `pgAi`, `sqliteAi`, `createAiTables` and `aiTables`; `openLists`, `createMailListTables` and `mailListTableNames` are `sqliteLists`, `createMailTables` and `mailTables`; `mailer({ listStore, suppressionStore })` is `store: { lists, suppressions }`; `pgLoader` and `sqliteLoader` of kayjs-cms are `pgCms` and `sqliteCms`.
22
- - Jobs: a handler is `(input, ctx)`, its signal and job being `ctx.signal` and `ctx.job` and no longer the second and third arguments, and `lostAfter` is `timeout`; `schedule('@hourly', job, options)` is `schedule({ cron: '@hourly', ...options }, job)`, `schedule('30s', job)` is `schedule({ every: '30s' }, job)`; `diskFiles(dir, hooks)` is `diskFiles({ dir, ...hooks })`; `ws.send(JSON.stringify(value))` of an `api()` socket is `ws.send(value)`.
23
- - A page's `noindex`, `sitemap`, `lastmod`, `search` and `feed` are written in `seo`, and `ttl` and `cacheControl` are `cache`: the build refuses a top-level key of `page`, naming the new one. An `img` takes `placeholder={false}` where it took `no-placeholder`.
24
- ### The island and template forms of 1.105 are gone
11
+ ### kayjs-auth no longer takes `@kaynooo/pg-orm` 7
25
12
 
26
- The `deprecated-page-island`, `deprecated-island-fence`, `deprecated-island-attributes`, `deprecated-island-events`, `deprecated-link-flags`, `deprecated-children-prop`, `deprecated-uncaught-await`, `deprecated-import-path`, `deprecated-context-import` and `deprecated-listen-target` lints are gone with the forms they reported; run `kay upgrade` on 1.108 first, which rewrote each but the page island.
13
+ kayjs-auth's Postgres store writes an OAuth grant with `insertOne`'s `skipConflicts`, which pg-orm 7 lacks, so its peer range is `^8.0.0 || ^9.0.0`. An app on pg-orm 7 moves to 8 or 9 with it (`bun add @kaynooo/pg-orm@^8.0.0`, then pg-orm's `MIGRATION_v8.0.0.md`); kay's own `kay/pg-orm` still takes 7.
27
14
 
28
- - A page without a `--- server` fence that needs the browser is the `page-island` error: move what needs the browser into a component and render it from the page.
29
- - `--- island`, `--- client` and `--- static` are unknown fences, and `export const island = { ... }` in a `--- module` fence is a `fence-invalid` error: write `island({ render, hydrate, persist, interactive })` first in the component's script.
30
- - `hydrate="client"` on a use is `render="client"`, and `server="defer"` is `server defer`: `server="defer"` is a `server-island-invalid` error and `hydrate="client"` an `attribute-invalid` one.
31
- - `data-keep-scroll`, `data-no-transition` and `data-no-prefetch` are read by nothing and are an `unknown-link-flag` error: write `data-scroll="keep"`, `data-transition="false"` and `data-prefetch="false"`.
32
- - A `// kay-allow uncaught-await` comment and a `lints: { 'uncaught-await': ... }` entry are an unknown lint, and `defineConfig` types no such `lints` key: remove them.
33
- - `listen(window, ...)` is `listen(() => window, ...)`: `listen` takes a function returning its target, and a value is a type error, and in a `.kay` file a server read of `window`.
34
- - Import `mount`, `Mounted`, `s`, `RateLimit` and `RateLimitRefusal` from `kay` and `sqliteCache` from `kay/cache`: `kay/mount` is no entry any more and `kay/server` no longer exports them.
35
- - `defineContext` is imported from `kay/server`: `kay/library` no longer exports it.
36
- - `children?: Snippet` beside a bare `slot` and `listen(() => document, 'kay:navigate', ...)` in an island are reported no more: both still work, and the function hook is the form to write.
37
- ### An action's form readers are only under `form`
15
+ ### kayjs-ai's Chat is flat and its controls are kayjs-ui's
38
16
 
39
- `add.failed()`, `add.error(field)` and `add.validate(form, field)` are gone from an action: write `add.form.failed()`, `add.form.error(field)` and `add.form.validate(form, field)`, which the 1.105 upgrade had already moved to. The `deprecated-action-readers` lint is gone with them, and `.error('field')` on an action in a template no longer describes its field.
17
+ The panel and the launcher have no shadow by default (`--kai-chat-shadow` still sets one). The suggestions, the edit's Save and Cancel, Try again, Allow and Deny and the conversation list's links are kayjs-ui `Button`s, and a conversation's delete is `ConfirmDelete` asking inline, so the parts `deleteConfirm` and `confirm` are gone: restyle `delete` (the trigger) instead. A `restyle` rule on the chat's own buttons now reaches kayjs-ui's classes. `labels.allowed` and `labels.denied` lose their colon (`Allowed add_note …`), a model prompt reading the old `Allowed:` start needs the new one, and the failure text ends on what to do, `The reply failed. Send your message again.`: set `labels.error` to keep yours.
40
18
 
41
- ### `Action<never, unknown>` is `Action`
19
+ ### A block's or a snippet's plain parameter is read-only in a component that renders again
42
20
 
43
- Write `Action` for a prop that takes any action: both parameters default to it. The `deprecated-action-type` lint is gone.
21
+ A `@cell(row)` block or a `snippet show(item)` of an island or a component reads its plain parameters through an accessor, so a block drawn once per key follows the item that replaces it. Writing to one (`item = null` in a handler) is the ``item` is read-only here`` error a loop's row already gives: keep the value in a `signal` of the component and write that. A page or a static component, whose parameters are plain values, is unchanged. `kay check` cannot tell a write meant for the parameter from one meant for a variable of the same name, so no lint rewrites it.
44
22
 
45
- ### An island's call answers only a result
23
+ ## 1.110.0
46
24
 
47
- A call read as its data (`const list = await call(notes, '/')` then `list.items`) is a type error, as the 1.105 call result made it; write `.orThrow()` after the call, or read `ok` and `data`. The `deprecated-call-result` lint that found it is gone.
25
+ ### A swap keeps an island whose props changed
48
26
 
49
- ### A callback of a library component takes only the event object
27
+ - A refresh (an action's, `refresh()`, a live value's) used to end an island whose props changed and hydrate it afresh; it now stays, with its signals, open dialogs and focus, and takes the new props in place. A value the island seeds from a prop once, `signal(light)`, keeps the first value: write `linked(() => light)` for one that follows, or give the island a `persist={key}` that changes to start it afresh. A list whose items move keeps each island by `persist={id}`.
28
+ - A visit to a page with the same layout keeps the islands the layout renders (a menu, a folded group) with their state; the page's own islands are still ended. An island of a layout that used to start closed on every page now stays as it was left.
29
+ - A refresh keeps a field a visitor typed in and a `details` they toggled unless the server changed that value, where it used to show the server's again.
30
+ ### A Dialog's close is a plain button with a `close` part
50
31
 
51
- `onChange={toggle}` with `toggle(on: boolean)` is a type error on a kayjs component: write `onChange={event => toggle(event.checked)}`, `{ value }` or `{ files }` for the others. The `deprecated-callback-handler` lint is gone.
32
+ Dialog's close button is a `button` (an `a` with `closeHref`) of the `kui-icon-btn` class drawing the `x` icon, no longer an `IconButton`. An app styling it through `part="root"` of that IconButton, or a `restyle` recipe on `IconButton` that reached it, styles the `close` part of Dialog instead (SidePanel hands it on as its own `close`); a `close` block still replaces the whole button.
52
33
 
53
- ### A refusal is only `ctx.deny(status, { message, errors, data })`
54
-
55
- `deny(403, 'text')` and `deny(403, 'text', data)` take a status and options only, `ctx.fail(...)` is gone, and `refuse('text', { status })` is `refuse(status, { message })`: write `ctx.deny(status, { message, errors, data })`. `RefuseOptions` is no longer exported from `kay/library`. The `deprecated-deny-call`, `deprecated-ctx-fail` and `deprecated-refuse-call` lints are gone, and with them the `unreturned-fail` lint of a `ctx.fail` left unreturned.
56
-
57
- ### `guard` and `requireGuards` are `guards`
58
-
59
- `vitals({ guard })`, `jobs: { guard }` and `images: { guard }` are `guards`, and `requireGuards: true` (in kay.config.ts, `pages()` and `testSite`) is `guards: { default: 'closed' }`, `false` `guards: { default: 'open' }`. `VitalsOptions.guard`, `KayConfig.requireGuards` and `PagesOptions.requireGuards` are gone, and so is the `deprecated-guard-option` lint.
60
-
61
- ### `limit.enforce(ctx)` is `limit.check(ctx)`
62
-
63
- `rateLimit()`'s `enforce(ctx, message?)` is gone: write `check(ctx, message?)`; `limiter().enforce(key)` keeps its name. The `deprecated-rate-enforce` lint is gone.
64
- ### The parts object of `class` is gone
65
-
66
- A component's parts are its `parts` attribute: `Card(class={{ head: 'p-6' }})` is `Card(parts={{ head: 'p-6' }})`, as `kay upgrade` on 1.108 wrote it. `class` is a string, an array or an object of conditions, so `{ head: 'p-6' }` in it is the class `head`: a type error on a component with parts, unreported when a shorthand or a spread sits beside it. The `deprecated-parts-class` lint is gone with it.
67
- ### `persisted(...)` and `persisted.query` are `persisted.cookie(...)` and `queryParam`
68
-
69
- A bare `persisted(name, value)` is `persisted.cookie(name, value)`, and `persisted.query(name, value, options)` is `queryParam(name, { default: value, ...options })`. The `deprecated-persisted-call` and `deprecated-persisted-query` lints are gone, and `PersistedQueryOptions` with them.
70
-
71
- ### `navigate({ query })`, `onNavigate` and `onBeforeNavigate` are gone
72
-
73
- `navigate({ query: changes })` is `navigate.query(changes)`, and the imported `onNavigate(fn)` and `onBeforeNavigate(fn)` are `navigation.onNavigate(fn)` and `navigation.onBeforeNavigate(fn)`. The `deprecated-navigate-query` and `deprecated-navigation-hooks` lints are gone.
74
-
75
- ### `set(key, next)` and `presence(room, member)` are refused
76
-
77
- `room.set(next, { key })` of a live value per key and `unread.set(next, { user })` of one per user take the next value first; the old order throws. `presence({ room, member, signal })` takes one object. The `deprecated-live-api` lint is gone.
78
-
79
- ### The old readers of a source are gone
80
-
81
- `value()`, `last()`, `rows()` (of a `resource`, `stream`, `socket`, `local()` and `infiniteList()`, and a list of your own given to `LoadMore`, `Table` or `VirtualList`), `unsynced()`, `syncStatus()`, `onSuccess` and `onSync` of a source or a `track()` handle, and an action's `succeeded()` are `data()`, `sync.queued()`, `sync.status()` and `onData({ value })` (an action's `succeeded()` is `data()`). The `deprecated-source-readers` lint is gone.
82
- ### kayjs-auth drops its 1.105 names
83
-
84
- - `organizations.members()`, `setMemberRoles()`, `removeMember()`, `invitations()`, `myInvitations()` and `invitation()`, `admin.roles()` and `auditLog()`, `oauthServer.clients()`, `passkeys.rename()`, `account.changeUsername()`, `profile()` and `saveProfile()`, `oauth.identities()` and `providerToken()`, `magicLink.signInWithCode()`, and the methods that sat on `auth` (`requireAdmin()`, `captchaRequired()`, `captchaChallenge()`, `provedLately()`, `reprove()`, `scopes()`, `hasScope()`, `oauthResource()`, `oauthOrigin()`, `oauthFixed()`) no longer exist: write the names of the 1.105.0 section below. `deprecated-auth-methods` is gone, so run `kay upgrade` on 1.108 first, which renames the calls.
85
- - `rateLimit` takes the grouped form only: the flat keys `signInAccount`, `signInAccountAll`, `resendAccount`, `forgotAccount`, `magicLinkAccount`, `emailChangeAccount`, `twoFactorAccount`, `emailCodeAccount`, `inviteAddress`, `oauthRegister`, `oauthRegisterAll`, `oauthDocument` and `oauthToken` throw at startup, naming the group to write (`signIn: { account }`, `oauth: { token }`). `deprecated-auth-rate-limits` is gone.
86
- - `SignedIn(role=...)` is `SignedIn(require=...)`, and the `SignedOut` component and kayjs-auth's `isSignedOut` are removed: put the children in an `@else` block of a `SignedIn`. `deprecated-auth-signed` is gone.
87
-
88
- ### kayjs-mail drops `send`, `enqueue` and its own `SubscribeForm`
89
-
90
- - `send` and `enqueue` are no longer exported from `@kayjs/mail` (`registeredMailer` went in 1.105): a page, an action or a guard sends through `ctx.locals.mail.send(...)` or `.enqueue(...)`, a job or a script through the mailer of `src/mail.ts`. `deprecated-mail-send` is gone.
91
- - `@kayjs/mail/subscribe-form.kay` does not resolve: import `SubscribeForm` from `@kayjs/ui/subscribe-form.kay`, which takes the same props. `deprecated-mail-form` is gone, so run `kay upgrade` on 1.108 first to have the import rewritten.
92
-
93
- ### kayjs-ai drops its 1.105 props and options
94
-
95
- - The `<key>Label` props of `Chat`, `ChatLauncher` and `ChatPanel` (`sendLabel`, `stopLabel`, `openLabel`, `attachTooBigLabel`...) are not read: write one `labels` object keyed as the `ai.chat.<key>` messages are, `labels={{ send: 'Go' }}`; `waitingLabel` and `failureLabel` are `labels.thinking` and `labels.error`. The `ChatLabelProps` and `ChatLauncherLabelProps` types are removed. `deprecated-ai-labels` is gone.
96
- - `Chat`'s `links` and `Sources`' `here` are not read: `links="apart"` is `newTab={true}` (the default), `links="here"` and `here` are `newTab="auto"`. `deprecated-ai-links` is gone.
97
- - `language` in the options of `transcribe()` and `describeImage()` is not read: write `locale`, a BCP 47 tag. `deprecated-ai-language` is gone.
98
-
99
- ### kayjs-cms drops `role`, `member` and a list `uploads`
100
-
101
- - `cms({ role: 'editor' })` is `cms({ access: 'editor' })`, and `cms({ member })` is folded into an `access` function, which admits and names the person in one: `access: ({ locals }) => locals.user && { name: locals.user.email, roles: locals.user.roles }`. Both throw as unknown options now. A `guard` of your own stays, for what `access` cannot say, and holds no role. `deprecated-cms-options` is gone, so `guard: passwordGuard(password)` is `access: { password }` by hand.
102
- - `uploads: ['image/*']` is `uploads: { types: ['image/*'] }`.
103
-
104
- ### kayjs-ui drops its 1.105 names
105
-
106
- - `onChange` on an Accordion, a Tabs and a ThemeToggle is `onValueChange({ value })`, a ZoomPane's is `onPlateChange({ plate })`, a Table's `onSort` is `onSortChange({ sort })` and a chart's `onActive` is `onActiveChange({ index })`: each takes one event object, and the old names are not called. `deprecated-ui-callbacks` is gone.
107
- - The list a component draws is `items`: `tabs`, `avatars`, `entries`, `links`, `steps`, `icons` and `slides` are not read on Tabs, AvatarGroup, CommandPalette, Timeline, SideNav, SiteNav, AppHeader, Steps, IconPicker and Carousel, nor the `list` of an infinite source on Table, Carousel, Masonry, MediaGallery, VirtualList and LoadMore. `deprecated-ui-items` is gone.
108
- - `deprecated-ui-input` is gone: a Toggle, Checkbox, Slider, ColorInput, Combobox or DateInput keeps its `id`, `title` and `data-*` on its root, as since 1.105, and `inputProps` is the way to reach the input.
109
-
110
- ### The old test helper names are gone
111
-
112
- - `aiTest`, `mailTest`, `cmsTest` and `authTest` are not exported by the libraries' `/test` entries: import `test` (`import { test as mailTest } from '@kayjs/mail/test'`). `site.refusal(...)` is `site.expectRefused(...)` and `site.socketRefusal(...)` is `site.socket.refused(...)`. `deprecated-test-helpers` is gone.
113
-
114
- ## 1.108.0
115
-
116
- ### The `deprecated-package-names` lint is gone
117
-
118
- A project still importing `@kaynooo/kayjs*` is not reported any more, and `kay check --fix` no longer rewrites it: write `@kayjs/kay` and `@kayjs/<library>` (`ui`, `auth`, `mail`, `cms`, `ai`) in the imports, config keys, stylesheets and `package.json` yourself, or run `kay upgrade`, which still moves an app off the old names, stopping at 1.107 first.
119
-
120
- ## 1.107.0
121
-
122
- ### `TSchema` is gone from `kay/library`
123
-
124
- Import `Schema` from `kay/library` instead, kay's own name for what `s` builds; `kay upgrade` on 1.106 rewrote the import and its uses. The `deprecated-schema-type` lint is gone with it.
125
-
126
- ### `--- script` opening a file is an error
127
-
128
- A file opens its script with `---`; `--- script` is only for a script that follows a `--- server`, `--- module` or `--- style` fence. The `deprecated-script-fence` lint is gone, and `--- script` first in a file is a `fence-invalid` error whose safe fix `kay check --fix` applies.
129
-
130
- ### `action({ input, ...options }, handler)`
131
-
132
- An action takes its options first, with its input in them, as an API route does: `action({ input: { title: s.string() }, maxSize: '1mb' }, handler)`. `action(schema, handler, options)` and `action(handler, options)` work until 2.0; `kay upgrade` rewrites them (`deprecated-action-options`).
133
-
134
- ### One validation for every input
135
-
136
- Actions, API routes, sockets and `defineEnv` read their input through one `validate(schema, value, { source })`. Text sources (a form, a query, path params, the environment) are read as the numbers, booleans and lists they spell, and a JSON body never is: an action called from an island, a socket message and an API route's JSON body that sent `'3'` for an int, or `'true'` for a boolean, are refused where Elysia's schemas let them by. An object refuses a key its shape lacks in JSON (`extra: 'strip'` drops it, as `s.Object` of the old builders still does); a query, the headers and the cookies of a request still drop theirs. A form post drops the fields the schema does not name (a named submit button, a widget), as a browser sends controls the app does not own. `validate` answers `{ errors: [{ path, key, params, message }], status: 422 }` worded in the request's locale and independent of `NODE_ENV`; an action's or API route's answer still carries `errors` as a `{ field: message }` map. An API route's refusal reaches an `onError` as an error with code `VALIDATION` whose `all` lists `path`, `message` and `summary`. No lint can find the app that sends such a key or such a JSON value, as it depends on what a request carries.
137
-
138
- ## 1.106.0
139
-
140
- ### `s` is kay's own builder, in lowercase
141
-
142
- `s.string({ min, max })`, `s.int()`, `s.enum()`, `s.object()` and the rest replace the PascalCase builders of Elysia, each taking the same field options (`optional: true`, `default`, `error`, `label`, `description`, `example`); `s.Optional(field)` is `optional: true` in the field's options, `s.UnionEnum` and `s.UnionKeys` are `s.enum`, `s.Numeric` is `s.number`, and `s.typebox` is gone: `s` builds a schema of its own, over TypeBox, and a schema built with Elysia's `t` is still taken. The old names work until 2.0, and `kay upgrade` rewrites them (`deprecated-schema-builders`, [schemas](schemas.md#schemas)). A file size of a file field is `'2mb'`, never `'2m'`. Two things differ in the new builders, which the fix does not hide: `s.object` refuses a key its shape lacks, where `s.Object` let it by (`{ extra: 'strip' }` keeps the old way; see [schemas](schemas.md#schemas) for where it refuses), and `s.list` is at most 1,000 items unless `max` says more. An unknown key of a query, the headers or the cookies is dropped, whatever the schema says, as a link or a proxy adds some; `s.Object` of a collection's frontmatter now refuses a key its shape lacks, so an entry with an extra key fails the build until the schema says `{ extra: 'strip' }`. An `action` or a `defineEnv` takes the record of fields where it took `s.Object({ ... })`, and the fix writes it.
143
- ### `@kaynooo/eslint` 8
144
-
145
- kay and `kay new` use `@kaynooo/eslint` 8, which has no formatters (Prettier, oxfmt and dprint, about 30 MB, are no longer installed): run `bun add -d @kaynooo/eslint@^8`, and drop a `formatters` option from `eslint.config.ts` if it sets one. `kay fmt` formats as before.
146
- ### `sanitizeHtml` keeps only `language-*` classes on `code`
147
-
148
- A call with `attributes: { code: ['class'] }` now keeps a `code` element's class only when it is `language-` and a language name (`language-ts`, `language-c++`); any other class is dropped. Style the element by its parent or by `[class^='language-']` instead of a class of your own on `code`.
149
-
150
- Releases before 1.106 are in [Upgrading, older releases](upgrading-archive.md).
34
+ Releases before 1.110 are in [Upgrading, older releases](upgrading-archive.md).
@@ -1,6 +1,35 @@
1
1
  # What's new, older releases
2
2
 
3
- What each release before 1.107 added, and the end of a newest release that was cut short (`(continued)`), newest first, each feature with where it is documented. The newer releases are in [What's new](whats-new.md); what a release breaks is in [Upgrading](upgrading.md).
3
+ What each release before 1.110 added, and the end of a newest release that was cut short (`(continued)`), newest first, each feature with where it is documented. The newer releases are in [What's new](whats-new.md); what a release breaks is in [Upgrading](upgrading.md).
4
+
5
+ ## 1.109.0
6
+
7
+ - An endpoint file (`src/routes/a.txt.ts`) no longer stops an app with a root `_guard.ts` and an extension layout that reaches files, as kayjs-auth's, from starting or passing `kay check` (`the layouts of the extensions are placed before what the pages reach was opened`): the endpoints are scanned after what the pages reach is open, as the pages are.
8
+ - `kay env` and `kay check` list the variables of a `defineEnv` module that kay.config.ts imports, as for any other module, so a variable required in production and missing from `.env.example` is reported ([environment](environment.md)).
9
+ - kayjs-ui's centred modal `Dialog` is as tall as its content again, capped at the viewport less 2rem (`size="full"` still fills it), and the opened dialog box no longer draws a browser focus ring round itself (a regression of the 1.105 placement change).
10
+ - An island reading a `queryParam` follows a swap that changes only the query, a link `?x=1` or a component's `param=` navigation, and Back and Forward, whatever its render mode: a signal made outside a component and shared by islands reads the address again after each swap and traversal, as one in a component does ([islands](islands.md#keep-a-filter-in-the-url)).
11
+ - On a static build or a `prerender` page, an island reading a `queryParam` is drawn again from the address when the page is opened with a query, instead of reporting `did not match its server markup`; the build warns naming each page holding one ([prerendering](prerendering.md#static-export)).
12
+ - `site.call(action.with(fields), input)` and `site.submit(action.with(fields), fields, { from: '/path' })` send the fields `with` fixes, as an island's call and a form's post do, instead of answering 422 for a missing field ([testing](testing.md)).
13
+
14
+ ## 1.108.0
15
+
16
+ - kayjs-ui's `BarChart` leaves `goals` out of an island that never writes them, a `ConfirmDelete` leaves out the inline pair (`ask`), the trigger looks and `details` it is never given, and the confirm words no longer carry the questions' queue: a plain `ConfirmDelete` island holds 3.1 KB less of kayjs-ui, a `BarChart` 1.6 KB, and a `Dialog`'s discard question loads when first asked, 1.2 KB less ([kayjs-ui](../../ui/llms/table.md))
17
+ - An island ships only the kayjs-ui icons it can draw: with kayjs-ui in the app's dependencies the default registry is cut to the slots the project writes as strings, about 8 KB minified off an island drawing a Dialog, and a slot named from a variable in the app keeps it whole; the app's own icon settings stay whole ([kayjs-ui setup](../../ui/llms/setup.md))
18
+ - The code that runs an action call (queue, timeout, retries, the post and what follows its answer) loads with the first call instead of with the first island holding an action: a page of hubble's with a table of rows and dialogs loads 1.8 KB gzip less ([islands](islands.md#the-action-caller))
19
+ - A component of an island that leaves a feature out (kayjs-ui's `Table` with no filter, selection, paging or detail rows) no longer ships the markers and the effects of the blocks it never draws, and an `aria-` or `data-` attribute of such a feature is not bound: a plain `Table` island carries 1.7 KB less of kayjs-ui's code, 9.9 KB in all, as any component declaring `uses()` features carries less.
20
+ - An extension's own islands, as kayjs-ui's toaster, tooltip host and confirm host, hydrate when the library resolves outside the project root (a workspace link, or a folder above it) and the app lists no dependency on it ([component libraries](component-libraries.md)).
21
+
22
+ ## 1.107.0
23
+
24
+ - `--- script` as a file's first fence is a compile error naming `---`, and the `deprecated-script-fence` lint is gone ([components](components.md)).
25
+ - `kay new` pins kay with `~` through 1.x and with `^` from 2.0.0, when a breaking change becomes a major ([Upgrading](upgrading.md))
26
+ - A component an island draws only where it may not render at first paint (inside an `if`, a `match` case, `@failed`, or the body of a closed `Dialog` or `FormDialog`) loads when that branch first draws, with nothing to declare: the page preloads what the server drew, a visitor reaching for the island loads the rest ahead, and a failed chunk is retried and reported; the code that posts an action call loads with its first call, retried after 1 s and 3 s when the load fails ([islands](islands-lazy-components.md#components-that-load-when-they-first-draw)).
27
+ - An island whose closed forms and dialogs hold words that are also component names loads less: a name in a string or a comment no longer keeps a component eager, and `Form`, `FormDialog` and `SaveForm` load their sending code on the first send. An island with a table, a closed form dialog and a select in it sheds 4.6 KB gzip of eager JS ([islands](islands.md))
28
+ - `action({ input, ...options }, handler)`: an action takes its options first with its input in them, as an API route does; the old argument order works until 2.0 and `kay upgrade` rewrites it ([actions](actions.md))
29
+ - One `validate(schema, value, { source })` reads every input of an app, an action's, an API route's, a socket's and `defineEnv`'s, and refuses with `{ errors: [{ path, key, params, message }], status: 422 }` worded in the request's locale; a JSON body is never coerced, and a Standard Schema validator (Zod, ArkType) is accepted where a schema is ([schemas](schemas.md))
30
+ - An island validates with the same schema: `validate(schema, value, { source })` from `kay` is the server's `validate` in the browser (JSON Schema built by the browser's `s`, a Standard Schema validator called as it is), its code a chunk the first call loads ([Schemas](schemas.md#schemas)).
31
+ - `kay check` names a Standard Schema validator with no `~standard.jsonSchema` (`schema-without-json-schema`) where an action's `input` or an API route's `body`, `query`, `params`, `headers` or `cookie` takes it, in `.ts` modules and `.kay` fences ([Schemas](schemas.md#schemas)).
32
+ - kayjs-ui's `Table` draws its failure row's retry as a plain button with a `retry` part, so an island holding a plain Table ships 6 KB less (the `Button`, its busy state and the icon set stay out unless the page uses them) ([restyle](https://git.kaynooo.fr/kaynooo/kayjs/src/branch/main/packages/ui/llms/restyle.md)).
4
33
 
5
34
  ## 1.106.0
6
35
 
@@ -42,33 +71,4 @@ What each release before 1.107 added, and the end of a newest release that was c
42
71
  - A kay extension takes `ui`, a module whose default export is `defineUi({ ... })`, so a package restyles components for every app listing it, under the app's own `src/ui.ts` ([component libraries](component-libraries.md)); `src/ui.ts` itself follows no import or spread.
43
72
  - `input(field=...)` takes its `type` (`email`, `url`, `number`, `date`, `checkbox`, `file` with `accept`) and `autocomplete` from the schema, and `select(field=...)` with no `option` lists the values of an `s.enum`, each unless the template writes it ([Forms](actions.md#forms)).
44
73
 
45
- ## 1.105.0
46
-
47
- - kayjs-ui's `Badge` takes `color`, any CSS colour, in place of a tone ([Badge](/ui/badge#any-colour)); the new `IconTile` draws an icon, or a letter, on a rounded tile tinted in a tone or any `color`, and `Stat` and `Widget` draw their `icon` as one with `iconTile` ([IconTile](/ui/icon-tile)); an `AppSwitcher` app takes a `color` that tints its tile and icon, and an `@appIcon(app)` block replaces the icon ([AppSwitcher](/ui/app-switcher#a-colour-per-app)).
48
- - The favicon, touch icon and manifest links, and the icons the manifest lists, end in `?v=` and a hash of the favicon source, so a CDN or browser holding the old icon fetches the new one after the source changes; the files keep their paths ([favicon](sitemap-search-fonts.md)).
49
- - A redirect whose target has a query of its own (`'/calendar': '/?tab=calendar'`) keeps it and adds the request's params it does not name, the target's winning on a clash, in `redirects` and in the runtime set alike ([routing](routing-endpoints-and-base.md)).
50
- - kayjs-ui's `Slider` and `AudioPlayer` fill their track in the accent up to the thumb (the danger colour when invalid, the muted when disabled): the range input carries `--range-fill`, its share from `0%` to `100%`, in its `style`, and Firefox draws `::-moz-range-progress`.
51
- - kayjs-ui's `Slider` draws its value on the label's row, at its end, in place of a row under the track: the `value` part now comes before the `input` part in its markup.
52
- - `deprecated-package-names` reports an old package name only where it is a specifier, a config key, a stylesheet path or a package.json entry, not a comment or a sentence in a string that mentions it ([deprecated lints](deprecated-lints.md)).
53
- - kayjs-auth's `SignedIn` takes `require`, what `auth.guard({ require })` takes (a role, a list, a predicate), and an `@else` block for everyone who does not meet it, so `SignedOut` and `role=` are deprecated (`deprecated-auth-signed` renames `role`); `fresh: '10m'` on `auth.guard()` and `requireUser()` asks for the password or passkey again before a sensitive action, `auth.provedLately('10m')` and `reprove()` being its two halves ([The signed-in user in templates](../../auth/llms/signed-in-components.md), [Ask for the password or passkey again](../../auth/llms/sessions-and-guards.md#ask-for-the-password-or-passkey-again), [upgrading](upgrading.md)).
54
- - kayjs-auth's groups share one set of verbs (`list`, `get`, `create`, `update`, `delete`, `revoke`) and every method sits in its group: `auth.organizations.listMembers()`, `auth.admin.require()`, `auth.captcha.required()`, `auth.proof.recent()`, `auth.tokens.hasScope()`, `auth.oauthServer.resource()`, `auth.email.signInWithCode()`; the old names work until 1.108 and `deprecated-auth-methods` rewrites them ([grouped methods](../../auth/llms/grouped-methods.md)).
55
- - Every kayjs-auth method answers one `Result<Ok, Code, Fields>` in place of sixty `*Result` aliases, and a failure is a kay `Failure` too: an action returns `auth.password.signIn(input)` as it is, and its island call reads `{ ok: false, status, data: { code, message } }` (kayjs-auth's `passwords-and-mails` guide).
56
- - An action's form readers are grouped under `form`, apart from its call state: `add.form.failed()`, `add.form.error('title')` and `await add.form.validate(form)`, where `add.pending()`, `add.status()` and `add.data()` stay on the action ([Reading the outcome](actions.md#reading-the-outcome)); the old names work until 1.108 and `deprecated-action-readers` rewrites them.
57
- - A component's `slot` and `slot name` type the children and blocks a call may pass, so a component declares no `children` and no block it only renders with `slot name`, and a call passing a block with no `slot` for it is a `kay check` error; `children?: Snippet` beside a bare `slot` is rewritten by `deprecated-children-prop` ([Slots](templates-elements-slots-snippets.md#slots), [upgrading](upgrading.md)).
58
- - kayjs-auth's `SignOutButton` and `SignInLink` replace the hand-written sign-out form and sign-in link, with no `features().prefix` in a template: `redirect`, `label`, children and a Button's `variant`, `tone`, `size` and `icon`, `SignInLink` taking `href` and `button`; `UserMenu` shows a visitor a link to sign in (`signIn={false}` leaves it out) and takes children and `redirect` ([signed-in components](../../auth/llms/signed-in-components.md)).
59
- - A call from an island answers `{ ok: true, data }` or `{ ok: false, status, message, errors, data, error }` and never throws for a refusal, a failed handler, a network failure or a timeout, for an action and for `call()` of an API route alike, and `.orThrow()` is the throwing style: `await add(input).orThrow()` ([Calling actions from islands](actions-from-islands.md), [API from islands](api-from-islands.md), [upgrading](upgrading.md)).
60
- - kayjs-ui's `Dialog` takes a `placement` (`center`, the default, or `right`): the side placement is the panel `SidePanel` draws, with the same parts, close guards and callbacks, and `SidePanel` and `FormDialog` are built on it, so `FormDialog` takes `placement` and `discard` too; a `src/ui.ts` restyle of a SidePanel's head, title, body or footer moves to the Dialog's ([upgrading](upgrading.md), [kayjs-ui](../../ui/llms/basics.md)).
61
- - A top-level `const` computed from a prop or a signal follows it in the browser, with no `memo` or function written: `const last = items.length - 1` shows the new length once the parent changes `items`. `once-read-prop` now names only a `let`, a destructured `const`, one that awaits and a nested declaration; a `// kay-allow once-read-prop` keeps the first value as before ([Components](components.md), [upgrading](upgrading.md)).
62
- - `endpoints` in kay.config.ts holds where the API and each feature are served, `{ api, openapi, mcp, health, metrics, jobs }`, every default under `/_kay` but the API's, and `openapi: { reference: { path } }` moves the reference page; the MCP endpoint is `/_kay/mcp` and the metrics `/_kay/metrics`, their old URLs answering until 1.108 ([Project](project.md), [upgrading](upgrading.md)).
63
- - `kay lsp` serves a plain `.ts` endpoint and an `api()` module on the same shadow `kay check` types, so `params`, `query` and `guard` of a handler are typed in the editor with no generic written ([Guards](guards.md)).
64
- - kayjs-ui controls that draw an input in a wrapper (Toggle, Checkbox, Slider, ColorInput, Combobox, DateInput) put `id`, `title` and `data-*` on the wrapper like every component, and the input takes `inputProps` (`deprecated-ui-input` rewrites the old form; [upgrading](upgrading.md)).
65
- - kayjs-ui components with a floating panel (Menu, AppSwitcher, BellInbox, AvatarGroup, DateInput, DateRangeInput, MultiSelect, Table, Combobox) take `panelProps`, and the ones drawing their own opening button (BellInbox, AvatarGroup, DateInput, DateRangeInput, MultiSelect, Table) `triggerProps`, typed as the element's attributes; `...rest` stays on the root ([slots and links](../../ui/llms/slots-and-links.md)).
66
- - kayjs-ui names the same things the same way: every list a component draws is `items` (`tabs`, `avatars`, `entries`, `links`, `steps`, `icons` and `slides` before, rewritten by `deprecated-ui-items`), an `infiniteList` is `items` too on Carousel, Masonry, MediaGallery, VirtualList, LoadMore and Table (`list` before), TextInput, Textarea, Select, DateInput, DateTimeInput, TimeInput, MarkdownEditor and FileDrop take `label` as their name, Tabs takes `disabled` for the whole group, TooltipHost takes `onOpenChange`, and a tooltip has one documented entry, `data-tooltip` ([blocks, links and parts](../../ui/llms/slots-and-links.md)).
67
- - Helpers of kay, kayjs-auth, kayjs-mail, kayjs-cms and kayjs-ai throw a `KayError` with a `code` where they threw a plain `Error` (`config-invalid`, `argument-invalid`, `outside-request`, `hook-timeout` and the new `helper-failed`, its `kind` naming a mail provider timing out or refusing), the helpers that run in an island too (`route()`, `every()`, `shortcut()`, `presence()`, `local()`, `navigate()`, `persisted`, `sanitizeHtml`, kayjs-ui's refused props) do the same, and each timeout says which one it is: `StoreTimeoutError` for a database call, `RequestTimeoutError` for a request, an action call's `timeout`, kayjs-ai's call, connect and idle timeouts. See [errors raised while running](errors-runtime.md#errors-raised-while-running).
68
- - An `await` with no `catch` and no `try` around it shows an alert in place of its block once its value rejects, instead of nothing, so `uncaught-await` is gone ([Rendering](rendering.md), [upgrading](upgrading.md)).
69
- - `src/await-failed.kay` replaces the alert of an `await` with no `catch` for the whole app, on the server and in islands, given the `error` and, in the browser, a `retry` ([Rendering](rendering.md)).
70
- - A component's parts are given as their own attribute, `Card(parts={{ head: 'p-6' }})`, `class` keeping strings, arrays and objects of conditions, on a component with parts too; `Card.mt-4(parts={{ ... }})` is allowed, and `deprecated-parts-class` rewrites the old `class={{ head: ... }}` ([Styles and assets](styles-and-assets.md), [upgrading](upgrading.md)).
71
- - `unkeyed-rows` covers every component, not only islands: a `for` over rows with no `id` needs a `key` ([Templates](templates.md), [upgrading](upgrading.md)).
72
- - A link's navigation flags are named as the options of `navigate()`: `data-scroll="keep"`, `data-transition="false"` and `data-prefetch="false"`, typed on every element, and a misspelt one such as `data-prefech` is a `kay check` error (`unknown-link-flag`); `data-keep-scroll`, `data-no-transition` and `data-no-prefetch` are rewritten by `deprecated-link-flags` ([Navigation](navigation-from-code.md#navigating-from-code), [upgrading](upgrading.md)).
73
-
74
- Releases before 1.105 are in the notes of their releases, at https://git.kaynooo.fr/kaynooo/kayjs/releases.
74
+ Releases before 1.106 are in the notes of their releases, at https://git.kaynooo.fr/kaynooo/kayjs/releases.