Commit graph

198 commits

Author SHA1 Message Date
Alem Tuzlak
53805408af
chore: upgrade Vitest to v4 (#497)
* ci: stop Release test:lib flakes from runner overload

Release runs nx run-many across every package at nx.json parallel: 5.
That oversubscribes GitHub-hosted runners and flakes two test:lib jobs:

- @tanstack/devtools-ui: default 5s timeout on Solid + goober mounts
- @tanstack/devtools: vitest worker RPC stall (onTaskUpdate)

PR already caps NX_PARALLEL at 3 (#478). Apply the same cap to Release,
and raise the 30s test/hook timeouts on the remaining heavy UI packages.

* chore: upgrade Vitest to v4

Bump vitest from 3.2.4 to 4.1.10. Vitest 4 replaces the 60s
onTaskUpdate RPC timeout that failed Release after every
@tanstack/devtools test had already passed.

Migrate defineWorkspace to test.projects. Turn off Solid HMR in
tests so the module runner does not load /@solid-refresh. Update
mocks and timers that Vitest 4 types or isolates differently.
2026-08-12 16:20:22 +02:00
github-actions[bot]
353a635381
ci: Version Packages (#495)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-11 14:50:47 +02:00
Alem Tuzlak
a46d1f5959
feat: redesign TanStack Devtools workbench (#492)
* fix: update devtools trigger logo

* docs: add TanStack Devtools branding design

* feat: redesign TanStack Devtools workbench

* fix: refine TanStack Devtools workbench

* ci: apply automated fixes

* fix(devtools): polish the Workbench UI and fix its interaction regressions

Separate chrome from canvas: the header and the secondary strips paint the
brand surface and close with a translucent ink hairline, while destination
content and plugin panes paint the workspace surface. `border.decorative` is
the cream brand colour, so any rule drawn on the chrome band was invisible.

Align everything to one gutter. `WORKBENCH_GUTTER` (16px, 12px below 430px) is
now the single inline gutter for the header, the strips and each destination's
content, which previously started at 0, 8, 12 and 32px depending on the tab.

Trade competing accents for the semantic theme:
- The Marketplace partnership banner was a saturated block; it is brand paper
  with a charcoal rule. Tag filters lost their outlined container, section
  headings stopped being cards, and emoji labels are plain text.
- SEO social cards were each outlined in their network's brand colour. The
  colour survives as a small dot; the card border is neutral. The tab also ran
  on the legacy grey ramp and is on the semantic theme now.
- Featured and active plugin cards keep the neutral outline and let their badge
  carry the state; "Active" was wearing the info colour.

The palm emblem is inline SVG instead of a raster filtered with
`brightness(2.5)` to fake dark mode, so it stays sharp and takes its colour
from the theme. Plugin destinations get a real empty state.

Fold the subheader, not the panel. A pull tab on the strip's bottom edge
animates the strip's height to zero and drops to the header's edge; the panel
height, the header and the destination content are untouched, and the tab is
only rendered where a strip exists. Folded, the strip is inert.

Interaction fixes:
- The resize handle had grown to 24px at `top: -10px`, covering the top 14px of
  the 36px header, so a press aimed at a header button started a resize. It is
  a thin bar on the panel edge again.
- The Marketplace settings drawer was `position: fixed` and covered the host
  page instead of the Workbench. The marketplace is a shell with an inner
  scroll region and the drawer is absolute inside it.
- Scroll gestures chained on to the host page. The outermost scroller in each
  destination contains them; deliberately not their descendants, since a plugin
  nests empty `overflow: auto` wrappers that must chain up to the pane.
- Plugin mounts are their own positioning context. Plugins position chrome
  absolutely from a statically positioned root, so it resolved against the
  whole Workbench and painted over our header.
- The floating trigger and drawer toggle replaced their brand fill with a
  translucent state colour on hover, making them vanish over the page.
- The "New" ribbon overlapped the card icon; it is an inline pill.
- HotkeyConfig never rendered its `title`, so each shortcut was headed by its
  own description, and its modifier chips were styled as success.

Interactive controls animate over 0.3s, with one reduced-motion guard scoped to
the core-owned `data-tsd-control` / `data-tsd-surface` markers.

Also removes 41 dead style blocks, which took nearly all remaining legacy-grey
colour usage with them, and a duplicated `plugin-marketplace` test id.

* fix(devtools): stop the SEO head watcher looping and unblock CI

The `Test` job died with a JavaScript heap OOM and the `E2e` job failed on all
eight apps. Two separate causes.

The head watcher looped. `createHeadChanges` observes attributes and character
data across the whole `<head>` subtree, and goober rewrites a `<style>` tag
there on every `css()` call — it even re-stamps the tag's `nonce` attribute each
time. So an SEO analysis re-rendered, the re-render emitted CSS, the CSS mutated
`<head>`, and the analysis ran again. The loop is synchronous, so no test
timeout could break it and the worker ran to the 4 GB heap limit. Stylesheets
carry no SEO metadata, so they are filtered out.

jsdom multiplied goober's stylesheets. goober finds its single
`<style id="_goober">` through `window._goober`, the global a browser creates
for any element with an `id`. jsdom does not do that for `<style>`, so goober
appended a new sheet on every `css()` call — about 2500 per Workbench mount,
never removed. Test 1 took 0.9s and test 20 took 21s. The test setup now gives
goober the global a browser would have: 2504 sheets per mount become 8, and the
package's 236 tests run in 38s instead of running out of memory.

That let `workbench.test.tsx` finish for the first time, which exposed nine
assertions still describing the pre-polish design — the header's trailing
gutter, the strip's 8px gutter, the 24px resize handle, a fixed 44px grid row,
the strip unmounting when folded, and the SEO label foregrounds. Each now
matches the shipped Workbench.

The redesign also dropped the test hooks `@tanstack/devtools-e2e` locates the
panel and header controls with, which is why every e2e app failed on
`openViaTrigger()`. The header carries them again and the tab assertions read
`data-tsd-selected` instead of the `active` class the old tabs used.

* feat(devtools): plugin workspace with splits, stacked tabs, drag and resize (#493)

* feat(devtools): add the plugin workspace layout tree

The workspace layout becomes a tree of splits and tab groups so plugins can be
arranged in rows, columns and stacks instead of one equal-width flex row. This
commit is the maths only: no UI is wired up and no dependency is added yet.

Everything in `layout-tree.ts` is pure and imports nothing. That is deliberate.
jsdom has no layout engine, so `getBoundingClientRect` returns zeros, and rect
maths verified through the DOM would only be verifying its own mocks. Keeping it
here makes it exhaustively testable — 67 cases in 58ms — and keeps the layout
logic out of the components.

Every returned tree upholds the same invariants: a group has at least one tab, a
split has at least two children, sizes match the child count and sum to 1, the
active index names a real tab, and a plugin id appears at most once. `prune`
restores them bottom up after any edit, so closing a tab can collapse an emptied
group, unwrap a single-child split, and flatten a same-direction nested split
without the callers knowing.

`repairLayout` cannot throw. A malformed layout is a data problem, the same as
the unknown plugin ids that are already pruned on load, and it must not stop the
panel from opening; storage *access* errors still propagate. It prunes unknown
and duplicated ids, renormalises sizes, clamps the active index, and falls back
to salvaging whatever plugin ids it can find from an unrecognisable shape so a
bad write costs the arrangement but not the open plugins. The hostile-input test
caught a real stack overflow on a self-referencing object, so reads are depth
capped and the salvage walk tracks visited objects.

Design and the decisions behind it, including the measured bundle cost of each
neodrag primitive, are in
docs/superpowers/specs/2026-08-07-plugin-layout-tree-design.md.

* feat(devtools): make the layout tree the stored truth for open plugins

`state.activePlugins` is replaced by `state.layout`. The tree is now the only
record of which plugins are open, and `activePlugins` is a memo that flattens it,
so the two cannot disagree. Rendering is unchanged: the flattened order feeds the
same flex row, so this commit moves the state without moving any pixels.

Hydration migrates and repairs. State written before the tree reopens as a single
group in the stored order, an existing tree wins over the superseded key, and
everything goes through `repairLayout`, which prunes unknown plugin ids exactly
as the old `activePlugins` filter did. The result is written back once so the
migration does not repeat. Storage *access* errors still propagate.

Two things the existing tests caught, both worth recording.

`flattenTabs` builds a fresh array each call, so a bare memo made every unrelated
store write look like a change and re-ran each plugin's `render` — the activation
order test failed with a duplicated entry. The memo now compares contents.

`plugin.destroy` cannot yet hang off the pane's own `onCleanup`, which is where
the design puts it. The panes live inside the destination-switched subtree, so
navigating to Marketplace unmounts them and would destroy every open plugin —
"moves among Marketplace and core destinations without plugin destruction" failed
immediately. Teardown stays on the close path until the panes live in a container
that outlives the navigation, which is the next commit.

`MAX_ACTIVE_PLUGINS` stays at 3 for now. Raising it to 9 only makes sense once
the workspace can split and scroll, otherwise nine panes share one flex row.

* feat(devtools): render the workspace from the layout tree, up to 9 panes

The plugin panes move out of the destination-switched subtree into a workspace
that is mounted once and hidden rather than unmounted. Each pane is a direct
child of that workspace for its whole life and is placed with offsets computed
from the tree, so no drag, split or resize ever re-parents it. That is what stops
an iframe plugin reloading and a canvas plugin losing its context — the React
basic example registers a plugin whose whole body is an iframe.

Because the workspace outlives navigation, `plugin.destroy` finally moves to the
pane's own `onCleanup`: exactly once, however the pane was closed, and before the
node is detached so the plugin can still tidy up. Removing the call from the
close path at the same time was necessary, not tidying — with both in place every
close destroyed twice, which the lifecycle test caught.

`MAX_ACTIVE_PLUGINS` goes from 3 to 9. Panes can now split and stack, so the cap
limits how many are open rather than how many fit across.

Splitters, tab bars with per-tab close controls, drop-zone highlighting and full
keyboard operation all arrive with it. Each gutter is a real focusable
`role="separator"` driven by the same arrow/Home/End pattern as the whole-panel
resizer, and a tab can be picked up with Enter, moved with the arrows and dropped
with Enter, so nothing needs a pointer. A drop that has no room to split becomes
a stacked tab instead of being refused.

Three things worth recording.

`appendPane` exists because `splitAt` was wrong for opening from the strip: it
halves the last pane, so three plugins came out 1/2, 1/4, 1/4. Panes opened side
by side should match, and a test now pins the thirds.

The move hint's id was `${PLUGIN_CONTAINER_ID}-move-hint`, which matches the
`[id^="plugin-container-"]` selector the tests use and counted as a phantom pane.
PLUGIN_CONTAINER_ID is a public export and the shared prefix of every pane id;
nothing else may borrow it.

The tab bar is not a `role="tablist"`. Its arrow keys move a pane rather than
walking the tabs, so claiming the role would promise a keyboard contract this
does not implement. Selection is `aria-pressed`, the close control is a sibling
button rather than nested inside the tab, targets are 24px, and the state of a
move is narrated through a live region because `aria-grabbed` is deprecated.

* feat(devtools): drag panes from the strip, hold to drag, and raise the cap to 18

Builds on the workspace with the interactions that make it usable, and fixes what
turned up once it was driven by hand rather than by tests.

Dragging. A press only becomes a drag after being **held** for 500ms. A movement
threshold was tried first and was wrong: any distance small enough to feel
responsive is also small enough that ordinary click jitter crosses it, so clicking
a stacked tab resolved a drop target from the pointer sitting over the tab bar and
split the pane straight back out. Holding is unambiguous — a click selects, a press
picks up. Dropping on a tab bar now always means "put it in this group" rather than
splitting its top edge, so the two gestures never compete for the same few pixels.

The tab being carried follows the cursor and every surface shows the grabbing
cursor while it does. The preview is portalled to the body because `MainPanel` sets
a transform, which makes it a containing block, so a `position: fixed` child
resolved against the panel and was clipped by the workspace's overflow.

Plugins strip. Entries can be held and dragged into the workspace to place a pane
where you want it instead of appending it, including onto an empty workspace, where
it takes the whole area. The strip now lists only the plugins that are *not* open,
so each plugin has exactly one control: its strip entry while closed, its pane tab
once open. It folds itself away when everything is open and returns when a plugin
closes.

`MAX_ACTIVE_PLUGINS` goes 9 -> 18. The tests were already pinned to the constant
rather than a literal, so this was a one-line change.

Three fixes worth naming.

The workspace measured itself once at mount. A hidden element measures zero, every
rect derived from a zero box is zero, and hit-testing then silently found nothing —
so a drag did nothing at all rather than looking broken. It re-measures when the
panel opens or the destination returns, ignores zero measurements, and measures
again at the start of every drag.

The strip's click-suppression flag was sticky. A drag that ends away from the entry
produces no `click` at all, so the flag survived and swallowed the *next* genuine
click, which is why opening a plugin started taking several attempts. It resets on
each press.

The strip-to-workspace handoff moved from module-level state onto the context. This
package ships several bundles, so two components can hold different copies of the
same module and never see each other's writes.

Two e2e cases are `test.fixme` rather than deleted: both drags that start from a
strip entry work with real pointer input, verified by hand in two apps, but do not
trigger under Playwright's synthetic mouse. Each carries a comment saying what is
covered elsewhere and what is left unproven.

* fix(devtools): unbreak CI — knip, duplicated Vue plugins, unstable gutters

Three separate causes behind the red `Test` and `E2e` jobs.

**knip.** `layout-tree.ts` exported five things nothing outside it uses —
`isGroup`, `isSplit`, `findGroupById`, `nodeAtPath` and the `Size` type. They are
module-private now. The two findings that remain locally (`check-font-assets.mjs`,
a `svelte` config hint) reproduce on the untouched base branch and pass on CI.

**Vue rendered every plugin twice.** The adapter's `render` and title callbacks
appended to `pluginsToRender` / `titlesToRender` without dropping the previous
entry for that mount element. `render` is called again whenever the theme or the
panel's open state changes, so this was always wrong — it only became visible now
that the core keeps one mount node per plugin for its lifetime instead of building
a fresh one. Previously each call landed in a new node and the duplicate was never
in the document. Both callbacks now replace by id. React was already correct: it
keys by element id.

**Gutters were rebuilt on every re-measure.** `splitterHandles` returns fresh
objects, so a keyed `For` destroyed and recreated every splitter whenever the
geometry changed. That threw keyboard focus away mid-resize and left stale element
references behind — the cause of both the flaky keyboard-resize test and
`boundingBox()` returning null in the drag test. Switched to `Index`, which keeps
the elements and updates their values, and the handle is read through its accessor
at gesture time so a re-measured gutter still moves the right sizes.

The e2e specs also wait for the geometry to settle rather than the tab bars alone,
and drive the keyboard through `locator.press` so focus and keypress are one step.

react-vite: 30 passed, 2 skipped, no flakes over repeated runs. vue: passing.
323 unit tests green.

* fix(devtools): make a tab's close button reliable, and drop the design spec

Closing a tab worked only sometimes. The close button sits inside the sortable
row's element, so the drag layer saw its pointerdown, decided a sort might be
starting, and swallowed the `click` that would have followed — which press landed
and which did not came down to a pixel of pointer movement.

The close control now stops the pointer events at itself and closes on pointerup,
with the `click` handler kept for keyboard activation, which fires no pointer
events at all. Closing twice is harmless: the second call finds no such tab and
returns the tree unchanged. Verified by closing three panes in a row, each press
landing.

Also removes `docs/superpowers/specs/2026-08-07-plugin-layout-tree-design.md`. It
is a planning artifact, not source, and does not belong in the history. The two
earlier commits mention it by path; the reasoning that matters is in the code
comments, `docs/plugin-workspace.md` and the changeset.

* fix(devtools): take the close button out of the drag surface, stop restyling the host page

**Closing a tab.** `SortableRow` is only a data attribute — the drag engine listens
globally and walks *up* from whatever the pointer hit looking for that key. Anything
inside the row is therefore a drag surface no matter what its own handlers do, so
the `stopPropagation` in the previous commit could not have worked. The close button
is now a sibling of the sortable row, positioned over the tab's right end, so a
press on it never reaches a sortable key.

Verified in the browser: pressing the X, moving 6px and holding for 700ms produces
no drag preview and still closes the pane, and three consecutive closes all land.

**The host page's cursor is not ours to change.** The grabbing cursor was applied to
`document.documentElement` with a descendant selector, which forced
`cursor: grabbing !important` onto every element of the page under inspection for
the length of a drag. It is scoped to the devtools panel now. Measured during a
drag: the host `<html>`, `<body>` and `<h1>` all stay at `auto` while the panel
shows `grabbing`, and the e2e test asserts both halves of that.

Everything else the devtools inject was already contained: an audit of every rule in
every injected stylesheet found zero selectors that could match an element the host
page owns — each one is scoped to a goober hash, `.tsd-*`, `[data-tsd*]`,
`[data-plugin*]` or `#tanstack_devtools`.

SSR verified across all three server runtimes: react-start, react-nitro and
react-cloudflare e2e all pass, including the server-to-client event bridge. Nothing
added here touches a browser global at module scope, and `layout-tree.ts` has no DOM
access at all.

* chore(devtools): pin @neodrag/solid to 3.0.0-next.11

The new release does not change `splitpane` — that file is byte-identical to
`next.10`, which this branch already used. What is new is its documentation page.
It does change `sortable`, `drop` and `resize`, and this uses `createSortable`, so
the bump is worth taking for whatever landed there.

Size goes 59.56 kB -> 61.23 kB, still inside the 65 kB limit. 323 unit tests and
30 react-vite e2e pass on it with no flakes.

Still pinned exactly rather than floated on `@next`: v3 is unreleased and its
published exports have already drifted from its docs more than once.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-10 14:12:44 +02:00
github-actions[bot]
06006350d6
ci: Version Packages (#487)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-22 14:51:32 +02:00
github-actions[bot]
f9553f5a88
ci: Version Packages (#486)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-22 14:23:45 +02:00
Alem Tuzlak
d6e9022a8b
feat: add @tanstack/devtools-rspack (1:1 Vite parity) + shared @tanstack/devtools-bundler-core (#484)
* feat(bundler-core): scaffold @tanstack/devtools-bundler-core package

* feat(bundler-core): move framework-agnostic logic out of devtools-vite

* feat(bundler-core): add dev-state singleton for loader/plugin sharing

* refactor(devtools-vite): consume @tanstack/devtools-bundler-core

* test(bundler-core): relocate handleDevToolsRequest routing tests from devtools-vite

* feat(devtools-rspack): scaffold package with skeleton exports

* feat(devtools-rspack): transform pipeline loader

* feat(devtools-rspack): plugin (loader injection, event bus, dev middleware, package manager) + dev-server port routing

* chore(devtools): fix core import ordering + guard rspack package-manager wiring in CI

* test(devtools-rspack): entry factory test

* test(devtools-rspack): react rspack example + e2e smoke

* chore: changesets for devtools-bundler-core + devtools-rspack

Also removes the redundant @rspack/core devDependency from
devtools-rspack (already declared as peerDependency, unused
otherwise per knip).

* fix(devtools-rspack): process @tanstack node_modules for connection placeholder + runtime-bridge injection

The single loader rule excluded all of node_modules, so the __TANSTACK_DEVTOOLS_*
connection placeholders (which live in @tanstack/devtools-event-bus's client, under
node_modules for real consumers) were never replaced -- breaking a custom
eventBusConfig.port/host/protocol. Add a second loader rule scoped to
@tanstack/devtools*|event-bus* under node_modules (flat + pnpm nested layouts), and
normalize the step-4 id gate to posix so it matches on Windows. Matches vite's
connection-injection, which does not exclude node_modules.

* fix(devtools-rspack): eager event-bus connection, gate dep-refresh on package.json, port-routing tests, doc accuracy

* fix(devtools-rspack): emit package-json-read on package.json change (vite parity)

* chore(devtools): formatting + lint fixes

* fix(devtools-rspack): make marketplace + go-to-source work under Rspack

- Seed the shared global event target before wiring the package manager so the
  plugin receives the client's `mounted` event and replies with
  `package-json-read` (the marketplace stayed empty without it), and gate the
  wiring on the compiler mode instead of `process.env.NODE_ENV`, which isn't set
  at `apply()` time under `rspack serve`.
- Normalize the module path before stripping cwd in enhance-logs and
  inject-source so Rspack's backslash ids on Windows don't leak an absolute path
  that breaks editor open.
- Enable `connectToServerBus` in the react-rspack example so the client connects
  to the event bus.

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-22 13:44:57 +02:00
github-actions[bot]
e0266670c8
ci: Version Packages (#475)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-24 13:21:43 +02:00
Alem Tuzlak
b1c1b20f6e
fix(examples): align @tanstack/devtools-a11y version to fix sherif CI (#474)
fix(examples): align @tanstack/devtools-a11y to ^0.1.5 across examples

The Version Packages release bumped the react a11y example to ^0.1.5
but left the angular example at ^0.1.4, tripping sherif's
multiple-dependency-versions check and failing CI on main.
2026-06-23 11:24:59 +02:00
github-actions[bot]
da1d7e2826
ci: Version Packages (#473)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-23 11:16:12 +02:00
github-actions[bot]
d9f2b37ce5
ci: Version Packages (#468)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-19 19:53:37 +02:00
Alem Tuzlak
958c6836b8
feat: deliver devtools events from isolated server runtimes via Vite HotChannel (#384)
* docs: add design spec for network transport fallback in isolated server runtimes

Addresses the issue where devtools events are lost when server code runs in
isolated environments (Nitro v3 worker threads, Cloudflare Workers, etc.)
that don't share globalThis with the Vite main thread.

* docs: address spec review findings for network transport fallback

Fix problem description precision, URL matching and handleNewConnection
signature issues, POST handler routing, placeholder convention, triplicate
interface sync, queue preservation, and multi-worker echo safety.

* docs: clarify dual handler paths in network transport spec

Disambiguate that both standalone and external server POST/upgrade
handlers need updates, and that only WebSocket URL matching needs
prefix change (not SSE/POST URLs).

* docs: add implementation plan for network transport fallback

7-task plan covering: interface updates, ServerEventBus bridge support,
POST handler routing, RingBuffer utility, EventClient network transport
detection, WebSocket connection/emit/receive, and integration tests.

* feat: add eventId and source fields to TanStackDevtoolsEvent interface

* feat: add server bridge WebSocket connection support to ServerEventBus

- Accept WebSocket connections with ?bridge=server query parameter
- Track bridge clients separately for proper routing
- Bridge messages route through emit() (broadcast to WS clients + EventTarget)
- Regular browser messages route through emitToServer() (EventTarget only)
- Clean up bridge client tracking on disconnect and stop()

* feat: add source-based routing to POST handlers for server bridge support

* feat: add RingBuffer utility for event ID deduplication

* feat: add network transport detection and compile-time placeholders to EventClient

* feat: add WebSocket network transport fallback to EventClient

When EventClient detects it is in an isolated server environment
(no shared globalThis.__TANSTACK_EVENT_TARGET__, no window), it
automatically connects to ServerEventBus via WebSocket. Bidirectional:
events emitted in the worker reach the devtools panel, and events
from the devtools panel reach listeners in the worker.

Includes echo prevention via 200-entry ring buffer, exponential
backoff reconnection, HTTP POST fallback, and event queuing.

* fix: improve WebSocket error handling and destroy cleanup in EventClient

- Add scheduleReconnect() call in error handler for non-browser runtimes
  where 'close' may not follow 'error'
- Reset wsGaveUp, wsReconnectAttempts, wsReconnectDelay in
  ___destroyNetworkTransport for safe reuse

* test: add end-to-end integration tests for network transport fallback

* docs: mark network transport fallback spec as implemented

* ci: apply automated fixes

* feat: add Nitro v3 and Cloudflare Workers test examples

Two minimal examples for manually testing the network transport fallback:

- examples/react/start-nitro — TanStack Start + Nitro v3 (worker threads)
- examples/react/start-cloudflare — TanStack Start + Cloudflare Workers

Both emit devtools events from server functions and display them in a
custom "Server Events" devtools panel. If events appear in the panel,
the network transport fallback is working correctly.

* Refactor code structure for improved readability and maintainability

* docs: design spec for native Vite HotChannel runtime bridge

* docs: implementation plan for native Vite HotChannel runtime bridge

* feat(devtools-vite): generate worker-side runtime bridge code

* feat(devtools-vite): inject runtime bridge into event-client for server envs

* feat(devtools-vite): wire dev-server hot channels to ServerEventBus

* feat(devtools-vite): hook runtime bridge into plugin and dev server

* chore: add devtools-vite changeset, remove planning docs from PR

* fix(devtools-vite): tear down runtime-bridge hot handlers to prevent duplicate events

* ci: apply automated fixes

* chore: align start-nitro/start-cloudflare examples to vite 8 (fix sherif)

* test(devtools-vite): use explicit function types in runtime-bridge mocks (eslint)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-19 19:47:33 +02:00
github-actions[bot]
c6374669b8
ci: Version Packages (#467)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-19 15:21:04 +02:00
github-actions[bot]
ca6e266ff4
ci: Version Packages (#465)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-19 14:24:51 +02:00
Alem Tuzlak
73983a7d7e
fix(devtools): restore plugin marketplace and harden event bus connection (#466)
The plugin marketplace rendered empty ("No additional plugins available")
because the `mounted` -> `package-json-read` round-trip could be lost:

- ClientEventBus.emitToServer silently dropped events emitted while the
  WebSocket was still connecting. They are now buffered and flushed once the
  socket opens.
- The marketplace re-requests package.json on every open and retries until it
  arrives, so re-opening always re-fetches the plugin list.
- The basic React example reconnects to the server bus (connectToServerBus).
- Added TanStack AI Devtools to the plugin marketplace registry.
2026-06-19 14:15:31 +02:00
github-actions[bot]
45d9b8e013
ci: Version Packages (#453)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-19 13:07:08 +02:00
github-actions[bot]
5d359f276e
ci: Version Packages (#442)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-13 16:45:28 +02:00
github-actions[bot]
0ec5292ac1
ci: Version Packages (#433)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-13 12:17:50 +02:00
renovate[bot]
e8ad97da91
chore(deps): update dependency drizzle-orm to ^0.45.0 [security] (#438)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-13 12:12:04 +02:00
Alem Tuzlak
31c194e24d
ci(security): harden CI/CD supply chain and bump pnpm to 11.1.1 (#436)
* chore(deps): upgrade pnpm to 11.1.1

Bumps the corepack-managed pnpm version across the root and the four
Angular example workspaces. pnpm 11 refuses to run install scripts by
default; declare a minimal allowBuilds allowlist in pnpm-workspace.yaml
so only the two packages whose postinstalls the build actually needs
(esbuild, nx) are permitted. The other eight transitively-pulled
postinstalls (sharp, lmdb, workerd, etc.) all fall back to JS paths
or are unused during build, and are explicitly denied.

Also pin the preinstall guard to only-allow@1.2.2 so it no longer
resolves a floating tag from npm on every install.

* ci(security): pin actions to SHAs and harden CI/CD supply chain

Replaces every mutable workflow reference (@main, @v1, @v3, @v4,
@v6.0.2) with a 40-char commit SHA + version comment so Renovate can
keep them current. Composite actions in TanStack/config — previously
pinned to @main — are the highest-impact change: a force-push or
compromised commit there would have given an attacker the npm OIDC
publishing identity plus contents/issues/PR write tokens on the next
push to main.

Other changes in this commit:

- release.yml: set cancel-in-progress: false so a re-push cannot abort
  changesets/action mid-publish and leave partial versions on npm.
  Add environment: release so required reviewers can be configured in
  repo settings for an explicit human gate before publish.

- triage-agent.yml: add a "SECURITY: Untrusted input" preamble to the
  Warp agent prompt. The agent reads attacker-controlled issue text,
  so it must treat that text strictly as data and refuse instructions
  embedded inside it. Also corrected the bug-report template path
  (bug-report.yml -> bug_report.yml) that the agent was failing to
  load.

- check-skills.yml / validate-skills.yml: pin @tanstack/intent to a
  specific version; npm install -g without a version was floating.

- pr.yml preview job: pin pkg-pr-new to a specific version; pnpx
  without a version was floating.

- .github/renovate.json: drop :automergeMinor. Combined with floating
  versions this could have landed a malicious patch without review.

- .github/CODEOWNERS (new): require owner review on workflows, package
  manifests, lockfile, .npmrc, and renovate config. Adjust the owner
  handle to a team once one exists.

- .github/workflows/dependency-review.yml (new): runs
  actions/dependency-review-action on every PR with
  fail-on-severity: high to block PRs that introduce known-vulnerable
  transitive dependencies.

* ci(security): bump TanStack/config pin to latest main SHA

* fix(ci): correct preinstall skip logic for CI

The original `||`-chained preinstall printed "Skipping preinstall..." in
CI but then ran only-allow anyway because `process.exit(1)` triggers
the `||` operator. CI happened to pass when only-allow was unpinned
(npx resolved it differently), but pinning to @1.2.2 forced a fresh
registry resolve in which only-allow strictly checks
npm_config_user_agent — which, when invoked via npx-inside-pnpm, is
npm's, not pnpm's — and rejects.

The fix matches the script's stated intent: when CI=true, exit 0 so
the `||` does not trigger and only-allow is genuinely skipped. Local
installs continue to fall through and enforce pnpm via only-allow as
before.
2026-05-12 14:59:09 +02:00
github-actions[bot]
3639ccfb78
ci: Version Packages (#429)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-11 12:32:40 +02:00
github-actions[bot]
b2924325a4
ci: Version Packages (#426)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-11 10:34:30 +02:00
Harry Whorlow
58e66f5a26
feat(devtools): add copy path to source inspector (#419)
* feat(devtools): add copy path to source inspector

* chore: remove config from example
2026-04-28 20:18:43 +02:00
Riccardo Perra
ad26f6182f
feat(angular): angular adapter and utils (#368)
* feat(angular-devtools): create angular adapter package

Add the @tanstack/angular-devtools package with:
- TanStackDevtoolsComponent: standalone Angular component that wraps TanStackDevtoolsCore
- Plugin system supporting Angular components rendered into devtools containers
- Type definitions for Angular-specific plugin and init configuration
- Build config using @analogjs/vite-plugin-angular for AOT compilation

* fix(angular-devtools): add reactivity for input changes, remove unused RenderArray

* feat(devtools-utils): add angular support

* fix: resolve angular build issues

- Remove @analogjs/vite-plugin-angular from build (produces empty chunks
  for library builds). Use plain esbuild via Vite instead - Angular AOT
  compilation happens at consumer's build time.
- Upgrade Angular dev deps from ^19 to ^20 for TypeScript 5.9 compat.
- Remove @angular/build dep (only needed by analogjs plugin).
- Add @tanstack/angular-devtools workspace override to root.

* ci: apply automated fixes

* fix: resolve lint, knip, and sherif issues

- Fix array-type ESLint rule in angular-devtools
- Fix import/consistent-type-specifier-style in devtools-utils angular
- Sort peerDependencies alphabetically (sherif)
- Remove unused devDependencies flagged by knip
- Remove angularCompilerOptions from tsconfig (not using ngc)

* feat: add Angular support with setup, adapter, and custom plugin documentation

* feat(angular): angular adapter add utils and some examples, fix build

* ci: apply automated fixes

* feat: Add angular adapter and devtools-utils/angular

* remove afterNextRender in devtools-utils

Since angular-devtools already run the code within afterNextRender in browser env, we don't like to wrap the panel returned from utils

* fix examples

* fix angular devtools wrong pnpm link

* feat(angular-devtools): add with-devtools provider

* docs(angular-devtools): update docs

* ci: apply automated fixes

* chore(angular-devtools): fix examples dependencies and knip issues

* feat(angular-devtools): rename withDevtools to provideTanStackDevtools

* Add a11y plugin for angular

* chore(deps): update @tanstack/devtools and related packages

* ci: apply automated fixes

---------

Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-28 20:17:46 +02:00
github-actions[bot]
f1844a29de
ci: Version Packages (#417)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-07 10:52:51 +02:00
github-actions[bot]
d6a292561c
ci: Version Packages (#408)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-30 15:00:43 +02:00
Abed Al Ghani Shaaban
e04bb11bec
Feat seo serp preview (#373)
* refactor(devtools): remove SeoTab component and related functionality

This commit deletes the SeoTab component from the devtools package, which included social media preview functionality and meta tag analysis. The removal streamlines the codebase by eliminating unused features.

* refactor(devtools): rename SocialPreviewSection to SocialPreviewsSection

This commit updates the naming of the SocialPreviewSection component to SocialPreviewsSection for consistency and clarity in the SEO tab of the devtools package. The change improves code readability and aligns with the pluralization of the component's purpose.

* refactor(devtools): rename social-preview file to social-previews and update import path

This commit renames the social-preview.tsx file to social-previews.tsx for consistency with the component naming convention. The import path in the SeoTab component is also updated accordingly, enhancing code clarity and maintainability.

* feat(devtools): add SEO tab navigation and enhance SocialPreviewsSection

This commit introduces a navigation bar in the SeoTab component, allowing users to switch between 'Social Previews' and 'SERP Preview' sections. It also updates the SocialPreviewsSection to conditionally render its title based on a new prop, improving flexibility in display options. New styles for the navigation elements are added to enhance the user interface.

* feat(devtools): enhance SERP and Social Previews with new styles and data handling

This commit introduces new styles for the SERP snippet and updates the SERP and Social Previews sections to dynamically display data from the current page's metadata. The SocialPreviewsSection and SerpPreviewSection components are refactored to improve clarity and functionality, removing unnecessary props and enhancing the user interface with better styling.

* refactor(devtools): update SERP snippet styles and structure

This commit refactors the SERP snippet styles by renaming the `serpSnippetUrlRow` to `serpSnippetTopRow` and introduces new styles for site name and URL. The structure of the SERP preview is enhanced to better organize the display of site information, improving the overall layout and visual consistency.

* feat(devtools): enhance SERP preview with truncation logic and overflow reporting

This commit adds functionality to the SERP preview section, implementing text truncation for the title and description based on specified width limits. It introduces new state management for overflow detection and displays warnings when the title or description exceeds the defined character limits. Additionally, new styles are added to support the hidden measurement elements for accurate text sizing.

* feat(devtools): add SERP overflow reporting and improve styles

This commit enhances the SERP preview section by introducing a new overflow reporting mechanism for the title and description. It adds a list of issues when the title or description exceeds specified limits, improving user feedback. Additionally, new styles are implemented for better visual presentation of error messages in the SERP preview.

* feat(devtools): add meta description and default favicon styles

This commit enhances the SEO capabilities of the basic example by adding a meta description tag for improved search engine visibility. Additionally, it introduces new styles for a default favicon, ensuring a consistent visual representation when no favicon is provided. This improves user feedback in the SERP preview section.

* feat(devtools): enhance SERP preview layout with new styles

This commit introduces new styles for the SERP preview section, including a dedicated block for the preview and a label for better organization. The layout improvements enhance the visual presentation of the desktop preview, ensuring a clearer display of the site name, URL, title, and description.

* feat(devtools): enhance SERP preview for mobile with new styles and overflow reporting

This commit introduces new styles for the mobile SERP preview, including a dedicated snippet layout and improved overflow reporting for the title and description. It adds functionality to handle mobile-specific text truncation and displays warnings for descriptions exceeding a three-line limit, enhancing user feedback and visual consistency across devices.

* feat(devtools): implement comprehensive SERP issue reporting and enhance component structure

This commit introduces a robust mechanism for reporting SERP issues, including checks for favicon, title, and description validity. It refactors the SERP preview component to utilize a more structured approach for handling overflow conditions and displaying relevant warnings. Additionally, it enhances the layout for both desktop and mobile previews, ensuring a consistent and informative user experience across devices.

* refactor(devtools): update SERP preview truncation logic and improve character limits

This commit refines the SERP preview component by replacing pixel-based truncation with character-based limits for titles and descriptions. It introduces constants for maximum character counts, enhancing the clarity of the truncation logic. Additionally, it simplifies the component structure by removing unnecessary measurement elements, improving overall readability and maintainability.

* refactor(devtools): streamline SERP preview component and improve character limit handling

This commit refines the SERP preview component by enhancing the character limit handling for titles and descriptions. It simplifies the component structure, removing redundant elements, and improves the overall readability and maintainability of the code. Additionally, it ensures consistent behavior across different display scenarios.

* refactor(devtools): reorder imports in social-previews component for consistency

---------

Co-authored-by: Alem Tuzlak <t.zlak97@gmail.com>
2026-03-30 14:46:35 +02:00
github-actions[bot]
45bdbb0413
ci: Version Packages (#393)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-16 09:35:17 +01:00
Harry Whorlow
b0993b603a
fix(a11y): extract theme and fix pnpm overides (#392) 2026-03-16 09:33:55 +01:00
github-actions[bot]
6c7b961fe4
ci: Version Packages (#389)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-15 09:52:44 +01:00
Harry Whorlow
d11aaf99fa
feat: extract theme provider (#386)
* feat: extract theme provider

* chore: export type

* chore: unify types

* fix:lock
2026-03-15 09:38:49 +01:00
Harry Whorlow
63e505c7b6
feat: support vite v8 (#388)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-03-15 09:35:54 +01:00
Sarah Gerrard
7c33985598
a11y plugin (#326)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Harry Whorlow <whorlowharry@gmail.com>
Co-authored-by: Harry Whorlow <79278353+harry-whorlow@users.noreply.github.com>
Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
2026-03-13 15:18:56 +01:00
github-actions[bot]
a120650543
ci: Version Packages (#380)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-11 14:39:21 +01:00
github-actions[bot]
da5ff35a0d
ci: Version Packages (#378)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-11 12:27:44 +01:00
github-actions[bot]
654dca5927
ci: Version Packages (#376)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-10 17:48:57 +01:00
github-actions[bot]
c6bbb90257
ci: Version Packages (#370)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-06 13:26:50 +01:00
Alem Tuzlak
024ea7d602
fix(devtools): prevent solid-js from leaking into server bundles (#367)
* fix(devtools): prevent solid-js from leaking into server bundles

Move all solid-js runtime imports (render, Portal, lazy, ClientEventBus)
from core into a new mount-impl.tsx file loaded via dynamic import().
This ensures solid-js code is never in the static import graph and only
loads as a separate chunk when mount() is called on the client.

* feat(devtools-utils): add Solid.js support and enhance routing configurations

* ci: apply automated fixes

* fix(devtools-utils): resolve self-referencing import for clean CI builds

Add ambient module declaration (barrel-types.d.ts) so TypeScript can
resolve @tanstack/devtools-utils/solid on clean checkouts without dist/.

* ci: apply automated fixes

* fix(devtools-utils): fix lint errors in solid class files

* fix(devtools-utils): use variable import path to prevent esbuild SSR pre-bundling

esbuild follows dynamic imports with string literals during Vite's
dependency optimization, pulling solid-js into the SSR bundle. Using a
variable path prevents static analysis from following the import.

* fix(devtools-utils): add workerd export condition to ./solid for Cloudflare SSR

The ./solid export was missing a workerd condition, causing Vite's SSR
dep optimizer (esbuild) to resolve to the client entry instead of
server.js when running under Cloudflare workerd. The client entry's
compiled Solid JSX imports use/setStyleProperty from solid-js/web which
don't exist in the server entry, crashing the dev server.

Also reverts the variable import workaround in class.ts back to a
literal import, since the workerd condition now properly routes SSR
resolution to the server entry.

* Refactor code structure for improved readability and maintainability

* fix(devtools-utils): use relative dynamic import for class-mount-impl

Replace the cross-package bare specifier import('@tanstack/devtools-utils/solid')
with a relative import('./class-mount-impl'). Bare specifiers in dynamic imports
inside pre-bundled dependencies aren't resolved by bundlers like esbuild/webpack,
causing "Failed to resolve module specifier" errors in the browser.

The relative import works in all bundlers (Vite, Next.js, etc.) because the
class-mount-impl.js file is co-located in the same dist directory, built
together via a single vite config with vite-plugin-solid for JSX compilation.

* ci: apply automated fixes

* chore: fix issues

* chore: changeset

* fix: lock

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-03-06 13:24:54 +01:00
github-actions[bot]
2117765147
ci: Version Packages (#365)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-04 14:27:33 +01:00
Harry Whorlow
b3e375f1b0
feat(devtools-ui): json tree handles dates (#258)
Co-authored-by: Alem Tuzlak <t.zlak97@gmail.com>
2026-03-04 14:02:06 +01:00
github-actions[bot]
fc8c3290bb
ci: Version Packages (#362)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-04 11:06:13 +01:00
Alem Tuzlak
cf23787b96
feat: simplify EventClient types to accept unprefixed event maps (#361)
* feat: simplify EventClient types to accept unprefixed event maps

EventClient now accepts event maps with plain event names instead of
requiring the pluginId prefix in every key. The prefix is handled
purely at runtime. This removes the complex conditional types that
were stripping prefixes from emit/on/createEventPayload signatures.

* ci: apply automated fixes

* chore: add patch changeset for event client type simplification

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-03-04 11:02:09 +01:00
github-actions[bot]
b75b84dc3a
ci: Version Packages (#358)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-02 15:55:12 +01:00
github-actions[bot]
16d96c7d6e
ci: Version Packages (#356)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-27 12:24:01 +01:00
github-actions[bot]
541fc6eda0
ci: Version Packages (#353)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-17 17:42:24 +01:00
github-actions[bot]
25daa2780e
ci: Version Packages (#344)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-07 17:48:30 +01:00
github-actions[bot]
f8c62b5308
ci: Version Packages (#338)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-30 16:52:56 +01:00
Alem Tuzlak
9f45788b45
Feat/console pipe (#337)
* feat: console piping

* implement the two way pipping

* ci: apply automated fixes

* revert: remove console piping from devtools-vite

* revert client changes

* ci: apply automated fixes

* remove extra file

* fix for logs

* fix23

* improvements

* knip issues

* ci: apply automated fixes

* changeeset

* changeset

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-01-30 16:48:54 +01:00
Alem Tuzlak
e1aaa98220
cloudflare example (#334)
* cloudflare example

* lock

* ci: apply automated fixes

* fix tests

* ci: apply automated fixes

* rename lib

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-01-28 15:58:48 +01:00
github-actions[bot]
a3d987720d
ci: Version Packages (#328)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-27 13:40:05 +01:00
github-actions[bot]
67be66c1e6
ci: Version Packages (#311)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-08 15:09:25 +01:00