Commit graph

16 commits

Author SHA1 Message Date
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
Alem Tuzlak
9bf08e270f
docs: comprehensive documentation overhaul (#363)
* docs: add documentation redesign design document

Comprehensive plan for restructuring TanStack Devtools documentation
with layered architecture approach: Getting Started, Concepts, Guides,
API Reference, and Examples sections. Adds 11 new pages including
architecture overview, event system deep-dive, Vue framework support,
and plugin building guides.

* docs: add documentation implementation plan

18-task plan covering: navigation restructure, 4 new Concepts pages
(architecture, event system, plugin lifecycle, source inspector),
3 new Guides (custom plugins, devtools-utils, bidirectional comms),
Vue framework support, Solid custom plugins, and updates to existing
pages including overview, quick-start, installation, and React adapter.

* docs: restructure navigation with Concepts and Guides sections, add Vue

* docs: expand overview with package map and architecture diagram

* docs: add all framework examples to quick start

* docs: add Vue and Preact installation instructions

* docs: add architecture overview page

* docs: add event system concepts page

* docs: add plugin lifecycle concepts page

* docs: add source inspector concepts page

* docs: add framework-agnostic custom plugin building guide

* docs: add devtools-utils guide for plugin factory helpers

* docs: add bidirectional communication guide

* docs: add Vue basic setup and adapter pages

* docs: add Vue and Solid custom plugins guides

* docs: replace TODO in React adapter with actual content

* docs: expand Vite plugin features documentation

* docs: fix event map key convention, typos, and internal link extensions

- Event map keys should be suffix-only (e.g., 'state-update'), not
  prefixed with pluginId. EventClient prepends pluginId automatically.
  Fixed across all custom plugin guides and concept pages.
- Fix enabled:false docs in event-system.md (emit is a no-op, not
  internal dispatch)
- Fix double "the the" typo in installation.md
- Remove .md extensions from internal doc links for consistency
- Fix event map key in configuration.md example

* docs: remove internal plan files

* docs: replace ASCII diagrams with mermaid in architecture overview

* docs: add mermaid diagrams across all documentation pages

- overview.md: architecture layer diagram
- event-system.md: connection lifecycle state diagram
- plugin-lifecycle.md: mount sequence flowchart + portal pattern diagram
- source-inspector.md: inspection flow diagram
- building-custom-plugins.md: plugin architecture overview
- bidirectional-communication.md: two-way flow + time travel sequence diagram
- vite-plugin.md: sub-plugin overview diagram
2026-03-04 13:52:26 +01:00
Alem Tuzlak
e2c1609da8
add piping docs (#339) 2026-01-30 17:23:30 +01:00
Sarah
5ae6ded099
docs: format callouts to put content on new line (#269)
fix callouts
2025-11-24 17:56:48 +01:00
Alem Tuzlak
4636cb9ca9
Feat/add ignore patterns (#223)
* fix

* feat: implement ignore patterns for injectSource
2025-10-21 13:12:25 +02:00
Alem Tuzlak
82afc87a33
fix (#222) 2025-10-21 12:44:51 +02:00
TakhyunKim
fadd95541d
docs: unify code conventions in example code within document (#156)
Fixes #155 

### Changes

Remove unused commas, semicolons, and spaces.
Also fix the incorrect constructor depth.
2025-09-22 12:51:15 +02:00
Alem Tuzlak
cf46006d67
Feat/fix sourcemapping issues (#151)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-19 14:49:48 +02:00
Alem Tuzlak
2b77aceb0b
feat: remove devtools from build bundles (#136)
Fixes #112

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-18 11:52:38 +02:00
Alem Tuzlak
627ecf4ff6
feat: improve go to source by using launch-editor (#121)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-09 11:19:15 +02:00
Alem Tuzlak
9feb9c3351
Feat/dettached mode but it works (#70)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-26 17:14:01 +02:00
Alem Tuzlak
6176382309
fix: make inject source optional (#68) 2025-08-25 17:12:02 +02:00
Alem Tuzlak
891b1eabfc
feat: fix some issues with go to and add better docs (#66)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-25 17:03:40 +02:00
Alem Tuzlak
89b1493ab0
feat: improve open source funtionality (#61)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-23 08:47:01 +02:00
Alem Tuzlak
2efe23f05f
feat: add go to source functionality to devtools (#56)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-21 17:38:48 +02:00
Alem Tuzlak
a7c5601607
Feat/vite plugin (#53)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-08-21 14:26:14 +02:00