@kayjs/kay 1.110.0 → 1.112.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 (137) hide show
  1. package/dist/eslint.js +160 -27
  2. package/editors/zed/extension.toml +2 -2
  3. package/llms/build-and-start.md +1 -1
  4. package/llms/checks.md +1 -0
  5. package/llms/component-libraries.md +1 -1
  6. package/llms/deprecated-lints.md +1 -1
  7. package/llms/dev-tool.md +1 -1
  8. package/llms/effects.md +1 -0
  9. package/llms/head.md +1 -1
  10. package/llms/images.md +2 -0
  11. package/llms/islands-lazy-components.md +23 -0
  12. package/llms/islands.md +2 -14
  13. package/llms/lints.md +1 -1
  14. package/llms/navigation.md +2 -2
  15. package/llms/performance-lints.md +1 -0
  16. package/llms/prerendering.md +1 -1
  17. package/llms/project-new-and-add.md +2 -2
  18. package/llms/project.md +1 -1
  19. package/llms/templates-elements-slots-snippets.md +2 -2
  20. package/llms/upgrading-archive.md +107 -58
  21. package/llms/upgrading.md +20 -124
  22. package/llms/whats-new-archive.md +31 -31
  23. package/llms/whats-new.md +36 -32
  24. package/llms.txt +3 -2
  25. package/package.json +11 -11
  26. package/src/build/client.ts +10 -8
  27. package/src/build/island-images.ts +277 -0
  28. package/src/build/pipeline.ts +10 -4
  29. package/src/build/static.ts +99 -24
  30. package/src/check/schema-builders.ts +113 -8
  31. package/src/check/shadow-types.ts +3 -3
  32. package/src/compiler/codegen.ts +1 -1
  33. package/src/compiler/dom.ts +4 -3
  34. package/src/compiler/handed-data.ts +15 -0
  35. package/src/compiler/helper-imports.ts +2 -2
  36. package/src/compiler/html.ts +3 -7
  37. package/src/compiler/index.ts +3 -1
  38. package/src/compiler/items.ts +162 -0
  39. package/src/compiler/jsx.ts +6 -8
  40. package/src/compiler/kay-exports.ts +1 -0
  41. package/src/compiler/lints.ts +1 -1
  42. package/src/compiler/markup.ts +10 -3
  43. package/src/compiler/rewrite-types.ts +2 -0
  44. package/src/compiler/rewrite.ts +4 -2
  45. package/src/compiler/route-lints.ts +8 -0
  46. package/src/compiler/template-walk.ts +2 -1
  47. package/src/config-shape.ts +4 -1
  48. package/src/config.ts +2 -2
  49. package/src/features.ts +1 -1
  50. package/src/new.ts +16 -4
  51. package/src/project.ts +3 -3
  52. package/src/runtime/await.server.ts +4 -2
  53. package/src/runtime/dev-tab-env.ts +28 -3
  54. package/src/runtime/dom-loop.ts +2 -4
  55. package/src/runtime/dom.ts +1 -1
  56. package/src/runtime/html.ts +52 -6
  57. package/src/runtime/image.ts +22 -4
  58. package/src/runtime/index.ts +1 -1
  59. package/src/runtime/island.server.ts +3 -3
  60. package/src/runtime/navigate.ts +5 -0
  61. package/src/runtime/navigation.ts +4 -0
  62. package/src/runtime/page-swap.ts +4 -1
  63. package/src/runtime/reactive.ts +72 -0
  64. package/src/runtime/row-key.ts +4 -0
  65. package/src/runtime/swap-focus.ts +56 -9
  66. package/src/runtime/swap-kept.ts +28 -0
  67. package/src/server/client.ts +3 -0
  68. package/src/server/dev.ts +2 -0
  69. package/src/server/image.ts +1 -1
  70. package/src/server/kept-exports.ts +1 -0
  71. package/src/server/render-document.ts +3 -2
  72. package/src/server/render.ts +2 -2
  73. package/src/template-styles.ts +2 -2
  74. package/types/build/client.d.ts +6 -0
  75. package/types/build/client.d.ts.map +1 -1
  76. package/types/build/island-images.d.ts +45 -0
  77. package/types/build/island-images.d.ts.map +1 -0
  78. package/types/build/pipeline.d.ts.map +1 -1
  79. package/types/build/static.d.ts.map +1 -1
  80. package/types/check/schema-builders.d.ts.map +1 -1
  81. package/types/compiler/dom.d.ts.map +1 -1
  82. package/types/compiler/handed-data.d.ts +5 -0
  83. package/types/compiler/handed-data.d.ts.map +1 -0
  84. package/types/compiler/html.d.ts.map +1 -1
  85. package/types/compiler/index.d.ts.map +1 -1
  86. package/types/compiler/items.d.ts +13 -0
  87. package/types/compiler/items.d.ts.map +1 -1
  88. package/types/compiler/jsx.d.ts.map +1 -1
  89. package/types/compiler/kay-exports.d.ts.map +1 -1
  90. package/types/compiler/lints.d.ts +9 -1
  91. package/types/compiler/lints.d.ts.map +1 -1
  92. package/types/compiler/markup.d.ts +2 -0
  93. package/types/compiler/markup.d.ts.map +1 -1
  94. package/types/compiler/rewrite-types.d.ts +1 -0
  95. package/types/compiler/rewrite-types.d.ts.map +1 -1
  96. package/types/compiler/route-lints.d.ts +8 -0
  97. package/types/compiler/route-lints.d.ts.map +1 -1
  98. package/types/compiler/template-walk.d.ts.map +1 -1
  99. package/types/config-shape.d.ts.map +1 -1
  100. package/types/config.d.ts +3 -1
  101. package/types/config.d.ts.map +1 -1
  102. package/types/new.d.ts.map +1 -1
  103. package/types/project.d.ts +2 -2
  104. package/types/project.d.ts.map +1 -1
  105. package/types/runtime/await.server.d.ts.map +1 -1
  106. package/types/runtime/dev-tab-env.d.ts.map +1 -1
  107. package/types/runtime/dom-loop.d.ts +2 -1
  108. package/types/runtime/dom-loop.d.ts.map +1 -1
  109. package/types/runtime/dom.d.ts +1 -1
  110. package/types/runtime/dom.d.ts.map +1 -1
  111. package/types/runtime/html.d.ts +5 -2
  112. package/types/runtime/html.d.ts.map +1 -1
  113. package/types/runtime/image.d.ts.map +1 -1
  114. package/types/runtime/index.d.ts +1 -1
  115. package/types/runtime/index.d.ts.map +1 -1
  116. package/types/runtime/navigate.d.ts.map +1 -1
  117. package/types/runtime/navigation.d.ts +2 -0
  118. package/types/runtime/navigation.d.ts.map +1 -1
  119. package/types/runtime/reactive.d.ts +5 -0
  120. package/types/runtime/reactive.d.ts.map +1 -1
  121. package/types/runtime/row-key.d.ts +2 -0
  122. package/types/runtime/row-key.d.ts.map +1 -0
  123. package/types/runtime/swap-focus.d.ts +2 -0
  124. package/types/runtime/swap-focus.d.ts.map +1 -1
  125. package/types/runtime/swap-kept.d.ts.map +1 -1
  126. package/types/server/app-stages.d.ts +3 -1
  127. package/types/server/app-stages.d.ts.map +1 -1
  128. package/types/server/app.d.ts +3 -1
  129. package/types/server/app.d.ts.map +1 -1
  130. package/types/server/client.d.ts +2 -0
  131. package/types/server/client.d.ts.map +1 -1
  132. package/types/server/dev.d.ts +1 -0
  133. package/types/server/dev.d.ts.map +1 -1
  134. package/types/server/kept-exports.d.ts.map +1 -1
  135. package/types/server/render-document.d.ts.map +1 -1
  136. package/types/server/render.d.ts +2 -2
  137. package/types/server/render.d.ts.map +1 -1
