Commit graph

338 commits

Author SHA1 Message Date
github-actions[bot]
566d39b7fc
ci: Version Packages (#513)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-20 22:05:59 +02:00
kolaworld
f82de5f6d2
fix(svelte-devtools): publish compatible adapter exports (#502)
* fix(svelte-devtools): publish compatible adapter exports

Closes #501

* fix(svelte-devtools): publish Svelte 5 component types

* fix(svelte-devtools): package with Svelte tooling

* refactor(svelte-devtools): reuse package compiler config

* dummy commit

* undo dummy commit

* test: fix timezone-sensitive date assertion and svelte adapter import

Use a local Date so YYYY-MM-DD is stable west of UTC, and import the adapter from its extracted .ts module.
2026-08-20 21:29:28 +02:00
github-actions[bot]
375c58fc15
ci: Version Packages (#512)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-20 12:38:11 +02:00
Renan Tatsuo
d3378571fa
chore(devtools): bump launch-editor and picomatch to fix security advisories (#498)
* chore(devtools): bump launch-editor and picomatch

* chore: add changeset for launch-editor and picomatch bumps

* chore: clarify changeset scope and remaining dev-only shell-quote
2026-08-20 11:22:40 +02:00
kolaworld
f1584c7db4
fix(devtools-utils): align Svelte factory contracts (#504)
* fix(devtools-utils): align Svelte factory contracts

Closes #503

* fix(svelte-devtools): replace mounted plugin components

* fix(svelte-devtools): clean up replaced plugin panels

* fix(devtools-utils): own Svelte panel lifecycle

* fix(svelte-devtools): preserve plugin state on updates
2026-08-20 11:22:18 +02:00
Robert Czobor
4ecd46e2f9
fix(devtools): install Neodrag core dependency (#509) 2026-08-20 11:11:11 +02:00
github-actions[bot]
71b2ad0bb6
ci: Version Packages (#506)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-19 18:56:50 +02:00
Alem Tuzlak
cf8e67875c
feat(devtools): rainbow trigger, persist strip fold, and pane gutters (#510)
Use the rainbow palm as the default trigger mark and default triggerMode to floating.
Keep the folded plugin strip across reloads.
Lay plugin panes in rounded cards with even gutters, theme panel scrollbars, and keep resize handles on the live layout so they stay in the gap after a pane opens or a drag.
2026-08-19 18:50:38 +02:00
kolaworld
2df2e04080
fix(event-bus): respect explicit connection config (#500)
* fix(event-bus): respect explicit connection config

* test(event-bus): guarantee client cleanup
2026-08-17 14:51:29 +02:00
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
Alem Tuzlak
10f28d8564
docs: add README header banners to the framework adapter packages (#491) 2026-08-03 11:59:03 +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
Vedant Pahune
f4c35d29be
fix(devtools-vite): preserve valid syntax when removing devtools JSX (#480)
* fix(devtools-vite): preserve valid syntax when removing devtools JSX

* add changeset

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-22 14:48:30 +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
Alem Tuzlak
d061f0cc3c
feat(devtools): add floating/draggable trigger with throw physics (#485)
* feat(devtools): add floating/draggable trigger with throw physics

Add a `triggerMode: 'fixed' | 'floating'` setting. In floating mode the trigger
can be dragged anywhere with the left mouse button; releasing with velocity
throws it (inertia + wall bounce). Position is clamped to a padded on-screen
area (matching the fixed trigger's edge offset) and persisted to local storage,
re-clamping on window resize so it can never load off-screen.

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-22 12:04:20 +02:00
Alem Tuzlak
92f69d014a
ci: stabilize flaky Test job (cap nx parallelism + raise vitest timeouts) (#478)
* test(devtools): raise vitest timeouts to stop flaky component test:lib in CI

The component tests added in #472 render the full Solid + goober tree and take
1-4s locally. Shared CI runners are ~4x slower (the suite runs in ~8s locally
but ~31s in CI), which pushes individual tests past vitest's default 5s
testTimeout and causes intermittent `@tanstack/devtools:test:lib` failures
across unrelated PRs (e.g. #471, #477).

Raise testTimeout and hookTimeout to 30s for the devtools package so slow CI
runs have headroom. Fast unit tests are unaffected; a real hang still fails
(just after 30s instead of 5s).

* ci: cap nx parallelism to 3 to fix flaky Test job

nx.json sets `parallel: 5`, which is fine for local dev machines but
oversubscribes GitHub-hosted runners: each affected `test:lib` (vitest) and
`test:types` (tsc) task spawns its own worker pool, so 5 heavy tasks at once
exhaust CPU/RAM and intermittently stall or OOM-kill deterministic tasks. That
produced flaky failures across unrelated PRs (#471, #477, #478) that pass on a
plain re-run.

The team already pins `test:e2e` to `--parallel=1` for the same reason; cap the
Test job's nx parallelism via NX_PARALLEL=3 (CI-only, leaves local dev at 5).
Combined with the raised vitest timeouts, this keeps tasks within the runner's
budget.
2026-06-24 14:05:02 +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
b1ac893a7d
feat(event-client): strip the root EventClient export from production by default (#471)
* feat(event-client): add shared types module, /production entry, and package wiring

* feat(event-client): add standalone no-op client and share event types

* feat(event-client): no-op the root export outside development

* docs(event-client): document dev-only root export and /production subpath

* chore(event-client): add changeset for production stripping

* test(event-client): guard no-op/real public-surface parity and cover the dev resolver branch

* docs(event-client): clarify unset NODE_ENV behavior and fix stale stripping guidance

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-24 13:13:14 +02:00
Alem Tuzlak
ea3c6749b0
fix(devtools): rename Solid use* primitives to create* for React Compiler compat (#477)
* fix(devtools): rename Solid use* primitives to create* for React Compiler compat

The devtools packages are Solid but used React-style naming (useStyles,
useTheme, useDevtoolsState, ...) for their custom primitives. When an app
enables React Compiler, it matches the use* convention and transforms this
Solid code as if it were React, breaking the panel.

Rename every custom Solid primitive in @tanstack/devtools, devtools-ui, and
devtools-a11y from use* to create*, and import Solid's useContext and
@solid-primitives' useKeyDownList under non-use aliases (getContext,
getKeyDownList).

BREAKING(@tanstack/devtools-ui): exported useTheme is renamed to createTheme.

* fix(devtools): apply create* rename to tests and docs merged from main

#472 added component tests (tabs.test.tsx, settings-tab.test.tsx) using the
old useDevtoolsState/useDevtoolsSettings names, and the devtools-plugin-panel
skill docs referenced the renamed devtools-ui export useTheme. Update them to
the create* names.
2026-06-24 13:04:02 +02:00
Alem Tuzlak
7114ecd285
test: e2e suite (8 apps + server↔client probe) + unit/component coverage (#472)
* test(e2e): scaffold Playwright harness, helper package, react-vite app, shell test-ids

* test(e2e): full react-vite shell behavior suite + event-probe

* ci(e2e): build packages before running the Playwright suite on every PR

* test(e2e): react-start runtime app + server probe

* test(e2e): extend event-probe with server-ping emitter + receiver

* test(e2e): promote react-start to real server->client via #384 runtime bridge; lock e2e deps

* test(e2e): react-nitro runtime app + server probe

* test(e2e): cloudflare/workerd runtime app

* test(e2e): solid adapter smoke

* test(e2e): vue adapter smoke

* test(e2e): preact adapter smoke

* test(e2e): angular adapter smoke

* ci(e2e): run all runtime + adapter e2e apps on every PR; lock e2e deps

* test(unit): fill pure-function coverage gaps in devtools + devtools-vite

* test(component): Solid shell render + reactivity tests

* test(component): React adapter portal wiring test

* chore(e2e): formatting and lint fixes

* fix(devtools-ui): Checkbox reflects controlled `checked` prop updates

* chore(knip): declare doc-script entrypoints and ignore generated intent bin stubs

* ci: apply automated fixes

* ci(e2e): pin actions to commit SHAs (org policy + zizmor)

* test(e2e): make server->client probe deterministic (re-emit until delivered)

* ci(e2e): run e2e projects serially — parallel dev servers collide on the shared devtools bus port

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-23 20:37:55 +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
Alem Tuzlak
d7c5a93710
feat: add Svelte 5 adapter and devtools-utils Svelte factories (#366)
* docs: add Svelte devtools adapter design doc

* docs: add Svelte devtools implementation plan

* feat(svelte-devtools): add Svelte 5 adapter package

* feat(devtools-utils): add Svelte factory functions and build config

* fix: resolve knip issues and update svelte vite plugin to v6

* docs: add Svelte documentation

* chore: add changeset for Svelte adapter

* ci: apply automated fixes

* fix(svelte-devtools): mount once and tear down stale plugin components on update

- Mount the core exactly once: untrack props in the mount $effect so a prop
  change no longer destroys and rebuilds the entire devtools core (the update
  $effect already handles config/plugin changes reactively).
- update() now calls destroyAllComponents() before setConfig(), matching the
  Angular adapter — the core re-invokes render/name for the new plugin set, so
  without this the previous Svelte instances were orphaned and leaked.
- renderComponent() keys mounted components by container.id directly (the core
  always assigns one) instead of an empty-string fallback that could never be
  matched on destroy.
- vite.config: cast svelte() plugin as any, matching the vue/solid configs, to
  satisfy the vite 8 plugin types.

* chore(devtools-utils): add svelte devDependency for the svelte subpath build

The `./svelte` build type-checks svelte-importing source, so svelte must be
resolvable at build time (mirroring vite-plugin-solid for the solid build)
rather than relying on workspace hoisting of the optional peer.

* test(devtools-utils): cover svelte plugin and panel factories

Mirrors the existing solid class factory tests: createSveltePlugin shape +
NoOp behavior, and createSveltePanel mounting/tearing down a class-based core.

* ci: apply automated fixes

* refactor(devtools-utils): make createSveltePlugin generic over component props

Threads a TComponentProps generic through the svelte plugin factory (mirroring
createVuePlugin) so plugin props are type-checked against the component instead
of falling back to `any`. Addresses PR review feedback.

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-23 11:12:54 +02:00
Alem Tuzlak
f17d7e8a0a
chore: add bugs.url metadata to all published packages (#470)
Adds the `bugs` field pointing to the GitHub issue tracker to every publishable package under packages/. This was the only standard metadata field missing; repository, license, homepage, funding, author and keywords were already present and consistent across all packages.
2026-06-22 16:35:07 +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
Eric Manganaro
cc8c81b9e2
fix(devtools): allow plugin panel roots to scroll (#456)
Co-authored-by: Alem Tuzlak <t.zlak97@gmail.com>
2026-06-19 15:14:47 +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
Vedant Pahune
2a2f9eb5b8
fix(devtools-vite): preserve valid syntax when removing parenthesized devtools JSX (#449)
* fix(devtools-vite): preserve valid syntax when removing parenthesized devtools JSX

* add changeset
2026-06-19 13:10:48 +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
Kent Hou Man
cf89dcd9e0
fix: fix go to source file whose path contains $ symbol (#450)
* fix: fix go to source when file name contains $ symbol

* chore: add changeset
2026-05-30 09:03:53 +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
Keven Arroyo
7be3776b86
refactor(devtools-vite): migrate from Babel to oxc-parser + MagicString (#397)
* refactor(devtools-vite): migrate from Babel to oxc-parser + MagicString

* changeset+knip fix

* docs update

* ci: apply automated fixes

* refactor(devtools-vite): address CodeRabbit feedback on oxc migration

- Extract shared TANSTACK_DEVTOOLS_PACKAGES constant; remove-devtools now
  recognizes preact/vue/svelte/angular packages (previously only
  react/solid/devtools were stripped).
- Escape displayName/packageName via JSON.stringify when generating
  plugin injection code so quotes/backslashes do not break the output.
- Skip appending a duplicate import when the plugin symbol is already
  imported from the same package.
- collectJsx no longer crosses function boundaries; inner components
  keep their own propsName context and aren't annotated with an outer
  function's data-tsd-source.
- Drop the redundant VariableDeclaration branch in visitFunctions;
  arrow/function expressions are reached via forEachChild, so the
  prior code walked them twice.
- Add regression tests covering non-ASCII source positions (emoji,
  CJK) — oxc-parser napi bindings already return UTF-16 code-unit
  indices, so no offset conversion is needed.
- Sync the devtools-production SKILL.md package list with the
  implementation.

* chore(deps): bump oxc-parser to ^0.120.0

Verified empirically that the napi bindings continue to return UTF-16
code-unit indices (matching the assumption in inject-source.ts and the
non-ASCII regression tests). All 167 devtools-vite tests pass on the new
version; lint, typecheck, build, and knip clean.

* ci: apply automated fixes

* fix(devtools-vite): emit correct source positions for enhanced logs

console-pipe-transform prepends a multi-line IIFE to root entry files
before better-console-logs runs. Because both plugins are enforce:'pre'
and execute in array order, enhanceConsoleLog was parsing the
post-prepend source and reporting line numbers shifted past the end of
the user's file -- 'Go to Source' links pointed nowhere.

Swap the two plugin entries so enhanceConsoleLog sees the original
source. Add a regression test asserting better-console-logs is
registered before console-pipe-transform.

* fix(devtools): snapshot data-tsd-source before mutating click state

The click handler in SourceInspector called `setDisabledAfterClick(true)`
before reading `highlightState.dataSource`. That signal write flipped
`isActive` to false, triggering the highlight effect's `resetHighlight()`
synchronously enough (via the chained `createStore` reactions) to clear
`dataSource` before the subsequent reads. Result: the open-source fetch
was issued with `?source=` empty and clipboard writes wrote an empty
string.

Capture `highlightState.dataSource` into a local before any state
mutations, then use the captured value for both the clipboard path and
the URL construction.

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com>
2026-05-13 16:13:22 +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]
bb2f499c1f
chore(deps): update dependency happy-dom to v20 [security] (#439)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-13 12:11:53 +02:00
Harry Whorlow
562ad00b61
fix(ci): fix eslint error (#432)
* fix(ci): fix eslint error

* chore: update with test

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-11 22:27:12 +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
Harry Whorlow
015b733686
fix(devtools ui): fix json tree nan values (#430) 2026-05-11 12:29:38 +02:00
Raudy Brito
16c0bf0d58
fix(devtools-vite): prevent console pipe loop and solid-js duplication (#412)
* fix(devtools-vite): prevent console pipe loop and solid-js duplication with Vite 8

* chore: add changeset

* fix(devtools-vite): add defensive fallback for invalid console level

* Remove Solid Dedupe

* format fix
2026-05-11 11:06:56 +02:00
Wz
113e9a7134
fix(devtools-vite): avoid piping raw DOM console arguments (#424)
fix console piping DOM serialization
2026-05-11 11:06:28 +02:00
Santos Vilanculos
5ac65f8059
chore(plugin): add inertia 3 plugin to registry (#420)
chore(plugin): add inertia 3 plugin
2026-05-11 10:42:25 +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
Michał Papliński
aa32769932
fix:duplicate Devtools UI rendering when React StrictMode is enabled (#404)
* fix race condition

* add changeset

---------

Co-authored-by: Alem Tuzlak <t.zlak97@gmail.com>
2026-04-07 10:46:11 +02:00