@kayjs/kay 1.105.0 → 1.106.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.
- package/dist/eslint.js +435 -120
- package/editors/zed/extension.toml +2 -2
- package/llms/action-protection.md +1 -1
- package/llms/actions-from-islands.md +2 -2
- package/llms/actions.md +22 -19
- package/llms/analytics.md +1 -1
- package/llms/api-from-islands.md +1 -1
- package/llms/api-routes.md +6 -6
- package/llms/check-and-tools.md +1 -1
- package/llms/code-lints.md +2 -2
- package/llms/compiler-api.md +1 -1
- package/llms/component-libraries.md +1 -0
- package/llms/content-cms.md +1 -1
- package/llms/content-markdown-to-caching.md +1 -1
- package/llms/content-preview.md +2 -2
- package/llms/content.md +21 -21
- package/llms/deprecated-lints-1-105-libraries.md +2 -0
- package/llms/deprecated-lints-1-105.md +3 -3
- package/llms/deprecated-lints.md +3 -2
- package/llms/dev-tool.md +2 -2
- package/llms/environment.md +22 -22
- package/llms/files.md +5 -5
- package/llms/islands-state-to-ids.md +2 -1
- package/llms/local-collections.md +2 -2
- package/llms/mcp.md +2 -1
- package/llms/navigation-from-code.md +1 -1
- package/llms/notifications.md +4 -2
- package/llms/project.md +1 -1
- package/llms/rate-limits.md +1 -1
- package/llms/recipes.md +16 -16
- package/llms/rooms.md +4 -4
- package/llms/routing-endpoints-and-base.md +1 -1
- package/llms/routing.md +5 -5
- package/llms/schemas.md +10 -5
- package/llms/server.md +7 -7
- package/llms/site.md +9 -9
- package/llms/sitemap-search-fonts.md +2 -0
- package/llms/styles-and-assets.md +2 -1
- package/llms/templates-elements-slots-snippets.md +2 -2
- package/llms/testing-browser.md +20 -0
- package/llms/testing.md +1 -1
- package/llms/upgrading-1-105-config.md +2 -2
- package/llms/upgrading.md +18 -3
- package/llms/whats-new-archive.md +35 -66
- package/llms/whats-new.md +34 -28
- package/llms.txt +1 -1
- package/package.json +15 -11
- package/src/add.ts +1 -1
- package/src/build/class-table.ts +2 -2
- package/src/build/client.ts +7 -6
- package/src/build/plugin.ts +14 -11
- package/src/build/styles.ts +3 -3
- package/src/build/transform.ts +3 -1
- package/src/build/ui-layers.ts +30 -0
- package/src/build/ui.ts +108 -11
- package/src/build/variants.ts +119 -43
- package/src/build/worker-bundle.ts +6 -0
- package/src/check/boot.ts +22 -1
- package/src/check/call-result.ts +242 -0
- package/src/check/config-objects.ts +17 -2
- package/src/check/diagnose.ts +22 -0
- package/src/check/handler-events.ts +149 -0
- package/src/check/index.ts +6 -2
- package/src/check/link-flag-tests.ts +130 -0
- package/src/check/project.ts +4 -3
- package/src/check/refusal-calls.ts +2 -2
- package/src/check/regroup.ts +5 -3
- package/src/check/renamed-packages.ts +58 -14
- package/src/check/schema-builders.ts +256 -0
- package/src/check/secret-keys.ts +15 -2
- package/src/check/shadow-types.ts +2 -0
- package/src/check/template-hints.ts +1 -1
- package/src/check/tool-labels.ts +11 -9
- package/src/check/ui-types.ts +4 -3
- package/src/check/ui.ts +14 -11
- package/src/commands/env-declare.ts +18 -6
- package/src/commands/routes.ts +1 -1
- package/src/compiler/a11y.ts +8 -1
- package/src/compiler/ast.ts +1 -1
- package/src/compiler/bound-props.ts +1 -1
- package/src/compiler/codegen.ts +6 -6
- package/src/compiler/deprecated-lints-1-106.ts +14 -0
- package/src/compiler/deprecated-lints.ts +10 -5
- package/src/compiler/deprecated-typed-lints.ts +23 -0
- package/src/compiler/dom-here.ts +72 -0
- package/src/compiler/dom.ts +23 -23
- package/src/compiler/fence-checks.ts +12 -11
- package/src/compiler/field-described.ts +2 -2
- package/src/compiler/helper-imports.ts +1 -1
- package/src/compiler/html-fields.ts +92 -0
- package/src/compiler/html-initial.ts +5 -3
- package/src/compiler/html.ts +14 -31
- package/src/compiler/index.ts +3 -1
- package/src/compiler/items.ts +5 -5
- package/src/compiler/link-flags.ts +6 -5
- package/src/compiler/lints.ts +12 -12
- package/src/compiler/rest-omits.ts +15 -0
- package/src/config-loader.ts +10 -2
- package/src/config-resolve.ts +3 -1
- package/src/config-shape.ts +2 -2
- package/src/config.ts +20 -4
- package/src/content/markdown.ts +2 -3
- package/src/generate-resource.ts +9 -9
- package/src/generate.ts +1 -1
- package/src/mcp/guards.ts +1 -1
- package/src/mcp/tools.ts +1 -1
- package/src/migrate/content.ts +61 -55
- package/src/runtime/action-shared.ts +2 -2
- package/src/runtime/action.ts +6 -2
- package/src/runtime/form-types.ts +99 -0
- package/src/runtime/form.ts +22 -7
- package/src/runtime/html.ts +36 -5
- package/src/runtime/markdown-autolink.ts +69 -0
- package/src/runtime/markdown-render.client.ts +39 -3
- package/src/runtime/markdown.client.ts +6 -3
- package/src/runtime/markdown.server.ts +6 -3
- package/src/runtime/markdown.ts +125 -1
- package/src/runtime/navigate-api.ts +10 -5
- package/src/runtime/persist.ts +7 -7
- package/src/runtime/query-param.ts +1 -1
- package/src/runtime/reactive.ts +14 -0
- package/src/runtime/sanitize.ts +3 -1
- package/src/runtime/schema-record.ts +31 -0
- package/src/runtime/schema.client.ts +1 -4
- package/src/runtime/schema.ts +321 -26
- package/src/runtime/swap-focus.ts +59 -11
- package/src/server/action-module.ts +16 -0
- package/src/server/actions.ts +6 -14
- package/src/server/api-modules.ts +1 -1
- package/src/server/api.ts +13 -1
- package/src/server/app-stages.ts +23 -18
- package/src/server/dev-ui.ts +2 -2
- package/src/server/env-state.ts +1 -1
- package/src/server/env.ts +11 -3
- package/src/server/favicon.ts +47 -1
- package/src/server/image-metadata-bmff.ts +1 -1
- package/src/server/kept-pages.ts +3 -3
- package/src/server/library.ts +2 -0
- package/src/server/mcp.ts +13 -12
- package/src/server/notifications.ts +4 -2
- package/src/server/offline.ts +24 -7
- package/src/server/push-settings.ts +16 -2
- package/src/server/push.ts +12 -4
- package/src/server/query.ts +13 -6
- package/src/server/render.ts +1 -1
- package/src/server/scope.ts +20 -13
- package/src/server/signals.ts +4 -4
- package/src/template-ws.ts +1 -1
- package/src/test/a11y-dom.ts +70 -0
- package/src/test/html-snapshot.ts +103 -0
- package/src/test/index.ts +2 -1
- package/src/test/mount.ts +8 -1
- package/src/test/page-checks.ts +12 -0
- package/src/test/screenshot-match.ts +2 -2
- package/src/test/shared-modules.ts +27 -5
- package/src/test/site-types.ts +5 -1
- package/types/build/class-table.d.ts +1 -1
- package/types/build/class-table.d.ts.map +1 -1
- package/types/build/client.d.ts.map +1 -1
- package/types/build/plugin.d.ts.map +1 -1
- package/types/build/transform.d.ts +1 -0
- package/types/build/transform.d.ts.map +1 -1
- package/types/build/ui-layers.d.ts +5 -0
- package/types/build/ui-layers.d.ts.map +1 -0
- package/types/build/ui.d.ts +7 -0
- package/types/build/ui.d.ts.map +1 -1
- package/types/build/variants.d.ts +1 -1
- package/types/build/variants.d.ts.map +1 -1
- package/types/build/worker-bundle.d.ts +1 -0
- package/types/build/worker-bundle.d.ts.map +1 -1
- package/types/check/boot.d.ts.map +1 -1
- package/types/check/call-result.d.ts +7 -0
- package/types/check/call-result.d.ts.map +1 -0
- package/types/check/config-objects.d.ts.map +1 -1
- package/types/check/diagnose.d.ts.map +1 -1
- package/types/check/handler-events.d.ts +9 -0
- package/types/check/handler-events.d.ts.map +1 -0
- package/types/check/index.d.ts +1 -0
- package/types/check/index.d.ts.map +1 -1
- package/types/check/link-flag-tests.d.ts +4 -0
- package/types/check/link-flag-tests.d.ts.map +1 -0
- package/types/check/project.d.ts.map +1 -1
- package/types/check/regroup.d.ts +1 -1
- package/types/check/regroup.d.ts.map +1 -1
- package/types/check/renamed-packages.d.ts +1 -0
- package/types/check/renamed-packages.d.ts.map +1 -1
- package/types/check/schema-builders.d.ts +3 -0
- package/types/check/schema-builders.d.ts.map +1 -0
- package/types/check/secret-keys.d.ts.map +1 -1
- package/types/check/shadow-types.d.ts.map +1 -1
- package/types/check/template-hints.d.ts +1 -0
- package/types/check/template-hints.d.ts.map +1 -1
- package/types/check/tool-labels.d.ts.map +1 -1
- package/types/check/ui-types.d.ts.map +1 -1
- package/types/check/ui.d.ts.map +1 -1
- package/types/commands/env-declare.d.ts.map +1 -1
- package/types/compiler/a11y.d.ts.map +1 -1
- package/types/compiler/bound-props.d.ts +1 -0
- package/types/compiler/bound-props.d.ts.map +1 -1
- package/types/compiler/codegen.d.ts +1 -0
- package/types/compiler/codegen.d.ts.map +1 -1
- package/types/compiler/deprecated-lints-1-106.d.ts +12 -0
- package/types/compiler/deprecated-lints-1-106.d.ts.map +1 -0
- package/types/compiler/deprecated-lints.d.ts +32 -5
- package/types/compiler/deprecated-lints.d.ts.map +1 -1
- package/types/compiler/deprecated-typed-lints.d.ts +21 -0
- package/types/compiler/deprecated-typed-lints.d.ts.map +1 -0
- package/types/compiler/dom-here.d.ts +14 -0
- package/types/compiler/dom-here.d.ts.map +1 -0
- package/types/compiler/dom.d.ts +1 -0
- package/types/compiler/dom.d.ts.map +1 -1
- package/types/compiler/fence-checks.d.ts.map +1 -1
- package/types/compiler/field-described.d.ts +1 -1
- package/types/compiler/field-described.d.ts.map +1 -1
- package/types/compiler/html-fields.d.ts +19 -0
- package/types/compiler/html-fields.d.ts.map +1 -0
- package/types/compiler/html-initial.d.ts +3 -2
- package/types/compiler/html-initial.d.ts.map +1 -1
- package/types/compiler/html.d.ts.map +1 -1
- package/types/compiler/index.d.ts +1 -0
- package/types/compiler/index.d.ts.map +1 -1
- package/types/compiler/items.d.ts +4 -1
- package/types/compiler/items.d.ts.map +1 -1
- package/types/compiler/link-flags.d.ts +6 -0
- package/types/compiler/link-flags.d.ts.map +1 -1
- package/types/compiler/lints.d.ts +44 -17
- package/types/compiler/lints.d.ts.map +1 -1
- package/types/compiler/rest-omits.d.ts +4 -0
- package/types/compiler/rest-omits.d.ts.map +1 -0
- package/types/config-loader.d.ts.map +1 -1
- package/types/config-resolve.d.ts.map +1 -1
- package/types/config.d.ts +15 -2
- package/types/config.d.ts.map +1 -1
- package/types/content/markdown.d.ts.map +1 -1
- package/types/migrate/content.d.ts.map +1 -1
- package/types/runtime/action-shared.d.ts +1 -1
- package/types/runtime/action-shared.d.ts.map +1 -1
- package/types/runtime/action.d.ts +3 -0
- package/types/runtime/action.d.ts.map +1 -1
- package/types/runtime/form-types.d.ts +6 -0
- package/types/runtime/form-types.d.ts.map +1 -0
- package/types/runtime/form.d.ts +3 -1
- package/types/runtime/form.d.ts.map +1 -1
- package/types/runtime/html.d.ts +3 -0
- package/types/runtime/html.d.ts.map +1 -1
- package/types/runtime/markdown-autolink.d.ts +11 -0
- package/types/runtime/markdown-autolink.d.ts.map +1 -0
- package/types/runtime/markdown-render.client.d.ts +2 -1
- package/types/runtime/markdown-render.client.d.ts.map +1 -1
- package/types/runtime/markdown.client.d.ts +3 -1
- package/types/runtime/markdown.client.d.ts.map +1 -1
- package/types/runtime/markdown.d.ts +11 -0
- package/types/runtime/markdown.d.ts.map +1 -1
- package/types/runtime/markdown.server.d.ts +3 -1
- package/types/runtime/markdown.server.d.ts.map +1 -1
- package/types/runtime/navigate-api.d.ts +1 -1
- package/types/runtime/navigate-api.d.ts.map +1 -1
- package/types/runtime/persist.d.ts +2 -2
- package/types/runtime/persist.d.ts.map +1 -1
- package/types/runtime/reactive.d.ts +3 -0
- package/types/runtime/reactive.d.ts.map +1 -1
- package/types/runtime/sanitize.d.ts.map +1 -1
- package/types/runtime/schema-record.d.ts +9 -0
- package/types/runtime/schema-record.d.ts.map +1 -0
- package/types/runtime/schema.client.d.ts.map +1 -1
- package/types/runtime/schema.d.ts +94 -10
- package/types/runtime/schema.d.ts.map +1 -1
- package/types/runtime/swap-focus.d.ts.map +1 -1
- package/types/server/action-module.d.ts +2 -0
- package/types/server/action-module.d.ts.map +1 -0
- package/types/server/actions.d.ts +1 -0
- package/types/server/actions.d.ts.map +1 -1
- package/types/server/api.d.ts.map +1 -1
- package/types/server/app-stages.d.ts +3 -2
- package/types/server/app-stages.d.ts.map +1 -1
- package/types/server/env-state.d.ts.map +1 -1
- package/types/server/env.d.ts +5 -1
- package/types/server/env.d.ts.map +1 -1
- package/types/server/favicon.d.ts +3 -1
- package/types/server/favicon.d.ts.map +1 -1
- package/types/server/kept-pages.d.ts +1 -1
- package/types/server/kept-pages.d.ts.map +1 -1
- package/types/server/library.d.ts +2 -0
- package/types/server/library.d.ts.map +1 -1
- package/types/server/mcp.d.ts +1 -1
- package/types/server/mcp.d.ts.map +1 -1
- package/types/server/notifications.d.ts +2 -1
- package/types/server/notifications.d.ts.map +1 -1
- package/types/server/offline.d.ts.map +1 -1
- package/types/server/push-settings.d.ts +1 -1
- package/types/server/push-settings.d.ts.map +1 -1
- package/types/server/push.d.ts +1 -0
- package/types/server/push.d.ts.map +1 -1
- package/types/server/query.d.ts.map +1 -1
- package/types/server/scope.d.ts +1 -1
- package/types/server/scope.d.ts.map +1 -1
- package/types/test/a11y-dom.d.ts +20 -0
- package/types/test/a11y-dom.d.ts.map +1 -0
- package/types/test/html-snapshot.d.ts +4 -0
- package/types/test/html-snapshot.d.ts.map +1 -0
- package/types/test/index.d.ts.map +1 -1
- package/types/test/mount.d.ts +3 -0
- package/types/test/mount.d.ts.map +1 -1
- package/types/test/page-checks.d.ts +6 -0
- package/types/test/page-checks.d.ts.map +1 -0
- package/types/test/screenshot-match.d.ts +1 -1
- package/types/test/screenshot-match.d.ts.map +1 -1
- package/types/test/shared-modules.d.ts.map +1 -1
- package/types/test/site-types.d.ts +3 -1
- package/types/test/site-types.d.ts.map +1 -1
|
@@ -113,6 +113,7 @@ export default defineUi({
|
|
|
113
113
|
- `defineUi` is typed from the components `kay check` writes to `.kay/types/kay-ui.d.ts`: each key completes, and a part, a variant or a value the component lacks fails `bun run check`.
|
|
114
114
|
- A variant or value the component's recipe lacks is added to it, with the classes the entry gives: `Badge(tone="brand")` above is valid, and the generated types take `brand` into `tone`'s union (a union written beside the recipe is replaced), so the editor completes it and `bun run check` accepts it. The recipe's `defaults` stay. A boolean, a numeric key and a variant of its own work as in a recipe; a component with no recipe, a generic one, an island and one whose props carry an index signature take added variants too.
|
|
115
115
|
- The component must have parts or a recipe. `kay check` reports an unknown component, part, a value a template passes that neither the recipe nor `src/ui.ts` declares (a type error), a page, a layout or a server-fenced file, two keys naming one component, a class that is not a plain string and a file with no default export. The dev server rebuilds when `src/ui.ts` changes.
|
|
116
|
+
- An extension's `ui` file restyles components in every app listing it ([component libraries](component-libraries.md)); `src/ui.ts` follows no import or spread.
|
|
116
117
|
|
|
117
118
|
### Serve a file at a fixed path
|
|
118
119
|
|
|
@@ -155,7 +156,7 @@ p {result()}
|
|
|
155
156
|
|
|
156
157
|
### Link or inline the stylesheets
|
|
157
158
|
|
|
158
|
-
In production a page writes its stylesheets into its head as `style` elements while together they compress under about 14 KB, so
|
|
159
|
+
In production a page writes its stylesheets into its head as `style` elements while together they compress under about 14 KB, so first paint waits for no request, and above it links a cut copy without the rules of components it never renders. `client.inlineStyles` forces one way:
|
|
159
160
|
|
|
160
161
|
```ts
|
|
161
162
|
import { defineConfig } from 'kay/server'
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
- Bound to anything else, a computed string, a template literal with values in it or a name typed as a string literal included, `kay check` and the editor report it unless the value is a `SafeHtml`, which `sanitizeHtml(markup)` and `trustHtml(markup)` from `kay` return; at runtime an `innerHTML` string nothing vouched for is dropped, even past a cast (`srcdoc` is a check-time rule only).
|
|
50
50
|
- `sanitizeHtml` is for markup a user wrote: it keeps `p`, `br`, `hr`, `b`, `strong`, `i`, `em`, `u`, `s`, `del`, `ins`, `small`, `sub`, `sup`, `code`, `pre`, `blockquote`, `h1` to `h6`, `ul`, `ol`, `li` and `a`, balanced and without attributes, a link's `href` kept when it is an http(s), `mailto:` or site URL and given `rel="nofollow ugc"`.
|
|
51
51
|
- It drops other tags, keeping their text, and `script`, `style`, `iframe`, `svg` and comments whole, and gives the same result on the server and in an island.
|
|
52
|
-
- A second argument keeps more: `sanitizeHtml(html, { tags: ['img', 'table', 'thead', 'tbody', 'tr', 'th', 'td'], attributes: { img: ['src', 'alt', 'title'] } })` keeps images and tables, a URL, such as an `href`, a `src`, a `poster` or each one of a `srcset`, only when it is an http(s), `mailto:` or site URL; `relativeUrls: true` also keeps one with no scheme, `./a.png` or `page?x=1`.
|
|
52
|
+
- A second argument keeps more: `sanitizeHtml(html, { tags: ['img', 'table', 'thead', 'tbody', 'tr', 'th', 'td'], attributes: { img: ['src', 'alt', 'title'] } })` keeps images and tables (`code: ['class']` keeps only a `language-*` class on `code`), a URL, such as an `href`, a `src`, a `poster` or each one of a `srcset`, only when it is an http(s), `mailto:` or site URL; `relativeUrls: true` also keeps one with no scheme, `./a.png` or `page?x=1`.
|
|
53
53
|
- A link in the result that leaves the site, another origin than the app's, opens in a new tab like a template's: `target="_blank"`, `rel="nofollow ugc noopener"` and `data-new-tab`, nothing under `client: { links: { outside: 'same-tab' } }`, nor for a link that keeps a `target` the options let it write. A kept `target` other than `_self` adds `noopener` to its `rel`.
|
|
54
54
|
- Markup fetched from elsewhere, such as a feed's body, passes the address it came from as `base`: `sanitizeHtml(body, { base: article.url, tags: ['img'], attributes: { img: ['src'] } })` resolves every kept URL (`href`, `src`, each of a `srcset`, `//host` ones too) as a browser would and drops one that does not resolve to an http(s) or `mailto:` URL, so a link to the base's own site counts as leaving yours. A `base` that is no absolute http(s) URL drops every relative URL; `base` replaces `relativeUrls`.
|
|
55
55
|
- `lazyImages: true` writes `loading="lazy"` on every kept `img` with no `loading` of its own, even when `attributes` does not list `loading`; an `img` that keeps a `loading` keeps it as written.
|
|
@@ -140,6 +140,6 @@ List(items={todos})
|
|
|
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)`.
|
|
143
|
-
- An `error` or `pending` line in a snippet follows the form the snippet is rendered in while it renders, as one in a component does, unless the form it is declared in is around it, which it keeps reading. In an island
|
|
143
|
+
- An `error` or `pending` line in a snippet follows the form the snippet is rendered in while it renders, as one in a component does, unless the form it is declared in is around it, which it keeps reading. In an island the snippet, like the children a component is given, takes the form it is called in once, as it is called, so a line inside an `await` block or an `if` shown later reads the same form, and a snippet declared outside the form works as one declared inside; call it in the form's own markup, `{note()}` or inside a larger expression. A component an `await` or an `if` of the snippet shows later reads no form: put the line in the snippet itself. `add.form.error('title')` and `add.pending()` take the action from anywhere.
|
|
144
144
|
- A static component passing one to an island is the `island-prop` error, as it is for a `@row(item)` block.
|
|
145
145
|
- Markup used by several files is a component; a snippet is for one file.
|
package/llms/testing-browser.md
CHANGED
|
@@ -31,6 +31,26 @@ const page = await site.open('/account', { cookies: cookie })
|
|
|
31
31
|
expect(await page.path()).toBe('/account')
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
### Check accessibility and snapshot HTML without a browser
|
|
35
|
+
|
|
36
|
+
A visited page (`site.visit`, `site.submit`) and a component from `mountComponent` have `a11y(selector?)` and `matchHtml(name)` too, with no Chrome:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
const page = await site.visit('/pricing')
|
|
40
|
+
|
|
41
|
+
expect(await page.a11y()).toEqual([])
|
|
42
|
+
await page.matchHtml('pricing')
|
|
43
|
+
|
|
44
|
+
const { a11y } = await mountComponent(Menu, { items })
|
|
45
|
+
|
|
46
|
+
expect(await a11y()).toEqual([])
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- `a11y` runs the same axe-core as the browser page's and resolves with the same violations, in a happy-dom document of its own: a visit's scripts never run, and what needs a browser's layout (`color-contrast`, `target-size`, `scrollable-region-focusable`) is left to `page.a11y()` of `site.open`. A mounted component checks its own element, so the rules about a whole page (a heading, a landmark, the title) do not apply to it.
|
|
50
|
+
- It needs `axe-core` (`kay new` adds it) and, for a visit, `@happy-dom/global-registrator`, which `mountComponent` needs already; a test fails naming the `bun add -d` command when one is missing.
|
|
51
|
+
- `matchHtml(name)` compares the HTML with the baseline `__html__/<test file>/<name>.html` beside the test file, written when there is none and rewritten by `KAY_UPDATE_SNAPSHOTS=1 bun test`, a `CI` run failing for a missing one; a difference writes `<name>.actual.html` beside it and names the first line that differs.
|
|
52
|
+
- The snapshot is normalised, so it holds the page and not the build: comments (hydration markers) are left out, the hash in a built file's name (`app-4n8x3k2m.css`) and in a `?v=` is `HASH`, a `nonce` is `NONCE`, the stamp of a `minTime` form is `STAMP`, and each tag or run of text is one indented line, `script`, `style`, `pre` and `textarea` kept as written.
|
|
53
|
+
|
|
34
54
|
## Reference
|
|
35
55
|
|
|
36
56
|
### Browser tests
|
package/llms/testing.md
CHANGED
|
@@ -198,7 +198,7 @@ it('shows why a todo was refused', async () => {
|
|
|
198
198
|
- `testSite({ config: { proxy: { key: { secret: 'secret' } } } })` of an app setting `proxy.key` turns the key check on for that site alone, with no `KAY_PROXY_KEY` written to `process.env` (`config` takes `mcp.token` too, as literals; `proxyKey` and `mcpKey` work until 1.108): `fetch`, `visit`, `call`, `mcp` and `socket` send the key in the header `proxy.key.header` names, a call's own header of that name wins (`{ headers: { 'x-upstream-key': 'wrong' } }`), and `''` sends none, so `await site.fetch('/', { headers: { 'x-upstream-key': '' } })` reads the 403. The key is trimmed, must not be blank, and it throws with `dev: true` or `browser` (whose `open()` sends no key).
|
|
199
199
|
- A project setting no `site`, nor `SITE_URL`, is served as `http://localhost`, so a page reading `siteUrl()` or `siteOrigin()` renders as it does in production.
|
|
200
200
|
- `site.submit(action, fields, { from })` posts a form without JavaScript, as multipart with any `File` among its fields, and follows it back to its page, or reads the page a refused post renders.
|
|
201
|
-
- An action declared with no input takes `{}` or no fields: `site.submit(forget, {}, { from })`, with no empty `s.
|
|
201
|
+
- An action declared with no input takes `{}` or no fields: `site.submit(forget, {}, { from })`, with no empty `s.object({})` given for the type's sake.
|
|
202
202
|
- `from` may be a page `visit` or `submit` resolved with instead of a path: the post goes where its form posts, from the URL the browser shows it at.
|
|
203
203
|
- A path as `from` is visited first, so a `workChallenge` field of the form on that page is solved as it is for a page: one extra GET per submit.
|
|
204
204
|
- So `site.submit(add, fields, { from: refused })` posts again from the page a refused post answered, as a visitor fixing the form does.
|
|
@@ -6,7 +6,7 @@ What 1.105 changed in kay.config.ts, the hooks, the stores and the guards of fea
|
|
|
6
6
|
|
|
7
7
|
### Secrets are one shape
|
|
8
8
|
|
|
9
|
-
`deprecated-secret-keys` (`kay check --fix`) renames `mcp: { key }` to `mcp: { token }` and writes `proxy: { key: 'x-upstream-key' }` as `proxy: { key: { header: 'x-upstream-key' } }`; the old keys work until 1.108. The loaded `KayConfig` has `mcp.token` and `proxy.key` as `{ header, secret? }` only, so code reading `config.mcp.key` or a string `config.proxy.key` reads the new fields. A secret is a string, `{ env: 'NAME' }` or `{ file: 'path' }`. One behaviour changes with the rename: `mcp.key: { file }` read `KAY_MCP_KEY` first, and `mcp.token: { file }` reads the file alone (`token: true` still reads the environment). `testSite({ mcpKey, proxyKey })` still work until 1.108 and `kay check` reports them:
|
|
9
|
+
`deprecated-secret-keys` (`kay check --fix`) renames `mcp: { key }` to `mcp: { token }` and writes `proxy: { key: 'x-upstream-key' }` as `proxy: { key: { header: 'x-upstream-key' } }`; the old keys work until 1.108. The loaded `KayConfig` has `mcp.token` and `proxy.key` as `{ header, secret? }` only, so code reading `config.mcp.key` or a string `config.proxy.key` reads the new fields. A secret is a string, `{ env: 'NAME' }` or `{ file: 'path' }`. One behaviour changes with the rename: `mcp.key: { file }` read `KAY_MCP_KEY` first, and `mcp.token: { file }` reads the file alone (`token: true` still reads the environment). `testSite({ mcpKey, proxyKey })` still work until 1.108 and `kay check` reports them: `kay check --fix` moves them into `config: { mcp: { token }, proxy: { key: { header, secret } } }`, `proxyKey` where the app's config names the header and no `config` is written yet, and the rest is by hand. The `config` of a `KayExtension` takes the keys of before 1.105 (`fonts`, `favicon`, `observe`...) as `kay.config.ts` does, until 1.108 under `deprecated-config-groups`.
|
|
10
10
|
|
|
11
11
|
### `links`, `offline` and `search` are keys of `client`
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ What 1.105 changed in kay.config.ts, the hooks, the stores and the guards of fea
|
|
|
14
14
|
|
|
15
15
|
### Every route the config moves is a key of `endpoints`, and `mcp` and `metrics` are under `/_kay`
|
|
16
16
|
|
|
17
|
-
`serve.apiPrefix` is `endpoints.api`, and the `path` of `openapi`, `mcp`, `health`, `metrics` and `jobs` is `endpoints.openapi`, `.mcp`, `.health`, `.metrics` and `.jobs`; `openapi.referencePath` is `openapi: { reference: { path } }`. `deprecated-route-keys` (`kay check --fix`) rewrites them, the old keys work until 1.108, and the loaded `KayConfig` no longer has them (read `config.endpoints?.api` for `config.serve?.apiPrefix`). The defaults move: the MCP endpoint is `/_kay/mcp` and the metrics `/_kay/metrics`, where they were `/mcp` and `/metrics`. An app that did not set the path keeps the old URL answering until 1.108, `/mcp`
|
|
17
|
+
`serve.apiPrefix` is `endpoints.api`, and the `path` of `openapi`, `mcp`, `health`, `metrics` and `jobs` is `endpoints.openapi`, `.mcp`, `.health`, `.metrics` and `.jobs`; `openapi.referencePath` is `openapi: { reference: { path } }`. `deprecated-route-keys` (`kay check --fix`) rewrites them, the old keys work until 1.108, and the loaded `KayConfig` no longer has them (read `config.endpoints?.api` for `config.serve?.apiPrefix`). The defaults move: the MCP endpoint is `/_kay/mcp` and the metrics `/_kay/metrics`, where they were `/mcp` and `/metrics`. An app that did not set the path keeps the old URL answering: `/metrics` answers as well until 1.108, and `/mcp` answers the MCP endpoint in place (not redirected) until 2.0, unless the app serves something there; point MCP clients and the metrics collector at the new path, or set `endpoints: { mcp: '/mcp', metrics: '/metrics' }` to keep them. The OAuth resource an MCP client signed in for is the endpoint's URL, so a client that registered for `/mcp` signs in again for `/_kay/mcp`.
|
|
18
18
|
|
|
19
19
|
### `defineContext` from `kay/server`, `env` is `envFiles`
|
|
20
20
|
|
package/llms/upgrading.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
What each minor 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 minor missing here broke nothing.
|
|
4
4
|
|
|
5
|
+
## 1.106.0
|
|
6
|
+
|
|
7
|
+
### `s` is kay's own builder, in lowercase
|
|
8
|
+
|
|
9
|
+
`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.
|
|
10
|
+
### `@kaynooo/eslint` 8
|
|
11
|
+
|
|
12
|
+
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.
|
|
13
|
+
### `sanitizeHtml` keeps only `language-*` classes on `code`
|
|
14
|
+
|
|
15
|
+
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`.
|
|
16
|
+
|
|
5
17
|
## 1.105.0
|
|
6
18
|
|
|
7
19
|
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).
|
|
@@ -19,7 +31,11 @@ Every group lists with `list`, reads with `get`, writes with `create` and `updat
|
|
|
19
31
|
|
|
20
32
|
### An island's call answers a result
|
|
21
33
|
|
|
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. `kay check`
|
|
34
|
+
`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. `kay check` reports where the old result is used as the data (`deprecated-call-result`, `deny`): `kay check --fix` writes `.orThrow()` after a call written on an imported name whose answer nothing reads `ok`, `data` or `error` of, and offers it otherwise. 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.
|
|
35
|
+
|
|
36
|
+
### A callback of a library component takes one event object
|
|
37
|
+
|
|
38
|
+
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. `deprecated-callback-handler` (`deny`) names it: `kay check --fix` writes `onChange={event => toggle(event.checked)}`, passing the fields the handler took, first ones first. A handler whose parameter is typed as an object is rewritten by an unsafe fix, which `kay upgrade` leaves to you, as it may take the event already; an arrow function is reported with no fix.
|
|
23
39
|
|
|
24
40
|
### An action's form readers sit under `form`
|
|
25
41
|
|
|
@@ -31,13 +47,12 @@ kayjs-auth's sixty `*Result` aliases (`PasswordSignInResult`, `RevokeTokenResult
|
|
|
31
47
|
|
|
32
48
|
### A refusal is one call
|
|
33
49
|
|
|
34
|
-
`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; `deprecated-deny-call`, `deprecated-ctx-fail` and `deprecated-refuse-call` (`kay check --fix`) rewrite `deny(403, 'text', data)`, `return ctx.fail(status, data, errors)` and `refuse('text', { status, errors, data })`, which work until 1.108. In an action, `ctx.deny(status, { data, errors })` fails the post as `ctx.fail` did (the page again with the fields, an `ActionError` for a call), while a
|
|
50
|
+
`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; `deprecated-deny-call`, `deprecated-ctx-fail` and `deprecated-refuse-call` (`kay check --fix`) rewrite `deny(403, 'text', data)`, `return ctx.fail(status, data, errors)` and `refuse('text', { status, errors, data })`, which work until 1.108. 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; the fixer writes a `ctx.fail('text')` text as `message`. The argument checks of `webPush.send`, `rooms`, `signed` and notifications throw a `KayError` with code `argument-invalid`, not a `RangeError` or `TypeError`.
|
|
35
51
|
|
|
36
52
|
### A top-level `const` follows the prop or signal it reads
|
|
37
53
|
|
|
38
54
|
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.
|
|
39
55
|
|
|
40
|
-
`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; `deprecated-deny-call`, `deprecated-ctx-fail` and `deprecated-refuse-call` (`kay check --fix`) rewrite `deny(403, 'text', data)`, `return ctx.fail(status, data, errors)` and `refuse('text', { status, errors, data })`, which work until 1.108. In an action, `ctx.deny(status, { data, errors })` fails the post as `ctx.fail` did (the page again with the fields, an `ActionError` for a call), while a refusal of a message alone stops with plain text as `deny(status, 'text')` did, so a guard run with an action's context refuses the same way; the fixer writes a `ctx.fail('text')` text as `data`, which an action takes as the form's message. The argument checks of `webPush.send`, `rooms`, `signed`, notifications and the helpers that also run in an island (`route()`, `every()`, `shortcut()`, `presence()`, `local()`, `navigate()`, `persisted`, `sanitizeHtml`) throw a `KayError` with code `argument-invalid`, not a `RangeError` or `TypeError`.
|
|
41
56
|
### Eight mistakes that ship a broken page refuse
|
|
42
57
|
|
|
43
58
|
`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.
|
|
@@ -1,70 +1,39 @@
|
|
|
1
1
|
# What's new, older releases
|
|
2
2
|
|
|
3
|
-
What each release before 1.
|
|
4
|
-
|
|
5
|
-
## 1.
|
|
6
|
-
|
|
7
|
-
- A
|
|
8
|
-
- `
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
- `
|
|
19
|
-
-
|
|
20
|
-
- kayjs-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- kayjs-
|
|
24
|
-
-
|
|
25
|
-
- `
|
|
26
|
-
- `
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
- A
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
- Live values and presence write alike: `live(initial, { key: true })` declares a value per key with a plain starting value, `set(next, { key })` and `set(next, { user })` write one key's or one user's, `presence({ room, member })` takes one object, and every live value tells `onData({ value })` and `onError({ error })` in a browser; `deprecated-live-api` rewrites the old forms ([live values](live-values.md), [island sources](island-sources.md)).
|
|
39
|
-
- One `Action` type crosses into components: bare `Action` takes any action, and a `.with()` action crosses into an island with its fields (`Action<never, unknown>` is rewritten by `deprecated-action-type`) ([actions from islands](actions-from-islands.md#pass-an-action-to-a-component)).
|
|
40
|
-
- Every component callback takes one event object and one naming rule: `onOpenChange({ open })`, `onChange({ value, option })`, `onSelectedChange({ keys, rows })`; state a prop can hold reports through `on<Prop>Change`, a press through `on<Verb>`, and `tests/callbacks.test.ts` holds the rule. `onChange` of Accordion, Tabs and ThemeToggle is `onValueChange`, ZoomPane's `onPlateChange`, Table's `onSortChange` and a chart's `onActiveChange`, the old names working until 1.108 with a `deprecated-ui-callbacks` fix ([conventions](component-library-conventions.md), [upgrading](upgrading.md)).
|
|
41
|
-
- Every guard option is named `guards` and takes a guard, a list, `{ load }` or `false`: `vitals({ guards })`, `jobs: { guards }`, `images: { guards }`, beside a page's and an API module's. A feature that lists or changes private data (`jobs`, `images.resolve`) answers 403 with none, and `requireGuards` is `guards: { default: 'closed' | 'open' }` ([Guards](guards.md#path-and-guard-options)); `kay check --fix` rewrites the old forms.
|
|
42
|
-
- Rate limits are one `RateLimit` and one check: `rateLimit(name, limit).check(ctx)` refuses a guard's request with a 429 (`enforce` is deprecated for it) and `.count(request)` gives `{ count, resetAt, wait }`; kayjs-auth's `rateLimit` is grouped by feature (`signIn: { ip, account, accountAll }`, `oauth: { token }`); `deprecated-rate-enforce` and `deprecated-auth-rate-limits` rewrite the old forms, and each kind of route's counting phase is written down ([Rate limits](rate-limits.md#when-a-request-is-counted)).
|
|
43
|
-
- `images.rateLimit`, `mcp.rateLimit`, `live.rateLimit` and `basicAuth({ rateLimit })` take a whole `RateLimit` minus `key`: a `store` to count in and an `onLimit` told of each refused request, as an action's does ([Rate limits](rate-limits.md#in-the-libraries)).
|
|
44
|
-
|
|
45
|
-
- A call to an action no longer reloads the page when its handler invalidated a `cached(..., { live: true })` key the page or a `resource()` follows: the live connection shows exactly the elements that read it, and `refresh: true` still reloads the page. ([actions from islands](actions-from-islands.md), [API from islands](api-from-islands.md)).
|
|
46
|
-
- `kay check` holds the context an endpoint file declares, `EndpointContext<{ slug: string }, { org: Org }>`, to its params and the `_guard.ts` files above it, and an `api({ guards: [needsKey] })` module reads what its own guards return as `ctx.guard` with no generic ([Guards](guards.md)). With no generic written, `ctx: EndpointContext` reads its `params`, its `guard` and its `page.query` typed from the file tree and `api()` reads the guards above its module, in `kay check`, which type-checks a shadow of those files.
|
|
47
|
-
- A page with `liveRefresh: true` in its settings is left to its live connection after a call whose handler invalidated only cached keys it follows, a streaming action's included (its end event names them), instead of loading again; `resource()` refetches when a tag its route's cached value names is invalidated, even once memory dropped that value, `resource(..., { tags: ['posts'] })` when a call of the page invalidated `posts` for a route reading no cached value, `revalidate: 'focus'` with `stale: '30s'` leaves an answer be for its window, and without `revalidate` a resource asks again only for `refresh()`, an invalidation or a changed option ([actions from islands](actions-from-islands.md), [API from islands](api-from-islands.md)).
|
|
48
|
-
- Every feature key of `kay.config.ts` takes `false`, `true` or its options (`robots`, `sitemap`, `favicon`, `security`, `health`, `preview`, `images.avif` and the rest), and `defineConfig` refuses an unknown key in every option bag at any depth, derived from `KayConfig` itself; `proxy: 2` is `proxy: { hops: 2 }`, which `deprecated-config-switch` rewrites ([Project](project.md)).
|
|
49
|
-
- The server hooks of kayjs-auth, -mail, -cms and -ai that observe are `after<Verb>`, as `before<Verb>` is the one that may refuse or change: `afterSignUp`, `afterSend`, `afterSuppress`, a list's `afterSubscribe`, `afterConfirm`, `afterUnsubscribe` and `afterBroadcast`, `afterSave` and `afterUpload`, `afterStep`, `afterToolCall` and `afterRequest`. The old `on<Verb>` names work until 1.108 and `deprecated-hook-names` renames them; see [Hooks](hooks.md) and [Upgrading](upgrading.md).
|
|
50
|
-
- The config's hooks are flat keys named by the moment they run, `onListen`, `onStop` and `onError` (which left `observe`), every hook event carries one `context` (an action hook's holds the action's own context too), `observe.log` is `{ format, requests, sink }`, and `pages()` and `testSite()` take their config as `{ config }` beside `root`; `deprecated-app-hooks`, `deprecated-hook-context` and `deprecated-pages-options` rewrite the old forms ([Hooks](hooks.md), [Production](production.md), [Project](project.md)).
|
|
51
|
-
- `images` is grouped as `remote: { hosts, maxSize, timeout }`, `formats: { quality, webp, avif }` and `limits: { variants, queue }`, and the lists a CMS or a database may hold take a function returning them (or a promise): `cors.origins`, `security.hosts`, `images.remote` hosts, `proxy.trusted`, `redirects`, `robots.disallow` and `allow`, `i18n.paths`, called once as the config loads; `ttl` is how long `signed.sign()`, `files.url()`, `workChallenge()`, kayjs-auth's `proofOfWork()` and an action's `minTime` and `proofOfWork` keep what they made, `maxAge` staying for HTTP and cookies, a store takes every length as a `Duration` (`durations: true`, [Stores](stores.md); a store written before keeps getting milliseconds until 1.108), and `deprecated-images-keys`, `deprecated-ttl-names` and `deprecated-store-ms` rewrite the old names ([Project](project.md), [Images](images.md)).
|
|
52
|
-
|
|
53
|
-
- `session.start(data, { maxAge })` signs a visitor in at once (new id, data, lifetime) and the session cookie follows `security.cookies`; rooms leave on close by themselves and take `member`, `beforeJoin`, `onJoin` and `onLeave` ([Rooms](rooms.md)); `files.response(key, request, { download })` names a download and `fileAnswer(file, request, { attachment })` from `kay/server` answers any file with `Range` and a download name ([Files](files.md)); `defineContext` comes from `kay/server` and the config's `env` is `envFiles` ([Server](server.md#sessions), [Environment](environment.md)).
|
|
54
|
-
- An island hears kay's DOM events through function hooks: `navigation.onStart`, `onError` and `onStall` beside `onNavigate`, and `add.onStart`, `onData` and `onError` on an action for the forms posting it in place, one table mapping each event to its hook ([events](events.md), [navigation](navigation-from-code.md#navigation-state-and-hooks), [actions](actions-from-islands.md)). The events stay for a plain script, `guardLeave` is documented as the preset of `navigation.onBeforeNavigate`, and `deprecated-island-events` reports an island's `listen` of an event and rewrites the swap's.
|
|
55
|
-
- `kay check` names the unknown id of a lone `T('nope')` (`T` has no message `nope`) instead of asking for the values of a message that does not exist ([Texts](locales.md#messages-holding-markup)).
|
|
56
|
-
- `T('intro', { name, about: text => ... })` renders a message with tags from a script or an expression, `kay check` holding its placeholders and blocks to the message as it does the `T(key="intro")` form ([Texts](locales.md#messages-holding-markup)).
|
|
57
|
-
- `guards` on a page, a layout, an endpoint and an `api()` module takes a guard, a list or `{ load }` as well as `false`: `false` skips the guards above, a list runs after them, and a route with guards of its own is covered ([Guards](guards.md)).
|
|
58
|
-
- `links`, `offline` and `search` of kay.config.ts are keys of `client`, with the rest of what the browser is given; `deprecated-client-keys` rewrites the old place ([Project](project.md)).
|
|
59
|
-
- The config's keys are grouped by concern: `assets` holds `images`, `fonts`, `favicon`, `manifest` and `publicCache`, `ops` holds `observe`, `health`, `metrics` and `jobs`, and `i18n` is `{ locales, default, mode }` with `mode` one of `'prefix'`, `'always'` or `{ domains }`, so a config can no longer give `domains` with `prefixDefault`; `deprecated-config-groups` and `deprecated-i18n-keys` rewrite the old places ([Project](project.md), [Locales](locales.md)).
|
|
60
|
-
|
|
61
|
-
- A secret of kay.config.ts is one shape, a string, `{ env: 'NAME' }` or `{ file: 'path' }`: `proxy: { key: { header, secret } }`, `mcp: { token }` (was `key`) and the new `ops: { metrics: { token } }`, each `true` or a secret where the environment is the default; `testSite({ config })` takes them as literals, and `deprecated-secret-keys` rewrites the old forms ([Proxies](proxy-and-security.md), [MCP](mcp.md), [Metrics](metrics.md), [Testing](testing.md)).
|
|
62
|
-
- An `error` or `pending` line in a snippet or a child component follows the form it is rendered in while it renders, so a field row can hold its own message and busy state; they stay as the markup form of `add.form.error('title')` and `add.pending()` ([Actions](actions.md#show-that-a-form-is-posting), [snippets](templates-elements-slots-snippets.md#snippets)).
|
|
63
|
-
|
|
64
|
-
Releases before 1.104.3 are in the notes of their releases, at https://git.kaynooo.fr/kaynooo/kayjs/releases.
|
|
65
|
-
|
|
66
|
-
- A `.ws()` route of an `api()` module speaks one JSON protocol, rooms included: every frame is JSON both ways, so a string, number, boolean or `null` reads back typed; a frame is measured before it is parsed and the upgrade is no longer wrapped; a message that is no JSON or fails `body` is answered `{ error: { key, fields } }`, never the schema, which `socket().onRefused` reads; `rooms({ reply })` checks what a room sends, for a route whose `response` is a status map too and against the models of the app each room's route belongs to; an `api()` route's refused upgrade frees its connection place at once ([API routes](api-routes.md#api-routes), [Rooms](rooms.md)).
|
|
67
|
-
- A refusal is one call, `ctx.deny(status, { message, errors, data })` in a guard, a page, an action and an endpoint, and `refuse(status, { ... })` throws it from anywhere; in an action it fails the post as `ctx.fail` did, which is now its deprecated spelling, as are `deny(status, 'text')` and `refuse('text', { ... })`. Helpers refuse a bad argument with a `KayError` coded `argument-invalid` ([Actions](actions.md#refused-posts), [Errors](errors-runtime.md))
|
|
68
|
-
- Eight lints that flagged a page shipped broken are errors now, not warnings: `unreturned-fail`, `brace-in-attribute`, `signal-set-call`, `constant-signal`, `literal-tag`, `positional-key`, `unkeyed-rows` and `once-read-prop` ([Lints](lints.md), [upgrading](upgrading.md)).
|
|
3
|
+
What each release before 1.106 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.106.0 (continued)
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
- `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)).
|
|
9
|
+
|
|
10
|
+
## 1.105.0
|
|
11
|
+
|
|
12
|
+
- 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)).
|
|
13
|
+
- 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)).
|
|
14
|
+
- 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)).
|
|
15
|
+
- 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`.
|
|
16
|
+
- 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.
|
|
17
|
+
- `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)).
|
|
18
|
+
- 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)).
|
|
19
|
+
- 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)).
|
|
20
|
+
- 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).
|
|
21
|
+
- 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.
|
|
22
|
+
- 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)).
|
|
23
|
+
- 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)).
|
|
24
|
+
- 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)).
|
|
25
|
+
- 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)).
|
|
26
|
+
- 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)).
|
|
27
|
+
- `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)).
|
|
28
|
+
- `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)).
|
|
29
|
+
- 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)).
|
|
30
|
+
- 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)).
|
|
31
|
+
- 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)).
|
|
32
|
+
- 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).
|
|
33
|
+
- 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)).
|
|
34
|
+
- `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)).
|
|
35
|
+
- 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)).
|
|
36
|
+
- `unkeyed-rows` covers every component, not only islands: a `for` over rows with no `id` needs a `key` ([Templates](templates.md), [upgrading](upgrading.md)).
|
|
37
|
+
- 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)).
|
|
69
38
|
|
|
70
39
|
Releases before 1.105 are in the notes of their releases, at https://git.kaynooo.fr/kaynooo/kayjs/releases.
|
package/llms/whats-new.md
CHANGED
|
@@ -2,35 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
What each release of kay and its libraries adds, newest first, each feature with where it is documented. kay and its libraries share one version, so one section covers them all; what a release breaks is in [Upgrading](upgrading.md).
|
|
4
4
|
|
|
5
|
-
## 1.
|
|
5
|
+
## 1.106.0
|
|
6
6
|
|
|
7
|
-
- kayjs-ui's `
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- kayjs-
|
|
11
|
-
- kayjs-ui
|
|
12
|
-
- `
|
|
13
|
-
-
|
|
14
|
-
- kayjs-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
- kayjs-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
- kayjs-ui
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- `
|
|
30
|
-
-
|
|
31
|
-
- `
|
|
32
|
-
-
|
|
7
|
+
- kayjs-ui's `BarChart`, `LineChart` and `ScatterChart` take `goals`, a dashed rule across the value axis at each `value` with its `title` on it and read by screen readers, such as a pass mark ([BarChart](/ui/bar-chart#goals-and-a-fixed-scale)); `BarChart` takes `max`, fixing the top of its value axis
|
|
8
|
+
- A page from `site.visit` and a component from `mountComponent` have `a11y()`, which runs axe-core without a browser, and `matchHtml(name)`, which compares normalised HTML (build hashes, nonces and hydration markers left out) with a baseline file beside the test ([accessibility and HTML snapshots](testing-browser.md#check-accessibility-and-snapshot-html-without-a-browser)).
|
|
9
|
+
- kayjs-ui: one `Placement` (`top`, `bottom`, `left`, `right`, each with `-start` or `-end`) types the `placement` of Popover, Menu, Bell, MultiSelect, HoverCard and Tooltip, `PopoverPlacement` and `HoverCardPlacement` staying as aliases; HoverCard takes `open`, `openDelay`, `closeDelay` and a `@trigger` block, and Notice reports its close button as `onOpenChange({ open: false })`, `onDismiss` staying ([popovers and cards](../../ui/llms/basics.md))
|
|
10
|
+
- kayjs-ai's `Chat` takes `speak`, an action answering `speakData(text)`, and reads each finished reply aloud: a newer reply, a send or a new conversation stops it, a browser refusing to play unasked leaves a play button on the turn, a failed reading shows a notice, and `autoplay`, `speaking`, `onSpeak`, `onSpeakEnd` and `onSpeakFail` let the app steer it ([Reading replies aloud](/llms/kayjs-ai-speech-and-embeddings))
|
|
11
|
+
- kayjs-ui RadioGroup and ChipGroup keep their state in a URL param with `param` and `paramDefault`, as Segmented and Select do, so every control holding a query param spells it one way; a ChipGroup sets the param once per picked option, and `navigate.query()` and `withQuery()` take a list for that ([forms](../../ui/llms/forms.md#radiogroup), [navigating](navigation-from-code.md)).
|
|
12
|
+
- A barrel file with `export * from` a module `mountComponent` shares with the test keeps ESM's rules: a name the barrel exports itself wins over the star's, a name two stars export is left out, and an export named with `$` keeps its name ([testing](testing.md)).
|
|
13
|
+
- In an island, an `error` or `pending` line in a snippet declared outside the form, or inside an `await` or an `if` shown later, follows the form the snippet is called in, as it does on a static page ([snippets](templates-elements-slots-snippets.md#snippets)).
|
|
14
|
+
- kayjs-ui's LineChart takes a `@tooltip(mark)` block that replaces its tooltip body and `notes` on a series, one message per label, added to the tooltip and the slider's reading ([LineChart](/ui/line-chart#the-tooltip)); a chart page without the block grows by about 120 B gzipped.
|
|
15
|
+
- A kayjs-ui Table island whose call sites all write `sortable={false}` leaves its sorting code out, and one that writes no `header`, `cell` or `noMatch` block leaves those out too (a plain Table drops about 4 KB minified); a BarChart leaves out `stacked`, `xLabels`, `empty`, `emptyLabel`, `active`, `onActive` and `onActiveChange` that no call site writes ([Table](../../ui/llms/table.md)).
|
|
16
|
+
- `s` is kay's own schema builder: lowercase builders with short options (`s.string({ min, max })`, `s.email()`, `s.int()`, `s.enum(values | record)`, `s.list()`, `s.object()`, `s.file({ maxSize: '5mb' })`), the same field options on every one (`optional`, `default`, `error`, `label`, `description`, `example`), strings and lists bounded by default, and a plain record of fields taken as the object schema by `action` and `defineEnv`; the PascalCase builders and `s.Optional` are deprecated (`deprecated-schema-builders`), `s.typebox` is gone ([Schemas](schemas.md#schemas)).
|
|
17
|
+
- kay and the apps `kay new` writes lint with `@kaynooo/eslint` 8, which installs about 30 MB less as it no longer pulls in the formatters ([upgrading](upgrading.md)).
|
|
18
|
+
- kayjs-ui's `infiniteList` starts over only when the first rows or what an `input` function returns change, compared by value: the same rows handed again, a new array of them too, keep the pages loaded ([LoadMore](/ui/load-more)).
|
|
19
|
+
- kayjs-ai's `Chat` takes `toolIcons`, an icon per tool by its name, drawn before the tool's label in the folded line and before its name in an opened call, in the `toolIcon` part; a tool without one keeps its row ([Chat](../../ai/llms/chat.md))
|
|
20
|
+
- Keys typed into a field during a query `navigate()` reach its island once it has hydrated, so an island that writes the value it was given back into the field, as kayjs-ui's `TextInput` does, no longer overwrites them ([navigation](navigation.md)).
|
|
21
|
+
- kayjs-ui's `TreeView` takes a `@row(node)` block that draws a row's icon and label, such as a tinted tile and a name, the row keeping its chevron, link, keys and roving focus, and `trailingShown` keeps the `@actions` block visible on every row, for an age or a count ([TreeView](/ui/tree-view#your-own-row)).
|
|
22
|
+
- kayjs-ui's `RelationGraph` draws an item and its neighbours on a ring, joined by lines, each neighbour a link, a button or a muted gap, in the keyboard order of `items`, which can be a list, a promise or a function; `@neighbour` and `@middle` replace the text ([RelationGraph](/ui/relation-graph)).
|
|
23
|
+
- kayjs-ui's `Sparkline` takes `variant="line"` or `"area"`: a line through the values, with a tint under it for an area, in `tone` or any `color`, a `null` splitting it into runs; `hints`, `onSelect`, `href` and the keyboard work as on bars, and `plot`, `line`, `area` and `point` are its new parts ([Sparkline](/ui/sparkline#a-line-or-an-area)).
|
|
24
|
+
- `defineConfig` takes `{ env }` and `{ file }` where an option takes a secret (`mcp.token`, `metrics.token`), which 1.105.0 refused as an unknown option, and still refuses a mistyped key inside them ([MCP](mcp.md)).
|
|
25
|
+
- A page's `--- server` fence reads a `persisted.cookie()` signal by calling it: the value is the request's, decoded and checked against `values` as the render does, so an app no longer reads `ctx.cookies` and decodes kay's format itself ([shared and persisted state](islands-state-to-ids.md)).
|
|
26
|
+
- kayjs-ui's `starfield` scatters about 270 stars over the viewport with CSS `random()` where the browser supports it, tiles everywhere else; a custom `.starfield::before` tile list goes in `@supports not (top: random(0px, 1px))` ([starfield](/libraries/kayjs-ui)).
|
|
27
|
+
- kayjs-ui's `AudioPlayer` takes `@lead(chapter, index)` before each chapter's button, a `subtitle` on a chapter, `@status(chapter, index)` for the chapter playing in the bar after the time, and `peaks` on a chapter, drawn as bars split by chapter in place of the seek groove ([AudioPlayer](/ui/audio-player#a-waveform)).
|
|
28
|
+
- `kay check --fix` rewrites what the 1.105 types refuse in an app still on the old forms: a function handed by name to a library component's callback (`deprecated-callback-handler`), an island call read as its data (`deprecated-call-result`, `.orThrow()` after the call), the `mcpKey` and `proxyKey` options of `testSite()`, and the `fonts`, `favicon` and `observe` keys in the `config` of an extension, which work until 1.108 ([upgrading](upgrading.md)).
|
|
29
|
+
- `kay check --fix` rewrites an old package name only where it is a specifier, a `require()` or `import()` argument, a config key, a stylesheet `@import` or `@plugin` path or a package.json entry, no longer a string of data that names one; and `deprecated-link-flags` reaches the app's test files, rewriting `[data-keep-scroll]` selectors to `[data-scroll=keep]` and reporting an attribute read by name ([deprecated lints](deprecated-lints.md)).
|
|
30
|
+
- `ctx.deny(status, { message })` in an action fails the post as `{ data }` does, the form showing the message and a call throwing an `ActionError` carrying it, in place of a bare status; the `deprecated-ctx-fail` fixer writes a text as `message` ([Refused posts](actions.md#refused-posts))
|
|
31
|
+
- The former `/mcp` answers the MCP endpoint in place until 2.0 for an app that did not set `endpoints.mcp`, where 1.105 sent it to `/_kay/mcp` with a 308 an MCP client does not follow; a page or route of the app at `/mcp` keeps it ([MCP](mcp.md), [upgrading](upgrading.md)).
|
|
32
|
+
- The installed app's icon badge shows the unread count: kayjs-ui's `Bell` sets it (`appBadge={false}` opts out) and a push from `notify()` carries the count for the worker to set (`notify(..., { badge: false })` opts out, `sendPush` takes `badge`) ([notifications](notifications.md)).
|
|
33
|
+
- `assets.manifest.shareTarget` lists the installed app in a device's share sheet, posting the shared title, text, link and files to an action ([web manifest](sitemap-search-fonts.md#favicon-and-web-manifest)).
|
|
34
|
+
- kayjs-ui's `Badge` takes `dot`, a small dot in its colour before the label ([Badge](/ui/badge#a-dot)).
|
|
35
|
+
- kayjs-ui's `TabNav` takes `variant="segmented"`, its links drawn as Segmented's tray of keys, still links with `aria-current` ([TabNav](/ui/tab-nav#segmented)).
|
|
36
|
+
- `markdownHtml` links a bare URL or address at the same place on the server and in an island, `[[https://x.y/?a=1&b=2]]` included, so a page hydrates over the markup it was drawn with ([Markdown in an island](/guides/content#markdown-in-an-island)).
|
|
37
|
+
- `markdownHtml` keeps a fence's `language-*` class on its `code` (`sanitizeHtml` with `attributes: { code: ['class'] }` keeps only that class), and takes `{ inline }`, custom inline syntax such as `[[name]]` links drawn the same on the server and in an island, every result escaped or sanitized ([Render Markdown a user writes](/guides/content)).
|
|
38
|
+
- kayjs-ui's `MarkdownEditor` takes `view` (`edit`, `split` or `preview`) and `onViewChange`, so a note can show the preview alone, with the field kept in the form and no toolbar, or the field alone ([MarkdownEditor](/ui/markdown-editor)).
|
|
33
39
|
|
|
34
40
|
The rest of this release is in [What's new, older releases](whats-new-archive.md).
|
|
35
41
|
|
|
36
|
-
Releases before 1.
|
|
42
|
+
Releases before 1.106 are in [What's new, older releases](whats-new-archive.md).
|
package/llms.txt
CHANGED
|
@@ -120,7 +120,7 @@ To build a site, read [Build a site](llms/site.md) first, then the topics below;
|
|
|
120
120
|
- [Upgrading to 1.105, config](llms/upgrading-1-105-config.md): config and hooks
|
|
121
121
|
- [Upgrading, older](llms/upgrading-archive.md): the minors before 1.105
|
|
122
122
|
- [What's new](llms/whats-new.md): what each recent release adds
|
|
123
|
-
- [What's new, older](llms/whats-new-archive.md): the releases before 1.
|
|
123
|
+
- [What's new, older](llms/whats-new-archive.md): the releases before 1.106
|
|
124
124
|
- [Privacy and personal data](llms/privacy.md): what kay keeps, erasing a person
|
|
125
125
|
- [Events and names](llms/events.md): DOM events, cookie and key rules
|
|
126
126
|
- [Notifications](llms/notifications.md): `notify()`, the Bell
|