• Product Introduction
  • Quick Start
    • Importing a Git Repository
    • Starting From a Template
    • Direct Upload
    • Start with AI
  • Framework Guide
    • Frontends
      • Vite
      • React
      • Vue
      • Other Frameworks
    • Backends
    • Full-stack
      • Next.js
      • Nuxt
      • Astro
      • React Router
      • SvelteKit
      • TanStack Start
      • Vike
    • Custom 404 Page
  • Project Guide
    • Project Management
    • edgeone.json
    • Configuring Cache
    • Error Codes
  • Build Guide
  • Deployment Guide
    • Overview
    • Create Deploys
    • Manage Deploys
    • Deploy Button
    • Using Github Actions
    • Using CNB Plugin
    • Using IDE PlugIn
    • Using CodeBuddy IDE
  • Domain Management
    • Overview
    • Custom Domain
    • HTTPS Configuration
      • Overview
      • Apply for Free Certificate
      • Using Managed SSL Certificate
    • Configure DNS CNAME Record
  • Observability
    • Overview
    • Metric Analysis
    • Log Analysis
  • Pages Functions
    • Overview
    • Edge Functions
    • Cloud Functions
      • Overview
      • Node Functions
  • Middleware
  • KV Storage
  • Edge AI
  • API Token
  • EdgeOne CLI
  • Pages MCP
  • Message Notification
  • Integration Guide
    • AI
      • Dialogue Large Models Integration
      • Large Models for Images Integration
    • Database
      • Supabase Integration
      • Pages KV Integration
    • Ecommerce
      • Shopify Integration
      • WooCommerce Integration
    • Payment
      • Stripe Integration
      • Integrating Paddle
    • CMS
      • WordPress Integration
      • Contentful Integration
      • Sanity Integration
      • Payload Integration
    • Authentication
      • Supabase Integration
      • Clerk Integration
  • Best Practices
    • Using General Large Model to Quickly Build AI Application
    • Use the DeepSeek model to quickly build a conversational AI site
    • Building an Ecommerce Platform with Shopify
    • Building a SaaS Site Using Supabase and Stripe
    • Building a Company Brand Site Quickly
    • How to Quickly Build a Blog Site
  • Migration Guides
    • Migrating from Vercel to EdgeOne Pages
    • Migrating from Cloudflare Pages to EdgeOne Pages
    • Migrating from Netlify to EdgeOne Pages
  • Troubleshooting
  • FAQs
  • Contact Us
  • Release Notes

TanStack Start

TanStack Start is a full-stack Web framework based on TanStack Router, now supporting React and Solid. Combining Vite build capacity, it provides type-safe routes, Server-side rendering (SSR), streaming, Server Functions, and other features, enabling you to build high-performance full-stack Web applications.
Note:
Pages now supports TanStack Start 1.0+ with full-stack deployment capabilities.

Core Features

Type-safe routing: Fully support TypeScript with type inference for routing parameters and data loading.
Full-stack framework: Support server-side rendering, API routing, and integration of front-end and back-end development.
File-based routing: Based on the file system route agreement, automatically generate a route tree.
Data loading: Built-in loader mechanism supports server-side data retrieval.
Streaming rendering: Supports React 18 Suspense and streaming SSR.

Getting Started

You can deploy TanStack Start projects on EdgeOne Pages in the following ways:
Import a TanStack Start project from a Git repository
Select the TanStack Start template from the Pages template library
Use the @edgeone/tanstack-start framework adapter to deploy a local project
Learn about TanStack Start performance on Pages deploy, and click the sample template below:


Pages Support for TanStack Start

TanStack Start Feature
System Support
Server-Side Rendering (SSR)
Static Site Generation (SSG)
Single Page Application (SPA)
Route Loaders
Server Functions
File-based Routing
Streaming

Deploying a TanStack Start Project on Pages

@edgeone/tanstack-start is a Vite plug-in designed for the Pages platform, automatically building TanStack Start applications into Pages deployment products. Combined with Pages scaffolding, it enables quick deployment of TanStack Start projects.
To deploy a TanStack Start project to Pages, follow the steps below.

1. Installing an Adapter

npm install @edgeone/tanstack-start

2. Configure Vite

In vite.config.ts, introduce and use @edgeone/tanstack-start:
import { defineConfig } from "vite";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import viteReact from "@vitejs/plugin-react";
import edgeoneAdapter from "@edgeone/tanstack-start";

export default defineConfig({
plugins: [
tanstackStart(),
viteReact(),
edgeoneAdapter(), // Add the Edgeone adapter
],
});

3. Deploy Project

Git Connection Deployment
After seamless integration of the adapter, commit the project to GitHub or GitLab, and use Git connection deployment.
CLI Deployment
Install the scaffolding tool for Pages (see EdgeOne CLI), then use the command to deploy once configured:
edgeone pages deploy
Note:
The current adapter does not support simultaneous use with the Nitro plug-in. If you need to use Nitro, please wait for the official EdgeOne Pages preset to be released.

Server-Side Rendering (SSR)

TanStack Start enables SSR by default. Use the loader function to retrieve data from the server.
// app/routes/posts.$postId.tsx
import { createFileRoute } from "@tanstack/react-router";

export const Route = createFileRoute("/posts/$postId")({
loader: async ({ params }) => {
const post = await fetchPost(params.postId);
return { post };
},
component: PostComponent,
});

function PostComponent() {
const { post } = Route.useLoaderData();
return (
<article>
<h1>{post.title}</h1>
<div>{post.content}</div>
</article>
);
}

Static Site Generation (SSG)

Support pre-rendering static pages during build.
// app/routes/about.tsx
import { createFileRoute } from "@tanstack/react-router";

export const Route = createFileRoute("/about")({
// Static data pre-rendered at build time
loader: () => ({
title: "About Us",
description: "Learn more about our company.",
}),
component: AboutComponent,
});

function AboutComponent() {
const data = Route.useLoaderData();
return (
<div>
<h1>{data.title}</h1>
<p>{data.description}</p>
</div>
);
}

Server Functions

TanStack Start supports server functions, which can run on the server for sensitive operations.
// app/routes/api.ts
import { createServerFn } from "@tanstack/react-start/server";

export const getServerTime = createServerFn().handler(async () => {
return new Date().toISOString();
});

export const createUser = createServerFn()
.validator((data: { name: string; email: string }) => data)
.handler(async ({ data }) => {
// Execute a database operation on the server
const user = await db.users.create(data);
return user;
});

Streaming Rendering

Support streaming rendering through React 18's Suspense, gradually transmitting page content.
import { Suspense } from "react";
import { createFileRoute, Await } from "@tanstack/react-router";

export const Route = createFileRoute("/dashboard")({
// Return Promises without awaiting
loader: () => ({
posts: fetchPosts(),
stats: fetchStats(),
}),
component: DashboardComponent,
});

function DashboardComponent() {
const { posts, stats } = Route.useLoaderData();

return (
<div>
<Suspense fallback={<p> Loading posts... </p>}>
<Await promise={posts}>{(data) => <PostList posts={data} />}</Await>
</Suspense>
<Suspense fallback={<p> Loading stats... </p>}>
<Await promise={stats}>{(data) => <StatsPanel stats={data} />}</Await>
</Suspense>
</div>
);
}

More Resources

ai-agent
You can ask me like
How to Get Started with EdgeOne Pages?