@tenphi/cookbook 0.22.1 → 0.24.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/docs/authoring.mdx +1 -1
- package/docs/component-styles.md +60 -31
- package/docs/custom-components.md +7 -5
- package/docs/migration.md +63 -1
- package/docs/site-navigation.md +23 -0
- package/docs/upstream/manifest.json +2 -2
- package/docs/upstream/tasty/README.md +2 -2
- package/docs/upstream/tasty/docs/pipeline.md +1 -1
- package/docs/upstream/tasty/docs/runtime-benchmarks.md +7 -7
- package/package.json +3 -3
package/docs/authoring.mdx
CHANGED
|
@@ -153,7 +153,7 @@ markers remain visible independently of their theme-aware backgrounds:
|
|
|
153
153
|
| --------- | --------------------------------------------------------------------------------------------------- |
|
|
154
154
|
| `Card` | Optional `title` and `href`; renders an article or link with slot content |
|
|
155
155
|
| `Steps` | Ordered list container; supply `li` elements |
|
|
156
|
-
| `Logo` | Optional `label`, `decorative`, and `class`; renders the Cookbook mark
|
|
156
|
+
| `Logo` | Optional `label`, `decorative`, and root `class`; renders the Cookbook mark |
|
|
157
157
|
| `Preview` | Required `title`; optional `html`, `css`, and `javascript`; isolates examples in a sandboxed iframe |
|
|
158
158
|
|
|
159
159
|
The public package exports each component's props type, such as `TabProps`,
|
package/docs/component-styles.md
CHANGED
|
@@ -13,7 +13,7 @@ its dimensions under `SiteLogo`.
|
|
|
13
13
|
|
|
14
14
|
Heading levels are states of the same element. Customize them through a root
|
|
15
15
|
property map such as `Heading: { textWrap: { "": "balance", ":is(h1)": "pretty" } }`.
|
|
16
|
-
Markdown heading wrappers use
|
|
16
|
+
Markdown heading wrappers use `level=h1` through `level=h6` as root states.
|
|
17
17
|
|
|
18
18
|
Block spacing uses `$margin-block-start` and `$margin-block-end` tokens. The
|
|
19
19
|
owning `blockMargin` consumes both tokens, and a surrounding prose/layout rule
|
|
@@ -65,14 +65,14 @@ theme: {
|
|
|
65
65
|
Sidebar: {
|
|
66
66
|
LinkLabel: {
|
|
67
67
|
preset: "body",
|
|
68
|
-
whiteSpace: { "": "nowrap", "
|
|
68
|
+
whiteSpace: { "": "nowrap", "!@md": "normal" }
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
The
|
|
75
|
+
The `!@md` value sits with the default value in one Tasty state map. Shared
|
|
76
76
|
tokens and presets keep the component aligned with the rest of the site, while
|
|
77
77
|
Glaze resolves semantic colors across the configured schemes and contrast
|
|
78
78
|
modes.
|
|
@@ -83,29 +83,36 @@ Cookbook registers these Tasty state aliases for `theme.styles`, custom
|
|
|
83
83
|
components, and recipes. Widths use CSS `rem` units; their pixel values depend
|
|
84
84
|
on the browser's font-size settings.
|
|
85
85
|
|
|
86
|
-
| State
|
|
87
|
-
|
|
|
88
|
-
| `@
|
|
89
|
-
| `@
|
|
90
|
-
| `@
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
86
|
+
| State | Condition | Typical use |
|
|
87
|
+
| ----- | ------------- | ---------------------------------------------- |
|
|
88
|
+
| `@sm` | width > 40rem | Pagination links share one row |
|
|
89
|
+
| `@md` | width ≥ 50rem | Desktop navigation and component layouts |
|
|
90
|
+
| `@lg` | width ≥ 72rem | Desktop table of contents fits beside the page |
|
|
91
|
+
|
|
92
|
+
The conditions select wider viewports. Use `!@sm` for stacked
|
|
93
|
+
pagination, `!@md` for mobile, and `!@lg` when the contents panel does not fit
|
|
94
|
+
beside the page. Combine states when needed, for example `@md & !@lg` for the
|
|
95
|
+
intermediate layout. Component-specific
|
|
96
|
+
thresholds use direct media conditions, such as `@media(w <= 23rem)` for
|
|
97
|
+
PackageVersion. Use the default state key `""` for the value outside a condition.
|
|
98
|
+
Add your own aliases with `theme.states`; redefining a built-in alias also
|
|
99
|
+
changes the renderer's responsive layout, so check the whole site when doing so.
|
|
100
|
+
|
|
101
|
+
Native pseudo-classes need no alias. Use `:is(:popover-open)` on a root or
|
|
102
|
+
`@own(:is(:popover-open))` for a selected descendant; the `:is()` wrapper is
|
|
103
|
+
needed because the pinned linter's simple pseudo-class list omits `:popover-open`.
|
|
104
|
+
|
|
105
|
+
### Appearance and motion states
|
|
106
|
+
|
|
107
|
+
Use these shared aliases to match the site's appearance or respect motion preferences.
|
|
108
|
+
|
|
109
|
+
| State | Condition | Typical use |
|
|
110
|
+
| ----------------- | ---------------------------------------------------------- | ------------------------------------------- |
|
|
111
|
+
| `@reduced-motion` | `prefers-reduced-motion: reduce` | Suppress optional motion |
|
|
112
|
+
| `@light` | Explicit light theme, or system light when no theme is set | Match the site's effective light appearance |
|
|
113
|
+
| `@dark` | Explicit dark theme, or system dark when no theme is set | Match the site's effective dark appearance |
|
|
114
|
+
| `@system-light` | `prefers-color-scheme: light` | Read the system preference directly |
|
|
115
|
+
| `@system-dark` | `prefers-color-scheme: dark` | Read the system preference directly |
|
|
109
116
|
|
|
110
117
|
Use `@light` and `@dark` in component styles. They check the page root's
|
|
111
118
|
`data-theme` attribute and use the system preference only when that attribute
|
|
@@ -113,6 +120,8 @@ is absent. Document rules that style the root itself use `@system-light` and
|
|
|
113
120
|
`@system-dark` within their automatic-theme branch. Keep scheme media queries
|
|
114
121
|
in the shared state definitions instead of repeating them in style objects.
|
|
115
122
|
|
|
123
|
+
### State maps and validation
|
|
124
|
+
|
|
116
125
|
In a generated site, run `npm run validate` (or the matching package manager's
|
|
117
126
|
command) after editing `docs.config.ts`. It checks TypeScript theme properties,
|
|
118
127
|
then runs Cookbook's preflight and production output checks. A misspelled
|
|
@@ -130,6 +139,17 @@ state keys for the component root. A sub-element cannot target its containing
|
|
|
130
139
|
element: use root state maps for callout kinds, hover/active buttons, compact
|
|
131
140
|
selectors, and syntax wrapping. Use Tasty element names such as `Primary > Search`
|
|
132
141
|
instead of spelling out `[data-element="Primary"] > [data-element="Search"]`.
|
|
142
|
+
For a state on the owning root, use a plain key: `DiffCode: { display: { "diff": "block" } }`.
|
|
143
|
+
Use `@own(:first-child)` when a structurally selected link needs its own condition,
|
|
144
|
+
instead of repeating its `Panel a` selector. `@prose` uses
|
|
145
|
+
`@own(!:is([data-not-content] *))` to exclude selected elements inside isolated
|
|
146
|
+
sections while preserving surrounding prose in the same Markdown root.
|
|
147
|
+
|
|
148
|
+
Markdown also shares `@prose-block` for a block following block content
|
|
149
|
+
(including linked Cards marked `data-block`), and `@prose-heading` for a heading
|
|
150
|
+
following non-heading content. Both preserve the same isolated-content condition
|
|
151
|
+
as `@prose`.
|
|
152
|
+
|
|
133
153
|
A scalar override replaces the property's
|
|
134
154
|
whole state map; use the matching state key without a default entry to change
|
|
135
155
|
only that branch. `"": null` omits a declaration outside a condition. For
|
|
@@ -139,9 +159,9 @@ conditional `display`, `"": null` is also supported, including styles with
|
|
|
139
159
|
For a compact language selector, customize the root with
|
|
140
160
|
`LanguageSelect: { border: { "[data-compact]": "4px solid #border" } }`.
|
|
141
161
|
The former `Compact` hook is now a root state. Likewise, customize code wrapping
|
|
142
|
-
with `SyntaxHighlight: { whiteSpace: { "
|
|
162
|
+
with `SyntaxHighlight: { whiteSpace: { "[data-syntax-wrap]": "pre-wrap" } }`.
|
|
143
163
|
Syntax category sub-elements such as `Keyword` target descendant spans; use
|
|
144
|
-
`SyntaxHighlight.color["
|
|
164
|
+
`SyntaxHighlight.color["[data-syntax-keyword]"]` when customizing the containing
|
|
145
165
|
code element itself.
|
|
146
166
|
|
|
147
167
|
Cookbook temporarily retains selectors for pseudo-element states that Tasty
|
|
@@ -194,7 +214,7 @@ it stays complete when a surface changes.
|
|
|
194
214
|
|
|
195
215
|
#### Page shell
|
|
196
216
|
|
|
197
|
-
* `Document`: `All`, `BlockSpacing`, `Body`, `Control`, `Pointer`, `ResponsiveWidth`, `ResponsiveHeight`, `Hidden`, `PrintHidden`, `DesktopBlock`, `DesktopFlex`, `ScreenReaderOnly`, `Strong`, `Link`, `NarrowBlock`, `MobileBlock`, `Code`, `FocusRing`, `CurrentLink`, `SearchOpen`
|
|
217
|
+
* `Document`: `All`, `BlockSpacing`, `Body`, `Control`, `Pointer`, `ResponsiveWidth`, `ResponsiveHeight`, `Hidden`, `PrintHidden`, `DesktopBlock`, `DesktopFlex`, `ScreenReaderOnly`, `RouteAnnouncer`, `Strong`, `Link`, `NarrowBlock`, `MobileBlock`, `Code`, `FocusRing`, `CurrentLink`, `SearchOpen`
|
|
198
218
|
* `Layout`: `Islands`
|
|
199
219
|
* `PageFrame`: `MainFrame`, `SidebarFrame`, `Columns`
|
|
200
220
|
* `MainPane`: None
|
|
@@ -442,8 +462,11 @@ colors with `theme.palette` (for example `syntax-keyword`). The default
|
|
|
442
462
|
to the page background's saturation, in dark mode. Set
|
|
443
463
|
`theme.palette["syntax-bg"]` to give code its own color seed;
|
|
444
464
|
syntax text and token contrast resolve against that surface. Code fences, including
|
|
445
|
-
MDX and diff blocks, use
|
|
446
|
-
|
|
465
|
+
MDX and diff blocks, use the `.tasty-code` root class, `data-syntax-*` modifiers, and
|
|
466
|
+
`data-diff` on the owning code-block wrapper. Diff lines carry
|
|
467
|
+
`data-inserted`/`data-deleted` with `data-element="Line"`. Custom Shiki
|
|
468
|
+
transformers may add root classes; token anatomy and state use identities or
|
|
469
|
+
modifiers. Unsupported token classes or inline declarations fail with a
|
|
447
470
|
configuration hint.
|
|
448
471
|
|
|
449
472
|
The production build rejects style attributes, style blocks (including inside
|
|
@@ -465,3 +488,9 @@ The fullscreen mobile dialog has no dimmed or blurred backdrop; the backdrop
|
|
|
465
488
|
transition applies only to wider layouts.
|
|
466
489
|
The Pagefind sizing adapter prevents inline layout declarations and is checked
|
|
467
490
|
against the pinned UI version during builds.
|
|
491
|
+
|
|
492
|
+
Root selectors may use stable classes (for example `.cookbook-markdown-content`,
|
|
493
|
+
`.td-code-block`, and `.tasty-code`) or `data-component`. `data-element` identifies
|
|
494
|
+
structural anatomy and must not serve as a variant or modifier. Use data modifiers
|
|
495
|
+
for states; authored sub-element classes remain only in the Pagefind bridge because
|
|
496
|
+
the library owns and updates its UI markup.
|
|
@@ -163,14 +163,14 @@ export const SiteTitleRoot = defineComponent("ProjectSiteTitle", {
|
|
|
163
163
|
gap: "1x",
|
|
164
164
|
inlineSize: "min 0",
|
|
165
165
|
color: "#text",
|
|
166
|
-
preset: { "": "h4 / strong", "
|
|
166
|
+
preset: { "": "h4 / strong", "!@md": "h5 / strong" },
|
|
167
167
|
textDecoration: "none",
|
|
168
168
|
Logo: {
|
|
169
169
|
$: "> svg",
|
|
170
170
|
display: "block",
|
|
171
171
|
flexShrink: "0",
|
|
172
|
-
inlineSize: { "": "2rem", "
|
|
173
|
-
blockSize: { "": "2rem", "
|
|
172
|
+
inlineSize: { "": "2rem", "!@md": "1.75rem" },
|
|
173
|
+
blockSize: { "": "2rem", "!@md": "1.75rem" },
|
|
174
174
|
color: "#accent-text",
|
|
175
175
|
},
|
|
176
176
|
Label: {
|
|
@@ -233,8 +233,10 @@ at render time follow Tasty's usual precedence.
|
|
|
233
233
|
Use `defineComponent` when authoring a component that should support
|
|
234
234
|
`theme.customStyles`. Use `tasty` directly for ordinary Tasty creation or composition
|
|
235
235
|
that does not need a configuration name. To define a named component around
|
|
236
|
-
an existing React component that forwards `className`, pass it as `as` in the options. Use `
|
|
237
|
-
|
|
236
|
+
an existing React component that forwards `className`, pass it as `as` in the options. Tasty attaches its generated classes for extracted CSS. Use `data-element` identities
|
|
237
|
+
and named sub-elements for owned anatomy, and modifiers/state maps for variants.
|
|
238
|
+
Root selectors may keep stable classes, such as `.project-note`, or use
|
|
239
|
+
`data-component`; avoid classes for sub-elements and modifiers.
|
|
238
240
|
|
|
239
241
|
### Extending a component
|
|
240
242
|
|
package/docs/migration.md
CHANGED
|
@@ -57,7 +57,7 @@ still use `--name`.
|
|
|
57
57
|
Built-in markup now uses Tasty’s `data-element` identities instead of
|
|
58
58
|
`data-tasty-anatomy`. Custom styles resolve through each owning definition.
|
|
59
59
|
Heading levels move from `Heading.Level1`–`Level6` to root property state maps
|
|
60
|
-
(`:is(h1)`–`:is(h6)`); Markdown wrappers use
|
|
60
|
+
(`:is(h1)`–`:is(h6)`); Markdown wrappers use `[data-level=h1]`–`[data-level=h6]`.
|
|
61
61
|
Panel first/second-child padding moves into `MainContent.Panel` token state maps.
|
|
62
62
|
Header’s shared title/search defaults live on `Title` and `Search`; Footer’s
|
|
63
63
|
only-child and hover states live on `MetaLink`, `MetaUpdated`, and `CreditLink`.
|
|
@@ -200,3 +200,65 @@ Apply these steps if your project still uses the earlier contracts:
|
|
|
200
200
|
|
|
201
201
|
See [authoring](./authoring.mdx) for component usage and
|
|
202
202
|
[working examples](./examples.md) for repository configuration patterns.
|
|
203
|
+
|
|
204
|
+
## Root hooks, anatomy, and button variants
|
|
205
|
+
|
|
206
|
+
Existing component root classes and Logo’s root `class` prop remain supported.
|
|
207
|
+
Stable generated-content root classes remain available for global ownership, including
|
|
208
|
+
`.cookbook-markdown-content`, `.cookbook-heading-wrapper`, `.td-code-block`,
|
|
209
|
+
`.tasty-code`, `.cookbook-alert`, and `.td-mermaid`. Custom roots may also use classes
|
|
210
|
+
or `data-component`.
|
|
211
|
+
|
|
212
|
+
Owned sub-elements use `data-element` identities, and state uses data modifiers.
|
|
213
|
+
Keep identity matching in structural `$` selectors. For example, hero actions use
|
|
214
|
+
`data-element="Action"` with `data-primary`, `data-secondary`, or `data-minimal`.
|
|
215
|
+
When customizing `Hero.PrimaryAction`, keep its variant condition in a property
|
|
216
|
+
map, such as `color: { "@own(primary)": "#accent-text" }`.
|
|
217
|
+
|
|
218
|
+
The code-block wrapper owns `data-diff` and `data-copy-state`; code and line rules
|
|
219
|
+
use plain `diff` or `copy-state=copied` state keys. Line insertion/deletion flags
|
|
220
|
+
belong to the line itself and use `@own(inserted)` / `@own(deleted)`.
|
|
221
|
+
|
|
222
|
+
Heading wrappers carry `data-heading` and `level=h1` through `level=h6` states.
|
|
223
|
+
Linked Cards carry `data-block` for prose spacing. Shared `@prose`, `@prose-block`,
|
|
224
|
+
and `@prose-heading` conditions keep repeated Markdown declarations readable while
|
|
225
|
+
preserving isolated `data-not-content` descendants and conditional omissions.
|
|
226
|
+
|
|
227
|
+
Syntax transformers may emit root classes. Token/category hooks use modifiers,
|
|
228
|
+
for example `SyntaxHighlight: { Keyword: { color: { "@own(syntax-keyword)": "#accent-text" } } }`.
|
|
229
|
+
Tasty-generated style hashes and library-owned Pagefind sub-element classes remain.
|
|
230
|
+
|
|
231
|
+
Hero buttons stay stationary on hover. Minimal actions share secondary outline
|
|
232
|
+
padding, background, and border width, with a transparent border (`border: "#clear"`).
|
|
233
|
+
Pagination links also reserve a transparent border before hover; hover changes
|
|
234
|
+
only its color, preserving `theme.styles.Pagination.Link` border width and style.
|
|
235
|
+
|
|
236
|
+
## Smaller shared state set
|
|
237
|
+
|
|
238
|
+
Responsive aliases now use one width scale: `@sm` (>40rem), `@md` (≥50rem), and
|
|
239
|
+
`@lg` (≥72rem). The conditions select wider viewports;
|
|
240
|
+
the exclusive 40rem boundary preserves the former `@small` behavior. The renderer
|
|
241
|
+
keeps its existing responsive thresholds.
|
|
242
|
+
Use these replacements for the removed shortcuts in custom style maps:
|
|
243
|
+
|
|
244
|
+
| Removed alias | Replacement |
|
|
245
|
+
| ---------------- | -------------------- |
|
|
246
|
+
| `@small` | `!@sm` |
|
|
247
|
+
| `@mobile` | `!@md` |
|
|
248
|
+
| `@narrow-layout` | `!@lg` |
|
|
249
|
+
| `@desktop` | `@md` |
|
|
250
|
+
| `@compact` | `@media(w <= 23rem)` |
|
|
251
|
+
| `@shell-mobile` | `@media(w <= 48rem)` |
|
|
252
|
+
| `@shell-desktop` | `@media(w > 48rem)` |
|
|
253
|
+
| `@medium-layout` | `@md & !@lg` |
|
|
254
|
+
| `@popover-open` | `:is(:popover-open)` |
|
|
255
|
+
|
|
256
|
+
Inside a selected descendant's condition, use `@own(:is(:popover-open))`.
|
|
257
|
+
The `:is()` wrapper accommodates the pinned linter's pseudo-class list.
|
|
258
|
+
The shell and medium-layout aliases were unused by built-in components;
|
|
259
|
+
PackageVersion's 23rem rule is now a direct media condition. Define a project
|
|
260
|
+
alias in `theme.states` if you need a named threshold across your own components.
|
|
261
|
+
|
|
262
|
+
If you customized `theme.states`, rename your breakpoint definitions and invert
|
|
263
|
+
the old upper-bound conditions. For example, `"@mobile": "@media(w < 43rem)"`
|
|
264
|
+
becomes `"@md": "@media(w >= 43rem)"`.
|
package/docs/site-navigation.md
CHANGED
|
@@ -21,6 +21,29 @@ navigation: {
|
|
|
21
21
|
}
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
## Client navigation
|
|
25
|
+
|
|
26
|
+
Internal page links use client navigation over the generated static HTML. The
|
|
27
|
+
router loads when an internal page link is hovered, focused, or clicked, so it
|
|
28
|
+
does not add to the initial page download for readers who stay on one page. The
|
|
29
|
+
current page stays visible while the next page and its styles load, then swaps
|
|
30
|
+
without a full-page fade. Appearance preferences, sidebar expansion choices, and
|
|
31
|
+
desktop sidebar scroll within the same navigation section are preserved. Article
|
|
32
|
+
scroll resets to the top on page changes, including Back and Forward; links with
|
|
33
|
+
fragments still navigate to their heading. The current page and its ancestors
|
|
34
|
+
update from the destination markup. Mobile navigation and other open panels close.
|
|
35
|
+
|
|
36
|
+
Search keeps its query and loaded engine between pages in the same language,
|
|
37
|
+
and closes when a result is followed. Language changes initialize the translated
|
|
38
|
+
search interface. External links, downloads, modified clicks, and links marked
|
|
39
|
+
`data-astro-reload` keep normal browser behavior. Without JavaScript, page links
|
|
40
|
+
use normal document navigation.
|
|
41
|
+
|
|
42
|
+
Custom browser scripts should attach behavior through custom-element lifecycle
|
|
43
|
+
callbacks or initialize on `astro:page-load`; bundled scripts are not rerun on
|
|
44
|
+
every client navigation. The router and appearance initialization belong to the common page shell
|
|
45
|
+
and remain available with replacement Header, Head, and PageFrame components.
|
|
46
|
+
|
|
24
47
|
## Search
|
|
25
48
|
|
|
26
49
|
The production build creates a local Pagefind index. Readers can select Search
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/tenphi/tasty/v3.9.
|
|
2
|
+
<img src="https://raw.githubusercontent.com/tenphi/tasty/v3.9.10/assets/tasty.svg" width="128" height="128" alt="Tasty logo" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">Tasty</h1>
|
|
@@ -615,7 +615,7 @@ const tokens = theme.tasty(); // Ready-to-use Tasty tokens
|
|
|
615
615
|
Syntax highlighting for Tasty styles in TypeScript, TSX, JavaScript, and JSX. Highlights color tokens, custom units, state keys, presets, and style properties inside `tasty()`, `tastyStatic()`, and related APIs.
|
|
616
616
|
|
|
617
617
|
<p align="center">
|
|
618
|
-
<img src="https://raw.githubusercontent.com/tenphi/tasty/v3.9.
|
|
618
|
+
<img src="https://raw.githubusercontent.com/tenphi/tasty/v3.9.10/assets/tasty-vscode-highlight.png" width="512" alt="Tasty VS Code syntax highlighting example" />
|
|
619
619
|
</p>
|
|
620
620
|
|
|
621
621
|
## Built with Tasty
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This document describes the style rendering pipeline that transforms style objects into CSS rules. The pipeline ensures that each style value is applied to exactly one condition through exclusive condition building, boolean simplification, and intelligent CSS generation.
|
|
4
4
|
|
|
5
|
-
**Implementation:** [`src/pipeline/`](https://github.com/tenphi/tasty/blob/v3.9.
|
|
5
|
+
**Implementation:** [`src/pipeline/`](https://github.com/tenphi/tasty/blob/v3.9.10/src/pipeline) — TypeScript file names below are relative to that directory.
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
@@ -80,9 +80,9 @@ cold cases. These benchmarks do not include React, DOM work, stylesheet
|
|
|
80
80
|
injection, style resolution, layout, or paint.
|
|
81
81
|
|
|
82
82
|
The benchmark sources are colocated with the code they exercise:
|
|
83
|
-
[`pipeline.bench.ts`](https://github.com/tenphi/tasty/blob/v3.9.
|
|
84
|
-
[`parseStateKey.bench.ts`](https://github.com/tenphi/tasty/blob/v3.9.
|
|
85
|
-
parser benchmark files under [`src/parser`](https://github.com/tenphi/tasty/blob/v3.9.
|
|
83
|
+
[`pipeline.bench.ts`](https://github.com/tenphi/tasty/blob/v3.9.10/src/pipeline/pipeline.bench.ts),
|
|
84
|
+
[`parseStateKey.bench.ts`](https://github.com/tenphi/tasty/blob/v3.9.10/src/pipeline/parseStateKey.bench.ts), and the
|
|
85
|
+
parser benchmark files under [`src/parser`](https://github.com/tenphi/tasty/blob/v3.9.10/src/parser).
|
|
86
86
|
|
|
87
87
|
## Empty Wrapper Overhead
|
|
88
88
|
|
|
@@ -91,7 +91,7 @@ Skipping the style pipeline does not make a `tasty()` component free. Even
|
|
|
91
91
|
tracks another fiber, and Tasty still processes and forwards the element's
|
|
92
92
|
props.
|
|
93
93
|
|
|
94
|
-
[`tasty-overhead.bench.tsx`](https://github.com/tenphi/tasty/blob/v3.9.
|
|
94
|
+
[`tasty-overhead.bench.tsx`](https://github.com/tenphi/tasty/blob/v3.9.10/src/tasty-overhead.bench.tsx) compares 10,000
|
|
95
95
|
raw `<div className>` siblings with 10,000 instances of one module-scoped
|
|
96
96
|
`tasty({})` component. Both receive the same props, and the benchmark fails if
|
|
97
97
|
they do not produce equivalent DOM.
|
|
@@ -125,7 +125,7 @@ snapshot experiment with controlled garbage collection.
|
|
|
125
125
|
|
|
126
126
|
## Cold Generation and Injection
|
|
127
127
|
|
|
128
|
-
[`tasty-injection.bench.ts`](https://github.com/tenphi/tasty/blob/v3.9.
|
|
128
|
+
[`tasty-injection.bench.ts`](https://github.com/tenphi/tasty/blob/v3.9.10/src/tasty-injection.bench.ts) measures the extra
|
|
129
129
|
work when Tasty must generate and inject CSS that an otherwise equivalent page
|
|
130
130
|
already has. It does not compare different stylesheet insertion techniques.
|
|
131
131
|
|
|
@@ -201,7 +201,7 @@ and dialogs open. Both paths go through the state-map and ref-counting
|
|
|
201
201
|
machinery rather than the parser, so a regression in them is invisible to every
|
|
202
202
|
other benchmark here.
|
|
203
203
|
|
|
204
|
-
[`tasty-interaction.bench.tsx`](https://github.com/tenphi/tasty/blob/v3.9.
|
|
204
|
+
[`tasty-interaction.bench.tsx`](https://github.com/tenphi/tasty/blob/v3.9.10/src/tasty-interaction.bench.tsx) pairs each
|
|
205
205
|
case with a raw-DOM equivalent driven by a hand-written stylesheet that
|
|
206
206
|
produces the same computed color and background in both states. The benchmark
|
|
207
207
|
fails if either arm resolves to anything else, so an arm that quietly rendered
|
|
@@ -255,7 +255,7 @@ reopening a menu re-pays the React wrapper, not the style pipeline.
|
|
|
255
255
|
## Page-Load Cold Start
|
|
256
256
|
|
|
257
257
|
Every benchmark above deliberately excludes the network, module compilation and
|
|
258
|
-
the first render. [`scripts/cold-start`](https://github.com/tenphi/tasty/blob/v3.9.
|
|
258
|
+
the first render. [`scripts/cold-start`](https://github.com/tenphi/tasty/blob/v3.9.10/scripts/cold-start) measures exactly
|
|
259
259
|
those: what a visitor waits for between requesting a page and seeing styled
|
|
260
260
|
content, in a real Chromium under CDP network and CPU throttling.
|
|
261
261
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenphi/cookbook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Repository-native static documentation for Astro",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"author": "Andrey Yamanov",
|
|
69
69
|
"license": "MIT",
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@tenphi/docs": "0.
|
|
72
|
-
"@tenphi/renderer": "0.
|
|
71
|
+
"@tenphi/docs": "0.24.0",
|
|
72
|
+
"@tenphi/renderer": "0.24.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"astro": "^7.3.2"
|