next.js
d9b34f55 - [16.5] Backport route.go and Switchyard direct routing (#102610)

Commit
13 hours ago
[16.5] Backport route.go and Switchyard direct routing (#102610) ### What? Backports the route.go and proxy.go changes that landed on `canary` after the 16.5 cut to `releases/stable/16-5`, in canary merge order: 1. #101898 Go routes: compile route.go/proxy.go directories as importable packages, not package main 2. #102444 Fix how the Go proxy handles dot segments in RSC requests 3. #101874 Add the next/go SDK and move Go Proxy helpers into it 4. #102447 Fix the Go package declaration in a native proxy test fixture 5. #101551 Add statically analyzed Go route and proxy configuration 6. #101985 Go routes: compile all route.go handlers into one binary for production builds 7. #102579 Improve Go route validation diagnostics 8. #102589 Fix static Go route rewrites in adapter deployments 9. #102102 switchyard: send plain route.go requests straight to their workers 10. #102103 switchyard: send route.go requests with a query string directly 11. #102113 switchyard: send dynamic and catch-all route.go requests directly 12. #102278 switchyard: compress direct route.go responses as Node does ### Why? So 16.5 ships route.go and proxy.go with Switchyard sending their requests to the Go workers directly. See the linked PRs for each change's motivation. ### How? One commit per PR, each a clean `git cherry-pick -x` of its canary merge commit, with no conflicts. Every file this PR touches now matches `canary`, except four that canary also changed in unrelated PRs (#102505, #102405, #102598 and the canary version bumps): `packages/next/package.json`, `packages/next/src/build/index.ts`, `packages/next/src/server/next-server.ts` and `test/lib/gate/conditions.ts`. ### Verification - `pnpm --filter=next types` - `pnpm exec jest test/unit/app-dir/native-route-runtime test/unit/go-config.test.ts test/unit/native-proxy-go/url-parity.test.ts test/unit/switchyard-route-table.test.ts`: 5 suites, 91/91 pass (`url-parity` needs Go on PATH) - Not run locally: the route.go e2e suites, because they need a native build of the Rust changes (`crates/next-api`, `turbopack-go`). This PR's CI builds native and runs them. <!-- NEXT_JS_LLM --> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Tim Neutkens <timneutkens@me.com> Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com> Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com> Co-authored-by: Tim Neutkens <tim@timneutkens.nl> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Author
Parents
Loading