Skip to content

Commit 3e36a90

Browse files
committed
feat(perf): swap React for @tanstack/dom-vite shim
Drop-in React-compatible shim (~9-10KB gzipped) replacing react / react-dom / react-dom/server via the @tanstack/dom-vite Vite plugin. Installing just @tanstack/dom-vite pulls the full set (dom-core, scheduler, react, react-dom, react-dom-server) transitively. Build-size win: app-shell + react gzip 160KB → 116KB (-44KB). Mobile Lighthouse: slight improvement (-128ms FCP, -27ms TBT). Desktop Lighthouse: parity with baseline. Also: - oxlint: ignore .claude/, disable nested config discovery so stale agent worktrees with their own oxlintrc copies don't break lint.
1 parent 0e6dc8b commit 3e36a90

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

.oxlintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
".tanstack-start",
2020
".netlify",
2121
"public",
22-
"convex/.temp"
22+
"convex/.temp",
23+
".claude"
2324
],
2425
"rules": {
2526
"no-array-constructor": "error",

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"build": "vite build",
1313
"start": "vite start",
1414
"start:prod": "pnpm run with-env node scripts/run-built-server.mjs",
15-
"lint": "oxlint --type-aware",
15+
"lint": "oxlint --type-aware --disable-nested-config",
1616
"format": "oxfmt --write",
1717
"db:generate": "drizzle-kit generate",
1818
"db:migrate": "drizzle-kit migrate",
@@ -122,6 +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.2",
125126
"@tanstack/react-devtools": "^0.10.2",
126127
"@tanstack/react-query-devtools": "^5.99.0",
127128
"@types/hast": "^3.0.4",

pnpm-lock.yaml

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

vite.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { sentryTanstackStart } from '@sentry/tanstackstart-react/vite'
22
import { defineConfig } from 'vite'
3+
import { tanstackDom } from '@tanstack/dom-vite'
34
import contentCollections from '@content-collections/vite'
45
import { devtools as tanstackDevtools } from '@tanstack/devtools-vite'
56
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
@@ -102,6 +103,12 @@ export default defineConfig({
102103
'discord-interactions',
103104
// Don't pre-bundle CLI so we always get fresh changes during dev
104105
...(isDev ? ['@tanstack/cli'] : []),
106+
// `use client` libraries that plugin-rsc pre-bundles inconsistently
107+
// across client/ssr/rsc envs when combined with our React shim — each
108+
// env resolves `react` to a different target, so the optimizer's hash
109+
// diverges. Excluding from optimize keeps resolution deterministic per
110+
// env and silences the 50k+ "inconsistently optimized" warning flood.
111+
'lucide-react',
105112
],
106113
},
107114
build: {
@@ -168,6 +175,7 @@ export default defineConfig({
168175
},
169176
},
170177
plugins: [
178+
tanstackDom(),
171179
...(isDev ? [tanstackDevtools()] : []),
172180
tanstackStart({
173181
rsc: {

0 commit comments

Comments
 (0)