add: Start basic netlify
Add start-basic-netlify example with @netlify/vite-plugin-tanstack-start in examples dir.
Summary by CodeRabbit
-
New Features
- Added a full TanStack Start + Netlify React example demonstrating file-based routing, dynamic routes, server-backed loaders, deferred data, API endpoints, error boundaries, and developer tooling.
-
Documentation
- Added a README with setup, dev, and build instructions for the example.
-
Style
- Included Tailwind-based app styling and editor config to ignore generated files.
βοΈ Tip: You can customize this high-level summary in your review settings.
[!IMPORTANT]
Review skipped
Review was skipped due to path filters
:no_entry: Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlCodeRabbit 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 thedistdirectory, by removing the pattern from both the lists.You can disable this status message by setting the
reviews.review_statustofalsein 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
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
- TanStack/router#5575 β parallel "start-basic-netlify" / example scaffolds adding similar routeTree, router, routes, and utils.
- TanStack/router#5557 β adds file-based router scaffolding (routeTree.gen.ts, router.tsx, __root route) similar to this example.
- TanStack/router#5211 β migration/usage patterns for createFileRoute/createServerFn and router wiring used across these examples.
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.
Comment @coderabbitai help to get the list of available commands and usage tips.
@coderabbitai generate docstrings
β Actions performed
Initiated docstring generation; will generate only if new commits exist.
[!NOTE] Docstrings generation - SUCCESS Generated docstrings for this pull request at https://github.com/TanStack/router/pull/6073
@coderabbitai review
β 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.