Skip to content
Source
Sign inSign up
TanStack/devtools

refactor(devtools-vite): migrate from Babel to oxc-parser + MagicString #397

Mergeddake3601(GitHub profile, opens in a new tab)merged 11 commits intomain fromrefs/pull/397/headmerged by AlemTuzlak View on GitHub

Showing 25 changed files with 7 additions and 2 deletions (loading 21).

x
0 of 25 viewed, 25 left
5 additions and 0 deletions.changeset/common-bottles-move.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/devtools-vite': minor
+---
+​
+migrate from Babel to oxc-parser + MagicString
1 addition and 1 deletion_artifacts/domain_map.yamlModified
View file
@@ -231,7 +231,7 @@
​
- mistake: 'Source injection on spread props elements'
mechanism: >
- The Babel transform skips elements with {...props} spread to avoid
+ The AST transform skips elements with {...props} spread to avoid
overwriting dynamic attributes. Agent might not realize source
inspector wont work on those elements.
source: 'packages/devtools-vite/src/inject-source.ts'
1 addition and 1 deletiondocs/architecture.mdModified
View file
@@ -194,7 +194,7 @@
`@tanstack/devtools-vite` is a collection of Vite plugins that enhance the development experience and clean up production builds. It returns an array of Vite plugins, each handling a specific concern:
​
### Source injection (`@tanstack/devtools:inject-source`)
-Uses Babel to parse JSX/TSX files and injects `data-tsd-source` attributes on every JSX element. These attributes encode the file path, line number, and column number of each element in source code, which the source inspector feature uses to implement click-to-open-in-editor.
+Parses JSX/TSX files with oxc-parser and injects `data-tsd-source` attributes on every JSX element via MagicString. These attributes encode the file path, line number, and column number of each element in source code, which the source inspector feature uses to implement click-to-open-in-editor.
​
### Server event bus (`@tanstack/devtools:custom-server`)
Starts a `ServerEventBus` on the Vite dev server. Also sets up middleware for the go-to-source editor integration and bidirectional console piping (client logs appear in the terminal, server logs appear in the browser).