Skip to content
Source
Sign inSign up
TanStack/router

perf(start-plugin-core): build Start compiler-generated code directly instead of parsing it #8680

OpenSheraff(GitHub profile, opens in a new tab)wants to merge 10 commits intoperf/copy-free-outputs fromperf/direct-builders-propened

Showing 11 changed files with 23 additions and 9 deletions (loading 9).

x
0 of 11 viewed, 11 left
6 additions and 0 deletions.changeset/start-compiler-builders.mdAdded
View file
@@ -0,0 +1,6 @@
+---
+'@tanstack/start-plugin-core': patch
+'@tanstack/react-start-rsc': patch
+---
+​
+Build the code the Start compiler inserts (server function RPC calls and handlers, env-only and isomorphic stubs, Hydrate imports and boundaries, RSC CSS options, import protection mocks) directly instead of parsing it, for faster server function compilation.
17 additions and 9 deletionspackages/react-start-rsc/src/plugin/rscCssTransform.tsModified
View file
@@ -106,16 +106,24 @@
continue
​
- const options = context.parseExpression(
- `{ ${RSC_CSS_OPTIONS_KEY}: null }`,
+ args.push(
+ b.ObjectExpression({
+ properties: [
+ // `b.Property` is typed as an object or a binding property
+ {
+ type: 'Property',
+ start: 0,
+ end: 0,
+ kind: 'init',
+ key: b.Identifier({ name: RSC_CSS_OPTIONS_KEY }),