WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@TomasBankauskas
Copy link

@TomasBankauskas TomasBankauskas commented Dec 11, 2025

Add start-basic-netlify example with @netlify/vite-plugin-tanstack-start in examples dir.

Summary by CodeRabbit

  • New Features

    • Added a Netlify-ready React starter: file-based routing, dynamic posts/users pages, API endpoints, deferred loading, error boundaries/NotFound UI, router setup, server/client data fetchers, logging middleware, SEO utilities, Tailwind styles, and web app manifest with Vite/Netlify build config.
  • Documentation

    • New README with setup, development, and production build instructions.
  • Chores

    • Editor/ignore updates and VS Code settings to exclude generated/build artifacts.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds a complete "start-basic-netlify" React example: project configs, Vite+Netlify wiring, generated route tree and router, file-based routes (pages + API), server functions/middleware, components, styles, editor ignores/settings, and documentation/assets.

Changes

Cohort / File(s) Summary
Project config & build
examples/react/start-basic-netlify/package.json, examples/react/start-basic-netlify/tsconfig.json, examples/react/start-basic-netlify/vite.config.ts, examples/react/start-basic-netlify/netlify.toml, examples/react/start-basic-netlify/postcss.config.mjs
New project manifests and build config: package scripts, TS config, Vite config wiring tanstackStart + Netlify plugin, Netlify build settings, and PostCSS/Tailwind plugin.
Ignore & editor
examples/react/start-basic-netlify/.gitignore, examples/react/start-basic-netlify/.prettierignore, examples/react/start-basic-netlify/.vscode/settings.json
Added ignore patterns for builds, locks, caches, envs, generated routeTree.gen.ts; Prettier ignore; VSCode settings to exclude/mark generated file readonly.
Docs & public assets
examples/react/start-basic-netlify/README.md, examples/react/start-basic-netlify/public/site.webmanifest
New README with setup/usage and a web app manifest (icons, theme/background, standalone display).
Generated route tree & router
examples/react/start-basic-netlify/src/routeTree.gen.ts, examples/react/start-basic-netlify/src/router.tsx
Adds generated typed route tree (many route typings, module augmentations) and getRouter() factory with defaults (preload, error/notFound components, scroll restoration).
Root route & shell
examples/react/start-basic-netlify/src/routes/__root.tsx, examples/react/start-basic-netlify/src/routes/index.tsx
Root createRootRoute with head/links/scripts, RootDocument shell, and home/index route.
Layouts & nested routes
examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx, .../_nested-layout.tsx, .../_nested-layout/route-a.tsx, .../_nested-layout/route-b.tsx
Pathless layout, nested layout, and child routes using Outlet composition and navigation.
Posts feature
examples/react/start-basic-netlify/src/routes/posts.tsx, .../posts.index.tsx, .../posts.$postId.tsx, .../posts_.$postId.deep.tsx, examples/react/start-basic-netlify/src/utils/posts.tsx
Posts listing, index, dynamic post route and deep view; server functions to fetch posts/post.
Users feature
examples/react/start-basic-netlify/src/routes/users.tsx, .../users.index.tsx, .../users.$userId.tsx, examples/react/start-basic-netlify/src/utils/users.tsx
Users listing and dynamic user routes using server fetch utilities and loaders; server functions fetchUsers/fetchUser.
API & misc server routes
examples/react/start-basic-netlify/src/routes/api/users.ts, .../api/users.$userId.ts, .../customScript.js.ts, .../redirect.tsx, .../deferred.tsx
Server API endpoints (users list and per-user), custom JS endpoint, redirect route, and deferred-data example using server functions + Suspense/Await.
Components: errors & UI
examples/react/start-basic-netlify/src/components/DefaultCatchBoundary.tsx, .../NotFound.tsx, .../PostError.tsx, .../UserError.tsx
Error boundary, not-found UI, and small error wrappers with retry/navigation actions.
Server utils & middleware
examples/react/start-basic-netlify/src/utils/loggingMiddleware.tsx, .../seo.ts, .../posts.tsx, .../users.tsx
Logging middleware capturing client/server timings, SEO helper, and server functions for posts/users.
Styling
examples/react/start-basic-netlify/src/styles/app.css
Tailwind-based global styles and color system utilities.

Sequence Diagram(s)

sequenceDiagram
  participant Browser as Browser (Client)
  participant Router as App Router (getRouter)
  participant Server as App Server (file routes / server fns / middleware)
  participant ExternalAPI as External API (jsonplaceholder)

  Browser->>Router: navigate / request (route loader or server route)
  Router->>Server: invoke loader / server handler (middlewares run)
  Server->>ExternalAPI: fetch data (posts/users)
  ExternalAPI-->>Server: return JSON
  Server-->>Router: loader data / Response
  Router-->>Browser: render page or return JSON response
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Focus areas:
    • src/routeTree.gen.ts — large generated typings and route wiring.
    • src/routes/deferred.tsx — deferred loaders and Suspense/Await behavior.
    • src/utils/loggingMiddleware.tsx — multi-phase timing and ctx propagation.
    • src/utils/posts.tsx / src/utils/users.tsx — server function input/response/error handling.
    • vite.config.ts & netlify.toml — plugin registration and deployment settings.

Possibly related PRs

Suggested labels

documentation

Suggested reviewers

  • brenelz
  • SeanCassiere

Poem

🐇 I hopped through folders, planted routes and tea,
I stitched pages, APIs, and a Netlify tree.
Generated branches and middleware tunes,
I nibble build files and hum under moons. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding a new TanStack Start example with Netlify integration to the examples directory.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@TomasBankauskas TomasBankauskas changed the title Start basic netlify add: Start basic netlify Dec 11, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (14)
examples/react/start-basic-netlify/src/components/UserError.tsx (1)

