@tarve/core 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/CHANGELOG.md +126 -1
  2. package/README.md +121 -12
  3. package/dist/npm/build.js +1401 -85
  4. package/dist/npm/cli.js +1940 -117
  5. package/dist/npm/embedded-assets.js +22 -3
  6. package/dist/npm/index.js +5274 -975
  7. package/dist/npm/jsx-dev-runtime.js +1268 -0
  8. package/dist/npm/jsx-runtime.js +1268 -0
  9. package/dist/npm/native-runtime.json +3 -3
  10. package/dist/npm/node-build.js +1159 -0
  11. package/dist/npm/protocol.js +1 -1
  12. package/dist/npm/runtime.js +5 -5
  13. package/dist/npm/txiki/fetch.ts +228 -0
  14. package/dist/npm/txiki/intl-data.ts +7 -0
  15. package/dist/npm/txiki/intl.test.ts +53 -0
  16. package/dist/npm/txiki/intl.ts +249 -0
  17. package/dist/npm/txiki/prelude.ts +132 -0
  18. package/dist/npm/txiki/runtime.ts +6 -0
  19. package/dist/npm/txiki/shims/buffer.ts +112 -0
  20. package/dist/npm/txiki/shims/child-process.ts +151 -0
  21. package/dist/npm/txiki/shims/crypto.ts +30 -0
  22. package/dist/npm/txiki/shims/events.ts +75 -0
  23. package/dist/npm/txiki/shims/fs-promises.ts +77 -0
  24. package/dist/npm/txiki/shims/fs.ts +231 -0
  25. package/dist/npm/txiki/shims/module.ts +8 -0
  26. package/dist/npm/txiki/shims/net.ts +69 -0
  27. package/dist/npm/txiki/shims/os.ts +72 -0
  28. package/dist/npm/txiki/shims/path.ts +4 -0
  29. package/dist/npm/txiki/shims/timers-promises.ts +9 -0
  30. package/dist/npm/txiki/shims/zlib.ts +9 -0
  31. package/dist/npm/txiki/tjs.d.ts +58 -0
  32. package/dist/npm/txiki/unavailable.ts +10 -0
  33. package/dist/types/core/build.d.ts +24 -0
  34. package/dist/types/core/cli.d.ts +1 -1
  35. package/dist/types/core/esbuild-file-imports.d.ts +8 -0
  36. package/dist/types/core/jsx-compile.d.ts +7 -0
  37. package/dist/types/core/node-build.d.ts +7 -0
  38. package/dist/types/core/node-dev.d.ts +4 -0
  39. package/dist/types/core/node-target.d.ts +10 -0
  40. package/dist/types/core/package-metadata.d.ts +49 -0
  41. package/dist/types/core/runtime-select.d.ts +8 -0
  42. package/dist/types/core/src/advanced-controls.d.ts +1 -1
  43. package/dist/types/core/src/app/element-events.d.ts +18 -0
  44. package/dist/types/core/src/app/media.d.ts +15 -0
  45. package/dist/types/core/src/app/requests.d.ts +25 -0
  46. package/dist/types/core/src/app/shadow.d.ts +7 -0
  47. package/dist/types/core/src/app/stats.d.ts +12 -0
  48. package/dist/types/core/src/app/tray.d.ts +40 -0
  49. package/dist/types/core/src/app-metadata.d.ts +18 -0
  50. package/dist/types/core/src/app.d.ts +89 -2
  51. package/dist/types/core/src/assets.d.ts +4 -0
  52. package/dist/types/core/src/bridge/binding.d.ts +10 -34
  53. package/dist/types/core/src/bridge/index.d.ts +1 -1
  54. package/dist/types/core/src/canvas.d.ts +161 -0
  55. package/dist/types/core/src/chat-controls.d.ts +2 -1
  56. package/dist/types/core/src/components/button.d.ts +1 -1
  57. package/dist/types/core/src/components/glass.d.ts +52 -0
  58. package/dist/types/core/src/components/icon.d.ts +1 -1
  59. package/dist/types/core/src/components/image.d.ts +8 -4
  60. package/dist/types/core/src/components/layout.d.ts +5 -4
  61. package/dist/types/core/src/components/pressable.d.ts +3 -3
  62. package/dist/types/core/src/components/rich-content.d.ts +1 -1
  63. package/dist/types/core/src/components/scroll.d.ts +2 -2
  64. package/dist/types/core/src/components/svg.d.ts +1 -1
  65. package/dist/types/core/src/components/titlebar.d.ts +15 -1
  66. package/dist/types/core/src/components/window.d.ts +21 -1
  67. package/dist/types/core/src/components.d.ts +2 -0
  68. package/dist/types/core/src/css-shadow.d.ts +1 -1
  69. package/dist/types/core/src/desktop-controls.d.ts +2 -2
  70. package/dist/types/core/src/embedded-assets.d.ts +3 -2
  71. package/dist/types/core/src/extra-controls.d.ts +2 -2
  72. package/dist/types/core/src/form-controls.d.ts +1 -1
  73. package/dist/types/core/src/html-elements.d.ts +26 -0
  74. package/dist/types/core/src/index.d.ts +23 -11
  75. package/dist/types/core/src/inline-text.d.ts +25 -0
  76. package/dist/types/core/src/intrinsic-style.d.ts +1 -1
  77. package/dist/types/core/src/jsx-runtime.d.ts +182 -5
  78. package/dist/types/core/src/media-element.d.ts +70 -0
  79. package/dist/types/core/src/memo.d.ts +28 -0
  80. package/dist/types/core/src/motion.d.ts +1 -1
  81. package/dist/types/core/src/png.d.ts +29 -0
  82. package/dist/types/core/src/popups.d.ts +4 -3
  83. package/dist/types/core/src/protocol.d.ts +6 -0
  84. package/dist/types/core/src/reconciler/diff.d.ts +11 -0
  85. package/dist/types/core/src/reconciler/intrinsics.d.ts +24 -0
  86. package/dist/types/core/src/reconciler.d.ts +33 -10
  87. package/dist/types/core/src/render-scope.d.ts +8 -0
  88. package/dist/types/core/src/style.d.ts +1 -1
  89. package/dist/types/core/src/tailwind-palette.d.ts +1 -0
  90. package/dist/types/core/src/tailwind.d.ts +8 -0
  91. package/dist/types/core/src/test-renderer.d.ts +3 -1
  92. package/dist/types/core/src/text-search.d.ts +1 -1
  93. package/dist/types/core/src/theme.d.ts +10 -2
  94. package/dist/types/core/src/updates.d.ts +87 -0
  95. package/dist/types/core/src/virtual-list.d.ts +8 -2
  96. package/dist/types/core/txiki/fetch.d.ts +1 -0
  97. package/dist/types/core/txiki/intl-data.d.ts +6 -0
  98. package/dist/types/core/txiki/intl.d.ts +92 -0
  99. package/dist/types/core/txiki/prelude.d.ts +1 -0
  100. package/dist/types/core/txiki/runtime.d.ts +2 -0
  101. package/dist/types/core/txiki/shims/buffer.d.ts +37 -0
  102. package/dist/types/core/txiki/shims/child-process.d.ts +46 -0
  103. package/dist/types/core/txiki/shims/crypto.d.ts +16 -0
  104. package/dist/types/core/txiki/shims/events.d.ts +21 -0
  105. package/dist/types/core/txiki/shims/fs-promises.d.ts +41 -0
  106. package/dist/types/core/txiki/shims/fs.d.ts +44 -0
  107. package/dist/types/core/txiki/shims/module.d.ts +5 -0
  108. package/dist/types/core/txiki/shims/net.d.ts +22 -0
  109. package/dist/types/core/txiki/shims/os.d.ts +52 -0
  110. package/dist/types/core/txiki/shims/path.d.ts +3 -0
  111. package/dist/types/core/txiki/shims/timers-promises.d.ts +7 -0
  112. package/dist/types/core/txiki/shims/zlib.d.ts +11 -0
  113. package/dist/types/core/txiki/unavailable.d.ts +5 -0
  114. package/dist/types/core/txiki-build.d.ts +23 -0
  115. package/dist/types/core/updates-build.d.ts +35 -0
  116. package/dist/types/core/windows-executable.d.ts +16 -0
  117. package/dist/types/protocol/src/index.d.ts +344 -11
  118. package/native/linux-x64/libtarve_native.so +0 -0
  119. package/native/linux-x64/runtime.json +4 -4
  120. package/native/win32-x64/runtime.json +4 -4
  121. package/native/win32-x64/tarve_native.dll +0 -0
  122. package/package.json +13 -3
