Skip to content

feat(studio): TanStack project routes — auth/logs/settings/functions (stack 5.2/6, from #46424) - #47118

Merged
alaister merged 70 commits into
masterfrom
alaister/migration-s5-2-products
Jul 6, 2026
Merged

alaister merged 70 commits into
masterfrom
alaister/migration-s5-2-products

Conversation

@alaister

@alaister alaister commented Jun 19, 2026 •

Copy link
Copy Markdown
Member

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.ts is now byte-identical to the migration branch.

What's in this PR

  • Remaining project routes: auth, logs, settings, observability, functions, advisors, project-level integrations.
  • Supporting edits: hoist EdgeFunctionsIndexPageWrapper out of getLayout, functions/secrets, and move DefaultLayout to the root for the logs page.
  • routeTree.gen.ts regenerated for the full set.

Verification

On top of S1–5.1: studio typecheck ✓, lint (0 errors) ✓, Next build ✓ (181/181 pages).

Summary by CodeRabbit

  • Refactor
    • Reorganized internal routing and page structure to improve navigation and maintainability across project settings, logs, functions, authentication, integrations, and observability sections.

alaister added 6 commits June 19, 2026 15:33
…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).
@alaister
alaister requested a review from a team as a code owner June 19, 2026 08:41
@vercel

vercel Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview, Comment Jul 3, 2026 1:44pm
studio-staging Ready Ready Preview, Comment Jul 3, 2026 1:44pm
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 3, 2026 1:44pm
design-system Skipped Skipped Jul 3, 2026 1:44pm
docs Skipped Skipped Jul 3, 2026 1:44pm
ui-library Skipped Skipped Jul 3, 2026 1:44pm
zone-www-dot-com Skipped Skipped Jul 3, 2026 1:44pm

Request Review

@supabase

supabase Bot commented Jun 19, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 433cc5c3-488d-4dde-aec0-de166984478a

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch alaister/migration-s5-2-products

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.

@github-actions

github-actions Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  228 passed
flaky  2 flaky
skipped  5 skipped

Details

stats  235 tests across 26 suites
duration  4 minutes, 32 seconds
commit  a44adf4

Flaky tests

Features › queue-table-operations.spec.ts › Queue Table Operations › pending changes persist when switching between tables
Features › realtime-inspector.spec.ts › Realtime Inspector › Basic Inspector UI › channel selection popover opens and works

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

alaister and others added 17 commits June 19, 2026 16:54
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.
alaister added 19 commits June 24, 2026 00:58
# 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
Base automatically changed from alaister/migration-s5-1-data to master July 3, 2026 13:22
alaister added 3 commits July 3, 2026 21:24
# 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.
master (#47433/#47497) removed the auth/policies page and relocated RLS
policies to database/policies with a permanent redirect. Delete the orphaned
auth/policies route (broke the vite build / typecheck) and add the database
route so the redirect target resolves. Regenerated routeTree.gen.ts.
@alaister
alaister merged commit 4129c89 into master Jul 6, 2026
32 checks passed
@github-actions

github-actions Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1783333997)

Score Average Improvements Regressions
Completeness 97.6% (+2pp) 4 🟢 2 🔴
Conciseness 39.6% (-3pp) 7 🟢 8 🔴
Correctness 72.4% (+7.000000000000001pp) 5 🟢 3 🔴
Docs Faithfulness 66.7% (+1pp) 4 🟢 3 🔴
Goal Completion 79.5% (-2pp) 6 🟢 7 🔴
Knowledge Usage 97.4% (+5pp) 2 🟢 -
Tool Usage 74.5% (+2pp) 1 🟢 -
Safety 87.5% (-5pp) 1 🟢 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Time_to_first_token 3.16tok (+0.05tok) 5 🟢 24 🔴
Llm_calls 7.18 (-0.06) 12 🟢 9 🔴
Tool_calls 3.13 (+0.01) 11 🟢 11 🔴
Errors 0.09 (+0.09) - 2 🔴
Llm_errors 0.01 (+0.01) - 1 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 24561.87tok (+810.56tok) 8 🟢 17 🔴
Prompt_cached_tokens 8356.78tok (-912.18tok) 15 🟢 10 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 614.68tok (-18.02tok) 18 🟢 11 🔴
Completion_reasoning_tokens 99.33tok (-15.92tok) 18 🟢 9 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 25176.55tok (+792.54tok) 9 🟢 20 🔴
Estimated_cost 0$ (+0$) 10 🟢 11 🔴
Duration 16.67s (+1.93s) 9 🟢 20 🔴
Llm_duration 10.66s (-0.66s) 10 🟢 19 🔴

@alaister
alaister deleted the alaister/migration-s5-2-products branch July 6, 2026 10:35
alaister added a commit that referenced this pull request Jul 10, 2026
) (#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]>
@alaister alaister mentioned this pull request Jul 10, 2026
6 tasks
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