@@ -157,5 +157,5 @@ export const pageWeight: KayExtension = {
157
157
  - A redirect without params becomes a page sending the browser on with `<meta http-equiv="refresh">`; every redirect also goes to `_redirects`, read by hosts such as Netlify and Cloudflare Pages.
158
158
  - With `i18n.mode: 'always'`, each unprefixed path sends the browser to the default locale's copy.
159
159
  - Locales by domain need a server.
160
- - The directory is cleared first, only when the last export wrote it: kay refuses one holding other files, and the project itself.
160
+ - The site is written to a folder beside the output (`dist.kay-staging`) and renamed over it once complete, the last export moved aside (`dist.kay-old`) and removed, so a host serving the directory never finds it empty or half written, and an export that fails leaves the last one untouched. kay replaces only a directory the last export wrote: it refuses one holding other files, and the project itself.
161
161
  - A page is rendered once, at the default query, and served at every query (`/page?tab=b` is `page.html`). An island reading a `queryParam` is marked `data-query` by that render: the browser draws it again from the address when the page is opened with a query, rather than claiming markup made for the default one, so it shows `?tab=b` with no mismatch. The page's own markup outside islands stays the default's, as does the island's before its JavaScript runs, so read the query in an island, never in the page, and the build warns naming each page holding such an island. The same holds for any `prerender: true` page.
@@ -33,8 +33,8 @@ kay generate resource post title:string body:text published:boolean
33
33
  ## Reference
34
34
 
35
35
  - `kay new <dir> [--kay <dependency>] [--template blank|server|site|app] [--with <features>] [--without <features>] [--forge forgejo|github] [--agents none] [--runner <label>] [--editor helix,zed|none] [-y] [--dry-run] [--format text|json] [--quiet]`:
36
- - Scaffold a project in an empty directory.
37
- - A project is a set of features: `server` (an Elysia server; off, a static site), `starter` (a header, a skip link, a `_404.kay`, a home page greeting from the server with a counter island), `tailwind` (Tailwind through `bun-plugin-tailwind` over orbit's near-black palette (kayjs-ui's token names: `background`, `foreground`, `border`, `muted`, `accent`) with a hairline on every box, no shadows and, with `ui`, a starfield behind the page, with the `.vscode/settings.json` every project gets also pointing Tailwind IntelliSense at the shorthand and `class="..."`; off, the markup carries no classes), `ui` (kayjs-ui: its space skin imported in `app.css`, Space Grotesk and JetBrains Mono served through `fonts`, `ui()` in `kay.config.ts` and the header drawn with `AppHeader`; in every preset, and it needs `tailwind`), `accents` (an accent picker in the header, twelve accents kept in a cookie, `starlight` by default, in no preset: `--with accents` or `kay add accents`, and it needs `starter` and `tailwind`), `eslint`, `tests`, `ci` (the workflow below, Forgejo's or GitHub's), `docker` (the container below; a static site's brings a `_404.kay` when `starter` is off, for its nginx 404), `auth` (kayjs-auth: what `kay add auth` writes, its users in a SQLite file, which needs `server` and `tailwind`), `postgres` (kayjs-auth's users in Postgres instead, with its compose stack and roles, which needs `auth`) and `ws` (the app's API module and websocket island, shown on the home page, which needs `server`).
36
+ - Scaffold a project in an empty directory, or in a fresh clone holding only `.git` and what a new forge repo carries (`README.md`, a `LICENSE` file, `.gitignore`, `.gitattributes`): the `.git` folder and its `origin` stay (the origin picks the CI host), the README, licence and `.gitattributes` are kept, and the template's `.gitignore` replaces the forge's. Any other entry stops it with `kay: <dir> is not empty: <first five entries> in the way`.
37
+ - A project is a set of features: `server` (an Elysia server; off, a static site), `starter` (a header, a skip link, a `_404.kay`, a home page greeting from the server with a counter island), `tailwind` (Tailwind through `bun-plugin-tailwind` over orbit's near-black palette (kayjs-ui's token names: `background`, `foreground`, `border`, `muted`, `accent`) with a hairline on every box, no shadows, with the `.vscode/settings.json` every project gets also pointing Tailwind IntelliSense at the shorthand and `class="..."`; off, the markup carries no classes), `ui` (kayjs-ui: its space skin imported in `app.css`, Space Grotesk and JetBrains Mono served through `fonts`, `ui()` in `kay.config.ts` and the header drawn with `AppHeader`; in every preset, and it needs `tailwind`), `accents` (an accent picker in the header, twelve accents kept in a cookie, `starlight` by default, in no preset: `--with accents` or `kay add accents`, and it needs `starter` and `tailwind`), `eslint`, `tests`, `ci` (the workflow below, Forgejo's or GitHub's), `docker` (the container below; a static site's brings a `_404.kay` when `starter` is off, for its nginx 404), `auth` (kayjs-auth: what `kay add auth` writes, its users in a SQLite file, which needs `server` and `tailwind`), `postgres` (kayjs-auth's users in Postgres instead, with its compose stack and roles, which needs `auth`) and `ws` (the app's API module and websocket island, shown on the home page, which needs `server`).
38
38
  - A preset names a set: `blank` none, one layout and one bare page built as a static site; `server`, `site` and `app` as described below.
39
39
  - Run in a terminal with none of `--template`, `--with`, `--without` or `-y`, it asks for a preset, then shows its features as a checklist. Checking a feature checks what it needs, and unchecking one unchecks what needs it.
40
40
  - Otherwise it takes `--template`, `server` by default, adds the comma-separated `--with` features and drops the `--without` ones, and refuses a feature listed in both, or one missing what it needs (`kay: accents needs tailwind: add --with tailwind, or drop it with --without accents`); when `ci` or `docker` is left out, the next steps name `kay add ci` and `kay add docker`;
package/llms/project.md CHANGED
@@ -54,7 +54,7 @@ kay migrate astro ../my-astro-site --outdir ../my-kay-site
54
54
  - kay is published as `@kayjs/kay` to npm, and as a mirror to the Forgejo registry at `https://git.kaynooo.fr/api/packages/kaynooo/npm/`, its libraries as `@kayjs/ui`, `@kayjs/auth`, `@kayjs/mail`, `@kayjs/cms` and `@kayjs/ai` (`@kaynooo/kayjs*` up to 1.103, which `kay upgrade` moves an app off), and installed under the name its imports use: `"kay": "npm:@kayjs/kay@~<version>"` in `package.json`. From 2.0.0 kay follows semver (a breaking change is a major, and `kay new` writes `^<version>`); through 1.x a minor may break what the one before it took, so `kay new` writes `~<version>`, each break listed in [Upgrading](upgrading.md) and every one `kay check` can recognise a `deprecated` lint with a fix, which `kay upgrade` applies as it moves the app. Every package a project installs, pg-orm and eslint included, is on npm, so a project carries no `.npmrc` and Bun needs no registry setup.
55
55
  - `bunx -p @kayjs/kay kay new my-app` writes a project that, after `cd my-app && bun install`, checks, builds and runs (`bun run dev`), both of those included: this setup, a layout, a page, a `_404.kay` and islands, or only what is picked of them (see [Commands](commands.md#commands) for the presets and features).
56
56
 
57
- - kay runs on Bun 1.4.4 or later, as its `engines` says: the CLI and `pages()` refuse an older one, naming its version, its path and the fix, `bun update bun` when it is the project's npm `bun` package, which a plugin's peer dependency installs and package scripts run ahead of the system Bun.
57
+ - kay runs on Bun 1.4.5 or later, as its `engines` says: the CLI and `pages()` refuse an older one, naming its version, its path and the fix, `bun update bun` when it is the project's npm `bun` package, which a plugin's peer dependency installs and package scripts run ahead of the system Bun.
58
58
 
59
59
  - A folder of the project holding its own `package.json` or `kay.config.ts`, such as a workspace package or a second kay app, is a project of its own: `kay check` and `kay build` leave its files out of the app's, and the app reaches a package there through `node_modules`, as it would one installed.
60
60
 
@@ -98,7 +98,7 @@ Card(title="Todos")
98
98
  p Body text
99
99
  ```
100
100
 
101
- A prop taking markup is typed `Snippet` from `kay`: `Snippet` for the children and a block with no parameters, `Snippet<[Item, number]>` for markup the component calls with values, once per row for instance. `@name(a, b)`, a local `snippet` passed as `name={feature}` and `slot name(a, b)` all use it, a fill with other parameters, or a `@name` written without the parameters the prop is called with, is a `kay check` error (the second names the parameters to write), and `slot name` on a prop that is no `Snippet` is reported at the name.
101
+ A prop taking markup is typed `Snippet` from `kay`: `Snippet` for the children and a block with no parameters, `Snippet<[Item, number]>` for markup the component calls with values, once per row for instance. `@name(a, b)`, a local `snippet` passed as `name={feature}` and `slot name(a, b)` all use it. A block or a snippet reads each plain parameter where the parameter is used, so a caller that draws it once for an item (`slot row(item)` under a keyed `for`, or `followed`) hands it the real item, and the block's markup follows a copy of the item replacing it under the same key, in the same nodes with their focus; a fill with other parameters, or a `@name` written without the parameters the prop is called with, is a `kay check` error (the second names the parameters to write), and `slot name` on a prop that is no `Snippet` is reported at the name.
102
102
 
103
103
  No function reaches the browser, so a static component passing one to an island is the `island-prop` error (unless the island lists `interactive` props and the use writes none, which renders as markup), fixed with `island()`, and a layout or a page with a `--- server` fence cannot pass one.
104
104
 
@@ -136,7 +136,7 @@ List(items={todos})
136
136
  - `{name(args)}` renders it anywhere below, as a text line or in the text of an element, and `kay check` types the call as any call.
137
137
  - It reads the signals, script consts, template `const`s and loop variables around it, so it needs no parameter for them.
138
138
  - A signal read in the snippet updates there in place; one read in an argument, `{feature(title())}`, draws that call again.
139
- - A loop row passed as the argument, `{show(row)}` under `for row of rows()`, is such a read when a new copy of the row replaces the old one, as a game snapshot each tick does: the call is drawn again and its nodes are new. A component, `Show(row={row})`, writes only the attributes that changed to the same nodes, so make per-row markup a component when it should keep its nodes, a CSS transition included.
139
+ - A loop row passed as the argument, `{show(row)}` under `for row of rows()`, is such a read when a new copy of the row replaces the old one, as a game snapshot each tick does: the call is drawn again and its nodes are new. `{followed(() => row, row => show(row))}` (`followed` from `kay`) draws it once for the row under its key instead, and the parameter reads the row as it stands where it is used (a plain script function handed the row, not a block or a snippet, gets the row as it was handed, and is drawn again when the row is replaced). A component, `Show(row={row})`, writes only the attributes that changed to the same nodes, so make per-row markup a component when it should keep its nodes, a CSS transition included.
140
140
  - It is scoped as a template `const` is: the lines after it at its indentation and their children see it, its own lines included, so it can call itself for a tree, and a later snippet can call an earlier one; an `@name` block after it among a component's children does not see it. Above its declaration or outside its block the name is unknown, and `kay check` reports it.
141
141
  - A name another snippet, an import, a script const, a prop or a loop variable already holds is reported at the snippet, and assigning one is refused.
142
142
  - It can hold components, a bare `slot` of the component declaring it, `if`, `for`, `await`, `match` and other snippets, and is a plain function, so `List(row={feature})` passes it where a prop takes a function, which the component renders with `slot row(item, i)`.
@@ -1,114 +1,163 @@
1
1
  # Upgrading, older releases
2
2
 
3
- What each minor release before 1.108 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.107.0
5
+ ## 1.109.0
6
6
 
7
- ### `TSchema` is gone from `kay/library`
7
+ ### The 1.105 config, page, server and store forms are gone
8
8
 
9
- 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.
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
- ### `--- script` opening a file is an error
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
12
25
 
13
- 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.
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.
14
27
 
15
- ### `action({ input, ...options }, handler)`
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.
16
36
 
17
- 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`).
37
+ ### The island and template forms of 1.105 are gone
18
38
 
19
- ### One validation for every input
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.
20
40
 
21
- 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.
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`
22
51
 
23
- ## 1.106.0
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.
24
53
 
25
- ### `s` is kay's own builder, in lowercase
54
+ ### `Action<never, unknown>` is `Action`
26
55
 
27
- `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.
28
- ### `@kaynooo/eslint` 8
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
- 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.
31
- ### `sanitizeHtml` keeps only `language-*` classes on `code`
58
+ ### An island's call answers only a result
32
59
 
33
- 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`.
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.
34
61
 
35
- ## 1.105.0
62
+ ### A callback of a library component takes only the event object
36
63
 
37
- 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).
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.
38
65
 
39
- ### `UserMenu` links a visitor to sign in
66
+ ### A refusal is only `ctx.deny(status, { message, errors, data })`
40
67
 
41
- `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.
42
- ### `SignedIn` takes `require` and an `@else` block
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.
43
69
 
44
- `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.
70
+ ### `guard` and `requireGuards` are `guards`
45
71
 
46
- ### kayjs-auth's methods share one set of verbs
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.
47
73
 
48
- 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.
74
+ ### `limit.enforce(ctx)` is `limit.check(ctx)`
49
75
 
50
- ### An island's call answers a result
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
51
78
 
52
- `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.
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`
53
81
 
54
- ### A callback of a library component takes one event object
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.
55
83
 
56
- 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.
84
+ ### `navigate({ query })`, `onNavigate` and `onBeforeNavigate` are gone
57
85
 
58
- ### An action's form readers sit under `form`
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.
59
87
 
60
- `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.
88
+ ### `set(key, next)` and `presence(room, member)` are refused
61
89
 
62
- ### An auth call answers one `Result`, and a rejection's `errors` are strings
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.
63
91
 
64
- 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.
92
+ ### The old readers of a source are gone
65
93
 
66
- ### A refusal is one call
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
67
96
 
68
- `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`.
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.
69
100
 
70
- ### A top-level `const` follows the prop or signal it reads
101
+ ### kayjs-mail drops `send`, `enqueue` and its own `SubscribeForm`
71
102
 
72
- 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.
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.
73
105
 
74
- ### Eight mistakes that ship a broken page refuse
106
+ ### kayjs-ai drops its 1.105 props and options
75
107
 
76
- `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.
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.
77
111
 
78
- ### An `await` with no `catch` shows an alert
112
+ ### kayjs-cms drops `role`, `member` and a list `uploads`
79
113
 
80
- 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`.
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/*'] }`.
81
116
 
82
- ### A `for` over rows with no `id` needs a `key` in every component
117
+ ### kayjs-ui drops its 1.105 names
83
118
 
84
- `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.
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.
85
122
 
86
- ### `slot` types the children and blocks of a component
123
+ ### The old test helper names are gone
87
124
 
88
- 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.
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.
89
126
 
90
- ### A link's flags are named as `navigate()`'s options
127
+ ## 1.108.0
91
128
 
92
- `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.
129
+ ### The `deprecated-package-names` lint is gone
93
130
 
94
- ### A component's parts are the `parts` attribute
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.
95
132
 
96
- `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.
133
+ ## 1.107.0
97
134
 
98
- ### Websocket frames are always JSON
135
+ ### `TSchema` is gone from `kay/library`
99
136
 
100
- 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.
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.
101
138
 
102
- ### An endpoint's declared context is checked
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
103
148
 
104
- 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`.
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.
105
150
 
106
- `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.
151
+ ## 1.106.0
107
152
 
108
- ### Test helpers share one shape
153
+ ### `s` is kay's own builder, in lowercase
109
154
 
110
- `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.
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
111
157
 
112
- 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.
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`.
113
162
 
114
- Releases before 1.105 are in the notes of their releases, at https://git.kaynooo.fr/kaynooo/kayjs/releases.
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,143 +2,39 @@
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.110.0
6
-
7
- ### A swap keeps an island whose props changed
8
-
9
- - 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}`.
10
- - 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.
11
- - 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.
12
- ### A Dialog's close is a plain button with a `close` part
13
-
14
- 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.
15
-
16
- ## 1.109.0
17
-
18
- ### The 1.105 config, page, server and store forms are gone
19
-
20
- 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).
21
-
22
- - 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.
23
- - `i18n`'s `defaultLocale` is `default`, `prefixDefault: true` is `mode: 'always'` and `domains` is `mode: { domains }`; the old keys are refused.
24
- - `serve.apiPrefix` and the `path` of `openapi`, `mcp`, `health`, `metrics` and `jobs` are `endpoints.*`; `openapi.referencePath` is `openapi: { reference: { path } }`.
25
- - `/mcp` and `/metrics`, where those endpoints were before 1.105, answer 404: use `/_kay/mcp` and `/_kay/metrics`, or what `endpoints` sets.
26
- - `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 }`.
27
- - `images` takes `remote`, `formats` and `limits` only: `remoteMaxSize`, `remoteTimeout`, `quality`, `webp`, `avif`, `maxVariants` and `queue` are refused.
28
- - `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 } } }`.
29
- - 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`.
30
- - `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 }`).
31
- - 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')`.
32
- - 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`.
33
- - 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)`.
34
- - 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`.
35
- ### What `kay upgrade` on 1.108 did not reach
36
-
37
- 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.
38
-
39
- - 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).
40
- - `.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)`.
41
- - `ctx.deny(status, message)` with the message in a variable (`ctx.deny(503, failure.message)`) is `ctx.deny(503, { message: failure.message })`.
42
- - `maxAge` in the options handed to `files.url(key, { maxAge: '1d' })` is `ttl`.
43
- - `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.
44
- - `formatDuration(ms)` of `kay/i18n` with a number held in a variable takes a `Duration`: write `` formatDuration(`${ms}ms`) ``.
45
- - 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.
46
- - 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 field already took the 10,000 characters of any action's string.
47
-
48
- ### The island and template forms of 1.105 are gone
49
-
50
- 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.
51
-
52
- - 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.
53
- - `--- 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.
54
- - `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.
55
- - `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"`.
56
- - 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.
57
- - `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`.
58
- - 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.
59
- - `defineContext` is imported from `kay/server`: `kay/library` no longer exports it.
60
- - `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.
61
- ### An action's form readers are only under `form`
62
-
63
- `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.
64
-
65
- ### `Action<never, unknown>` is `Action`
66
-
67
- Write `Action` for a prop that takes any action: both parameters default to it. The `deprecated-action-type` lint is gone.
68
-
69
- ### An island's call answers only a result
5
+ ## 1.112.0
70
6
 
71
- 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.
7
+ ### kayjs-ui's `starfield` utility is removed
72
8
 
73
- ### A callback of a library component takes only the event object
9
+ `@kayjs/ui/starfield.css`, the `starfield` class and the `--color-star`, `--color-star-cool` and `--color-star-warm` tokens are gone, and the space skin no longer draws stars: its fixed full-viewport layer kept the GPU compositing on every scroll and made pages lag on a machine short of video memory. Tailwind now stops the build with `Cannot apply unknown utility class starfield`: delete the `@import '@kayjs/ui/starfield.css'` line, and replace `starfield` with `bg-background` wherever a class list or an `@apply` names it, such as the `body` rule a `kay new` app with `ui` has in `src/app.css`. The space skin keeps its near-black ground.
74
10
 
75
- `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.
11
+ ## 1.111.0
76
12
 
77
- ### A refusal is only `ctx.deny(status, { message, errors, data })`
13
+ ### kay needs Bun 1.4.5
78
14
 
79
- `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.
15
+ 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`).
80
16
 
81
- ### `guard` and `requireGuards` are `guards`
17
+ ### kayjs-auth no longer takes `@kaynooo/pg-orm` 7
82
18
 
83
- `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.
19
+ 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.
84
20
 
85
- ### `limit.enforce(ctx)` is `limit.check(ctx)`
21
+ ### kayjs-ai's Chat is flat and its controls are kayjs-ui's
86
22
 
87
- `rateLimit()`'s `enforce(ctx, message?)` is gone: write `check(ctx, message?)`; `limiter().enforce(key)` keeps its name. The `deprecated-rate-enforce` lint is gone.
88
- ### The parts object of `class` is gone
23
+ 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.
89
24
 
90
- 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.
91
- ### `persisted(...)` and `persisted.query` are `persisted.cookie(...)` and `queryParam`
25
+ ### A block's or a snippet's plain parameter is read-only in a component that renders again
92
26
 
93
- 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.
27
+ 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.
94
28
 
95
- ### `navigate({ query })`, `onNavigate` and `onBeforeNavigate` are gone
96
-
97
- `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.
98
-
99
- ### `set(key, next)` and `presence(room, member)` are refused
100
-
101
- `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.
102
-
103
- ### The old readers of a source are gone
104
-
105
- `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.
106
- ### kayjs-auth drops its 1.105 names
107
-
108
- - `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.
109
- - `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.
110
- - `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.
111
-
112
- ### kayjs-mail drops `send`, `enqueue` and its own `SubscribeForm`
113
-
114
- - `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.
115
- - `@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.
116
-
117
- ### kayjs-ai drops its 1.105 props and options
118
-
119
- - 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.
120
- - `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.
121
- - `language` in the options of `transcribe()` and `describeImage()` is not read: write `locale`, a BCP 47 tag. `deprecated-ai-language` is gone.
122
-
123
- ### kayjs-cms drops `role`, `member` and a list `uploads`
124
-
125
- - `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.
126
- - `uploads: ['image/*']` is `uploads: { types: ['image/*'] }`.
127
-
128
- ### kayjs-ui drops its 1.105 names
129
-
130
- - `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.
131
- - 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.
132
- - `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.
133
-
134
- ### The old test helper names are gone
135
-
136
- - `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.
29
+ ## 1.110.0
137
30
 
138
- ## 1.108.0
31
+ ### A swap keeps an island whose props changed
139
32
 
140
- ### The `deprecated-package-names` lint is gone
33
+ - 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}`.
34
+ - 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.
35
+ - 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.
36
+ ### A Dialog's close is a plain button with a `close` part
141
37
 
142
- 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.
38
+ 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.
143
39
 
144
- Releases before 1.108 are in [Upgrading, older releases](upgrading-archive.md).
40
+ Releases before 1.110 are in [Upgrading, older releases](upgrading-archive.md).