Repository navigation
feat(studio): TanStack project routes — auth/logs/settings/functions (stack 5.2/6, from #46424) - #47118
Conversation
…RAMEWORK flag (1/6, from #46424) Foundation of the TanStack Start migration (#46424), split into a reviewable stack. Next remains the default and only active framework after this PR — the TanStack build pipeline is wired up but has no routes yet, so it isn't functional or tested until later PRs flip the feature flag. - package.json: dev/build/start now dispatch via scripts/dispatch.js (defaults to next); add :next/:tanstack variants, vite/tanstack deps. - scripts: dispatch.js, serve.js, smoke-server.mjs, generateLocalEnv.js. - vite.config.ts, turbo.jsonc, tsconfig.json (jsx: react-jsx, Bundler). - next.config.ts + redirects.shared.ts (shared redirect rules with vercel.ts), proxy.ts/start.ts middleware + hosted-api-allowlist.ts. - companion adaptations the tsconfig change requires to keep typecheck green (BufferSource casts, packages/ui unused-React import removals, etc.). Verified: frozen install, studio typecheck, Next build, and lint ratchet all green; Next stays the default build.
…46424) Adds compat/next/* — drop-in shims for next/link, next/router, next/navigation, next/head, next/image, next/script, next/dynamic, next/server, and a toWebHandler (compat/next/api.ts) that lets pages-router API handlers run as TanStack server routes. Under TanStack these are wired in via Vite aliases (next/* -> @/compat/next/*); Next never imports them, so this is purely additive. No routes consume them yet — that starts in the next stack PR. Stacked on #47107. Verified: studio typecheck + lint (0 errors).
…outes (stack 3/6, from #46424) Adds the TanStack Start app skeleton: routes/__root.tsx (root layout + redirect beforeLoad), router.tsx, and the _auth (sign-in/up, forgot/reset password, SSO/MFA/partner, CLI login) and _app (account, org/$slug, support) route trees. These are thin wrappers that render the existing pages-router page components via the compat shims from #47110. routeTree.gen.ts is REGENERATED by the tanstackStart vite plugin for exactly the routes present in this PR (not copied from the migration branch, whose tree references all ~300 routes) — so it typechecks standalone. API routes and project routes (and a full regenerated tree) land in the next stack PRs. Stacked on #47110. Verified: studio typecheck + lint (0 errors). Next is unaffected (it builds pages/, ignores routes/).
…outes (stack 4/6, from #46424) Adds routes/api/** — ~104 thin TanStack server routes, each wrapping the existing pages/api handler via toWebHandler (compat shim from S2). Mechanical and homogeneous: createFileRoute(...).server.handlers = { METHOD: handler }. Covers platform (pg-meta, auth, storage, integrations, telemetry, ...), ai, v1, connect, content/mcp, and the standalone utility endpoints. routeTree.gen.ts is REGENERATED for the routes now present (root + auth/app + api). Project page routes + the full tree land in stack 5. Stacked on #47112. Verified: studio typecheck + lint (0 errors). Next is unaffected (builds pages/, ignores routes/).
…tack 5.1/6, from #46424) First half of the project routes (split from the original S5 to stay under CodeRabbit's 150-file review limit). Covers the data cluster — database, editor, sql, storage, realtime, branches — plus the top-level/onboarding routes (authorize, join, logout, redeem, verify-email, claim-project, vercel/ github integration entrypoints) and the _app/_auth layout shells + /org/_, /project/_ catch-alls. Supporting page edits: hoist BranchesPageWrapper out of getLayout, ConnectStepsSection import.meta.glob, api/server.js. routeTree.gen.ts regenerated for the routes present so far. Remaining product surfaces (auth, logs, settings, observability, functions, advisors, integrations) land in 5.2. Stacked on #47113. Verified: studio typecheck, lint (0 errors), Next build (181/181 pages).
…etc (stack 5.2/6, from #46424) Second half of the project routes (split from S5 for CodeRabbit's 150-file review cap). Covers the remaining product surfaces: auth, logs, settings, observability, functions, advisors, and project-level integrations. Supporting page edits: hoist EdgeFunctionsIndexPageWrapper out of getLayout (functions), functions/secrets, and move DefaultLayout to the root for logs. routeTree.gen.ts regenerated for the full route set — now byte-identical to the migration branch. After this the TanStack app is structurally complete; stack 6 flips on the E2E matrix. Stacked on #47117. Verified: studio typecheck, lint (0 errors), Next build (181/181 pages).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
🎭 Playwright Test ResultsDetails
Flaky testsFeatures › queue-table-operations.spec.ts › Queue Table Operations › pending changes persist when switching between tables Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
Iterating response.headers and calling res.setHeader collapses duplicate keys; for set-cookie the Headers iterator joins every cookie into one comma-separated value, corrupting auth/session cookies. Pull cookies out via getSetCookie() and set them as an array. Addresses PR review feedback.
The navigate() shim overloaded Next's `shallow` option as the
push-vs-replace signal, but the ternary was inverted so replace() did a
push. Inverting it naively would also break the 5 push(url, { shallow:
true }) call sites, since shallow is a real Next option (no-op here) and
has nothing to do with push vs replace. Use a dedicated internal
`_replace` flag instead, matching Next's pages-router where push always
pushes and replace always replaces regardless of shallow.
Addresses PR review feedback.
The Next pages pass inboundFlow to SignInLayout (sign-in -> 'sign-in', sign-up -> 'sign-up'), which gates the focused-provider interstitial and destination-branded heading for inbound auth links. The TanStack route wrappers dropped it. sign-in-sso intentionally left unchanged — its Next page doesn't pass inboundFlow either. Addresses PR review feedback.
…backpressure - mcp: stringify the non-Error throw in the 500 fallback instead of embedding the raw value, so a circular/non-serializable cause can't make JSON.stringify throw inside the catch. - functions body: build the multipart stream from an async generator via Readable.from(...).toWeb() so file reads honour consumer backpressure and close the file handle on client disconnect, instead of eagerly buffering every file in ReadableStream.start(). Addresses PR review feedback.
The DatabaseLayout title read only the leaf match's staticData, so trigger sub-routes (triggers/data, triggers/event, the index) that don't define their own title rendered an empty title instead of inheriting 'Triggers' from the triggers.tsx section layout. Walk up the match chain to the nearest databaseLayoutTitle. Still returns a string so the select() memoization holds. Addresses PR review feedback.
Extract the .env parser into scripts/lib/env.js so dispatch.js and serve.js use one implementation instead of duplicating the regex. dispatch.js now reads .env as well as .env.local (matching serve.js / vite precedence: shell > .env.local > .env), so STUDIO_FRAMEWORK set in .env is picked up — previously only .env.local was read, which is why setting it in .env silently did nothing. Addresses PR review feedback.
# Conflicts: # apps/studio/routeTree.gen.ts
master changed components/ui/NoPermission to a named-only export; update the ported TanStack route to match (was a default import, breaking the vite build).
# Conflicts: # apps/studio/routeTree.gen.ts
# Conflicts: # apps/studio/routeTree.gen.ts # apps/studio/routes/new/$slug.tsx
The WizardLayout fix (constrained wizard width + auth guard) did not make it into 5.1 before it merged, so master carries the superseded PageLayout version. Restore the canonical version here so it lands when this PR merges.
Braintrust eval report
|
) (#47119) **Stack 6/6 (final)** of the TanStack Start migration (#46424). The middle slices (#47107 → #47118) have all merged, so this now sits directly on master. ## What's in this PR One file: `.github/workflows/studio-e2e-test.yml` — adds `framework: [next, tanstack]` to the test/report matrices and sets `STUDIO_FRAMEWORK` (consumed by `scripts/dispatch.js`). Until now CI only built/tested Next. This flips on the dual-framework E2E matrix so the TanStack build gets exercised end-to-end on every run. ##⚠️ Depends on #47657 (merge that first) The `tanstack` shard needs the Monaco loader fix in **#47657** to be on master. Quick version: master's #47182 re-nested the Monaco assets under `public/monaco-editor/vs/` and the TanStack root was still pointing at the old flat path, so Monaco didn't mount anywhere in the TanStack build and every editor-backed test timed out (RLS, cron SQL, realtime JSON, db functions, GraphiQL). Kept that fix on its own branch rather than piling it onto this one. Merge order: 1. #47657 → master 2. re-merge master into here (I'll cascade it) 3. `tanstack` shard goes green → merge this ##⚠️ Branch-protection note This renames the E2E jobs (`E2E tests` → `E2E tests (next|tanstack, shard)`), so master's current required status checks (`E2E tests (1, 2)` / `(2, 2)`) stop being reported. The required-check list in branch protection needs updating to the new names when this merges. ## Verification Config-only, no app code. The real validation is this matrix running both shards green once #47657 lands — the `next` shards already pass here; the `tanstack` shards pass once the Monaco fix is on master. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Integration overview markdown can now be loaded more reliably from a synchronized on-disk registry (raw markdown support). * **Bug Fixes** * Navigation, redirects, and prefetch now preserve query strings and hash fragments more consistently using Next-like semantics (including repeated keys, empty clearing, and lossless encoding like newlines). * Improved internal-link/router compatibility for Next-style `?`/`#` targets and base-path handling. * Edge Functions diff tab matching works correctly in the browser without Node-specific path utilities. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alaister Young <[email protected]> Co-authored-by: Ivan Vasilov <[email protected]>
Stack 5.2/6 of the TanStack Start migration (#46424) — second half of the project routes (S5 was split for CodeRabbit's 150-file cap). Stacked on #47117 (5.1).
Note
Same shape as 5.1 — thin route wrappers over the existing pages-router components. With this PR every route is present, so
routeTree.gen.tsis now byte-identical to the migration branch.What's in this PR
EdgeFunctionsIndexPageWrapperout ofgetLayout,functions/secrets, and moveDefaultLayoutto the root for the logs page.routeTree.gen.tsregenerated for the full set.Verification
On top of S1–5.1:
studiotypecheck ✓, lint (0 errors) ✓, Next build ✓ (181/181 pages).Summary by CodeRabbit