Skip to content

Commit 9771d0d

Browse files
committed
feat: bump @tanstack/dom-vite to 0.1.0-alpha.4 + alias runtime-specific server variants
Pulls in the shell-chunk batching perf fix landed in the shim's react-dom-server (0.1.0-alpha.4 vs. alpha.3 before). Adds manual top-level aliases for `react-dom/server.{edge,node,bun, browser}` and `react-dom/static.*` → `@tanstack/react-dom-server`. The shim ships a single universal server build; React splits per runtime and @vitejs/plugin-rsc / the Netlify edge adapter import those per-runtime specifiers conditionally. Vite 8's EnvironmentResolveOptions doesn't accept `alias`, so these have to live at top-level resolve.alias. Home route verified rendering cleanly via SSR with no console errors.
1 parent 8a00018 commit 9771d0d

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"@playwright/test": "^1.59.0",
123123
"@shikijs/transformers": "^4.0.2",
124124
"@tanstack/devtools-vite": "^0.6.0",
125-
"@tanstack/dom-vite": "0.1.0-alpha.3",
125+
"@tanstack/dom-vite": "0.1.0-alpha.4",
126126
"@tanstack/react-devtools": "^0.10.2",
127127
"@tanstack/react-query-devtools": "^5.99.0",
128128
"@types/hast": "^3.0.4",

pnpm-lock.yaml

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vite.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,28 @@ const rscSsrExternals = [
3737
const sentrySsrExternals = ['@sentry/node', '@sentry/tanstackstart-react']
3838
const dbSsrExternals = ['drizzle-orm', 'drizzle-orm/postgres-js']
3939

40+
// Runtime-specific `react-dom/server` variants aren't in @tanstack/dom-vite's
41+
// default alias map — our shim ships a single universal server build, unlike
42+
// React which maintains per-runtime forks (edge/node/bun/browser + static.*).
43+
// @vitejs/plugin-rsc and Netlify's edge adapter import them conditionally, so
44+
// we funnel them all to `@tanstack/react-dom-server` at the top-level resolve
45+
// (Vite 8's `EnvironmentResolveOptions` doesn't accept `alias`, so env-scoped
46+
// aliasing isn't an option).
47+
const serverVariantAliases: Record<string, string> = {
48+
'react-dom/server.edge': '@tanstack/react-dom-server',
49+
'react-dom/server.node': '@tanstack/react-dom-server',
50+
'react-dom/server.bun': '@tanstack/react-dom-server',
51+
'react-dom/server.browser': '@tanstack/react-dom-server',
52+
'react-dom/static.edge': '@tanstack/react-dom-server',
53+
'react-dom/static.node': '@tanstack/react-dom-server',
54+
'react-dom/static': '@tanstack/react-dom-server',
55+
}
56+
4057
export default defineConfig({
4158
resolve: {
4259
alias: {
4360
'~': path.resolve(__dirname, './src'),
61+
...serverVariantAliases,
4462
},
4563
},
4664
server: {

0 commit comments

Comments
 (0)