Repository navigation
Conversation
- Move the radix3 API router and matchAPIRoute into a server-only api-routes.ts. - routes.ts keeps only pageRoutes, which the client needs. - Match routes that only export an OPTIONS handler. - Add a build test that checks the router is not in client output. Fixes #2361 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for solid-start-landing-page ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: c928b9c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
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.
The client imports
pageRoutesfromserver/routes.ts, and that module also built the radix3 API router at load time. The bundler could not drop that call, so radix3 and the router code shipped to the browser. The client route manifest has no API handlers, so that router was always empty there.Fixes #2361.
Changes
containsHTTPandmatchAPIRouteinto a new server-onlyserver/api-routes.ts.pageRoutesinserver/routes.ts.OPTIONShandler.HTTP_METHODSincludesOPTIONS, butcontainsHTTPdid not check$OPTIONS, so those routes were never added to the router.routes.spec.tstoapi-routes.spec.tsand add a test for anOPTIONS-only route.treeshaking/api-router.server.test.ts. It checks that the router is in the server output and not in any client file.Testing
packages/start:tsc --noEmitpasses and all 267 unit tests pass.apps/tests: built the app and ran the node tests. All pass.routes.tsrestored, the new build test fails becauseentry-clientcontains the router.apps/testsdrops from 147,161 to 144,643 bytes. This matches the 2.5 KB difference reported in the issue.🤖 Generated with Claude Code