feat: startInstance carries createServerFn and createMiddleware #6748
main fromstartInstance-monorepo·opened Summary by CodeRabbit#
New Features
- Added an end-to-end example project demonstrating React Start with analytics middleware and context management.
- Enhanced StartInstance with typed
createMiddlewareandcreateServerFnmethods, enabling external packages to create middleware and server functions with full type safety.
Tests
- Added comprehensive type and integration tests for server function and middleware composition with context propagation.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-plugin-core
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-client-core
View your CI Pipeline Execution ↗ for commit 0d6fbd7789041adc6ad2b6654d99aa6ea587c845
Command Status Duration Result nx run tanstack-router-e2e-bundle-size:build --...✅ Succeeded 1m 27s View ↗
☁️ Nx Cloud last updated this comment at
2026-02-24 00:21:32UTCBundle Size Benchmarks#
- Commit:
7f7f6cb7ca1a - Measured at:
2026-02-24T00:11:03.150Z - Baseline source:
history:09405b22ccff - Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend react-router.minimal86.53 KiB 0 B (0.00%) 272.15 KiB 75.17 KiB ▇▇▇██▆▆▆▁▁▁ react-router.full89.55 KiB 0 B (0.00%) 282.49 KiB 77.88 KiB █████▇▆▆▁▁▁ solid-router.minimal35.80 KiB 0 B (0.00%) 107.27 KiB 32.12 KiB █████▆▆▆▁▁▁ solid-router.full40.15 KiB 0 B (0.00%) 120.32 KiB 36.10 KiB █████▇▆▆▁▁▂ vue-router.minimal51.66 KiB 0 B (0.00%) 147.25 KiB 46.49 KiB ███▇▇▆▆▆▁▁▁ vue-router.full56.49 KiB 0 B (0.00%) 162.83 KiB 50.70 KiB ███▇▇▆▆▆▁▁▁ react-start.minimal99.08 KiB 0 B (0.00%) 311.29 KiB 85.71 KiB ▇▇▇▇▇▆▆█▁▁▁ react-start.full102.42 KiB 0 B (0.00%) 321.06 KiB 88.47 KiB █████▆▅▆▁▁▁ solid-start.minimal48.12 KiB 0 B (0.00%) 144.84 KiB 42.55 KiB ███▇▇▆▅█▁▁▂ solid-start.full53.58 KiB 0 B (0.00%) 160.76 KiB 47.34 KiB █████▆▆█▁▁▁ Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better.
- Commit:
More templates
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-i18n-paraglide
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-router-react-example-basic-authjs
- tanstack-start-example-basic-cloudflare
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-rsc
- tanstack-start-example-basic-static
- tanstack-start-bun-hosting
- tanstack-start-example-clerk-basic
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-i18n-paraglide
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-streaming-data-from-server-functions
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
- tanstack-router-vue-example-basic-jsx
- tanstack-router-vue-example-basic-file-based-jsx
- tanstack-router-vue-example-basic-file-based-sfc
- tanstack-router-solid-example-authenticated-routes
- tanstack-router-solid-example-authenticated-routes-firebase
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-default-search-params
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-basic-virtual-file-based
- tanstack-router-solid-example-basic-virtual-inside-file-based
- tanstack-router-solid-example-deferred-data
- tanstack-router-solid-i18n-paraglide
- tanstack-router-solid-example-kitchen-sink
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-kitchen-sink-solid-query
- tanstack-router-solid-example-kitchen-sink-solid-query-file-based
- tanstack-router-solid-example-large-file-based
- tanstack-router-solid-example-location-masking
- tanstack-router-solid-example-navigation-blocking
- tanstack-router-solid-example-quickstart
- tanstack-router-solid-example-quickstart-esbuild-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-router-solid-example-quickstart-rspack-file-based
- tanstack-router-solid-example-quickstart-webpack-file-based
- @tanstack/router-solid-mono-simple
- router-solid-mono-simple-lazy
- router-solid-monorepo-solid-query
- tanstack-router-solid-example-scroll-restoration
- tanstack-solid-router-search-validator-adapters
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-auth
- tanstack-solid-start-example-basic-authjs
- tanstack-solid-start-example-basic-cloudflare
- tanstack-solid-start-example-basic-netlify
- tanstack-solid-start-example-basic-nitro
- tanstack-start-example-basic-solid-query
- tanstack-solid-start-example-basic-static
- tanstack-solid-start-bun-hosting
- tanstack-solid-start-example-convex-better-auth
- tanstack-solid-start-example-counter
- tanstack-solid-start-i18n-paraglide
- tanstack-solid-start-example-large
- tanstack-solid-start-streaming-data-from-server-functions
- tanstack-solid-start-example-supabase-basic
- tanstack-solid-start-tailwind-v4
- tanstack-router-solid-example-view-transitions
- tanstack-router-solid-example-with-framer-motion
- tanstack-router-solid-example-with-trpc
@tanstack/arktype-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@6748@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@6748@tanstack/history
npm i https://pkg.pr.new/TanStack/router/@tanstack/history@6748@tanstack/nitro-v2-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@6748@tanstack/react-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@6748@tanstack/react-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@6748@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@6748@tanstack/react-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@6748@tanstack/react-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@6748@tanstack/react-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@6748@tanstack/router-cli
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@6748@tanstack/router-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@6748@tanstack/router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@6748@tanstack/router-devtools-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@6748@tanstack/router-generator
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@6748@tanstack/router-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@6748@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@6748@tanstack/router-utils
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@6748@tanstack/router-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@6748@tanstack/solid-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@6748@tanstack/solid-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@6748@tanstack/solid-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@6748@tanstack/solid-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@6748@tanstack/solid-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@6748@tanstack/solid-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@6748@tanstack/start-client-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@6748@tanstack/start-fn-stubs
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-fn-stubs@6748@tanstack/start-plugin-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@6748@tanstack/start-server-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@6748@tanstack/start-static-server-functions
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@6748@tanstack/start-storage-context
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@6748@tanstack/valibot-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@6748@tanstack/virtual-file-routes
npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@6748@tanstack/vue-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router@6748@tanstack/vue-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router-devtools@6748@tanstack/vue-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router-ssr-query@6748@tanstack/vue-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start@6748@tanstack/vue-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-client@6748@tanstack/vue-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-server@6748@tanstack/zod-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@6748commit:
0d6fbd7Actionable comments posted: 2
♻️ Duplicate comments (1)
packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createStart.tsx (1)
1-22: LGTM — server-caller snapshot wirescreateSsrRpcwith lazy dynamic imports correctlyThe pattern of using
createSsrRpcwith a deferredimport().then(m => m[handler])for the server-caller split is consistent with the established SSR RPC approach in the codebase. The same unused-createServerFn-import observation applies here as noted in the client snapshot.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createStart.tsx` around lines 1 - 22, The snapshot imports createServerFn but never uses it; remove the unused import to clean up the file — update the import statement that currently reads "import { createStart, createServerFn, createMiddleware } from '@tanstack/react-start';" to drop createServerFn so only createStart and createMiddleware are imported, ensuring there are no leftover references to createServerFn in this file.🧹 Nitpick comments (3)
packages/start-client-core/src/createStart.ts (1)
195-215:as unknown asis broad — consider narrowing the casts to just the mismatched properties.The whole object literal is cast via
as unknown as StartInstance<...>, which silences TypeScript on all properties. A future accidental swap (e.g.createServerFn: createMiddleware) would go undetected. The type mismatch that necessitates the cast is only oncreateMiddlewareandcreateServerFn(runtime type usesRegister, interface expects the instance-specific generic).♻️ Narrower cast suggestion
- return { - getOptions: async () => { - ... - }, - createMiddleware: createMiddleware, - createServerFn: createServerFn, - } as unknown as StartInstance< - TSerializationAdapters, - TDefaultSsr, - TRequestMiddlewares, - TFunctionMiddlewares - > + return { + getOptions: async () => { + ... + }, + createMiddleware: createMiddleware as unknown as StartInstance< + TSerializationAdapters, + TDefaultSsr, + TRequestMiddlewares, + TFunctionMiddlewares + >['createMiddleware'], + createServerFn: createServerFn as unknown as StartInstance< + TSerializationAdapters, + TDefaultSsr, + TRequestMiddlewares, + TFunctionMiddlewares + >['createServerFn'], + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/start-client-core/src/createStart.ts` around lines 195 - 215, The object is being cast wholesale with "as unknown as StartInstance<...>" which hides any other mismatches; restrict casting to the two mismatched properties instead: leave the returned object typed naturally, and only cast createMiddleware and createServerFn to the expected Register-compatible signatures (or to the specific StartInstance function types) so TypeScript still checks getOptions and serialization handling (see getOptions, dedupeSerializationAdapters, createMiddleware, createServerFn, and StartInstance). Update the return to return a properly typed object and apply narrow casts only on createMiddleware/createServerFn rather than the entire object.packages/start-plugin-core/tests/createServerFn/snapshots/client/createStart.tsx (1)
2-2:createServerFnimport is unused in createStart snapshotscreateServerFnis imported but never referenced directly — onlystartInstance.createServerFnis used. This pattern appears consistently across all three createStart snapshot variants (client, server-provider, server-caller), generating unused import warnings for end-users if the plugin doesn't post-process imports.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/start-plugin-core/tests/createServerFn/snapshots/client/createStart.tsx` at line 2, The import list includes createServerFn but the code only uses startInstance.createServerFn, so remove createServerFn from the import statement to avoid unused-import warnings; update the import to only import the actually used symbols (e.g., keep createStart and createMiddleware) in the createStart snapshots where createServerFn is unused (refer to the import line that currently lists createStart, createServerFn, createMiddleware and to usages like startInstance.createServerFn).e2e/react-start/monorepo/packages/analytics/src/index.ts (1)
23-32: Redundantas stringcast on template literal.Template literals are already typed as
stringin TypeScript, so the assertion on line 26 is unnecessary.Suggested fix
- const sessionId = `session-${context.userId}-${context.locale}` as string + const sessionId = `session-${context.userId}-${context.locale}`🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@e2e/react-start/monorepo/packages/analytics/src/index.ts` around lines 23 - 32, Remove the redundant type assertion from the template literal when creating sessionId in analyticsMiddleware: in the server handler created by startInstance.createMiddleware().server, change the line that sets const sessionId = `session-${context.userId}-${context.locale}` as string to simply const sessionId = `session-${context.userId}-${context.locale}` so the inferred string type is used; update any references to sessionId if necessary but do not add an explicit cast.🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed. Inline comments: In `@e2e/react-start/monorepo/src/styles/app.css`: - Line 1: The Biome linter is failing to parse Tailwind v4 `@import` ... source() syntax; open the repository root biome.json and add the Tailwind opt-in flag by setting "tailwindDirectives": true in Biome's CSS parser config (add or update the CSS parser section so the config includes "tailwindDirectives": true), ensuring Biome will accept the Tailwind directives used in app.css; reference the biome.json file and the tailwindDirectives key when making this change. In `@e2e/react-start/monorepo/tests/monorepo.spec.ts`: - Line 1: Change the import so `Page` is imported as a type-only import and ensure the type import comes before the value import to satisfy sorting: replace the combined import with a type-only import for `Page` (import type { Page }) and a separate value import for `expect` (import { expect }) so `Page` (type) is declared before `expect` (value), updating the import line that currently imports `expect, Page` from '@playwright/test'. --- Duplicate comments: In `@packages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createStart.tsx`: - Around line 1-22: The snapshot imports createServerFn but never uses it; remove the unused import to clean up the file — update the import statement that currently reads "import { createStart, createServerFn, createMiddleware } from '@tanstack/react-start';" to drop createServerFn so only createStart and createMiddleware are imported, ensuring there are no leftover references to createServerFn in this file. --- Nitpick comments: In `@e2e/react-start/monorepo/packages/analytics/src/index.ts`: - Around line 23-32: Remove the redundant type assertion from the template literal when creating sessionId in analyticsMiddleware: in the server handler created by startInstance.createMiddleware().server, change the line that sets const sessionId = `session-${context.userId}-${context.locale}` as string to simply const sessionId = `session-${context.userId}-${context.locale}` so the inferred string type is used; update any references to sessionId if necessary but do not add an explicit cast. In `@packages/start-client-core/src/createStart.ts`: - Around line 195-215: The object is being cast wholesale with "as unknown as StartInstance<...>" which hides any other mismatches; restrict casting to the two mismatched properties instead: leave the returned object typed naturally, and only cast createMiddleware and createServerFn to the expected Register-compatible signatures (or to the specific StartInstance function types) so TypeScript still checks getOptions and serialization handling (see getOptions, dedupeSerializationAdapters, createMiddleware, createServerFn, and StartInstance). Update the return to return a properly typed object and apply narrow casts only on createMiddleware/createServerFn rather than the entire object. In `@packages/start-plugin-core/tests/createServerFn/snapshots/client/createStart.tsx`: - Line 2: The import list includes createServerFn but the code only uses startInstance.createServerFn, so remove createServerFn from the import statement to avoid unused-import warnings; update the import to only import the actually used symbols (e.g., keep createStart and createMiddleware) in the createStart snapshots where createServerFn is unused (refer to the import line that currently lists createStart, createServerFn, createMiddleware and to usages like startInstance.createServerFn).
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between ea31c50be97ce036128a92b052e129eba4bc49e3 and 0d6fbd7789041adc6ad2b6654d99aa6ea587c845.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (25)
e2e/react-start/monorepo/.gitignoree2e/react-start/monorepo/package.jsone2e/react-start/monorepo/packages/analytics/src/index.tse2e/react-start/monorepo/packages/start-config/src/index.tse2e/react-start/monorepo/playwright.config.tse2e/react-start/monorepo/src/routeTree.gen.tse2e/react-start/monorepo/src/router.tsxe2e/react-start/monorepo/src/routes/__root.tsxe2e/react-start/monorepo/src/routes/analytics-context.tsxe2e/react-start/monorepo/src/routes/analytics-session.tsxe2e/react-start/monorepo/src/routes/index.tsxe2e/react-start/monorepo/src/start.tse2e/react-start/monorepo/src/styles/app.csse2e/react-start/monorepo/tests/monorepo.spec.tse2e/react-start/monorepo/tsconfig.jsone2e/react-start/monorepo/vite.config.tspackages/start-client-core/src/createStart.tspackages/start-client-core/src/index.tsxpackages/start-client-core/src/tests/createStartServerFn.test-d.tspackages/start-plugin-core/src/start-compiler-plugin/plugin.tspackages/start-plugin-core/tests/createServerFn/createServerFn.test.tspackages/start-plugin-core/tests/createServerFn/snapshots/client/createStart.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server-caller/createStart.tsxpackages/start-plugin-core/tests/createServerFn/snapshots/server-provider/createStart.tsxpackages/start-plugin-core/tests/createServerFn/test-files/createStart.tsx
e2e/react-start/monorepo/src/styles/app.css line 1@@ -0,0 +1 @@1+@import 'tailwindcss' source('../');⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
# Check if the CSS file exists and its content cat e2e/react-start/monorepo/src/styles/app.css 2>/dev/null || echo "File not found"Repository: TanStack/router
Length of output: 95
🏁 Script executed:
# Find all biome.json files in the repository and check their content fd -type f -name 'biome.json' | head -20Repository: TanStack/router
Length of output: 229
🏁 Script executed:
# Check for biome.json in the e2e project root and parent directories cd e2e/react-start && pwd && ls -la biome.json 2>/dev/null || echo "No biome.json in e2e/react-start"Repository: TanStack/router
Length of output: 126
🏁 Script executed:
# Search for all biome.json files in the repository find . -maxdepth 3 -name 'biome.json' 2>/dev/nullRepository: TanStack/router
Length of output: 71
🏁 Script executed:
# Check the root directory and parent directories for biome.json ls -la biome.json 2>/dev/null || echo "No biome.json at root" cat biome.json 2>/dev/null || echo "Cannot read root biome.json"Repository: TanStack/router
Length of output: 1893
🏁 Script executed:
# Search for any biome-related configuration rg 'tailwindDirectives' --type json 2>/dev/null || echo "No tailwindDirectives found"Repository: TanStack/router
Length of output: 86
Add
tailwindDirectives: trueto Biome's CSS parser config.Biome 2.4.4 cannot parse Tailwind v4's
@import ... source()syntax without enabling the opt-in Tailwind support. Thebiome.jsonat the repository root currently lacks this configuration, which will cause Biome linting to fail on this CSS file.Add the following to
biome.json:Required biome.json change
{ "css": { "linter": { "enabled": true }, "parser": { - "cssModules": true + "cssModules": true, + "tailwindDirectives": true } } }🧰 Tools
🪛 Biome (2.4.4)
[error] 1-1: expected
,but instead found((parse)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@e2e/react-start/monorepo/src/styles/app.css` at line 1, The Biome linter is failing to parse Tailwind v4 `@import` ... source() syntax; open the repository root biome.json and add the Tailwind opt-in flag by setting "tailwindDirectives": true in Biome's CSS parser config (add or update the CSS parser section so the config includes "tailwindDirectives": true), ensuring Biome will accept the Tailwind directives used in app.css; reference the biome.json file and the tailwindDirectives key when making this change.e2e/react-start/monorepo/tests/monorepo.spec.ts line 1@@ -0,0 +1 @@1+import { expect, Page } from '@playwright/test'⚠️ Potential issue | 🟡 Minor
Fix type-only import of
Page— two ESLint errors on this linePageis used only as a TypeScript type annotation (page: Page) and must be a type import per@typescript-eslint/consistent-type-imports. Additionally,sort-importsexpectsPagebeforeexpect(uppercasePsorts before lowercaseein ASCII order).🛠️ Proposed fix
-import { expect, Page } from '@playwright/test' +import { expect } from '@playwright/test' +import type { Page } from '@playwright/test'📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import { expect } from '@playwright/test' import type { Page } from '@playwright/test'🧰 Tools
🪛 ESLint
[error] 1-1: Imports "Page" are only used as type.
(
@typescript-eslint/consistent-type-imports)
[error] 1-1: Member 'Page' of the import declaration should be sorted alphabetically.
(sort-imports)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@e2e/react-start/monorepo/tests/monorepo.spec.ts` at line 1, Change the import so `Page` is imported as a type-only import and ensure the type import comes before the value import to satisfy sorting: replace the combined import with a type-only import for `Page` (import type { Page }) and a separate value import for `expect` (import { expect }) so `Page` (type) is declared before `expect` (value), updating the import line that currently imports `expect, Page` from '@playwright/test'.
Sign in to join this conversation.
📝 Walkthrough
Walkthrough#
This PR introduces an end-to-end React monorepo example demonstrating middleware and server function composition, while simultaneously expanding the
StartInstancepublic API to exposecreateMiddlewareandcreateServerFnfactory methods with full type support.Changes#
e2e/react-start/monorepo/.gitignore,package.json,tsconfig.json,vite.config.ts,playwright.config.tse2e/react-start/monorepo/packages/analytics/src/index.ts,packages/start-config/src/index.tse2e/react-start/monorepo/src/router.tsx,src/routeTree.gen.ts,src/routes/__root.tsx,src/routes/index.tsx,src/routes/analytics-context.tsx,src/routes/analytics-session.tsxe2e/react-start/monorepo/src/start.ts,src/styles/app.csse2e/react-start/monorepo/tests/monorepo.spec.tspackages/start-client-core/src/createStart.ts,packages/start-client-core/src/index.tsx,packages/start-client-core/src/tests/createStartServerFn.test-d.tscreateMiddlewareandcreateServerFnas public StartInstance members with full generic typing; adds comprehensive TypeScript type tests covering middleware context propagation and server function combinations.packages/start-plugin-core/src/start-compiler-plugin/plugin.ts,packages/start-plugin-core/tests/createServerFn/createServerFn.test.tspackages/start-plugin-core/tests/createServerFn/snapshots/client/createStart.tsx,snapshots/server-caller/createStart.tsx,snapshots/server-provider/createStart.tsx,test-files/createStart.tsxSequence Diagram#
Estimated code review effort#
🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs#
Suggested labels#
package: start-client-core,e2e,examplesSuggested reviewers#
Poem#
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (2 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands and usage tips.