package/CHANGELOG.md CHANGED
@@ -1,6 +1,131 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to `@tarve/core` and `@tarve/react-icons` are documented here. Versions follow [Semantic Versioning](https://semver.org/); before 1.0, minor versions may contain breaking changes.
3
+ All notable changes to `@tarve/core`, `@tarve/react-icons` and `@tarve/headless` are documented here. Versions follow [Semantic Versioning](https://semver.org/); before 1.0, minor versions may contain breaking changes.
4
+
5
+ ## Unreleased
6
+
7
+ ## 0.6.0 — 2026-10-15
8
+
9
+ ### Added
10
+ - Signed auto-updates: `tarve keygen` creates an Ed25519 key pair, `tarve release` copies built executables and writes a signed `latest.json` (size and SHA-256 per platform), and `checkForUpdate`, `downloadUpdate`, `installUpdate` and `canInstallUpdate` let a built app update and restart itself. Manifests, URLs (HTTPS only), versions (newer only), app names, sizes, hashes and executable formats are validated on both sides. `tarve release --sign "<command> {file}"` (or `TARVE_SIGN_COMMAND`) Authenticode-signs Windows executables before hashing. `tarve build` now bakes the app version into the executable. See `/docs/updates`.
11
+ - Tailwind utility classes on native views, with no CSS and no DOM: `class` (or `className`) on any element compiles to its native `style` at the JSX call site, and `tw("…")` returns the same `Style` for component `style` props (falsy arguments are skipped, as with `clsx`; an inline `style` wins). Covered: layout (`flex`, `grid`, `items-*`, `justify-*` including `around`/`evenly`, `gap-*`, `gap-x-*`/`gap-y-*`, `inset-*`, `z-*`), spacing and sizing (fractions, `full`, arbitrary `[12px]`/`[50%]`), the full colour palette with `/opacity` modifiers, theme tokens (`bg-primary`, `text-muted-foreground`, `border-border`, also with `/opacity`), typography (`text-sm/6`, `font-*`, `leading-*`, `tracking-*`, `truncate`, `line-clamp-*`, decorations), borders and radii (`rounded-t-lg`, `rounded-tl-*`…), `shadow-*`, `ring-*`, `outline-*`, `opacity-*`, `cursor-*`, `select-*`, `overflow-*`, transforms (`scale-*`, `translate-*`), transitions (`transition`, `duration-*`, `delay-*`, `ease-*`), gradients (`bg-gradient-to-r from-… via-… to-…`) and the `hover:`, `focus:`, `focus-visible:`, `active:`, `disabled:` and `dark:` variants. Also `mx-auto` and friends (auto margins, new in the protocol: `Margins` sides take `"auto"` and percentages), `start-*`/`end-*`, the container scale on widths (`w-xs`, `min-w-sm`), `space-x/y-*` (as a flex gap), `object-*`, `bg-radial`/`bg-conic`/`bg-linear-<angle>` with `from-10%`-style stop positions, coloured shadows (`shadow-red-500/50`), `inset-shadow-*`, `text-shadow-*`, `backdrop-blur-*`/`backdrop-saturate-*` (as the glass material), `animate-spin`, `sr-only`, `outline`, `aspect-3/2`. Breakpoints and `group-hover:` have no native counterpart and are dropped. New `examples/tailwind`: a live playground that shows the style a class list compiles to, a palette with a shade slider, per-corner radius controls, tabs, a gap slider, gradients and a runtime theme switch.
12
+ - A parity suite (`packages/core/src/tailwind-parity.test.tsx`) compiles ~230 utility classes, variants, arbitrary values, gradient and coloured-shadow combinations with the Tailwind CSS 4 compiler itself (`@tailwindcss/node`) and compares every declaration with what `tw()` produces, after resolving its theme variables, `calc()`, `oklch()` and `color-mix()`; the few intentional differences (`inline-flex`, `static`, viewport units, generic font families, `space-*` as a flex gap, `ease-*`/`delay-*` without a duration, Tailwind's transition property list) are listed and asserted there. The colour palette is Tailwind 4's OKLCH palette mapped into sRGB as browsers paint it, generated into `packages/core/src/tailwind-palette.ts` by `bun scripts/tailwind-palette.ts` (`bun run check` fails when it is stale).
13
+ - `Style.dark`: overrides applied when the window theme is dark (its background luminance below 0.5), folded by the reconciler so the native tree never sees the key; also inside inline spans.
14
+ - `Style.radius` takes an object, `{ topLeft, topRight, bottomRight, bottomLeft }`, for per-corner radii. The box, its clip, the solid border and the inner padding-box radii (shrunk by the adjacent border widths, as CSS does) follow each corner; `radius` still transitions, corner by corner. Shadows, glass and outlines use the largest corner for now.
15
+ - `Style.rowGap`/`columnGap` (CSS `row-gap`/`column-gap`), each falling back to `gap`; `justify` accepts `"around"` and `"evenly"`.
16
+ - Layout and paint keys the CSS vocabulary needed: `alignSelf`, `alignContent`, `justifyItems`, `justifySelf` (Taffy had them; the protocol now exposes them), `align: "baseline"`, `justify: "stretch"`, `textAlign: "justify"`, `pointerEvents: "none"` (the pointer falls through the box and its children) and `transform.rotate`/`skewX`/`skewY` in degrees about `originX`/`originY` (fractions of the box), all animating with `transition`.
17
+ - Style variants beyond the pointer states: `group: true` marks a box and `groupHover` applies to its descendants while it is hovered (Tailwind's `group-hover:`); `focusWithin` applies while the box or a descendant has focus; `first`/`last`/`odd`/`even` apply by position among the parent's element children; `sm`/`md`/`lg`/`xl`/`2xl` apply when the window is at least 640/768/1024/1280/1536 px wide, and the app re-renders when the width crosses a breakpoint (the root reports its size only while some style uses one). The position and width variants are folded by the reconciler, side by side (`first:pt-0` over `p-2` keeps the other three sides), so the native tree never sees them. `tw()` emits all of them: `group-hover:`, `focus-within:`, `first:`, `md:hover:`, `dark:md:`…
18
+ - `Icon` names `play`, `pause`, `skip-back` and `skip-forward`, so a transport needs no stand-in glyphs. `over(top, bottom)` composites one hex colour over another (source-over), the operation `Glass` applies to its tint.
19
+ - Glass that flows: `<Glass merge="…">` names a surface, and every glass box of one frame with the same key is drawn as one — where two come within `blend` px of each other (default 32) their shapes bridge with a smooth union, like drops of liquid, and a box fading out (`opacity`) shrinks away out of the surface. `GlassMaterial.merge`/`blend` on `style.glass` for other nodes; the D3D11 renderer fuses up to 8 shapes per surface (the first box's tint, clip and material; later ones paint where the first does). New `examples/liquid`: a weather card and a big lens over a vivid wallpaper, a dock the drops fall into and part from, and a drop that follows the pointer. The `smoke:glass` script checks that merged drops bridge their gap.
20
+ - Liquid Glass, as in iOS 26: `<Glass>` is a container whose backdrop shows through blurred and bent at its rounded edge (a lens, with a trace of chromatic aberration), saturated, under a light veil, with a bright rim on top. `variant` (`regular`, `clear`, `tinted`), `appearance` (`light`, `dark`), `tint`, `radius`, `material` overrides (`blur`, `saturate`, `refraction`, `highlight`, `magnify`) and `shadow`. The glass is a thick slab with a quarter-round edge: the flat part enlarges the backdrop slightly, the edge bends it outward (what lies past the edge is pulled into the rim, with a trace of dispersion) and reflects (a Fresnel glow, a bright edge line, a sheen top-left); the blur is light, the lens is what reads as glass. The material is the new `style.glass` (`GlassMaterial`) on any node, with `background` as its tint; the D3D11 renderer paints it (the backdrop under the box is copied, blurred in two passes and sampled through the edge's distance field; with `msaa` on, tint only), wgpu and the CPU renderer paint the tint, so a glass UI degrades to a translucent one. New `examples/glass`: a music screen with a glass tab bar, floating toolbar, search that morphs out of a button, now-playing card with a pointer-following sheen and a settings sheet; `bun run smoke:glass` checks the blur.
21
+ - `TitleBar` takes `buttonStyle`, merged into each window control (minimize, maximize, close): round 36 px controls inside a glass capsule, as in the glass example, without giving up the standard `showMinimize`/`showMaximize`/`showClose`.
22
+ - `<TitleBar glass>` (or `glass="clear" | "tinted"`, with `appearance="light" | "dark"`) is the ordinary title bar made of Liquid Glass: veil, material, rim, round controls and the appearance's ink, while `title`, `children`, `showMinimize`/`showMaximize`/`showClose` and `buttonStyle` work as before. Lay it over content for the backdrop to show. `glassSurface(variant, appearance, options)` returns the style `Glass` uses, for any node.
23
+ - `TrayOptions`, `TrayHandle`, `TrayMenuItem`, `NotifyOptions` and `SystemMediaSession` are exported from `@tarve/core`; they were the types of `app.tray()`, `app.notify()` and `app.systemMedia()` but could not be named.
24
+ - `onScroll` (Scroll, ScrollArea, VirtualList, DataGrid, MessageScroller) gets a third argument, `{ source }`: `"user"` for the wheel, scrollbar, keyboard and assistive technology, `"program"` for `scrollToItem` and every step of a smooth one, `"layout"` when rows around the anchor change height. `onScrollPosition` carries the same `source`. A view that follows something (lyrics, a log, a "fly to" animation) can now step aside when the user scrolls, without guessing from timing. Runtimes that predate it report `"user"`.
25
+ - `Window`'s `level` can change while the app runs (a `windowLevel` command follows the re-render), and `"alwaysOnBottom"` now holds on Windows: the system placed the window at the bottom only once, so showing, clicking or dragging it brought it forward. A desktop widget takes `level` too, to switch "always behind" off.
26
+ - `Window` desktop widgets: `desktopWidget={{ columns, rows }}` (Windows) makes the window a widget on the desktop icon grid, like a home-screen widget. It is sized to whole icon cells, sits below every window, off the taskbar and Alt+Tab, and when dragged (by a `dragRegion`) it drops into the nearest cells free of icons, never over one; icons that later land under it (a file saved to the desktop, an icon dragged onto it) are moved to the nearest free cell. `position` picks where it first looks for room. The parts are also separate options: `level` (`"normal"`, `"alwaysOnTop"`, `"alwaysOnBottom"`), `skipTaskbar` (Windows: no taskbar button and no Alt+Tab entry) and `frameless` (no native frame without a `TitleBar`). New `examples/widget`: a 3 × 2 clock with CPU and memory. On Linux (X11, or XWayland on a Wayland session) a widget, `skipTaskbar` and `level` set the EWMH window states (`_NET_WM_STATE_BELOW`/`ABOVE`, `SKIP_TASKBAR`, `SKIP_PAGER`, `STICKY` for widgets), and a widget takes cells of a typical icon (80 × 100); there is no desktop icon grid to follow there.
27
+
28
+ ### Fixed
29
+ - `<div onClick>` never fired: the handler was registered but the div compiled to a plain `view`, and only buttons and pressables receive native clicks. A div with `onClick` is now a `pressable`, out of the tab order unless `focusable` says otherwise, as in HTML.
30
+ - Contiguous text children of a box (`Mark {count} as read`) are one anonymous text node, as in CSS; each JSX expression used to become its own text box.
31
+ - A border with different widths per side (`borderWidth: { top: 1, right: 1, bottom: 0, left: 1 }`) on a rounded box lost its corner arcs: the sides were painted as straight rectangles clipped to the rounded shape. It is now the ring between the border box and the padding box, and the D3D11 renderer paints that ring from its distance fields (per-corner radii, antialiased on both edges) instead of the feathered path, which left a hard, jagged inner edge.
32
+ - `Glass` `tint` is laid over the variant's veil instead of replacing it: a tinted `regular` box stays frosted and legible, a tinted `clear` one shows the tint nearly alone, and `tinted` reads as its name says. A gradient tint still passes through as is.
33
+ - `<TitleBar glass>` with a `radius` in `style` is a floating capsule: full rim, drop shadow and clipped corners; without one it stays an edge-to-edge bar with a hairline at the bottom. The glass example built its controls capsule by hand from `glassChrome` and copied veil colours; it now uses the prop.
34
+ - `GlassProps.merge` documents what the renderer does: the first box of a key in tree order paints the surface (tint, material, `blend`), later ones add only their shape; `StateStyle.lineHeight` documents that it is a multiple of the font size, not px (the liquid example passed 64 and the degrees vanished).
35
+ - `app.openFileDialog`/`openFilesDialog`/`openFolderDialog`/`saveFileDialog` rejected with `Native request timed out: fileDialog` when the dialog stayed open for more than 10 s: the request meant to wait forever fell back to the default timeout. A dialog now waits for the user.
36
+ - Uncontrolled state (`<input type="checkbox">` without `checked`, `<details>`, an open `<Select>`, a hovered `Tooltip`, `<audio>` playback) belongs to the app that rendered it: `app.remount()` and a second `createApp` in the same process (tests) start clean instead of inheriting it.
37
+ - `dragRegion` on a plain `View`/`Column` now moves the window from anywhere on it, its plain text included; it only worked on `TitleBar`, which also blocks pointer events. Controls inside still get their own presses.
38
+ - An update sent right as the window closed (a timer ticking while the user clicks ✕) reported `Tried to wake up a closed EventLoop`: commands that reach a closed window are now dropped, as `closed` is already on its way.
39
+ - `skipTaskbar` on Windows stays in effect after the window is hidden, shown or changes `level`: winit rewrote the extended window style on each of those and the window came back in Alt+Tab.
40
+ - A `Window` smaller than 780×580 without `minWidth`/`minHeight` opened at 780×580: the default minimum now never exceeds the requested size. Double-clicking a drag region no longer maximizes a non-resizable window.
41
+ - A hotkey made of a typing key (`Space`, a letter, `Enter`, an arrow…, alone or with Shift) no longer fires while a text field has focus: typing a space in a search box also toggled playback in the player and YouTube Music examples. Chords (`Ctrl+K`), F-keys and `Escape` still fire.
42
+ - `app.focus` and `app.scrollToItem` called right after `app.update()` (or a state change in an event handler) reach the nodes that render adds: they used to go out before the queued render and miss a field or list it was about to create.
43
+ - `app.scrollToItem` on a list that is not mounted (another page, a hidden panel) does nothing, like `scrollIntoView` on a detached element, instead of reporting an error. A mounted node that is not a variable `VirtualList` still errors.
44
+ - `<audio src="https://…">` from googlevideo (YouTube) failed on many songs: the CDN answers 403 to a second request to a file while one is in flight, and to a range behind what it already served, and the stream used four parallel connections plus jumps for seeks. A remote file now downloads in one forward pass (4 MB ranges, one connection; a seek more than 8 MB ahead, as in a long podcast, starts a pass there), retrying 403, 429, 5xx and network errors with backoff (not 404). A 40-song soak went from 32 errors to none, in a third of the time; first sound ~0.6 s.
45
+ - `<audio>` follows the output device: when it goes away (unplugged, sleep, a driver restart) or the default output changes, a new output stream plays on from the same sample. Tracks are mixed (in the first device's own format, so samples are converted once) into one mix that outlives output streams, so nothing is reopened, reloaded or sought (a switch used to restart the song, and failing to seek could skip it).
46
+ - `<audio>` never blocks the window on the audio thread: rodio's `try_seek` and `clear` wait for the audio thread to acknowledge, so a stalled network read or a lost device froze the whole app on the next seek or song change. Seeks now run on a helper thread (`seeked` fires once done) and a replay swaps in a new player.
47
+ - A remote `<audio>` whose network stalls for 30 s reports an error (the page can reload it) instead of ending as if the track were over.
48
+
49
+ ### Performance
50
+ - Each update no longer copies every native node into the shadow tree the reconciler diffs against; nodes are shared with the compiled tree and copied only when native edited them (typed text, a dragged slider). Nodes without handlers no longer allocate a 32-slot handler record. On a 2 000-row list (6 000 nodes) one update went from ~23 ms to ~19 ms of TypeScript time and the retained heap from 12.5 MB to 7.2 MB; at 30 000 nodes, 140 ms → 112 ms and 54 MB → 26 MB (`bun run bench:reconcile`). Rendering a list through `memo` stays the real win: 2.9 ms → 2.0 ms on the same tree.
51
+ - A window hidden with `app.hide()` (close to tray) drops its GPU device, swap chain and textures, stops animation ticks and layout, and trims its working set; `app.show()` builds them again and paints before the window appears. Measured on Windows with an animated window: GPU memory 29 MB → 0, CPU 3–10% → 0, threads 48 → 25, working set 39 → 20 MB; showing again takes ~80–130 ms. Minimized windows also stop animation ticks. `capture()` of a hidden window still works: it builds a renderer for that frame and gives it back.
52
+
53
+ ## 0.5.0 — 2026-10-12
54
+
55
+ ### Performance
56
+ - D3D11 draws circles, rounded rectangles with one radius and round SVG dots (zero-length round-capped segments, as dot-matrix charts use) as one quad each from a distance field, instead of flattening, tessellating and feathering an outline. On the Pulse example (eight dot charts refreshed every second) the app process went from ~3.2% to ~1.9% of a core and from ~120 MB to ~77 MB of working set.
57
+ - `@tarve/react-icons` adapters remember their result per icon component and props (`memoizeAdapter`), so an icon on screen runs its React component and serializes its SVG once, not on every update.
58
+
59
+ ### Added
60
+ - App icon and metadata from one place: a `"tarve"` field in `package.json` (`name`, `description`, `publisher`, `copyright`, `icon`, `appId`, per-entry overrides under `apps`) or `tarve build --icon/--publisher/--copyright/--description/--app-id`. `tarve build` writes them into the executable (Bun and Node builds alike: multi-size `.ico`, version info, no Node.js branding) and writes a `.desktop` file with the icon on Linux. `createApp({ icon })` sets the window and taskbar icon (PNG or ICO, Windows and Linux), and `app.tray()` without its own `icon` shows it too; `tarve run`/`dev` and built apps pick the icon, name and app id up from the metadata, so media controls and notifications are named without an explicit `appIdentity`.
61
+ - `<Image src="https://…">` (and `<img>`): the native side fetches and decodes a URL on worker threads the first time the image is painted, so off-screen images are not downloaded, then lays it out with its decoded size. Up to six downloads run at once, newest first; a failed image is tried again when it is shown again; a remote SVG never reads local files through `<image href>`; responses with `Cache-Control: max-age` go to a disk cache. `@tarve/headless` fetches them with `fetch()` and `settle()` waits for them. Apps no longer need `loadImageSource` plus their own visibility tracking; the YouTube Music example dropped its artwork loader and every scroll listener it kept for it.
62
+ - `app.scrollToItem(id, index, offset, { smooth: true })` eases a variable VirtualList to the item on the native motion clock (300–900 ms by distance) and reports each step through `onScroll`; wheeling cancels it. The performance example's 16 ms `setInterval` scroll animation is gone.
63
+ - `inspect().fps`: frames presented in the last second, so a frame-rate meter no longer differences frame counters itself.
64
+ - `<Tooltip>` without `open` is uncontrolled: it shows while its trigger is hovered, one tooltip at a time, so apps no longer track which tip is open. `open` + `onOpenChange` still control it.
65
+ - Intrinsic `<div>` follows more of CSS: `overflow: "auto"`/`"scroll"` makes it a scroll container (vertical; `overflowX` adds the horizontal axis), `display: "flex"` lays children in a row unless `flexDirection` says otherwise, and `alignItems`, `justifyContent` and `borderRadius` alias `align`, `justify` and `radius`. `<img style={{ objectFit }}>` sets its fit. `<label htmlFor>` can point at a `<meter>` or `<progress>`.
66
+ - `fontVariantNumeric` (`tabular-nums`, `slashed-zero`, …) and `fontFeatureSettings` (`'"ss01" 1'`), as in CSS; both inherit. Tabular digits keep live numbers from jittering.
67
+ - `onPointerMove({ x, y })` and `onPointerLeave()` on any element: the pointer's position inside it (DOM `offsetX`/`offsetY`) while it is over the element or its children, for scrubbing charts and other hover readouts. The test renderer's locators gain `hover(offset?)`.
68
+ - `scrollbarWidth: "none" | "thin"` on scroll areas and text areas, as CSS `scrollbar-width`: `none` hides the bar and its hit area, the box still scrolls.
69
+ - `import font from "./Inter.ttf" with { type: "file" }` (and `.otf`, `.woff2`, `.webp`) type-checks.
70
+ - Windows media controls: `app.systemMedia({ title, artist, album, artwork, playing, duration, position, canSeek, canNext, canPrevious, onAction })` shows the current track in the system media flyout and lock screen, and forwards play, pause, next, previous and seek (hardware media keys included) to `onAction`; `null` clears it. The `appIdentity: { id, name, icon? }` option names the app there and in notifications instead of the host executable or "Unknown app".
71
+ - `examples/pulse.tsx`: a clone of the Pulse system monitor with live data a user program can read on Windows without administrator rights: CPU and per-core load, load averages, temperatures, package and GPU power, energy by app, the memory split (app, wired, compressed, cached, free), GPU, disk, network, battery health and cycles, and every process with its program icon. Ships its font and uses Phosphor icons.
72
+ - `app.setMaxFps(fps)` and the `maxFps` option set the animation frame rate (transitions, `spin`, keyframes); `null` follows the display's refresh rate. Animations stay clock-based, so a lower rate draws fewer frames at the same speed. The clock now ticks on a fixed grid: a late frame no longer delays the next one, so 60 fps animations run at 60 instead of ~52. Example: `examples/fps.tsx`. Native protocol v55.
73
+ - `<audio src controls autoPlay loop muted volume>` with the browser's default control bar (play/pause, time, seek, mute) and `onLoadedMetadata`, `onPlay`, `onPause`, `onTimeUpdate`, `onSeeked`, `onEnded`, `onError`. Play after the end starts over, as in `HTMLMediaElement`. `app.media(id)` plays, pauses, seeks and sets volume. MP3, WAV, FLAC, Ogg Vorbis and AAC/MP4 decode in pure Rust (rodio): WASAPI on Windows, ALSA on Linux (`libasound2` at runtime, `libasound2-dev` to build). Without an output device, or with `TARVE_AUDIO=silent`, playback runs on a real-time silent clock so time and `ended` still advance. `bun run smoke:media` checks the lifecycle. Native protocol v54.
74
+ - `<audio src="https://…">` streams: playback starts once the first 256 KB chunk arrives (≈0.15 s on YouTube's CDN), the rest downloads behind it over up to four HTTP range connections (rustls via `ureq`, no system TLS), and a seek fetches the chunk it lands in first. Servers without range support still stream in order. Remote MP4s open unseekable so they start before the file is in; the first seek builds a seekable decoder in the background and then emits `seeked`. A connection that fails mid-way reports `error`, not `ended`.
75
+ - `memo(Component, equal?)`: a component whose compiled subtree is reused while its props are equal (shallowly by default), so an update renders, compiles and diffs only the components whose props changed. Reused subtrees keep their native shadow, so the diff skips them by identity; subtrees tied to a `<label htmlFor>` elsewhere, or containing the `Window`, always recompile. In the YouTube Music example the clock ticking during playback costs 1.4 ms per update instead of 30 ms.
76
+ - `onSize` on any node (a ResizeObserver): native sends the content-box size on first layout and whenever it changes, window resizes included.
77
+ - `VirtualList` without `height` fills its parent (`flex: 1`) and follows its real laid-out height through `onSize`; it needs an `id`. Fixed, variable and windowed lists all support it.
78
+ - A handler that runs inside a `memo` subtree recompiles that subtree on the next render, so components keeping their own state (VirtualList's measured height) stay current.
79
+ - Anonymous nodes are named from their nearest node instead of the root, so scrolling a virtual list sends about 40% fewer bytes per step; memo bookkeeping no longer rescans every compiled node on each cache miss.
80
+ - Decoded images are shared by `key`: a new node showing a cached key reuses the decode, and images no node shows stay decoded (up to 256, 32 MB of CPU pixels; on D3D11 only the texture) so a list row scrolling back or a page reopening decodes nothing. Returning to the YouTube Music home (125 covers): 104–126 ms → 58–68 ms. Byte sources are base64-encoded once per source object. Measured and rejected: a binary bridge for image bytes, which saved under 0.1 ms per cover against 0.35 ms of JPEG decode.
81
+ - `memo` keeps nested memoized components alive from a list recorded at compile time instead of scanning every cache entry on each hit: an update of 2,000 memoized rows went from 19 ms to 3.7 ms of JS.
82
+ - Text measurement is cached per width, and any width at least as wide as the unwrapped line reuses the unwrapped size: a window resize relayouts 2,000 labelled rows in 18 ms instead of 21.5 ms, and 400 wrapped paragraphs in 9 ms instead of 13 ms.
83
+ - `createApp({ headless: true })` (tests, captures, `createTestRenderer`) renders on the CPU unless a `renderer` is given: a hidden window never reaches the screen, so it no longer loads the GPU driver. Empty headless app on Windows: 138 MB → 51 MB working set, first frame 86 ms → 20 ms.
84
+ - Windows: once a window has been idle for `memoryTrimDelay` ms (default 3000) after its last frame, the pages only startup touched (driver and shader setup) are handed back with `EmptyWorkingSet` (the first time even while animating: startup's pages are done with by then; later only after the window has been still that long); they stay committed and return from the standby list if touched. Counter app: 50 MB → 3 MB private working set (Task Manager). `memoryTrimDelay: false` turns it off; `TARVE_TRIM` (ms, 0 = off) overrides it.
85
+ - D3D11 no longer multisamples by default: `msaa: 0` (the default) gives filled and stroked shapes a one-pixel coverage fringe instead, ~30 MB less memory (counter app: 80 → 50 MB private working set, 259 → 229 MB committed). Without MSAA, a rectangle, rounded rectangle or circle clip (`overflow: hidden` with `radius`, gradient fills, nested scroll areas, also rotated, e.g. spinning) is applied in the pixel shader with coverage, as MyGo does; other `clip-path` shapes and hard stops inside gradients stay aliased. `msaa: 2 | 4 | 8` (or `TARVE_MSAA`) brings MSAA back.
86
+ - D3D11 keeps an uploaded image only as its texture: the decoded CPU pixels are released after upload and decoded again from the node if the texture is lost, and fully restored when another renderer takes over. 30 screenshot-sized images: 622 MB → 429 MB working set.
87
+ - `<canvas width height onDraw={ctx => …}>` with the Canvas 2D API: paths (`moveTo`, `lineTo`, `quadraticCurveTo`, `bezierCurveTo`, `arc`, `arcTo`, `ellipse`, `rect`, `roundRect`), `fill` (nonzero/evenodd), `stroke` (width, caps, joins, miter limit, dashes), `fillRect`/`strokeRect`/`clearRect`, linear and radial gradients, `save`/`restore`, `translate`/`rotate`/`scale`/`setTransform`, `globalAlpha` and `fillText`/`strokeText` with the CSS `font` shorthand. Each render records into a vector scene, sharp at any DPI. `bun run test:canvas` compares 10 drawings pixel by pixel with Chromium's canvas.
88
+ - `<sub>` and `<sup>`: `vertical-align: sub | super` with `font-size: smaller`, shifting by Chromium's parent size / 5 + 1px and / 3 + 1px, nesting, and growing the line box (and the lines below it) to contain the shifted text; selection and caret follow. The CSS parity suite checks them against Chromium within 2px.
89
+ - `<input type="color">` (swatch, palette and hex field; values normalize to lowercase `#rrggbb`) and `<input type="time">` (`HH:MM`, 24-hour; invalid entries submit as empty, as in HTML).
90
+ - `display: "block"`: CSS block flow, where adjacent vertical margins collapse (Taffy's block layout). In a flex container margins add up, as in CSS. The CSS parity suite covers collapsing paragraphs and headings (49 layouts).
91
+ - **Breaking:** HTML block elements get the browser's user-agent margins: `<p>` and `<pre>` 1em above and below, `<h1>`–`<h6>` 0.67em–2.33em, lists and `<dl>` 1em, `<blockquote>` 1em 40px. `Text`, `View` and the other components are unchanged; set `margin` to override.
92
+ - `cursor` style (CSS keywords, inherited by descendants). `gridColumn`/`gridRow` placements (`"span 2"`, `"1 / 3"`), and table `colSpan`/`rowSpan`. `<pre>`, `<blockquote>`, `<meter>` and `<abbr title>`. The CSS parity suite covers spanning tables, `pre` and `blockquote` (46 layouts). Native protocol v53.
93
+ - HTML elements: `<input type="checkbox" | "radio" | "range" | "date" | "file">` (radios grouped by `name`; `accept`/`multiple` for files through the native dialog); `<form onSubmit onInvalid>` collecting named values on Enter or a submit button, with `required`, and `<button type="button">` opting out; `<fieldset>`/`<legend>`; `<ul>`, `<ol start>`, `<li>`, `<dl>`/`<dt>`/`<dd>` with the user-agent 40px indent; `<table>` with `caption`/`thead`/`tbody`/`tfoot`/`tr`/`th`/`td` as auto columns with `border-spacing: 2px` and 1px cell padding; `<details>`/`<summary>`. Uncontrolled elements keep their state like the DOM. The CSS parity suite adds lists and a table against Chromium (43 layouts). Bare string children now inherit text style like any text. Example: `examples/html.tsx`.
94
+ - Text properties are inherited like CSS. `fontFamily`, `fontStyle`, `letterSpacing`, `wordSpacing` and `textTransform` reach every text descendant (text, buttons, inputs, Markdown); `color`, `fontSize`, `fontWeight`, `lineHeight`, `textAlign` and `whiteSpace` also reach `Text`/`p`/`span`/headings and `Markdown`, while controls keep their own size, weight and colour. Set them on a `Window` or any container; a node's own value wins. The theme gives the root's initial values; `Code`, `Diff` and `<code>` stay monospace.
95
+ - **Breaking:** text follows CSS `white-space: normal` by default: runs of spaces and newlines collapse to one space and leading/trailing spaces are dropped. Use `whiteSpace: "pre-wrap"` (or `"pre"`/`"pre-line"`) to keep them, or `<br />` for a line break.
96
+ - CSS text and overflow: phrasing elements inside a paragraph (`strong`, `b`, `em`, `i`, `u`, `s`, `del`, `ins`, `code`, `kbd`, `mark`, `small`, nested `span`, `a`, `br`) become styled runs of one text node with Chromium's user-agent styles and relative `bolder`/`smaller`; `<a href>` and `<span onClick>` inside text are click targets. New styles `fontStyle`, `letterSpacing`, `wordSpacing`, `textTransform`, `whiteSpace` (`normal`/`nowrap`/`pre`/`pre-wrap`/`pre-line`), `textOverflow: "ellipsis"`, `lineClamp` and `overflow: "hidden" | "clip"` (clips children and lets the box shrink below its content). Links and clickable spans inside text show the pointer cursor. `fontFaces` in `createApp` options loads app font files like CSS `@font-face`, and variable fonts follow `font-optical-sizing: auto` (the `opsz` axis tracks the font size). The CSS parity suite covers 15 text cases against Chromium with the bundled Inter on every OS, plus two overflow cases; `bun run smoke:text` checks the painted `<mark>`, ellipsis, clamp and clip pixels. Example: `examples/text.tsx`. Native protocol v52.
97
+ - Windows: dragging a window between monitors with different display scaling keeps its size; it grew by the scale ratio on every crossing and could bounce on the boundary. A window with a custom `TitleBar` can be dragged again right after a move.
98
+ - `@tarve/headless`: renders and tests Tarve apps with the WebAssembly build of the native tree, with no window, GPU or native library. `renderToPng`/`renderToRgba`, `createHeadlessApp`, `createHeadlessTestRenderer` (the `TestRenderer` API) and `matchImageSnapshot`. Text uses bundled Inter and JetBrains Mono and time only moves with `advanceMotion`, so a view renders to the same bytes on every machine. CI runs its image snapshots on Linux, Windows and macOS; releases publish it next to `@tarve/core`.
99
+ - `style.spin`: continuous rotation about the centre, one turn per `spin` milliseconds, driven by the native clock. `Spinner` uses it.
100
+ - `destructiveText` theme colour for error text and icons.
101
+ - Pointer drag and drop. `draggable` on `Pressable` turns a press that travels past 4px into a drag (a short press still clicks); `onDragStart`, `onDragMove` and `onDragEnd` report position, the target under the pointer and whether the drag was cancelled (Escape or window blur). Any view with `onDrop`, `onDragEnter` or `onDragLeave` becomes a drop target; the innermost visible target wins, targets inside the dragged node, clipped by a scroll area, disabled or behind a modal are skipped. Example: `examples/drag-and-drop.tsx`. Native protocol v49.
102
+ - System tray and notifications on Windows and Linux: `app.tray({ icon, tooltip, menu, onClick, onDoubleClick, onMenu })` shows a tray icon with a native menu (items, separators, checkmarks, disabled items, submenus); `update()` changes it in place. `app.notify({ title, body, onClick })` shows a desktop notification. `app.show()`, `app.hide()`, `app.minimize()` and `closeBehavior: "hide"` keep an app running in the tray. Windows calls `Shell_NotifyIconW`/`TrackPopupMenu` directly (no new dependency) and re-adds the icon after Explorer restarts. Linux publishes a StatusNotifierItem with dbusmenu (`ksni`) and uses org.freedesktop.Notifications (`notify-rust`), both pure-Rust zbus; KDE, XFCE, Cinnamon, MATE and most wlroots bars show it natively, GNOME needs the AppIndicator extension (the app gets an error event otherwise). `onDoubleClick` maps to middle click on Linux. Icons are read in JS so compiled executables can use imported assets. `bun run smoke:tray` drives the real icon and menu on both systems. Example: `examples/tray.tsx`. Native protocol v50.
103
+ - CSS flex and grid sizing: `flex` accepts the CSS shorthand (`"1 1 176px"`, `"auto"`, `"none"`), plus `grow` and `basis`. Grid `columns` and new `rows` accept CSS track lists, including `repeat(auto-fill, minmax(176px, 1fr))`, `fr`, percentages and `auto`. `bun run test:css-layout` lays out 23 cases in Chromium and in Tarve and fails on any box more than a pixel apart. Native protocol v51.
104
+ - Node.js 26.10+ runtime alongside Bun: the same TSX apps run through `node:ffi`. One CLI for both: `tarve run|dev|build` uses the runtime that launched it (`bunx`/`bun run` → Bun, `npx`/`npm run` → Node 26.10+, or Bun as before on older Node; `--runtime` overrides). Node builds are single-executable apps with the native library and imported assets embedded, the same GUI subsystem and app name/version metadata as Bun builds; `dev` remounts into the same window on edits; `--target linux-x64`/`windows-x64` cross-compiles by downloading (checksum-verified, cached) the matching official Node.js binary, and `--target-executable` supplies one offline. `build({ runtime: "node" })` and `@tarve/core/build-node` expose the same from code. `TestRenderer`, `launchTestProcess` and `readPngRgba` no longer depend on Bun APIs.
105
+
106
+ ### Fixed
107
+ - HTML elements look like a browser's defaults: a `<fieldset>`'s `<legend>` sits on its top border (regular weight, a 1px light grey border), `<meter>` is green and `<progress>` blue in a light grey track (160×16px, as in Chrome; `Progress` takes its fill colour from `style.foreground`), a `<table>` is as wide as its content, and `<details>` uses a chevron where the ▸ glyph had no font.
108
+ - HTML forms: a named `<select>` and `<textarea>` submit with their `<form>` (`name`, `required`, `defaultValue`), like inputs. An uncontrolled `<select>` shows `defaultValue` or its first enabled option and keeps the user's choice; it showed the placeholder and forgot the choice.
109
+ - Text and phrasing elements (`strong`, `code`, `a`, …) inside `<li>`, `<dt>` and `<dd>` flow into one line box, as in CSS; each element was laid out as its own block. A table `<caption>` is centred over the table.
110
+ - `closeBehavior: "hide"` hides the window from its own close button again; the custom title bar's close button closed the app.
111
+ - A column of auto height whose child has `flex: 1` (basis 0) is as tall as its content when its row sits in a sized parent, as in browsers; it came out as if the child were empty. Fixed in a vendored Taffy 0.14 (`native/vendor/taffy`, one change marked "Tarve patch").
112
+ - Headless (hidden) windows lay out as soon as the tree changes, so `onSize` and virtual-list events arrive without waiting for a capture; nodes created after the first render never got `onSize`.
113
+ - Windows (D3D11) without MSAA: a path of many small shapes (an SVG dot matrix) is no longer quadratic in its contour count; 1,800 dots updated once a second went from ~11% to ~2% of a core.
114
+ - Thin dotted underlines (`text-decoration-style: dotted`, `abbr[title]`) draw square dots snapped to device pixels, as browsers do; round 1px dots smeared into a grey line at fractional scales, on the CPU renderer most visibly.
115
+ - Changing an `<Image>`'s byte source (its `cacheKey` or bytes) on an existing node now repaints; the diff ignored `image` and sent nothing.
116
+ - An explicit `minWidth` on an item with numeric `flex` is respected; it was reset to 0. Grid `auto` tracks stretch to fill the container, as in CSS. `DataGrid` rows and sortable headers are square instead of inheriting `Pressable` rounding.
117
+ - `examples/drag-and-drop-view.tsx` used the unsupported `justify: "space-between"` and failed the package smoke typecheck; it now uses `"between"`.
118
+ - A modal opened with the mouse no longer paints the keyboard focus ring on its first control, and closing it no longer rings the trigger.
119
+ - `Tooltip` text no longer wraps to the width of its trigger; `Command` lists no longer clip with group headings; the search field of `Command` and `Combobox` no longer draws a ring across its icon.
120
+ - `Alert`, `Field` errors and failed `Attachment`s use readable destructive text; `Alert` tints an uncoloured icon; `Field` shows the description with the error; `InputGroup` strips its `Input`'s border; `NavigationMenu` triggers show open and current state.
121
+ - `getByRole("button", { name })` finds plain `Button`s.
122
+ - `InputGroup` is clickable across its whole box: presses on the prefix, suffix or padding focus the field (text cursor included), and the group shows a focus border. New style value `pointerEvents: "delegate"` sends presses on a node's own area to its first enabled input or textarea and gives the node that field's focus state.
123
+
124
+ ### Changed
125
+ - Windows (D3D11): 8x MSAA renders through a fixed 256px tile instead of window-sized targets, and each tile is hashed so an unchanged one is reused from the last frame. Memory no longer grows with the window (2560×1400: 369 → 151 MB of working set) and a hover redraws only the tiles it touches (player example: median GPU time per hover frame 3.9 → 1.3 ms). Linear-gradient bands are cut to the shape's box instead of covering ~7× its area, and draws inside a clip only mark the clip's tiles dirty; the tile hash is computed once per command per frame. With 600 spinning gradient squares: tiles redrawn per frame 16 → 12, CPU time per frame 3.2 → 0.85 ms. Output is identical (gradient edges within 1/255).
126
+ - **Breaking:** `flex` follows CSS. `flex: 1` is now `flex: 1 1 0` with CSS's automatic minimum size: the item shrinks when space runs out but not below its content. Before, a numeric `flex` never shrank and could be squeezed below its content. Add `minWidth: 0` (or `minHeight: 0` in a column) where content should be clipped or scroll instead of pushing the layout, as in CSS. Scroll areas already do this.
127
+ - **Breaking:** every flex item shrinks by default (`shrink: 1`, CSS `flex-shrink: 1`), never below its content; sized `Image`s and `Svg`s keep their size like CSS replaced elements. Set `shrink: 0` to keep a fixed size when space runs out.
128
+ - Startup: the native tree takes the startup document's nodes instead of deep-cloning them (~11 ms and ~23 MB less for a 2,000-row list), and the first layout and text shaping run while the prewarmed D3D11 device finishes. First paint of a 2,000-row list on D3D11 drops from ~384 ms to ~349 ms.
4
129
 
5
130
  ## 0.4.0 — 2026-10-01
6
131
 
package/README.md CHANGED
@@ -6,7 +6,7 @@ Tarve turns a TSX tree into a retained native interface. It does not use a brows
6
6
 
7
7
  > **Current supported targets:** Windows x64 and Linux x64
8
8
  >
9
- > **Runtime:** Bun 1.4+
9
+ > **Runtime:** Bun 1.4+ or Node.js 26.10+
10
10
  >
11
11
  > **Package:** [`@tarve/core`](https://www.npmjs.com/package/@tarve/core) (CLI: `tarve`)
12
12
  >
@@ -75,32 +75,37 @@ await app.ready;
75
75
  await app.closed;
76
76
  ```
77
77
 
78
- Run the source directly with Bun:
78
+ Run it with the `tarve` CLI, under Bun or Node.js 26.10+ — the same commands work with either:
79
79
 
80
80
  ```powershell
81
- bun app.tsx
81
+ bunx tarve run app.tsx # Bun
82
+ npx tarve run app.tsx # Node.js
83
+ bunx tarve dev app.tsx # hot reload into the same window (npx tarve dev on Node)
82
84
  ```
83
85
 
86
+ `tarve` uses the runtime that launched it: `bunx`/`bun run` pick Bun, `npx`/`npm run` pick Node (Bun, as before, when Node is older than 26.10). `--runtime bun|node` overrides it. With Bun you can still run the source directly with `bun app.tsx`.
87
+
84
88
  ## Build a standalone executable
85
89
 
86
90
  The package CLI compiles a Tarve application into a standalone executable and embeds the native runtime. Windows produces a `.exe`; Linux produces an ELF executable with no required extension. The target defaults to the current host. Published Tarve packages contain both Windows x64 and Linux x64 native runtimes, so `--target` can switch between those targets without rebuilding Tarve's Rust runtime.
87
91
 
88
92
  ```powershell
89
- bun run tarve build app.tsx --outfile dist/App.exe
93
+ bunx tarve build app.tsx --outfile dist/App.exe # Bun executable
94
+ npx tarve build app.tsx --outfile dist/App.exe # Node.js executable
90
95
  ```
91
96
 
92
97
  ```bash
93
- bun run tarve build app.tsx --outfile dist/App
98
+ bunx tarve build app.tsx --outfile dist/App
94
99
  ```
95
100
 
96
101
  Cross-compile explicitly from either Windows x64 or Linux x64:
97
102
 
98
103
  ```bash
99
- bun run tarve build app.tsx --target windows-x64 --outfile dist/App.exe
100
- bun run tarve build app.tsx --target linux-x64 --outfile dist/App
104
+ bunx tarve build app.tsx --target windows-x64 --outfile dist/App.exe
105
+ npx tarve build app.tsx --target linux-x64 --outfile dist/App
101
106
  ```
102
107
 
103
- The published package already contains both runtimes, so `tarve build` needs no Rust toolchain.
108
+ The published package already contains both runtimes, so `tarve build` needs no Rust toolchain. Both runtimes produce a GUI executable (no console window on Windows) named and versioned after the app (`--name`, `--version`).
104
109
 
105
110
  The build API is also exported:
106
111
 
@@ -115,6 +120,41 @@ await build({
115
120
  });
116
121
  ```
117
122
 
123
+ ## Auto-updates
124
+
125
+ Built apps can update themselves from signed releases hosted on any HTTPS server (GitHub Releases, S3/R2, a CDN). The full guide is at [tarve.dev/docs/updates](https://tarve.dev/docs/updates).
126
+
127
+ ```bash
128
+ bunx tarve keygen # once: ./tarve-update.key (secret) + the public key
129
+ bunx tarve build app.tsx --version 1.2.0 --outfile dist/App.exe
130
+ bunx tarve release --version 1.2.0 --artifact win32-x64=dist/App.exe --out dist/updates \
131
+ --sign "signtool sign /fd sha256 /tr http://timestamp.digicert.com /td sha256 /a {file}" # optional Authenticode
132
+ # upload dist/updates: the executables first, latest.json last
133
+ ```
134
+
135
+ ```ts
136
+ import { canInstallUpdate, checkForUpdate, downloadUpdate, installUpdate } from "@tarve/core";
137
+
138
+ const update = await checkForUpdate({ url: "https://example.com/app/latest.json", publicKey: "…" });
139
+ if (update && canInstallUpdate()) installUpdate(await downloadUpdate(update, { onProgress: (n, total) => {} }));
140
+ ```
141
+
142
+ `latest.json` is signed with Ed25519 and lists the size and SHA-256 of each platform's executable; the app checks the signature, only accepts newer versions, HTTPS URLs and a matching app name, and verifies the download before `installUpdate` swaps the executable and restarts. `--sign` (or `TARVE_SIGN_COMMAND`) runs your Authenticode tool on each Windows executable before it is hashed. Self-updating needs a writable install folder (per-user or portable); `canInstallUpdate()` is false under `Program Files` or a package manager. txiki.js builds are not supported yet.
143
+
144
+ ## Node.js runtime
145
+
146
+ The same TSX components, desktop APIs, renderer modes and native bridge run on Node.js 26.10+ with the same `tarve run|dev|build` commands; a Node-only project needs neither Bun nor Rust:
147
+
148
+ ```powershell
149
+ npm install @tarve/core
150
+ npx tarve dev app.tsx
151
+ npx tarve build app.tsx --outfile dist/App.exe
152
+ ```
153
+
154
+ `dev` rebuilds TSX and remounts into the same native window when the entry uses `await render(App)`, as with Bun's hot mode. Node builds compile TSX with esbuild and embed the app and native library in a Node.js single-executable application. Node's FFI and single-executable APIs are experimental in Node 26.
155
+
156
+ The shared build API also accepts `build({ entrypoint: "app.tsx", runtime: "node" })` from `@tarve/core/build`, and Node-only tooling can call `buildNode` from `@tarve/core/build-node`. Cross-compiling works as with Bun: `npx tarve build app.tsx --target linux-x64 --outfile dist/App`. The first build for a target downloads the official Node.js binary of the same version as the Node running the build from nodejs.org (or `NODEJS_ORG_MIRROR`), checks it against the release `SHASUMS256.txt` and caches it (`TARVE_CACHE_DIR`, by default `%LOCALAPPDATA%\tarve\cache` or `~/.cache/tarve`). Offline or with a custom Node build, pass it with `--target-executable path/to/node`; it must be the same Node.js version. As with Bun, the packaged native runtime for that target must match the current protocol.
157
+
118
158
  ## Renderers
119
159
 
120
160
  `createApp` accepts `renderer: "auto" | "gpu" | "cpu"`.
@@ -178,7 +218,7 @@ function App() {
178
218
 
179
219
  Every colour property (`background`, `foreground`, `borderColor`, `outlineColor`, rich-content and diff colours, state styles and the window background) accepts hex (`#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`), `rgb()`/`rgba()`, `hsl()`/`hsla()`, common names such as `transparent` or `white`, and theme tokens. Unsupported colour strings throw when the view is compiled instead of rendering black.
180
220
 
181
- `transform` translates and scales a node and its subtree about the box centre: `{ x, y, scale, scaleX, scaleY }` or CSS syntax such as `"translateY(-2px) scale(1.02)"`. It is paint-only (layout does not move) but hit testing and hover follow the transformed box, and it transitions like other paint properties. Rotation is not supported yet.
221
+ `transform` translates, scales, rotates and skews a node and its subtree: `{ x, y, scale, scaleX, scaleY, rotate, skewX, skewY, originX, originY }` (angles in degrees; the origin is a fraction of the box, the centre by default) or CSS syntax such as `"translateY(-2px) scale(1.02)"`. It is paint-only (layout does not move) but hit testing and hover follow the transformed box, and it transitions like other paint properties. `radius` takes a number or per-corner `{ topLeft, topRight, bottomRight, bottomLeft }`; `margin` sides take `"auto"` to centre a box or push it aside, as CSS auto margins do.
182
222
 
183
223
  Borders accept `borderStyle` with the same values as `outlineStyle` (`dashed`, `dotted`, `double`, `groove`, `ridge`, `inset`, `outset`, `none`); non-solid styles apply when all four border widths are equal. Text, button labels, `Input` and `TextArea` accept `textShadow: { x, y, blur, color }`, an offset copy of the glyphs (`blur` is the CSS blur radius; 0 is a solid copy, larger values blur it identically on every renderer); it also works inside state styles such as `hover`.
184
224
 
@@ -201,6 +241,36 @@ Both shadows also accept CSS syntax: `boxShadow: "inset 0 1px 2px rgba(0,0,0,.2)
201
241
 
202
242
  Create derived themes with `createTheme` or `Theme.create`. Theme tokens cover surfaces, foregrounds, borders, focus outlines, selection, caret, scrollbars, modal overlays, rich-content colors, and control states.
203
243
 
244
+ Besides `hover`, `focus`, `focusVisible`, `active` and `disabled`, a style can carry `groupHover` (applied while an ancestor with `group: true` is hovered), `focusWithin` (while the box or a descendant has focus), `dark` (under a dark window theme), `first`/`last`/`odd`/`even` (by position among the parent's element children) and `sm`/`md`/`lg`/`xl`/`2xl` (window at least 640/768/1024/1280/1536 px wide; the app re-renders when the width crosses a breakpoint). The last three groups are folded by the reconciler, so the native tree never sees them.
245
+
246
+ ## Tailwind classes
247
+
248
+ Tailwind CSS utility classes work on every element, with no CSS and no DOM: `class` (or `className`) compiles to the element's native `style` at the JSX call site, and `tw("…")` returns the same `Style` for component `style` props. Later classes win and an inline `style` wins over classes, as in CSS.
249
+
250
+ ```tsx
251
+ import { Column, Text, Window, tw } from "@tarve/core";
252
+
253
+ function Card({ active }: { active: boolean }) {
254
+ return (
255
+ <Window>
256
+ <div class="group flex flex-col gap-2 p-4 rounded-xl bg-card border border-border shadow-md hover:shadow-lg dark:bg-zinc-900 md:flex-row">
257
+ <span class="text-sm font-semibold text-foreground group-hover:text-primary">Title</span>
258
+ <div class={`px-3 py-1.5 rounded-md text-sm transition active:scale-95 ${active ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"}`} onClick={() => {}}>
259
+ Action
260
+ </div>
261
+ </div>
262
+ <Column style={tw("gap-1 p-3 rounded-lg border border-border", active && "bg-primary/10")}>
263
+ <Text style={tw("text-xs text-muted-foreground")}>tw() composes like clsx</Text>
264
+ </Column>
265
+ </Window>
266
+ );
267
+ }
268
+ ```
269
+
270
+ The vocabulary follows Tailwind CSS 4 and is checked class by class against the real compiler (`packages/core/src/tailwind-parity.test.tsx`): layout (`flex`, `grid`, `items-*`, `self-*`, `content-*`, `justify-*`, `place-*`, `gap-*`, `gap-x/y-*`, `space-x/y-*`, `inset-*`, `start-*`/`end-*`, `z-*`), spacing and sizing (the 4 px scale, fractions, `full`, the container scale on `w-*`/`min-w-*`/`max-w-*`, `mx-auto`, arbitrary `[12px]`/`[50%]`), the full colour palette (Tailwind 4's OKLCH colours mapped into sRGB) with `/opacity` modifiers, theme tokens (`bg-primary`, `text-muted-foreground`, `border-border`, also with `/opacity`), typography (`text-sm/6`, `font-*`, `leading-*`, `tracking-*`, `text-justify`, `truncate`, `line-clamp-*`, decorations), borders and radii per side and corner, `shadow-*` and `inset-shadow-*` with colours, `text-shadow-*`, `ring-*`, `outline-*`, `opacity-*`, `cursor-*`, `select-*`, `pointer-events-*`, `overflow-*`, `object-*`, `aspect-*`, transforms (`scale-*`, `translate-*`, `rotate-*`, `skew-*`, `origin-*`), transitions (`transition`, `duration-*`, `delay-*`, `ease-*`), `animate-spin`, gradients (`bg-linear-to-r`, `bg-linear-45`, `bg-radial`, `bg-conic`, `from-*`/`via-*`/`to-*` with positions), `backdrop-blur-*`/`backdrop-saturate-*` (as the Liquid Glass material) and the variants `hover:`, `focus:`, `focus-visible:`, `focus-within:`, `active:`, `disabled:`, `group-hover:` (with `group`), `dark:`, `first:`/`last:`/`odd:`/`even:` and `sm:`…`2xl:`.
271
+
272
+ What has no native counterpart is dropped rather than approximated: `inline`/`table`/`float` layouts, `fixed`/`sticky`, min/max-content widths, viewport units, CSS filters (`blur`, `grayscale`, `drop-shadow`), blend modes, lists, columns, pseudo-elements (`before:`, `placeholder:`, `selection:`), `print:`/`motion-*:`/`rtl:`, `peer-*`, `has-[]`, arbitrary properties (`[mask-type:luminance]`) and `calc()` lengths. A few classes map to the closest native notion: `inline-flex` is `flex`, `static` is `relative`, `space-x/y-*` is a flex gap, `ring-*`/`outline-*` are both the outline, `backdrop-*` needs the D3D11 renderer (others paint the tint), and `ease-*`/`delay-*` animate nothing without a duration, as CSS does. The `tailwind` example is a live playground.
273
+
204
274
  ## Native motion
205
275
 
206
276
  Tarve transitions retained native values without a Bun timer or per-frame TSX render. Bun sends the new target once; Rust owns interpolation, layout/paint invalidation, frame scheduling, retargeting, and completion.
@@ -283,9 +353,30 @@ Base numeric style targets participate in native motion. Interactive `hover`, `f
283
353
 
284
354
  `createTextSearchController` and `findRanges` provide search/navigation helpers for `Text`, `Markdown`, `Code`, and `Diff`.
285
355
 
356
+ ## App icon and metadata
357
+
358
+ Name, icon and publisher live in the app's `package.json` under `"tarve"`; `tarve build`, `tarve run` and `tarve dev` read them, and CLI flags (`--name`, `--version`, `--icon`, `--publisher`, `--copyright`, `--description`, `--app-id`) override them.
359
+
360
+ ```json
361
+ {
362
+ "name": "pulse",
363
+ "version": "1.2.0",
364
+ "tarve": {
365
+ "name": "Pulse",
366
+ "description": "System monitor",
367
+ "publisher": "Example Inc.",
368
+ "copyright": "© 2026 Example Inc.",
369
+ "icon": "assets/icon.png",
370
+ "appId": "Example.Pulse"
371
+ }
372
+ }
373
+ ```
374
+
375
+ A monorepo of apps sets per-entry values under `"tarve": { "apps": { "pulse/pulse.tsx": { … } } }`. The icon is a square PNG (256 px or larger) or an `.ico`: on Windows the build writes a multi-size icon and the version info into the `.exe`, for Bun and Node builds alike; on Linux it writes `<App>.desktop` and `<App>.png` beside the binary. At run time the window and taskbar use the same icon, and `appId` names the app in media controls and notifications. `createApp(view, { icon })` sets the window icon directly.
376
+
286
377
  ## Images
287
378
 
288
- `Image` accepts local paths, data URLs, encoded PNG/JPEG/WebP/SVG bytes, and raw RGBA8 pixels. Raw RGBA is sent directly to the native image cache, so live pixel updates do not require a PNG encode/decode round trip.
379
+ `Image` accepts local paths, `http(s)://` URLs, data URLs, encoded PNG/JPEG/WebP/SVG bytes, and raw RGBA8 pixels. Raw RGBA is sent directly to the native image cache, so live pixel updates do not require a PNG encode/decode round trip.
289
380
 
290
381
  ```tsx
291
382
  <Image
@@ -301,7 +392,13 @@ Base numeric style targets participate in native motion. Interactive `hover`, `f
301
392
  />
302
393
  ```
303
394
 
304
- HTTP(S) loading is explicit and asynchronous. `loadImageSource` supports `AbortSignal`, payload limits, and a bounded in-process LRU cache:
395
+ A URL is fetched and decoded natively, off the UI thread, the first time the image is painted, like `loading="lazy"`: covers further down a list or in a closed panel cost nothing until they scroll in. Until then the image shows its `placeholderBackground`; once decoded it lays out again with its intrinsic size. At most six downloads run at once, and responses with `Cache-Control: max-age` are kept in a disk cache (256 MB) so they survive a restart.
396
+
397
+ ```tsx
398
+ <Image src="https://example.com/cover.webp" width={152} height={152} fit="cover" />
399
+ ```
400
+
401
+ To load bytes yourself (for an `AbortSignal`, a payload limit or to process them), `loadImageSource` fetches into a bounded in-process LRU cache:
305
402
 
306
403
  ```tsx
307
404
  const controller = new AbortController();
@@ -429,6 +526,17 @@ test.close();
429
526
 
430
527
  Use `launchTestProcess` to isolate CPU/GPU test runs in child processes. `readPngRgba`, `comparePngCaptures`, and `assertPngMatches` are reusable pixel-regression helpers; Tarve's own visual smoke tests use the same public PNG decoder.
431
528
 
529
+ ### Without a window: `@tarve/headless`
530
+
531
+ [`@tarve/headless`](packages/headless) runs the same tree, layout, text, input and CPU painter compiled to WebAssembly, so tests need no window, GPU or native library and run on any CI machine. Text uses bundled fonts and time only moves with `advanceMotion`, so captures are byte-identical across platforms.
532
+
533
+ ```tsx
534
+ import { createHeadlessTestRenderer, matchImageSnapshot, renderToRgba } from "@tarve/headless";
535
+
536
+ const test = await createHeadlessTestRenderer(App); // the TestRenderer API above
537
+ await matchImageSnapshot(await renderToRgba(App, { scale: 2 }), "__snapshots__/app.png");
538
+ ```
539
+
432
540
  ## Custom title bar
433
541
 
434
542
  Render `TitleBar` inside `Window` to opt into Tarve-managed window chrome:
@@ -528,9 +636,10 @@ bun run diff
528
636
  bun run motion
529
637
  bun run studio
530
638
  bun run performance
639
+ bun run tailwind
531
640
  ```
532
641
 
533
- From the repository root, `bun run dev --entry examples/<name>.tsx` runs an example with hot reload and the development tools enabled.
642
+ From the repository root, `bun run dev --entry examples/<name>/<name>.tsx` runs an example with hot reload and the development tools enabled.
534
643
 
535
644
  `setup:examples` builds host-local package staging itself; it does not require the universal publishable tarball.
536
645