welcome tanstack start - #1
Merged
Merged
Conversation
Migrate the Vite SPA to TanStack Start (SSR + file-based routing): - Add @tanstack/react-start and @tanstack/react-router - Wire tanstackStart() into vite.config.ts (keep manual @ alias) - Add src/router.tsx, __root.tsx document shell, and index route - Move the landing page from App.tsx into src/routes/index.tsx - Drop index.html and main.tsx (root route owns the document) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Sample blog posts in src/data/posts.ts - Server functions (createServerFn) getPosts/getPost in src/lib/blog.ts - Landing route: hero + blog stream, loaded via route loader (SSR) - Post detail route blog.$slug.tsx with notFound handling - Drop leftover Vite-template App.css and logo assets - eslint: ignore generated route tree, allow _-prefixed unused vars, disable react-refresh only-export-components for routes and ui dirs Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Restructure the template to mirror labset/startup's web/apps/site and fold in the practices from the "building this site" post. Structure: - content/ owns the MDX loader (posts.ts) + authors.ts, with meta validation - providers/theme/ split into context, hook, provider, barrel - dedicated page components (landing-page, blog-index, blog-post-page, not-found) with thin routes pointing at them - root-document + site-layout + site-header/footer shells - components/mdx/ for the element map and a sample Callout - routes/blog/ dir (index + $slug) and a prerendered 404 route Best practices: - MDX content layer via import.meta.glob (no Shiki, per choice) - static prerendering (crawlLinks) + explicit /404 page - full SEO: socialMeta() OG/Twitter tags + self-referencing canonical - dark mode via useSyncExternalStore + pre-paint inline theme script Tooling: - gitignore the generated src/routeTree.gen.ts; build is "vite build && tsc -b" so the tree is generated before typecheck - eslint only relaxes react-refresh for ui/**; tsconfig keeps baseUrl with ignoreDeprecations "6.0" Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the hand-rolled ui primitives with the real shadcn (base-luma)
components from the site app, and make sure each is actually used.
- button: forward render + nativeButton, so `render={<a/>}` no longer emits
an invalid type="button" on anchors (now role="button")
- badge: canonical useRender-based variant set (default/secondary/outline/
ghost/link/destructive)
- card: canonical size-aware Card with Header/Title/Description/Content/
Footer/Action
- sheet: canonical four-side sheet with built-in close, Header/Footer/Title/
Description
- add a features section that uses Card + Badge (Card was previously unused)
and link it from the header/footer nav
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the stock Vite boilerplate with docs for this template: stack, source structure, how to write MDX posts, prerendering, SEO, and the dev/build workflow. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Group the loose files under src/components/ by domain instead of leaving them flat, alongside the existing ui/ and mdx/: - layout/ — root-document, site-layout, site-header/footer, theme-toggle, not-found - home/ — landing-page, hero-section, features-section, latest-posts-section - blog/ — blog-index, blog-post, blog-post-page, post-card Rewrite the @/components import paths and update the README structure. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rebuilds the template on TanStack Start and turns it into a content-driven
starter: a landing page and an MDX blog, server-rendered and statically
prerendered. The structure mirrors the sibling
labset/startupweb/apps/siteapp and folds in the practices from the "building this site" post.
What's included
__root.tsxdocumentshell, and
getRouter(); noindex.html. Route files stay thin and point atdedicated page components.
src/content/posts/YYYY/MM/*.mdx,discovered with
import.meta.glob, withmetavalidated at build time and anauthor registry. (No Shiki, by choice.)
HTML (
crawlLinks), plus an explicit prerendered/404.socialMeta()OG/Twitter tags + self-referencing canonical links,per route.
SITE_URLlives insrc/lib/site.ts.toggle backed by
useSyncExternalStore.button,card,badge,sheet,separator(not hand-rolled), each actually used. Fixes an invalidtype="button"that hand-rolled anchors were emitting.ui/,mdx/,layout/,home/,blog/) instead of loose files.Structure
Tooling
src/routeTree.gen.tsis gitignored; build isvite build && tsc -bso thetree is generated before the type-check.
react-refresh/only-export-componentsonly forui/**.Testing
pnpm build— passes, prerenders 8 static pages (home,/blog, 3 posts,/404,/#features)tsc -b— passespnpm lint— passesNotes
SITE_URLinsrc/lib/site.ts(currentlyhttps://example.com) toyour deployed origin before shipping — it drives canonical + OG URLs.
dist/client/for a static host.🤖 Generated with Claude Code