4-6: Add explicit return type annotation.

As per coding guidelines requiring TypeScript strict mode with extensive type safety, consider adding an explicit return type annotation to improve type safety and code clarity.

Apply this diff:

-export function UserErrorComponent({ error }: ErrorComponentProps) {
+export function UserErrorComponent({ error }: ErrorComponentProps): JSX.Element {
   return <ErrorComponent error={error} />
 }

Consider whether this wrapper component is necessary.

The component currently only forwards props directly to ErrorComponent without adding any customization. Routes could import and use ErrorComponent directly from @tanstack/react-router instead.

However, if this wrapper is intentional for demonstrating custom error component patterns or as a placeholder for future customization in this example, it's reasonable to keep.

examples/react/start-basic-netlify/src/routes/api/users.$userId.ts (1)

10-28: Consider differentiating error responses by type.

The catch block returns a 404 for all errors, including network failures and parsing errors. This could mask actual server issues. The similar /api/users route in users.ts throws the error rather than catching and converting to 404.

        try {
          const res = await fetch(
            'https://jsonplaceholder.typicode.com/users/' + params.userId,
          )
          if (!res.ok) {
-           throw new Error('Failed to fetch user')
+           if (res.status === 404) {
+             return json({ error: 'User not found' }, { status: 404 })
+           }
+           return json({ error: 'Failed to fetch user' }, { status: res.status })
          }

          const user = (await res.json()) as User

          return json({
            id: user.id,
            name: user.name,
            email: user.email,
          })
        } catch (e) {
          console.error(e)
-         return json({ error: 'User not found' }, { status: 404 })
+         return json({ error: 'Internal server error' }, { status: 500 })
        }
examples/react/start-basic-netlify/src/utils/seo.ts (1)

12-30: Consider filtering out tags with undefined content.

When description or keywords are not provided, meta tags with content: undefined will be included in the array. This could result in empty or "undefined" meta tags being rendered.

-  return tags
+  return tags.filter((tag) => 'title' in tag || tag.content !== undefined)
examples/react/start-basic-netlify/src/routes/posts_.$postId.deep.tsx (2)

2-3: Inconsistent import path styles.

The file mixes relative imports ('../utils/posts') with alias imports ('~/components/PostError'). Consider using a consistent import style throughout.

-import { fetchPost } from '../utils/posts'
-import { PostErrorComponent } from '~/components/PostError'
+import { fetchPost } from '~/utils/posts'
+import { PostErrorComponent } from '~/components/PostError'

5-12: Consider adding notFoundComponent for consistency.

The similar route posts.$postId.tsx includes a notFoundComponent to handle 404 cases when fetchPost throws notFound(). This route lacks that handler, which could result in a less user-friendly error display when a post is not found.

+import { NotFound } from '~/components/NotFound'
+
 export const Route = createFileRoute('/posts_/$postId/deep')({
   loader: async ({ params: { postId } }) =>
     fetchPost({
       data: postId,
     }),
   errorComponent: PostErrorComponent,
   component: PostDeepComponent,
+  notFoundComponent: () => {
+    return <NotFound>Post not found</NotFound>
+  },
 })
examples/react/start-basic-netlify/src/routes/users.$userId.tsx (1)

1-4: Inconsistent and potentially problematic import paths.

The imports use 'src/components/...' which is non-standard and may cause issues depending on bundler configuration. Other files in this example use '~/...' alias or relative paths. Consider using consistent import paths.

 import { createFileRoute } from '@tanstack/react-router'
-import { NotFound } from 'src/components/NotFound'
-import { UserErrorComponent } from 'src/components/UserError'
-import { fetchUser } from '../utils/users'
+import { NotFound } from '~/components/NotFound'
+import { UserErrorComponent } from '~/components/UserError'
+import { fetchUser } from '~/utils/users'
examples/react/start-basic-netlify/src/utils/users.tsx (2)

21-23: Input validator provides no validation.

The inputValidator currently just passes through the input without any validation. For a more robust example, consider validating that the input is a non-empty string and optionally checking if it's a valid numeric ID format.

Apply this diff to add basic validation:

 export const fetchUser = createServerFn({ method: 'POST' })
-  .inputValidator((d: string) => d)
+  .inputValidator((d: string) => {
+    if (!d || typeof d !== 'string') {
+      throw new Error('User ID is required and must be a string')
+    }
+    return d
+  })
   .handler(async ({ data }) => {

11-11: Consider adding timeout to fetch calls.

External API calls without timeouts can hang indefinitely, degrading user experience. Consider adding an AbortSignal with a timeout for production-ready examples.

Example pattern:

const controller = new AbortController()
const timeoutId = setTimeout(() => controller.abort(), 5000)
try {
  const res = await fetch(url, { signal: controller.signal })
  // ... handle response
} finally {
  clearTimeout(timeoutId)
}

Also applies to: 25-27

examples/react/start-basic-netlify/src/utils/posts.tsx (1)

10-12: Input validator provides no validation.

The inputValidator currently just passes through the input. For better demonstration of best practices, consider adding validation to ensure the input is a non-empty string and optionally validate the format.

Apply this diff:

 export const fetchPost = createServerFn({ method: 'POST' })
-  .inputValidator((d: string) => d)
+  .inputValidator((d: string) => {
+    if (!d || typeof d !== 'string') {
+      throw new Error('Post ID is required and must be a string')
+    }
+    return d
+  })
   .handler(async ({ data, context }) => {
examples/react/start-basic-netlify/src/components/DefaultCatchBoundary.tsx (1)

23-49: Consider extracting duplicate button styles.

The className string for buttons is repeated three times. While this is a minor point, extracting it to a constant would improve maintainability.

+const buttonClassName = 'px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold'
+
 export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
   const router = useRouter()
   const isRoot = useMatch({
@@ -20,7 +22,7 @@
     <div className="min-w-0 flex-1 p-4 flex flex-col items-center justify-center gap-6">
       <ErrorComponent error={error} />
       <div className="flex gap-2 items-center flex-wrap">
         <button
           onClick={() => {
             router.invalidate()
           }}
-          className={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded-sm text-white uppercase font-extrabold`}
+          className={buttonClassName}
         >
examples/react/start-basic-netlify/src/routes/posts.tsx (1)

15-32: Consider optional chaining for title access.

While the current data sources provide titles, using optional chaining would add defensive safety:

-                  <div>{post.title.substring(0, 20)}</div>
+                  <div>{post.title?.substring(0, 20)}</div>

This is a minor suggestion since the fake post includes a title property.

examples/react/start-basic-netlify/src/routes/__root.tsx (1)

67-67: Add lang attribute for accessibility.

The <html> element should include a lang attribute for accessibility and SEO:

-    <html>
+    <html lang="en">
examples/react/start-basic-netlify/src/routes/api/users.ts (2)

23-39: Commented random redirect example could be problematic if enabled

The middleware composition looks fine, but the commented example using Math.random() to sometimes throw a redirect would introduce non‑deterministic behavior if it’s ever uncommented. That can make debugging and tests flaky.

If you plan to keep a redirect example here, consider basing it on a deterministic condition (e.g., a query param or header) rather than randomness.


41-63: Consider consistent structured error responses and minimal data validation

The GET handler is clean: it logs, fetches users, limits to 10, and returns a trimmed shape (id, name, email) with a strongly typed array.

Two optional improvements:

  • For consistency with the single‑user route, you may want this endpoint to also return a structured JSON error payload with an explicit status code instead of throwing a bare Error, so clients see a predictable shape across /api/users and /api/users/$userId.
  • Optionally, you could guard against unexpected external responses (e.g., non‑array) before calling .slice, and log/return a 5xx JSON error in that case.

These aren’t correctness blockers, but they’d make the API behavior more uniform and robust against upstream changes.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bcce02c and 61c116b.

⛔ Files ignored due to path filters (8)
  • examples/react/start-basic-netlify/public/android-chrome-192x192.png is excluded by !**/*.png
  • examples/react/start-basic-netlify/public/android-chrome-512x512.png is excluded by !**/*.png
  • examples/react/start-basic-netlify/public/apple-touch-icon.png is excluded by !**/*.png
  • examples/react/start-basic-netlify/public/favicon-16x16.png is excluded by !**/*.png
  • examples/react/start-basic-netlify/public/favicon-32x32.png is excluded by !**/*.png
  • examples/react/start-basic-netlify/public/favicon.ico is excluded by !**/*.ico
  • examples/react/start-basic-netlify/public/favicon.png is excluded by !**/*.png
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (38)
  • examples/react/start-basic-netlify/.gitignore (1 hunks)
  • examples/react/start-basic-netlify/.prettierignore (1 hunks)
  • examples/react/start-basic-netlify/.vscode/settings.json (1 hunks)
  • examples/react/start-basic-netlify/README.md (1 hunks)
  • examples/react/start-basic-netlify/package.json (1 hunks)
  • examples/react/start-basic-netlify/postcss.config.mjs (1 hunks)
  • examples/react/start-basic-netlify/public/site.webmanifest (1 hunks)
  • examples/react/start-basic-netlify/src/components/DefaultCatchBoundary.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/components/NotFound.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/components/PostError.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/components/UserError.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routeTree.gen.ts (1 hunks)
  • examples/react/start-basic-netlify/src/router.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/__root.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/api/users.$userId.ts (1 hunks)
  • examples/react/start-basic-netlify/src/routes/api/users.ts (1 hunks)
  • examples/react/start-basic-netlify/src/routes/customScript[.]js.ts (1 hunks)
  • examples/react/start-basic-netlify/src/routes/deferred.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/index.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/posts.$postId.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/posts.index.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/posts.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/posts_.$postId.deep.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/redirect.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/users.$userId.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/users.index.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/routes/users.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/styles/app.css (1 hunks)
  • examples/react/start-basic-netlify/src/utils/loggingMiddleware.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/utils/posts.tsx (1 hunks)
  • examples/react/start-basic-netlify/src/utils/seo.ts (1 hunks)
  • examples/react/start-basic-netlify/src/utils/users.tsx (1 hunks)
  • examples/react/start-basic-netlify/tsconfig.json (1 hunks)
  • examples/react/start-basic-netlify/vite.config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode with extensive type safety for all code

Files:

  • examples/react/start-basic-netlify/src/routes/customScript[.]js.ts
  • examples/react/start-basic-netlify/src/components/UserError.tsx
  • examples/react/start-basic-netlify/src/routes/posts.index.tsx
  • examples/react/start-basic-netlify/src/routes/api/users.ts
  • examples/react/start-basic-netlify/src/components/NotFound.tsx
  • examples/react/start-basic-netlify/src/components/DefaultCatchBoundary.tsx
  • examples/react/start-basic-netlify/vite.config.ts
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • examples/react/start-basic-netlify/src/utils/loggingMiddleware.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout.tsx
  • examples/react/start-basic-netlify/src/routes/deferred.tsx
  • examples/react/start-basic-netlify/src/components/PostError.tsx
  • examples/react/start-basic-netlify/src/routes/redirect.tsx
  • examples/react/start-basic-netlify/src/routes/users.tsx
  • examples/react/start-basic-netlify/src/routes/api/users.$userId.ts
  • examples/react/start-basic-netlify/src/routes/__root.tsx
  • examples/react/start-basic-netlify/src/utils/seo.ts
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • examples/react/start-basic-netlify/src/routes/posts.$postId.tsx
  • examples/react/start-basic-netlify/src/router.tsx
  • examples/react/start-basic-netlify/src/utils/posts.tsx
  • examples/react/start-basic-netlify/src/routes/posts_.$postId.deep.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx
  • examples/react/start-basic-netlify/src/routes/posts.tsx
  • examples/react/start-basic-netlify/src/utils/users.tsx
  • examples/react/start-basic-netlify/src/routes/users.$userId.tsx
  • examples/react/start-basic-netlify/src/routes/index.tsx
  • examples/react/start-basic-netlify/src/routes/users.index.tsx
  • examples/react/start-basic-netlify/src/routeTree.gen.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Implement ESLint rules for router best practices using the ESLint plugin router

Files:

  • examples/react/start-basic-netlify/src/routes/customScript[.]js.ts
  • examples/react/start-basic-netlify/src/components/UserError.tsx
  • examples/react/start-basic-netlify/src/routes/posts.index.tsx
  • examples/react/start-basic-netlify/src/routes/api/users.ts
  • examples/react/start-basic-netlify/src/components/NotFound.tsx
  • examples/react/start-basic-netlify/src/components/DefaultCatchBoundary.tsx
  • examples/react/start-basic-netlify/vite.config.ts
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • examples/react/start-basic-netlify/src/utils/loggingMiddleware.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout.tsx
  • examples/react/start-basic-netlify/src/routes/deferred.tsx
  • examples/react/start-basic-netlify/src/components/PostError.tsx
  • examples/react/start-basic-netlify/src/routes/redirect.tsx
  • examples/react/start-basic-netlify/src/routes/users.tsx
  • examples/react/start-basic-netlify/src/routes/api/users.$userId.ts
  • examples/react/start-basic-netlify/src/routes/__root.tsx
  • examples/react/start-basic-netlify/src/utils/seo.ts
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • examples/react/start-basic-netlify/src/routes/posts.$postId.tsx
  • examples/react/start-basic-netlify/src/router.tsx
  • examples/react/start-basic-netlify/src/utils/posts.tsx
  • examples/react/start-basic-netlify/src/routes/posts_.$postId.deep.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx
  • examples/react/start-basic-netlify/src/routes/posts.tsx
  • examples/react/start-basic-netlify/src/utils/users.tsx
  • examples/react/start-basic-netlify/src/routes/users.$userId.tsx
  • examples/react/start-basic-netlify/src/routes/index.tsx
  • examples/react/start-basic-netlify/src/routes/users.index.tsx
  • examples/react/start-basic-netlify/src/routeTree.gen.ts
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Use workspace protocol workspace:* for internal dependencies in package.json files

Files:

  • examples/react/start-basic-netlify/package.json
🧠 Learnings (8)
📓 Common learnings
Learnt from: FatahChan
Repo: TanStack/router PR: 5475
File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0
Timestamp: 2025-10-14T18:59:33.990Z
Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.

Applied to files:

  • examples/react/start-basic-netlify/src/routes/customScript[.]js.ts
  • examples/react/start-basic-netlify/.vscode/settings.json
  • examples/react/start-basic-netlify/.prettierignore
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx
  • examples/react/start-basic-netlify/src/routes/index.tsx
  • examples/react/start-basic-netlify/src/routeTree.gen.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{js,ts,tsx} : Implement ESLint rules for router best practices using the ESLint plugin router

Applied to files:

  • examples/react/start-basic-netlify/src/routes/customScript[.]js.ts
  • examples/react/start-basic-netlify/src/routes/posts.index.tsx
  • examples/react/start-basic-netlify/.prettierignore
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout.tsx
  • examples/react/start-basic-netlify/src/routes/redirect.tsx
  • examples/react/start-basic-netlify/src/routes/users.tsx
  • examples/react/start-basic-netlify/src/routes/__root.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • examples/react/start-basic-netlify/src/router.tsx
  • examples/react/start-basic-netlify/src/routes/posts_.$postId.deep.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx
  • examples/react/start-basic-netlify/src/routes/posts.tsx
  • examples/react/start-basic-netlify/tsconfig.json
  • examples/react/start-basic-netlify/src/routes/index.tsx
  • examples/react/start-basic-netlify/src/routeTree.gen.ts
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.

Applied to files:

  • examples/react/start-basic-netlify/.vscode/settings.json
  • examples/react/start-basic-netlify/.prettierignore
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • examples/react/start-basic-netlify/src/router.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx
  • examples/react/start-basic-netlify/src/routes/posts.tsx
  • examples/react/start-basic-netlify/src/routeTree.gen.ts
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.

Applied to files:

  • examples/react/start-basic-netlify/.vscode/settings.json
  • examples/react/start-basic-netlify/src/routes/deferred.tsx
  • examples/react/start-basic-netlify/package.json
  • examples/react/start-basic-netlify/src/routes/redirect.tsx
  • examples/react/start-basic-netlify/src/router.tsx
  • examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx
  • examples/react/start-basic-netlify/src/routes/index.tsx
  • examples/react/start-basic-netlify/src/routeTree.gen.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Use file-based routing in `src/routes/` directories or code-based routing with route definitions

Applied to files:

  • examples/react/start-basic-netlify/src/routes/posts.index.tsx
  • examples/react/start-basic-netlify/src/routes/api/users.ts
  • examples/react/start-basic-netlify/src/routes/posts_.$postId.deep.tsx
  • examples/react/start-basic-netlify/src/routes/index.tsx
  • examples/react/start-basic-netlify/src/routes/users.index.tsx
  • examples/react/start-basic-netlify/src/routeTree.gen.ts
📚 Learning: 2025-10-01T18:30:26.591Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: packages/router-core/src/router.ts:2231-2245
Timestamp: 2025-10-01T18:30:26.591Z
Learning: In `packages/router-core/src/router.ts`, the `resolveRedirect` method intentionally strips the router's origin from redirect URLs when they match (e.g., `https://foo.com/bar` → `/bar` for same-origin redirects) while preserving the full URL for cross-origin redirects. This logic should not be removed or simplified to use `location.publicHref` directly.

Applied to files:

  • examples/react/start-basic-netlify/src/routes/redirect.tsx
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript strict mode with extensive type safety for all code

Applied to files:

  • examples/react/start-basic-netlify/tsconfig.json
🧬 Code graph analysis (20)
examples/react/start-basic-netlify/src/routes/customScript[.]js.ts (1)
examples/react/start-basic-netlify/src/routes/__root.tsx (1)
  • Route (15-63)
examples/react/start-basic-netlify/src/components/UserError.tsx (1)
examples/solid/start-basic-netlify/src/components/UserError.tsx (1)
  • UserErrorComponent (4-6)
examples/react/start-basic-netlify/src/routes/posts.index.tsx (2)
examples/react/start-basic-netlify/src/routes/index.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/users.index.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/api/users.ts (3)
packages/start-server-core/src/request-response.ts (1)
  • getRequestHeaders (77-80)
examples/react/start-basic-netlify/src/routes/api/users.$userId.ts (1)
  • Route (5-32)
examples/react/start-basic-netlify/src/utils/users.tsx (1)
  • User (3-7)
examples/react/start-basic-netlify/src/components/NotFound.tsx (2)
e2e/react-start/server-routes/src/components/NotFound.tsx (1)
  • NotFound (3-25)
examples/react/start-basic-cloudflare/src/components/NotFound.tsx (1)
  • NotFound (3-25)
examples/react/start-basic-netlify/src/components/DefaultCatchBoundary.tsx (1)
packages/router-core/src/router.ts (1)
  • state (1088-1090)
examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout.tsx (3)
examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1)
  • Route (3-7)
examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)
  • Route (3-7)
examples/react/start-basic-netlify/src/routes/deferred.tsx (2)
examples/react/start-basic-netlify/src/routes/index.tsx (1)
  • Route (3-5)
examples/solid/start-basic/src/routes/deferred.tsx (1)
  • Deferred (31-62)
examples/react/start-basic-netlify/src/components/PostError.tsx (4)
examples/solid/start-basic-netlify/src/components/PostError.tsx (1)
  • PostErrorComponent (4-6)
examples/react/start-basic/src/components/PostError.tsx (1)
  • PostErrorComponent (4-6)
examples/solid/start-basic-cloudflare/src/components/PostError.tsx (1)
  • PostErrorComponent (4-6)
examples/react/start-basic-cloudflare/src/components/PostError.tsx (1)
  • PostErrorComponent (4-6)
examples/react/start-basic-netlify/src/routes/users.tsx (3)
examples/react/start-basic-netlify/src/routes/posts.tsx (1)
  • Route (4-7)
examples/react/start-basic-netlify/src/routes/users.$userId.tsx (1)
  • Route (6-13)
examples/react/start-basic-netlify/src/utils/users.tsx (1)
  • fetchUsers (9-19)
examples/react/start-basic-netlify/src/routes/api/users.$userId.ts (3)
examples/react/start-basic-netlify/src/routes/api/users.ts (1)
  • Route (41-63)
examples/react/start-basic-netlify/src/routes/users.$userId.tsx (1)
  • Route (6-13)
examples/react/start-basic-netlify/src/utils/users.tsx (1)
  • User (3-7)
examples/react/start-basic-netlify/src/routes/__root.tsx (4)
examples/react/start-basic-netlify/src/routes/index.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/utils/seo.ts (1)
  • seo (1-33)
examples/react/start-basic-netlify/src/components/DefaultCatchBoundary.tsx (1)
  • DefaultCatchBoundary (10-53)
examples/react/start-basic-netlify/src/components/NotFound.tsx (1)
  • NotFound (3-25)
examples/react/start-basic-netlify/src/utils/seo.ts (1)
scripts/llms-generate.mjs (1)
  • title (101-101)
examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (3)
examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)
  • Route (3-7)
examples/react/start-basic-netlify/src/routes/posts.$postId.tsx (8)
examples/react/start-basic-netlify/src/routes/__root.tsx (1)
  • Route (15-63)
examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/index.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/posts.index.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/posts.tsx (1)
  • Route (4-7)
examples/react/start-basic-netlify/src/routes/posts_.$postId.deep.tsx (1)
  • Route (5-12)
examples/react/start-basic-netlify/src/routes/redirect.tsx (1)
  • Route (3-9)
examples/react/start-basic-netlify/src/components/PostError.tsx (1)
  • PostErrorComponent (4-6)
examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx (2)
examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/index.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/posts.tsx (2)
examples/react/start-basic-netlify/src/routes/posts.$postId.tsx (1)
  • Route (6-13)
examples/react/start-basic-netlify/src/utils/posts.tsx (1)
  • fetchPosts (31-41)
examples/react/start-basic-netlify/src/routes/users.$userId.tsx (4)
examples/react/start-basic-netlify/src/routes/api/users.ts (1)
  • Route (41-63)
examples/react/start-basic-netlify/src/utils/users.tsx (1)
  • fetchUser (21-37)
examples/react/start-basic-netlify/src/components/UserError.tsx (1)
  • UserErrorComponent (4-6)
examples/react/start-basic-netlify/src/components/NotFound.tsx (1)
  • NotFound (3-25)
examples/react/start-basic-netlify/src/routes/index.tsx (5)
examples/react/start-basic-netlify/src/routes/__root.tsx (1)
  • Route (15-63)
examples/react/start-basic-netlify/src/routes/posts.$postId.tsx (1)
  • Route (6-13)
examples/react/start-basic-netlify/src/routes/posts.tsx (1)
  • Route (4-7)
examples/react/start-basic-netlify/src/routes/redirect.tsx (1)
  • Route (3-9)
examples/react/start-basic-netlify/src/routes/users.$userId.tsx (1)
  • Route (6-13)
examples/react/start-basic-netlify/src/routes/users.index.tsx (5)
examples/react/start-basic-netlify/src/routes/__root.tsx (1)
  • Route (15-63)
examples/react/start-basic-netlify/src/routes/api/users.ts (1)
  • Route (41-63)
examples/react/start-basic-netlify/src/routes/index.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/posts.index.tsx (1)
  • Route (3-5)
examples/react/start-basic-netlify/src/routes/users.$userId.tsx (1)
  • Route (6-13)
🪛 Biome (2.1.2)
examples/react/start-basic-netlify/src/routes/deferred.tsx

[error] 43-43: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)


[error] 53-53: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)

🔇 Additional comments (38)
examples/react/start-basic-netlify/src/components/UserError.tsx (1)

1-2: LGTM!

The imports are properly structured with correct type import syntax for ErrorComponentProps.

examples/react/start-basic-netlify/.gitignore (1)

1-24: LGTM!

The ignore patterns are comprehensive and appropriate for a Netlify + TanStack Start project, covering dependencies, build artifacts, environment files, test outputs, and platform-specific folders.

examples/react/start-basic-netlify/.prettierignore (1)

1-4: LGTM!

The Prettier ignore patterns correctly exclude build artifacts, public assets, and the autogenerated routeTree.gen.ts file, aligning with TanStack Router conventions.

examples/react/start-basic-netlify/.vscode/settings.json (1)

1-11: LGTM!

The VSCode settings appropriately prevent modification of the autogenerated routeTree.gen.ts file by excluding it from file watching, search, and marking it read-only.

examples/react/start-basic-netlify/src/routes/posts.index.tsx (1)

1-9: LGTM!

The route definition follows TanStack Router file-based routing conventions correctly, and the component provides an appropriate placeholder for the posts index route.

examples/react/start-basic-netlify/src/routes/users.index.tsx (1)

1-19: LGTM!

The route definition follows TanStack Router conventions correctly. The component appropriately uses a native anchor tag to link to the JSON API endpoint (external navigation for viewing raw JSON is suitable here).

examples/react/start-basic-netlify/public/site.webmanifest (2)

4-18: LGTM!

The icon definitions, theme colors, and display mode are configured appropriately for a PWA manifest.


2-3: Populate the name and short_name fields.

The name and short_name fields are empty, which will result in a poor Progressive Web App (PWA) experience. These should be populated with appropriate values for the example application.

Apply this diff to add example values:

-  "name": "",
-  "short_name": "",
+  "name": "TanStack Start Netlify Example",
+  "short_name": "TS Netlify",
⛔ Skipped due to learnings
Learnt from: hokkyss
Repo: TanStack/router PR: 5418
File: e2e/react-start/custom-identifier-prefix/public/site.webmanifest:2-3
Timestamp: 2025-10-09T12:59:14.842Z
Learning: In e2e test fixtures (files under e2e directories), empty or placeholder values in configuration files like site.webmanifest are acceptable and should not be flagged unless the test specifically validates those fields.
examples/react/start-basic-netlify/package.json (1)

1-13: LGTM!

The package metadata, scripts, and external dependencies (Netlify plugin, React, Vite, TypeScript, etc.) are configured appropriately for a TanStack Start + Netlify example project.

Also applies to: 17-34

examples/react/start-basic-netlify/src/routes/customScript[.]js.ts (1)

1-15: LGTM!

The server route correctly demonstrates dynamic JavaScript file generation. The filename uses TanStack Router's bracket escaping syntax ([.]) to create a literal .js route, the Response construction is correct, and the Content-Type header is appropriately set.

examples/react/start-basic-netlify/README.md (1)

1-37: LGTM!

The README is well-structured with clear setup instructions, appropriate links to documentation, and standard build commands for the example project.

examples/react/start-basic-netlify/src/routes/users.$userId.tsx (2)

10-12: notFoundComponent may not trigger as expected.

Looking at fetchUser in utils/users.tsx, it throws Error('User not found') on 404 rather than calling notFound(). This means the errorComponent will handle 404s, and notFoundComponent will never be triggered.

For consistency with fetchPost (which correctly uses throw notFound()), consider updating fetchUser to use notFound(), or remove the notFoundComponent here to avoid confusion.


15-31: LGTM!

The component correctly uses Route.useLoaderData() to access the loaded user data and renders the user information with appropriate styling. The raw <a> tag for the JSON API link is appropriate since it's intended to navigate to a server route.

examples/react/start-basic-netlify/src/utils/loggingMiddleware.tsx (1)

1-41: LGTM! Clean middleware implementation.

The two-stage middleware pattern correctly tracks client/server timing through the request lifecycle. The use of sendContext to pass timing data between phases is appropriate.

examples/react/start-basic-netlify/src/utils/posts.tsx (1)

18-24: Good use of notFound() for 404 handling.

The error handling correctly uses notFound() for 404 responses, which integrates properly with TanStack Router's not-found handling.

examples/react/start-basic-netlify/postcss.config.mjs (1)

1-5: LGTM! Standard Tailwind PostCSS configuration.

The configuration is minimal and correct for processing Tailwind CSS with the new @tailwindcss/postcss plugin.

examples/react/start-basic-netlify/src/components/PostError.tsx (1)

1-6: LGTM! Consistent with other TanStack examples.

The component is a simple wrapper around ErrorComponent and matches the pattern used in other examples (start-basic, start-basic-cloudflare, etc.).

examples/react/start-basic-netlify/src/routes/index.tsx (1)

1-13: LGTM! Clean root route definition.

The route follows TanStack Router file-based routing conventions. The Home component is correctly hoisted and used in the route configuration.

examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx (1)

1-16: LGTM! Correct pathless layout pattern.

The route correctly implements a pathless layout using the underscore prefix convention and properly renders child routes via <Outlet />.

examples/react/start-basic-netlify/src/router.tsx (1)

1-15: LGTM! Standard router configuration.

The router setup follows TanStack Router best practices with appropriate defaults:

  • Intent-based preloading for better UX
  • Custom error and not-found boundaries
  • Scroll restoration enabled
examples/react/start-basic-netlify/tsconfig.json (1)

1-22: LGTM! Excellent TypeScript configuration.

The configuration correctly enables strict mode and modern TypeScript features, aligning with the coding guidelines for extensive type safety.

examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1)

1-11: LGTM! Clean route implementation.

The route follows TanStack Router conventions correctly with proper file-based routing setup.

examples/react/start-basic-netlify/src/styles/app.css (1)

1-30: LGTM! Modern Tailwind setup.

The CSS uses Tailwind v4's new @import syntax and provides appropriate base styling with light/dark mode support.

examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)

1-11: LGTM! Clean route implementation.

The route follows TanStack Router conventions correctly with proper file-based routing setup.

examples/react/start-basic-netlify/src/routes/redirect.tsx (1)

1-9: LGTM! Correct redirect implementation.

The redirect pattern using throw redirect() in beforeLoad is the proper way to handle redirects in TanStack Router.

examples/react/start-basic-netlify/vite.config.ts (1)

12-21: No action needed. The plugin order is correct and does not require changes. According to official Netlify and TanStack Start documentation, the netlifyPlugin() can be placed anywhere in the Vite plugins array, so its position relative to other plugins does not affect build behavior or runtime functionality.

examples/react/start-basic-netlify/src/routes/posts.$postId.tsx (2)

1-13: Route configuration is well-structured.

The route correctly implements:

  • Data fetching via loader with proper param extraction
  • Error boundary handling
  • Not found component for missing posts
  • Type-safe route definition

The mixed import styles (relative ../utils/posts vs alias ~/components/...) work but could be unified for consistency.


15-34: LGTM!

The component correctly uses Route.useLoaderData() for type-safe data access and properly passes the postId param to the deep view link.

examples/react/start-basic-netlify/src/routes/users.tsx (2)

4-7: LGTM!

The route configuration follows the established pattern in this example project, correctly wiring the loader to fetchUsers() and the component.


15-17: Intentional test data for not-found demonstration.

The hardcoded non-existent user entry is a useful pattern for demonstrating the notFoundComponent behavior defined in /users/$userId route.

examples/react/start-basic-netlify/src/routes/posts.tsx (1)

4-7: LGTM!

The route configuration correctly sets up the loader with fetchPosts() and component binding.

examples/react/start-basic-netlify/src/routes/__root.tsx (1)

15-63: Root route configuration is well-structured.

The route properly configures:

  • SEO metadata via the seo utility
  • Favicon and manifest links
  • Error and not-found boundaries
  • Shell component for document structure
examples/react/start-basic-netlify/src/routes/deferred.tsx (3)

5-16: LGTM!

The server functions are correctly defined with input validation and appropriate handlers. The slowServerFn properly demonstrates async behavior with a delay.


18-29: Deferred loading pattern is correctly implemented.

The loader properly demonstrates:

  • deferredStuff: Raw promise (not awaited)
  • deferredPerson: Server function call (not awaited)
  • person: Immediately resolved data (awaited)

This is the correct pattern for streaming/deferred data with TanStack Start.


40-55: Biome warning is a false positive for TanStack Router's Await API.

The static analysis flags children prop usage, but Await from @tanstack/react-router uses a render prop pattern where children is a function receiving the resolved data. This is the intended API usage, not JSX children.

examples/react/start-basic-netlify/src/routeTree.gen.ts (1)

1-447: Generated route tree – intentionally excluded from manual review

This routeTree.gen.ts file is auto-generated (as indicated by its header and repository conventions) and should not be edited, linted, or formatted manually. I’m treating it as a build artifact and not reviewing its internal contents; any changes should come from updating the source routes/config that feed the generator. Based on learnings, this file is excluded from detailed review.

examples/react/start-basic-netlify/src/routes/api/users.ts (2)

1-5: Imports and types are minimal and correctly used

All imported symbols are used in this file, and the type-only import keeps the runtime bundle clean. No issues here.


15-21: Parent middleware behavior and header stamping look good

The parent middleware’s “in/out” logging and addition of an x-test-parent header are straightforward and side‑effect free beyond intentional logging/header mutation. No problems spotted here.

TomasBankauskas and others added 2 commits December 11, 2025 22:17
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@TomasBankauskas
Copy link
Author

@coderabbitai generate docstrings

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

✅ Actions performed

Initiated docstring generation; will generate only if new commits exist.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #6073

coderabbitai bot added a commit that referenced this pull request Dec 11, 2025
Docstrings generation was requested by @TomasBankauskas.

* #6071 (comment)

The following files were modified:

* `examples/react/start-basic-netlify/src/components/DefaultCatchBoundary.tsx`
* `examples/react/start-basic-netlify/src/components/NotFound.tsx`
* `examples/react/start-basic-netlify/src/components/PostError.tsx`
* `examples/react/start-basic-netlify/src/components/UserError.tsx`
* `examples/react/start-basic-netlify/src/router.tsx`
* `examples/react/start-basic-netlify/src/routes/__root.tsx`
* `examples/react/start-basic-netlify/src/routes/_pathlessLayout.tsx`
* `examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout.tsx`
* `examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-a.tsx`
* `examples/react/start-basic-netlify/src/routes/_pathlessLayout/_nested-layout/route-b.tsx`
* `examples/react/start-basic-netlify/src/routes/deferred.tsx`
* `examples/react/start-basic-netlify/src/routes/index.tsx`
* `examples/react/start-basic-netlify/src/routes/posts.$postId.tsx`
* `examples/react/start-basic-netlify/src/routes/posts.index.tsx`
* `examples/react/start-basic-netlify/src/routes/posts.tsx`
* `examples/react/start-basic-netlify/src/routes/posts_.$postId.deep.tsx`
* `examples/react/start-basic-netlify/src/routes/users.$userId.tsx`
* `examples/react/start-basic-netlify/src/routes/users.index.tsx`
* `examples/react/start-basic-netlify/src/routes/users.tsx`
@TomasBankauskas
Copy link
Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@serhalp serhalp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. couple suggestions.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfebcf1 and 631d869.

📒 Files selected for processing (1)
  • examples/react/start-basic-netlify/vite.config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode with extensive type safety for all code

Files:

  • examples/react/start-basic-netlify/vite.config.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Implement ESLint rules for router best practices using the ESLint plugin router

Files:

  • examples/react/start-basic-netlify/vite.config.ts
🔇 Additional comments (1)
examples/react/start-basic-netlify/vite.config.ts (1)

1-5: Imports + plugin selection look correct for a minimal Netlify-enabled Start example.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 631d869 and 5b81075.

📒 Files selected for processing (1)
  • examples/react/start-basic-netlify/vite.config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode with extensive type safety for all code

Files:

  • examples/react/start-basic-netlify/vite.config.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Implement ESLint rules for router best practices using the ESLint plugin router

Files:

  • examples/react/start-basic-netlify/vite.config.ts
🪛 Biome (2.1.2)
examples/react/start-basic-netlify/vite.config.ts

[error] 22-23: Expected a statement but instead found '})'.

Expected a statement here.

(parse)

🔇 Additional comments (1)
examples/react/start-basic-netlify/vite.config.ts (1)

1-21: LGTM! Configuration correctly implements previous feedback.

The server configuration now correctly uses process.env.PORT with a fallback and enables strictPort, addressing the previous review concern about hardcoded ports. Plugin ordering follows TanStack Start best practices.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe31e97 and a9247db.

📒 Files selected for processing (1)
  • examples/react/start-basic-netlify/src/utils/seo.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode with extensive type safety for all code

Files:

  • examples/react/start-basic-netlify/src/utils/seo.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Implement ESLint rules for router best practices using the ESLint plugin router

Files:

  • examples/react/start-basic-netlify/src/utils/seo.ts
🧬 Code graph analysis (1)
examples/react/start-basic-netlify/src/utils/seo.ts (1)
scripts/llms-generate.mjs (1)
  • title (101-101)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
examples/react/start-basic-netlify/src/utils/seo.ts (1)

1-37: Add explicit return type for better type safety.

Per the TypeScript coding guidelines, add an explicit return type annotation to improve type safety and IDE support.

+type MetaTag = 
+  | { title: string }
+  | { name: string; content: string }
+  | { property: string; content: string }
+
 export const seo = ({
   title,
   description,
   keywords,
   image,
 }: {
   title: string
   description?: string
   image?: string
   keywords?: string
-}) => {
+}): MetaTag[] => {
   const tags = [

As per coding guidelines, use TypeScript strict mode with extensive type safety for all code.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9247db and 998f7c8.

📒 Files selected for processing (1)
  • examples/react/start-basic-netlify/src/utils/seo.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode with extensive type safety for all code

Files:

  • examples/react/start-basic-netlify/src/utils/seo.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Implement ESLint rules for router best practices using the ESLint plugin router

Files:

  • examples/react/start-basic-netlify/src/utils/seo.ts
🧬 Code graph analysis (1)
examples/react/start-basic-netlify/src/utils/seo.ts (1)
scripts/llms-generate.mjs (1)
  • title (101-101)
🔇 Additional comments (1)
examples/react/start-basic-netlify/src/utils/seo.ts (1)

14-33: Previous issues have been resolved—implementation is now correct.

The code now properly:

  • Uses property for Open Graph tags (lines 22-23, 25, 31)
  • Uses name for Twitter Card and standard meta tags
  • Conditionally includes optional fields only when values are defined, preventing content: undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants