@kayjs/kay 1.107.0 → 1.108.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 +50 -29
- package/editors/zed/extension.toml +2 -2
- package/llms/actions-from-islands.md +1 -1
- package/llms/component-libraries.md +1 -1
- package/llms/deprecated-lints.md +0 -1
- package/llms/islands.md +1 -1
- package/llms/upgrading.md +6 -0
- package/llms/whats-new-archive.md +36 -1
- package/llms/whats-new.md +9 -39
- package/llms.txt +1 -1
- package/package.json +6 -6
- package/src/build/client.ts +7 -6
- package/src/build/icon-slots.ts +140 -0
- package/src/build/libraries.ts +24 -2
- package/src/build/plugin.ts +10 -0
- package/src/build/runtime-chunk.ts +2 -2
- package/src/build/source-files.ts +8 -3
- package/src/build/variants.ts +90 -1
- package/src/check/project.ts +4 -4
- package/src/check/renamed-packages.ts +3 -63
- package/src/check/shadow-types.ts +4 -18
- package/src/compiler/dead-code.ts +22 -0
- package/src/compiler/deprecated-lints.ts +1 -10
- package/src/compiler/dom-property.ts +23 -0
- package/src/compiler/dom.ts +15 -15
- package/src/package-names.ts +1 -1
- package/src/runtime/action-call.ts +39 -327
- package/src/runtime/action-run.ts +357 -0
- package/types/build/client.d.ts +1 -1
- package/types/build/client.d.ts.map +1 -1
- package/types/build/icon-slots.d.ts +7 -0
- package/types/build/icon-slots.d.ts.map +1 -0
- package/types/build/libraries.d.ts +2 -0
- package/types/build/libraries.d.ts.map +1 -1
- package/types/build/plugin.d.ts +1 -0
- package/types/build/plugin.d.ts.map +1 -1
- package/types/build/source-files.d.ts.map +1 -1
- package/types/build/variants.d.ts.map +1 -1
- package/types/check/renamed-packages.d.ts +0 -3
- package/types/check/renamed-packages.d.ts.map +1 -1
- package/types/check/shadow-types.d.ts.map +1 -1
- package/types/compiler/dead-code.d.ts +9 -0
- package/types/compiler/dead-code.d.ts.map +1 -0
- package/types/compiler/deprecated-lints.d.ts +0 -9
- package/types/compiler/deprecated-lints.d.ts.map +1 -1
- package/types/compiler/dom-property.d.ts +9 -0
- package/types/compiler/dom-property.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/lints.d.ts +0 -9
- package/types/compiler/lints.d.ts.map +1 -1
- package/types/runtime/action-call.d.ts.map +1 -1
- package/types/runtime/action-run.d.ts +23 -0
- package/types/runtime/action-run.d.ts.map +1 -0
package/dist/eslint.js
CHANGED
|
@@ -25,7 +25,7 @@ var __esm = (fn, res, err) => () => {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
// package.json
|
|
28
|
-
var version = "1.
|
|
28
|
+
var version = "1.108.0", peerDependencies;
|
|
29
29
|
var init_package = __esm(() => {
|
|
30
30
|
peerDependencies = {
|
|
31
31
|
"@happy-dom/global-registrator": "^20.14.6 || ^21.0.3",
|
|
@@ -6024,6 +6024,24 @@ var init_outside = __esm(() => {
|
|
|
6024
6024
|
OUTSIDE_TARGET = ` target="_blank" ${NEW_TAB_ATTRIBUTE}`;
|
|
6025
6025
|
});
|
|
6026
6026
|
|
|
6027
|
+
// src/compiler/dead-code.ts
|
|
6028
|
+
function text(src, span) {
|
|
6029
|
+
return src.slice(span.start, span.end).trim();
|
|
6030
|
+
}
|
|
6031
|
+
function neverTaken(src, branch) {
|
|
6032
|
+
return branch.alias === undefined && text(src, branch.test) === "false";
|
|
6033
|
+
}
|
|
6034
|
+
function neverShown(src, node) {
|
|
6035
|
+
return node.fallback === undefined && node.branches.every((branch) => neverTaken(src, branch));
|
|
6036
|
+
}
|
|
6037
|
+
function neverSet(src, attribute) {
|
|
6038
|
+
return !attribute.action && UNSET_NAME.test(attribute.name) && text(src, attribute.expression) === "undefined";
|
|
6039
|
+
}
|
|
6040
|
+
var UNSET_NAME;
|
|
6041
|
+
var init_dead_code = __esm(() => {
|
|
6042
|
+
UNSET_NAME = /^(?:aria|data)-/;
|
|
6043
|
+
});
|
|
6044
|
+
|
|
6027
6045
|
// src/runtime/class-table.ts
|
|
6028
6046
|
function resolveClasses(text, table = globalThis[TABLE]) {
|
|
6029
6047
|
if (table === undefined)
|
|
@@ -8674,6 +8692,25 @@ var init_dom_here = __esm(() => {
|
|
|
8674
8692
|
CALLED = /[a-z_$][\w$]*(?=\s*\()/gi;
|
|
8675
8693
|
});
|
|
8676
8694
|
|
|
8695
|
+
// src/compiler/dom-property.ts
|
|
8696
|
+
function propertyBindings(b, src, attribute, link, node) {
|
|
8697
|
+
if (neverSet(src, attribute))
|
|
8698
|
+
return [];
|
|
8699
|
+
return [(variable) => {
|
|
8700
|
+
b.add(`KayEffect(() => KayProperty(${variable(node)}, ${JSON.stringify(attribute.name)}, `);
|
|
8701
|
+
if (attribute.action)
|
|
8702
|
+
b.add("KayFormAction((").addSource(attribute.expression).add("))");
|
|
8703
|
+
else if (attribute.name === "href" && link.leaving)
|
|
8704
|
+
b.add(`KayOutside(${variable(node)}, (`).addSource(attribute.expression).add(`)${link.rel ? ", true" : ""})`);
|
|
8705
|
+
else
|
|
8706
|
+
b.add("(").addSource(attribute.expression).add(")");
|
|
8707
|
+
b.add(`${link.written && attribute.name === "href" ? ", true" : ""}));`);
|
|
8708
|
+
}];
|
|
8709
|
+
}
|
|
8710
|
+
var init_dom_property = __esm(() => {
|
|
8711
|
+
init_dead_code();
|
|
8712
|
+
});
|
|
8713
|
+
|
|
8677
8714
|
// src/compiler/style-arguments.ts
|
|
8678
8715
|
function addStyleArguments(b, attribute) {
|
|
8679
8716
|
if (attribute.expression)
|
|
@@ -8721,8 +8758,10 @@ var DomTemplate;
|
|
|
8721
8758
|
var init_dom = __esm(() => {
|
|
8722
8759
|
init_outside();
|
|
8723
8760
|
init_ast();
|
|
8761
|
+
init_dead_code();
|
|
8724
8762
|
init_dom_fields();
|
|
8725
8763
|
init_dom_here();
|
|
8764
|
+
init_dom_property();
|
|
8726
8765
|
init_event_modifiers();
|
|
8727
8766
|
init_expression();
|
|
8728
8767
|
init_items();
|
|
@@ -8791,6 +8830,8 @@ var init_dom = __esm(() => {
|
|
|
8791
8830
|
b.add(`KayAppend(${parent}, `);
|
|
8792
8831
|
this.element(item.node);
|
|
8793
8832
|
b.add("); ");
|
|
8833
|
+
} else if (item.kind === "if" && neverShown(this.src, item.node)) {
|
|
8834
|
+
b.add(`KayMarkers(${parent}); `);
|
|
8794
8835
|
} else {
|
|
8795
8836
|
b.add(`{ const [KayS, KayE] = KayMarkers(${parent}); `);
|
|
8796
8837
|
this.dynamic(item, "null", "KayS", "KayE");
|
|
@@ -8799,6 +8840,10 @@ var init_dom = __esm(() => {
|
|
|
8799
8840
|
}
|
|
8800
8841
|
b.add(`${"} ".repeat(blocks)}})`);
|
|
8801
8842
|
}
|
|
8843
|
+
slot(item, element, start, end) {
|
|
8844
|
+
if (item.kind !== "if" || !neverShown(this.src, item.node))
|
|
8845
|
+
this.dynamic(item, element, start, end);
|
|
8846
|
+
}
|
|
8802
8847
|
dynamic(item, element, start, end) {
|
|
8803
8848
|
const { b } = this;
|
|
8804
8849
|
const at = `${element}, ${start}, ${end}`;
|
|
@@ -8874,7 +8919,7 @@ var init_dom = __esm(() => {
|
|
|
8874
8919
|
if(node, at) {
|
|
8875
8920
|
const { b } = this;
|
|
8876
8921
|
b.add(`${node.branches.some((branch) => branch.alias) ? "KayBranches" : "KayChoose"}(${at}, [`);
|
|
8877
|
-
for (const branch of node.branches) {
|
|
8922
|
+
for (const branch of node.branches.filter((each) => !neverTaken(this.src, each))) {
|
|
8878
8923
|
b.wrap(branch, () => {
|
|
8879
8924
|
b.add("[() => (").addSource(branch.test).add("), (");
|
|
8880
8925
|
if (branch.alias)
|
|
@@ -9109,16 +9154,7 @@ var init_dom = __esm(() => {
|
|
|
9109
9154
|
break;
|
|
9110
9155
|
case "value":
|
|
9111
9156
|
this.notesLink(link, attribute.name);
|
|
9112
|
-
own.push((
|
|
9113
|
-
b.add(`KayEffect(() => KayProperty(${variable(node)}, ${JSON.stringify(attribute.name)}, `);
|
|
9114
|
-
if (attribute.action)
|
|
9115
|
-
b.add("KayFormAction((").addSource(attribute.expression).add("))");
|
|
9116
|
-
else if (attribute.name === "href" && link.leaving)
|
|
9117
|
-
b.add(`KayOutside(${variable(node)}, (`).addSource(attribute.expression).add(`)${link.rel ? ", true" : ""})`);
|
|
9118
|
-
else
|
|
9119
|
-
b.add("(").addSource(attribute.expression).add(")");
|
|
9120
|
-
b.add(`${link.written && attribute.name === "href" ? ", true" : ""}));`);
|
|
9121
|
-
});
|
|
9157
|
+
own.push(...propertyBindings(b, this.src, attribute, link, node));
|
|
9122
9158
|
break;
|
|
9123
9159
|
}
|
|
9124
9160
|
}
|
|
@@ -9166,12 +9202,12 @@ var init_dom = __esm(() => {
|
|
|
9166
9202
|
} else if (item.kind === "element") {
|
|
9167
9203
|
html += this.templateOf(item.node, this.child(node, "element"), bindings);
|
|
9168
9204
|
} else if (sole) {
|
|
9169
|
-
bindings.push((variable) => this.
|
|
9205
|
+
bindings.push((variable) => this.slot(item, variable(node), "null", "null"));
|
|
9170
9206
|
} else {
|
|
9171
9207
|
const start = this.child(node, "start");
|
|
9172
9208
|
const end = this.child(node, "end");
|
|
9173
9209
|
html += START_MARKER + END_MARKER;
|
|
9174
|
-
bindings.push((variable) => this.
|
|
9210
|
+
bindings.push((variable) => this.slot(item, "null", variable(start), variable(end)));
|
|
9175
9211
|
}
|
|
9176
9212
|
}
|
|
9177
9213
|
if (blocks > 0) {
|
|
@@ -14310,21 +14346,6 @@ Card(class={{ head: 'p-6' }})`,
|
|
|
14310
14346
|
import Card from './card.kay'
|
|
14311
14347
|
---
|
|
14312
14348
|
Card(parts={{ head: 'p-6' }})`
|
|
14313
|
-
},
|
|
14314
|
-
"deprecated-package-names": {
|
|
14315
|
-
level: "warn",
|
|
14316
|
-
group: "deprecated",
|
|
14317
|
-
since: "1.104",
|
|
14318
|
-
site: true,
|
|
14319
|
-
summary: "A package of kay under the `@kaynooo` scope, `@kayjs` since 1.104: `@kaynooo/kayjs` is `@kayjs/kay`, and `@kaynooo/kayjs-ui`, `-auth`, `-mail`, `-cms` and `-ai` are `@kayjs/ui`, `@kayjs/auth`, `@kayjs/mail`, `@kayjs/cms` and `@kayjs/ai`. The old names stop at 1.103, which stays installable, so an app on them installs and checks as before until it moves; this lint goes in 1.107. Found where a name is an `import` or `export ... from` specifier, a `require()`, `import()` or `mock.module()` argument or a config key (a quoted name keyed to anything but a package name or a version, as `librarySettings`) of the project's TypeScript and `.kay` files, in the `@import` and `@plugin` paths of its CSS, and in its package.json and tsconfig files; a name in a comment or any other string, as data a tool reads or a table of renames, is left alone. The fix writes the new name; a package.json that lists the new name already is reported with a fix that is not safe, and `kay upgrade` does the whole move, package.json and install included.",
|
|
14320
|
-
wrong: `---
|
|
14321
|
-
import Button from '@kaynooo/kayjs-ui/button.kay'
|
|
14322
|
-
---
|
|
14323
|
-
Button Save`,
|
|
14324
|
-
right: `---
|
|
14325
|
-
import Button from '@kayjs/ui/button.kay'
|
|
14326
|
-
---
|
|
14327
|
-
Button Save`
|
|
14328
14349
|
},
|
|
14329
14350
|
"deprecated-test-helpers": {
|
|
14330
14351
|
level: "warn",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
id = "kay"
|
|
2
2
|
name = "Kay"
|
|
3
3
|
description = "Highlighting and the kay language server for .kay components"
|
|
4
|
-
version = "1.
|
|
4
|
+
version = "1.108.0"
|
|
5
5
|
schema_version = 1
|
|
6
6
|
authors = [ "Kaynooo" ]
|
|
7
7
|
repository = "https://github.com/Kayno0o/kayjs"
|
|
8
8
|
|
|
9
9
|
[grammars.kay]
|
|
10
10
|
repository = "https://github.com/Kayno0o/kayjs"
|
|
11
|
-
rev = "v1.
|
|
11
|
+
rev = "v1.108.0"
|
|
12
12
|
path = "editors/tree-sitter-kay"
|
|
13
13
|
|
|
14
14
|
[language_servers.kay]
|
|
@@ -129,7 +129,7 @@ p {column()}
|
|
|
129
129
|
- `timeout: '5s'` aborts a post unanswered that long (counted from the post, not from the wait in a queue): the call answers a failure with status 0, `pending()` clears, `track()` records it as a failure, `.orThrow()` rejects with that `ApiError` (status 0, its `cause` the `TimeoutError`), and the page refreshes as after an abort once sent.
|
|
130
130
|
- `keepalive: true` sends the post with `fetch`'s `keepalive`, so a call made from `pagehide` or `beforeunload` outlives the page: `save(state, { keepalive: true })`. A browser caps a keepalive body at 64 KB, so a JSON body over it is sent as a plain post instead of failing, as is a call carrying files or a form. The cap is shared by every keepalive request of the page in flight, so a call that would pass it with the ones kay sent is posted plain too; kay's own error reports count against it unseen, so a save can still be refused beside them; a page holding a proof-of-work challenge loads its solver first, which an unloading page may not finish.
|
|
131
131
|
- `retry: 2` or `retry: { times, delay, when }` posts again after a 503 or a post that failed before it was sent (`delay` defaults to `'500ms'` and doubles; `when(error)` takes an `ApiError` and decides alone for the rest). A timeout, a 504 and a network failure after the send need a `when`, as the handler may have run; a redirect and an abort are never tried again, and a TypeError thrown before the post is no failure of it. Every try sends one `Idempotency-Key` header (32 hex characters, an own `headers` entry wins), read from `ctx.request`, so a handler tells a repeat from a new call.
|
|
132
|
-
- `onStart({ input })`, `onSuccess({ data })`, `onError({ error })` (an `ApiError`) and `onSettled({ data, error })` observe a call; none runs `onError` for an abort or a redirect, `onSettled` runs for every ending (an abort's `error` is the abort), `onSuccess` of a stream runs as it starts, `latest` never aborts a stream already started, and a hook that throws or rejects is logged and never fails the call.
|
|
132
|
+
- `onStart({ input })`, `onSuccess({ data })`, `onError({ error })` (an `ApiError`) and `onSettled({ data, error })` observe a call; none runs `onError` for an abort or a redirect, `onSettled` runs for every ending but a call whose code never loaded (an abort's `error` is the abort), `onSuccess` of a stream runs as it starts, `latest` never aborts a stream already started, and a hook that throws or rejects is logged and never fails the call.
|
|
133
133
|
- `refresh` also takes a `resource()` or a list of them (anything with a `refresh()`): those are refreshed in place of the page's loads, with or without the page swap.
|
|
134
134
|
- `refresh: 'cart'` names a load of the page instead, the binding of a top-level `const cart = await ...` in the page's or a layout's server fence (a destructuring names each of its bindings; a `const total = cart.total * 2` names the load it reads): the page runs as a whole, but only the elements reading that load are sent and swapped, and what shows the others stays as it is. `refresh: ['cart', wishlist]` mixes names and `resource()`s, and `refresh()` from `kay` takes the same names: [rendering](rendering.md#refreshing-some-loads).
|
|
135
135
|
- A `form(action={add})` posting in place tells an island how it goes with the hooks of the action: `add.onStart(({ input }) => ...)` before the post (`input` the fields as `FormData`), then `add.onData(({ input }) => ...)` once it went through or `add.onError(({ error, input }) => ...)` when it did not (`error` an `ApiError` with the `status` and the `errors` per field, status 0 and none for a failure with no answer), while the form is still on the page. Each returns what removes it and ends with the island; they hear the posts of every form of that action, `.with()` ones included, and not the calls of `add(...)`, which take `onStart`, `onSuccess` and `onError` as options. An island shows a change with `add.onStart` and `optimistic(change)` from `kay`, which gives `{ undo, keep }`, and calls `undo()` on the error and `keep()` on success. They are the function form of the `kay:action-start`, `kay:action-success` and `kay:action-error` events the form fires on itself (bubbling, `detail: { action, data }`, then `{ action, data }` and `{ action, status, errors, data }`), which a plain script listens to; `listen(() => form, 'kay:action-start', ...)` in an island is `deprecated-island-events`. [Events](events.md) maps each event to its hook.
|
|
@@ -78,7 +78,7 @@ export function auth({ prefix = '/auth' } = {}): KayExtension {
|
|
|
78
78
|
- `routes` lays a directory of the library's `.kay` pages, layouts, guards and special pages over the app's `src/routes` at `prefix`, the root by default: `routes/login.kay` serves `/auth/login`, its server fence, load and actions included, as if it were `src/routes/auth/login.kay`.
|
|
79
79
|
- A file of the app at the same path replaces the library's: `src/routes/auth/login.kay` serves `/auth/login` in its place, and the library's other pages stay.
|
|
80
80
|
- Layouts, guards, `_404.kay`, `_error.kay` and the status pages (`_403.kay`...) resolve per URL directory across both trees, the app's file winning at a level both have one: the app's root layout wraps a library page, and a library `_layout.kay` wraps its pages, an app page replacing one of them included, unless the app has its own `_layout.kay` in `src/routes/auth`. A library layout whose `page` sets `layouts: false` starts the chain afresh, as an app's does: none of the app's layouts above wraps its pages, so a library with screens of its own (kayjs-cms's admin) draws its own chrome, and it imports the stylesheet those pages need, as the app's root layout is not there to. The app's `seo`, `fonts`, security headers and `kay.config.ts` head still apply, its layouts' own head tags and imported CSS do not.
|
|
81
|
-
- Its islands and stylesheets are bundled with the app's, and `kay build --compile` and `--static` carry its pages; a static export refuses a library page taking an action, as it refuses the app's, unless the app replaces it.
|
|
81
|
+
- Its islands and stylesheets are bundled with the app's, whether the library is installed, linked from a workspace or a folder above the root, with or without a dependency on it in the app's `package.json`, and `kay build --compile` and `--static` carry its pages; a static export refuses a library page taking an action, as it refuses the app's, unless the app replaces it.
|
|
82
82
|
- `kay check` lets links point at its pages; type errors inside an installed library's files are the library's own check's.
|
|
83
83
|
- An extension listed by a path beside the app or through a link, as a library's own example or fixture app lists it, is checked as the app's own, by `kay check` and in the editor: its pages, its CMS editor and the components they reach, their route params typed, with the app's catalogs, `ctx.locals` and matchers in scope, under the `tsconfig.json` options of the extension's package when they differ from the app's; its `.ts` modules stay the library's own check's, and the dependencies its package installs itself resolve from its pages.
|
|
84
84
|
- A path an extension's routes name, a link, a redirect or a `localPath` fallback, is checked only when it goes under its own prefix, `/fr/auth/x` as `/auth/x`: `/` or any other page of the app is taken as written, and an extension mounted at the root checks none.
|
package/llms/deprecated-lints.md
CHANGED
|
@@ -15,7 +15,6 @@ The lints of the `deprecated` group, each the old form a minor replaced, reporte
|
|
|
15
15
|
| `deprecated-action-options` | warn | deprecated | The arguments of `action` before 1.107, `action(schema, handler, options)` and `action(handler, options)`: the options come first, with the input in them, as an API route's do, `action({ input: schema, ...options }, handler)` and `action(options, handler)`. `input` is a plain record of fields or any schema. The old forms work until 2.0. Found on the `action` a file imports from `kay`, in the TypeScript files and the fences of `.kay` files; the fix moves the arguments and keeps their text. |
|
|
16
16
|
| `deprecated-schema-builders` | warn | deprecated | The PascalCase builders of `s` before 1.106, which kay's own lowercase builders replace, each taking the same field options (`optional`, `default`, `error`, `label`, `description`, `example`) and short names for the rest: `s.String` is `s.string` (`min`, `max`), `s.Integer` `s.int`, `s.Number` and `s.Numeric` `s.number`, `s.Boolean` and `s.BooleanString` `s.boolean`, `s.Array` `s.list`, `s.UnionEnum` and `s.UnionKeys` `s.enum`, and `s.Date`, `s.Literal`, `s.Union`, `s.Object`, `s.File`, `s.Files`, `s.Secret` and `s.Public` their lowercase names; `s.Optional(field)` is `optional: true` in the options of the field; an `s.Object({ ... })` that is the schema of an `action` or a `defineEnv` is the record of fields alone; and a file size written `'2m'` is `'2mb'`. The old names work until 2.0. Found on the `s` a file imports from `kay`, in the TypeScript files and the fences of `.kay` files. The fix renames the builder and the options that changed; an `s.Optional` around anything but one of these builders, such as a helper of `kay/content`, is left as it is. A lowercase `s.object` refuses a key its shape lacks where kay reads the schema itself (an action's input, an API route's body, `defineEnv`, collection frontmatter), where `s.Object` let it by: write `{ extra: 'strip' }` where the old way is wanted. A query, the headers and the cookies of a request carry keys no schema names, so their unknown keys are dropped whatever the schema says. |
|
|
17
17
|
| `deprecated-uncaught-await` | warn | deprecated | A `// kay-allow uncaught-await` comment or a `lints: { 'uncaught-await': ... }` entry of kay.config.ts, since 1.105: the `uncaught-await` lint is gone, as an `await` with no `catch` renders the `catch` of the `try` around it, else an alert (`data-kay-await-failed`, worded by the `kay.await.failed` message) in its place, the rejection reported either way. The fix removes the comment, or the name from a list of lints, or the config entry. |
|
|
18
|
-
| `deprecated-package-names` | warn | deprecated | A package of kay under the `@kaynooo` scope, `@kayjs` since 1.104: `@kaynooo/kayjs` is `@kayjs/kay`, and `@kaynooo/kayjs-ui`, `-auth`, `-mail`, `-cms` and `-ai` are `@kayjs/ui`, `@kayjs/auth`, `@kayjs/mail`, `@kayjs/cms` and `@kayjs/ai`. The old names stop at 1.103, which stays installable, so an app on them installs and checks as before until it moves; this lint goes in 1.107. Found where a name is an `import` or `export ... from` specifier, a `require()`, `import()` or `mock.module()` argument or a config key (a quoted name keyed to anything but a package name or a version, as `librarySettings`) of the project's TypeScript and `.kay` files, in the `@import` and `@plugin` paths of its CSS, and in its package.json and tsconfig files; a name in a comment or any other string, as data a tool reads or a table of renames, is left alone. The fix writes the new name, raising a package.json range below 1.104 to it, and `kay check` loads a `kay.config.ts` that still imports an old name no longer installed as if renamed, so an app that renamed `package.json` by hand can run `kay check --fix`; a package.json that lists the new name already is reported with a fix that is not safe, and `kay upgrade` does the whole move, package.json and install included. |
|
|
19
18
|
| `deprecated-children-prop` | warn | deprecated | `children?: Snippet` in a props type beside a bare `slot`, since 1.105: the template types the children, so a component declares none. `children: Snippet` still requires them. The old declaration works until 1.108. The fix removes the member. |
|
|
20
19
|
| `deprecated-link-flags` | warn | deprecated | `data-keep-scroll`, `data-no-transition` and `data-no-prefetch`, since 1.105 `data-scroll="keep"`, `data-transition="false"` and `data-prefetch="false"`, named as the options of `navigate()`. The old names work until 1.108. The fix writes the new attribute; a dynamic `data-no-transition` or `data-no-prefetch` has none. The app's test files (`*.test.*`, `*.spec.*`) are checked too: a selector `[data-keep-scroll]` is written `[data-scroll=keep]` by the fix, an attribute read by name (`getAttribute('data-keep-scroll')`) has a fix that is not safe, a read of `dataset.keepScroll` (and `noTransition`, `noPrefetch`) has one too, and a write of it and any other string naming an old flag have none. |
|
|
21
20
|
| `deprecated-parts-class` | warn | deprecated | The parts of a component given as its `class`, `parts` since 1.105: `Card(class={{ head: 'p-6' }})` is `Card(parts={{ head: 'p-6' }})`. The old form, an object literal of strings by part name, works until 1.108, the compiler handing it on as `parts`. The fix writes `parts` for `class`. |
|
package/llms/islands.md
CHANGED
|
@@ -278,7 +278,7 @@ if !connected()
|
|
|
278
278
|
|
|
279
279
|
### The action caller
|
|
280
280
|
|
|
281
|
-
- The code that
|
|
281
|
+
- The code that runs an action call (its queue, timeout and retries, the post and its answer) loads with the first call, so an island that only declares or passes an action does not carry it; the action's own state (`pending()`, `data()`, `status()`, `error()`) is there from the first paint, and a call counts as pending at once, before that code is in, its `onStart` hook running when it is. A call whose code never loads rejects without running its hooks. An island holding an action caller loads it at idle, so a call made as the page goes away finds it in; a chunk a deploy dropped reloads the page as other chunks do.
|
|
282
282
|
|
|
283
283
|
### Components that load when they first draw
|
|
284
284
|
|
package/llms/upgrading.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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.108.0
|
|
6
|
+
|
|
7
|
+
### The `deprecated-package-names` lint is gone
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
5
11
|
## 1.107.0
|
|
6
12
|
|
|
7
13
|
### `TSchema` is gone from `kay/library`
|
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
# What's new, older releases
|
|
2
2
|
|
|
3
|
-
What each release before 1.
|
|
3
|
+
What each release before 1.107 added, and the end of a newest release that was cut short (`(continued)`), newest first, each feature with where it is documented. The newer releases are in [What's new](whats-new.md); what a release breaks is in [Upgrading](upgrading.md).
|
|
4
|
+
|
|
5
|
+
## 1.106.0
|
|
6
|
+
|
|
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-refused-fields.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)).
|
|
4
39
|
|
|
5
40
|
## 1.106.0 (continued)
|
|
6
41
|
|
package/llms/whats-new.md
CHANGED
|
@@ -2,10 +2,17 @@
|
|
|
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.108.0
|
|
6
|
+
|
|
7
|
+
- kayjs-ui's `BarChart` leaves `goals` out of an island that never writes them, a `ConfirmDelete` leaves out the inline pair (`ask`), the trigger looks and `details` it is never given, and the confirm words no longer carry the questions' queue: a plain `ConfirmDelete` island holds 3.1 KB less of kayjs-ui, a `BarChart` 1.6 KB, and a `Dialog`'s discard question loads when first asked, 1.2 KB less ([kayjs-ui](../../ui/llms/table.md))
|
|
8
|
+
- An island ships only the kayjs-ui icons it can draw: with kayjs-ui in the app's dependencies the default registry is cut to the slots the project writes as strings, about 8 KB minified off an island drawing a Dialog, and a slot named from a variable in the app keeps it whole; the app's own icon settings stay whole ([kayjs-ui setup](../../ui/llms/setup.md))
|
|
9
|
+
- The code that runs an action call (queue, timeout, retries, the post and what follows its answer) loads with the first call instead of with the first island holding an action: a page of hubble's with a table of rows and dialogs loads 1.8 KB gzip less ([islands](islands.md#the-action-caller))
|
|
10
|
+
- A component of an island that leaves a feature out (kayjs-ui's `Table` with no filter, selection, paging or detail rows) no longer ships the markers and the effects of the blocks it never draws, and an `aria-` or `data-` attribute of such a feature is not bound: a plain `Table` island carries 1.7 KB less of kayjs-ui's code, 9.9 KB in all, as any component declaring `uses()` features carries less.
|
|
11
|
+
- An extension's own islands, as kayjs-ui's toaster, tooltip host and confirm host, hydrate when the library resolves outside the project root (a workspace link, or a folder above it) and the app lists no dependency on it ([component libraries](component-libraries.md)).
|
|
12
|
+
|
|
5
13
|
## 1.107.0
|
|
6
14
|
|
|
7
15
|
- `--- script` as a file's first fence is a compile error naming `---`, and the `deprecated-script-fence` lint is gone ([components](components.md)).
|
|
8
|
-
- `kay new` pins kay with `^` from 2.0.0, when a breaking change is a major, and with `~` through 1.x, where a minor may break; the semver policy is stated in [Upgrading](upgrading.md) and the install pages ([project](project.md))
|
|
9
16
|
- `kay new` pins kay with `~` through 1.x and with `^` from 2.0.0, when a breaking change becomes a major ([Upgrading](upgrading.md))
|
|
10
17
|
- A component an island draws only where it may not render at first paint (inside an `if`, a `match` case, `@failed`, or the body of a closed `Dialog` or `FormDialog`) loads when that branch first draws, with nothing to declare: the page preloads what the server drew, a visitor reaching for the island loads the rest ahead, and a failed chunk is retried and reported; the code that posts an action call loads with its first call, retried after 1 s and 3 s when the load fails ([islands](islands.md#components-that-load-when-they-first-draw)).
|
|
11
18
|
- An island whose closed forms and dialogs hold words that are also component names loads less: a name in a string or a comment no longer keeps a component eager, and `Form`, `FormDialog` and `SaveForm` load their sending code on the first send. An island with a table, a closed form dialog and a select in it sheds 4.6 KB gzip of eager JS ([islands](islands.md))
|
|
@@ -15,41 +22,4 @@ What each release of kay and its libraries adds, newest first, each feature with
|
|
|
15
22
|
- `kay check` names a Standard Schema validator with no `~standard.jsonSchema` (`schema-without-json-schema`) where an action's `input` or an API route's `body`, `query`, `params`, `headers` or `cookie` takes it, in `.ts` modules and `.kay` fences ([Schemas](schemas.md#schemas)).
|
|
16
23
|
- kayjs-ui's `Table` draws its failure row's retry as a plain button with a `retry` part, so an island holding a plain Table ships 6 KB less (the `Button`, its busy state and the icon set stay out unless the page uses them) ([restyle](https://git.kaynooo.fr/kaynooo/kayjs/src/branch/main/packages/ui/llms/restyle.md)).
|
|
17
24
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- 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
|
|
21
|
-
- 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)).
|
|
22
|
-
- 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))
|
|
23
|
-
- 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))
|
|
24
|
-
- 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)).
|
|
25
|
-
- 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)).
|
|
26
|
-
- 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)).
|
|
27
|
-
- 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.
|
|
28
|
-
- 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)).
|
|
29
|
-
- `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)).
|
|
30
|
-
- 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)).
|
|
31
|
-
- 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)).
|
|
32
|
-
- 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))
|
|
33
|
-
- 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)).
|
|
34
|
-
- 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)).
|
|
35
|
-
- 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)).
|
|
36
|
-
- 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)).
|
|
37
|
-
- `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)).
|
|
38
|
-
- 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)).
|
|
39
|
-
- 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)).
|
|
40
|
-
- 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)).
|
|
41
|
-
- `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)).
|
|
42
|
-
- `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)).
|
|
43
|
-
- `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-refused-fields.md#refused-posts))
|
|
44
|
-
- 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)).
|
|
45
|
-
- 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)).
|
|
46
|
-
- `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)).
|
|
47
|
-
- kayjs-ui's `Badge` takes `dot`, a small dot in its colour before the label ([Badge](/ui/badge#a-dot)).
|
|
48
|
-
- 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)).
|
|
49
|
-
- `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)).
|
|
50
|
-
- `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)).
|
|
51
|
-
- 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)).
|
|
52
|
-
|
|
53
|
-
The rest of this release is in [What's new, older releases](whats-new-archive.md).
|
|
54
|
-
|
|
55
|
-
Releases before 1.106 are in [What's new, older releases](whats-new-archive.md).
|
|
25
|
+
Releases before 1.107 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.107
|
|
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
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kayjs/kay",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.108.0",
|
|
5
5
|
"description": "A Bun web framework: one .kay file per component, pages rendered to plain HTML on the server, interactive islands in the browser",
|
|
6
6
|
"author": "Kaynooo <https://github.com/Kayno0o>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -308,11 +308,11 @@
|
|
|
308
308
|
"@fontsource/inter": "^5.3.0",
|
|
309
309
|
"@happy-dom/global-registrator": "^21.0.4",
|
|
310
310
|
"@iconify-json/tabler": "^1.2.42",
|
|
311
|
-
"@kayjs/ai": "1.
|
|
312
|
-
"@kayjs/auth": "1.
|
|
313
|
-
"@kayjs/cms": "1.
|
|
314
|
-
"@kayjs/mail": "1.
|
|
315
|
-
"@kayjs/ui": "1.
|
|
311
|
+
"@kayjs/ai": "1.108.0",
|
|
312
|
+
"@kayjs/auth": "1.108.0",
|
|
313
|
+
"@kayjs/cms": "1.108.0",
|
|
314
|
+
"@kayjs/mail": "1.108.0",
|
|
315
|
+
"@kayjs/ui": "1.108.0",
|
|
316
316
|
"@kaynooo/eslint": "^8.0.3",
|
|
317
317
|
"@kaynooo/pg-orm": "^8.1.4",
|
|
318
318
|
"@oxc-parser/binding-wasm32-wasip1": "0.155.0",
|
package/src/build/client.ts
CHANGED
|
@@ -32,6 +32,7 @@ import { pruneNodes, pruneUtilityLayer } from './class-rules'
|
|
|
32
32
|
import { buildClassTable, mergesAtRuntime } from './class-table'
|
|
33
33
|
import { entryFile, KAY_OUTPUT, lazyEntryKey } from './entry-files'
|
|
34
34
|
import { CSS_FILE, findKayFiles, findProjectFiles, forgetSources, inWalkScope, keepSources, liftSources, readSource, readSourcePaths, readText, writeIfChanged } from './files'
|
|
35
|
+
import { iconSlotsOf, slotsKey } from './icon-slots'
|
|
35
36
|
import { Increments, realPaths, sameEntries } from './increments'
|
|
36
37
|
import { keepBundleMapCached, pruneKeptMaps } from './kept-maps'
|
|
37
38
|
import { hoistLayerOrder } from './layer-order'
|
|
@@ -226,7 +227,7 @@ export function clientSession(root: string, options: ClientOptions, settings: Se
|
|
|
226
227
|
if (previous && islandsAgain)
|
|
227
228
|
await increments!.stopMaps(false)
|
|
228
229
|
|
|
229
|
-
const [scripts, styles] = await bothBundles(islandsAgain ? bundleIslands(root, sources.islands, sources.files, sources.actionForms, sources.actionProps, options, classTable, islandTable) : undefined, stylesAgain ? bundleStyles(root, sources, options) : undefined)
|
|
230
|
+
const [scripts, styles] = await bothBundles(islandsAgain ? bundleIslands(root, sources.islands, sources.files, sources.actionForms, sources.actionProps, options, classTable, islandTable, await iconSlotsOf(root, [...sources.files, ...sources.islands.values()], sources.libraries, graph)) : undefined, stylesAgain ? bundleStyles(root, sources, options) : undefined)
|
|
230
231
|
const styleUses = styles ? styles.uses : previous!.styleUses
|
|
231
232
|
const manifest: ClientManifest = { ...scripts?.manifest ?? previous!.islands, styles: styles?.styles ?? previous!.styles, ...classTable && { classTable }, ...styleUses && { styleUses }, ...options.hot && { problems: sources.problems }, ...key !== undefined && { options: key } }
|
|
232
233
|
|
|
@@ -507,12 +508,12 @@ export async function islandClassTableOf(root: string, sources: Pick<ClientSourc
|
|
|
507
508
|
// `inputs` holds the modules of each chunk, `maps` the source maps written.
|
|
508
509
|
interface Bundled { manifest: Omit<ClientManifest, 'styles'>, inputs: ChunkInputs, maps: string[] }
|
|
509
510
|
|
|
510
|
-
async function bundleIslands(root: string, islands: Map<string, string>, files: string[], actionForms: boolean, actionProps: boolean, options: ClientOptions, classTable?: ClassTable, islandTable?: ClassTable): Promise<Bundled> {
|
|
511
|
-
return inRounds(async last => bundleRound(root, islands, files, actionForms, actionProps, options, last, classTable, islandTable))
|
|
511
|
+
async function bundleIslands(root: string, islands: Map<string, string>, files: string[], actionForms: boolean, actionProps: boolean, options: ClientOptions, classTable?: ClassTable, islandTable?: ClassTable, iconSlots?: ReadonlySet<string>): Promise<Bundled> {
|
|
512
|
+
return inRounds(async last => bundleRound(root, islands, files, actionForms, actionProps, options, last, classTable, islandTable, iconSlots))
|
|
512
513
|
}
|
|
513
514
|
|
|
514
515
|
// One build of the islands, which `foldStubs` ends when lazy components that do not pay were left.
|
|
515
|
-
async function bundleRound(root: string, islands: Map<string, string>, files: string[], actionForms: boolean, actionProps: boolean, options: ClientOptions, last: boolean, classTable?: ClassTable, islandTable?: ClassTable): Promise<Bundled> {
|
|
516
|
+
async function bundleRound(root: string, islands: Map<string, string>, files: string[], actionForms: boolean, actionProps: boolean, options: ClientOptions, last: boolean, classTable?: ClassTable, islandTable?: ClassTable, iconSlots?: ReadonlySet<string>): Promise<Bundled> {
|
|
516
517
|
const navigation = options.client?.navigation ?? true
|
|
517
518
|
|
|
518
519
|
if (islands.size === 0 && !navigation)
|
|
@@ -567,13 +568,13 @@ async function bundleRound(root: string, islands: Map<string, string>, files: st
|
|
|
567
568
|
// Bun resolves packages' `development` export condition unless NODE_ENV is defined as production, which would ship a package's dev build; a build for development, not NODE_ENV, asks for theirs.
|
|
568
569
|
const define: Record<string, string> = { 'KAY_BROWSER': 'true', 'process.env.NODE_ENV': JSON.stringify(options.hot === true ? 'development' : 'production'), 'KAY_STATIC_EXPORT': options.exported === true ? 'true' : 'undefined', 'KAY_NAV_ENTRY': 'undefined', 'KAY_FRENCH': options.french === true ? 'true' : 'undefined', 'KAY_I18N': options.i18n === true ? 'true' : 'undefined', 'KAY_NO_ACTION_PROPS': options.hot !== true && !actionProps ? 'true' : 'undefined', 'KAY_VISIBLE_MARGIN': JSON.stringify(rootMargin(options.client?.hydration?.visible, '200px', 'visible')), 'KAY_NEAR_MARGIN': JSON.stringify(rootMargin(options.client?.hydration?.serverIslands, '100% 0px', 'serverIslands')) }
|
|
569
570
|
const external = publicEnv !== undefined ? [publicEnv] : []
|
|
570
|
-
const plugins = (anchor?: string, anchored?: ReadonlySet<string>, direct?: boolean) => [withoutStyles(), api, kay({ target: 'dom', root, variants, localeLinks: options.i18n === true, cacheDir: projectPaths(root).cache, settings: options.librarySettings, anchor, anchored, direct, inspect: options.inspect, api: trees, external, classTable }), ...options.plugins ?? []]
|
|
571
|
+
const plugins = (anchor?: string, anchored?: ReadonlySet<string>, direct?: boolean) => [withoutStyles(), api, kay({ target: 'dom', root, variants, localeLinks: options.i18n === true, cacheDir: projectPaths(root).cache, settings: options.librarySettings, iconSlots, anchor, anchored, direct, inspect: options.inspect, api: trees, external, classTable }), ...options.plugins ?? []]
|
|
571
572
|
|
|
572
573
|
await Bun.write(entryFile, `import ${JSON.stringify(bootFile)}\n`)
|
|
573
574
|
|
|
574
575
|
// Without the registry in the boot, each island is an entry point of its own.
|
|
575
576
|
const islandFiles = options.hot ? [] : [...entries.values()]
|
|
576
|
-
const chunk = await runtimeChunk(entryFile, { plugins: plugins(), define, external, islands: islandFiles, cache: { file: join(projectPaths(root).cache, `runtime-search-${options.hot ? 'dev' : 'build'}.json`), key: `${JSON.stringify([options.librarySettings, options.inspect, options.client?.navigation, trees, islandFiles, eagerKeys()])}\0${await Bun.file(bootFile).text()}` } })
|
|
577
|
+
const chunk = await runtimeChunk(entryFile, { plugins: plugins(), define, external, islands: islandFiles, cache: { file: join(projectPaths(root).cache, `runtime-search-${options.hot ? 'dev' : 'build'}.json`), key: `${JSON.stringify([options.librarySettings, slotsKey(iconSlots), options.inspect, options.client?.navigation, trees, islandFiles, eagerKeys()])}\0${await Bun.file(bootFile).text()}` } })
|
|
577
578
|
|
|
578
579
|
// In development the entry keeps its own code, the islands it imports by their hashed names included: the runtime's chunk then stays as it was through an edit of an island, which swaps in alone.
|
|
579
580
|
// A second entry point importing the runtime alone has Bun give it that chunk of its own, which it would otherwise merge into the entry's.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { ImportGraph, KayLibrary } from './libraries'
|
|
2
|
+
import { existsSync, readFileSync, realpathSync } from 'node:fs'
|
|
3
|
+
import { dirname, join, resolve, sep } from 'node:path'
|
|
4
|
+
import { importEdges, importsOf, reachedFrom } from './libraries'
|
|
5
|
+
|
|
6
|
+
// kayjs-ui draws its icons from a registry keyed by slot, `settings.icons[slot]`, which a bundler cannot shrink: an island would carry every icon of it. The build instead reads the slots the project and the modules it reaches write, and loads the registry holding those alone.
|
|
7
|
+
// A slot is named where the code writes it as a string, `icon="close"` or `icon: 'close'`; pages hand them to islands as props, so every `.kay` file of the build is read, not only what an island imports. One taken from a variable in the project's own code may be any slot, so the whole registry stays.
|
|
8
|
+
const WORD = /(["'`])(\w+)\1/g
|
|
9
|
+
const ICON_PROP = /\b\w*[iI]con\w*=\{((?:[^{}]|\{[^{}]*\})*)\}/g
|
|
10
|
+
const ICON_KEY = /\b\w*[iI]con\w*\s*:\s*([^,}\n]+)/g
|
|
11
|
+
const ICON_IMPORT = /^import\s+(\w+)\s+from\s+(["'])~icons\/[^"'\n]+\2/gm
|
|
12
|
+
const LITERAL = /^(["'])\w+\1$/
|
|
13
|
+
const CHOICE = /^[^'"`?]+\?\s*(["'])\w+\1\s*:\s*(["'])\w+\2$/
|
|
14
|
+
const IDENTIFIER = /^[\w$]+$/
|
|
15
|
+
const TYPE_WORD = /^(?:string|undefined|null|true|false|any|unknown|number|boolean)\b/
|
|
16
|
+
const LOWERCASE = /^[a-z]/
|
|
17
|
+
const SLOT_NAME = /^\w+/
|
|
18
|
+
const IN_PACKAGES = /[\\/]node_modules[\\/]/
|
|
19
|
+
const UI_ICON = /[\\/](?:packages[\\/]ui|node_modules[\\/]@kayjs[\\/]ui)[\\/]src[\\/]icon\.kay$/
|
|
20
|
+
// A component called with a spread, `Button({...opts})`: the props it takes, an icon among them, are not written here.
|
|
21
|
+
const SPREAD_CALL = /\b[A-Z]\w*\([^)\n]*\.\.\./
|
|
22
|
+
const JSON_IMPORT = /(?:from\s*|import\(\s*)((["'])\.[^"'\n]*\.json\2)/g
|
|
23
|
+
const SCANNED = /\.(?:kay|[cm]?[jt]sx?)$/
|
|
24
|
+
|
|
25
|
+
// The registry modules of kayjs-ui, by where the project reaches it: in a checkout or under `node_modules`.
|
|
26
|
+
export const REGISTRY_FILE = /[\\/](?:packages[\\/]ui|node_modules[\\/]@kayjs[\\/]ui)[\\/]src[\\/](?:defaults|added-icons)\.ts$/
|
|
27
|
+
|
|
28
|
+
// Whether a registry module belongs to kayjs-ui itself, not to an app's own `packages/ui`.
|
|
29
|
+
export function isUiRegistry(file: string): boolean {
|
|
30
|
+
try {
|
|
31
|
+
return (JSON.parse(readFileSync(join(dirname(file), '../package.json'), 'utf8')) as { name?: string }).name === '@kayjs/ui'
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return false
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Whether the value written for an icon is a slot or an icon of a set, and not something computed.
|
|
39
|
+
function isStatic(value: string, imported: ReadonlySet<string>): boolean {
|
|
40
|
+
const written = value.trim()
|
|
41
|
+
|
|
42
|
+
return LITERAL.test(written) || CHOICE.test(written) || (IDENTIFIER.test(written) && imported.has(written))
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Whether a file belongs to kayjs-ui, by the package.json above it.
|
|
46
|
+
function inUi(file: string): boolean {
|
|
47
|
+
for (let dir = dirname(file); dir !== dirname(dir); dir = dirname(dir)) {
|
|
48
|
+
if (existsSync(join(dir, 'package.json')))
|
|
49
|
+
return isUiRegistry(join(dir, 'src/x'))
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return false
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// The words written as strings in the files of the build and what they import, or undefined when a slot may come from a variable.
|
|
56
|
+
export async function iconSlotsOf(root: string, entries: Iterable<string>, libraries: KayLibrary[], graph?: ImportGraph): Promise<ReadonlySet<string> | undefined> {
|
|
57
|
+
const project = realpathSync(root) + sep
|
|
58
|
+
const reached = await reachedFrom([...entries], importEdges(root, libraries, graph))
|
|
59
|
+
const slots = new Set<string>()
|
|
60
|
+
let dynamic = false
|
|
61
|
+
|
|
62
|
+
await Promise.all([...reached].map(async (file) => {
|
|
63
|
+
if (REGISTRY_FILE.test(file) || !SCANNED.test(file))
|
|
64
|
+
return
|
|
65
|
+
|
|
66
|
+
const text = await Bun.file(file).text()
|
|
67
|
+
|
|
68
|
+
for (const [, , word] of text.matchAll(WORD))
|
|
69
|
+
slots.add(word!)
|
|
70
|
+
|
|
71
|
+
// Data a file imports hands icons to components as props, which no component writes.
|
|
72
|
+
for (const [, written] of text.matchAll(JSON_IMPORT)) {
|
|
73
|
+
const data = resolve(dirname(file), JSON.parse(written!.replaceAll('\'', '"')) as string)
|
|
74
|
+
|
|
75
|
+
if (existsSync(data)) {
|
|
76
|
+
for (const [, , word] of readFileSync(data, 'utf8').matchAll(WORD))
|
|
77
|
+
slots.add(word!)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// A kayjs-ui file the file imports and the walk did not follow, which its slots would be missing from.
|
|
82
|
+
for (const specifier of await importsOf(file, text)) {
|
|
83
|
+
try {
|
|
84
|
+
const path = realpathSync(Bun.resolveSync(specifier, dirname(file)))
|
|
85
|
+
|
|
86
|
+
if (SCANNED.test(path) && !reached.has(path) && inUi(path))
|
|
87
|
+
dynamic = true
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// Not a file of the project's: a builtin or a package.
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!file.startsWith(project) || IN_PACKAGES.test(file.slice(project.length)))
|
|
95
|
+
return
|
|
96
|
+
|
|
97
|
+
if (SPREAD_CALL.test(text))
|
|
98
|
+
dynamic = true
|
|
99
|
+
|
|
100
|
+
const imported = new Set([...text.matchAll(ICON_IMPORT)].map(hit => hit[1]!))
|
|
101
|
+
|
|
102
|
+
for (const [, value] of text.matchAll(ICON_PROP)) {
|
|
103
|
+
if (!isStatic(value!, imported))
|
|
104
|
+
dynamic = true
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
for (const [, value] of text.matchAll(ICON_KEY)) {
|
|
108
|
+
const written = value!.trim()
|
|
109
|
+
|
|
110
|
+
// A type annotation, `icon: IconSlot`, writes no value.
|
|
111
|
+
if (!isStatic(written, imported) && (written.includes('.') || written.includes('(') || written.includes('[') || (LOWERCASE.test(written) && !TYPE_WORD.test(written))))
|
|
112
|
+
dynamic = true
|
|
113
|
+
}
|
|
114
|
+
}))
|
|
115
|
+
|
|
116
|
+
// Without kayjs-ui's Icon among the files read, its components were not followed (a library the project does not declare), and their slots are unknown.
|
|
117
|
+
return dynamic || ![...reached].some(file => UI_ICON.test(file)) ? undefined : slots
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const REGISTRY = /^(\s*icons: |export const addedIcons\b[^=\n]*= )\{ ([^{}\n]*) \}(,?)$/m
|
|
121
|
+
const ICON_IMPORT_LINE = /^import (\w+) from '~icons\/[^'\n]+'\n/gm
|
|
122
|
+
|
|
123
|
+
// A registry module with the entries of `slots` only, the imports of the others dropped with them. A module whose registry is not written on one line as `{ slot, other: local }` is left as it is.
|
|
124
|
+
export function registryWith(source: string, slots: ReadonlySet<string>): string {
|
|
125
|
+
const hit = REGISTRY.exec(source)
|
|
126
|
+
|
|
127
|
+
if (hit === null)
|
|
128
|
+
return source
|
|
129
|
+
|
|
130
|
+
const kept = hit[2]!.split(', ').filter(entry => slots.has(SLOT_NAME.exec(entry)![0]))
|
|
131
|
+
const body = source.replace(REGISTRY, () => `${hit[1]}{ ${kept.join(', ')} }${hit[3]}`)
|
|
132
|
+
const names = new Set(kept.map(entry => entry.split(':').at(-1)!.trim()))
|
|
133
|
+
|
|
134
|
+
return body.replace(ICON_IMPORT_LINE, (line, name: string) => names.has(name) ? line : '')
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// What a cache keyed on the slots holds of them.
|
|
138
|
+
export function slotsKey(slots: ReadonlySet<string> | undefined): string {
|
|
139
|
+
return slots === undefined ? '*' : [...slots].sort().join(',')
|
|
140
|
+
}
|