devtools/docs/vite-plugin.md

250 lines
7.7 KiB

2025-10-21 12:44:51 +02:00
2026-01-30 17:23:30 +01:00
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
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
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 07:13:22 -07:00
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
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
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 07:13:22 -07:00
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