mirror of
https://github.com/TanStack/devtools.git
synced 2026-11-16 10:49:48 +00:00
fix(devtools-vite): inject data-tsd-source before other plugins transform (#548)
* fix(devtools-vite): inject data-tsd-source before other plugins transform inject-source uses `enforce: 'pre'`, so a `pre` plugin listed before devtools() transformed the code first. When that plugin changes the code of one environment only (a server-function compiler, for example), the lines shift, and data-tsd-source differs between the SSR and client output. React then reports a hydration mismatch, for example `editor.tsx:632:5` on the server and `editor.tsx:636:5` on the client. The transform hook now has `order: 'pre'`, so it runs before the other plugins' transform hooks, whatever their position in the array. Fixes #405 Fixes #189 * docs(devtools-vite): note that an earlier order: 'pre' transform still runs first
This commit is contained in:
parent
0803d09382
commit
40f32e4cda
3 changed files with 73 additions and 0 deletions
Loading…
Add table
Add a link
Reference in a new issue