-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: server side route resolution #13379
Conversation
…use in prod the imports are different / not resolved through vite / wrong; also it's better this way); better hydration without an unnecessary roundtrip
🦋 Changeset detectedLatest commit: 27a8243 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
bc7cdff
to
b05f960
Compare
…es work at runtime: we don't need to dynamically import server routes to get certain info, which is especially important for when we generate edge functions for these, where the server will have much less work to do / files to deploy. Also fixes a bug where prerendered routes with ssr=false were not showing up in the server manifest, and will prevent potential bugs in adapters when they split routes
… and works better for the root
…r things like is_foo = _is_foo(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright I think this is ready to go! The edge function generated in adapter-vercel
still has a lot of dead weight — it includes all the Svelte rendering code, even though there's nothing to render — but I think it would be reasonable to tackle that later rather than blocking on it
This PR adds server side route resolution to SvelteKit. This means that instead of loading the whole routing manifest in the client, and doing the route resolution there, the server runtime is invoked for each route request.
How this works:
<a href="/foo/bar">..</a>
_app/routes[route].js
, so in this case_app/routes/foo/bar.js
What this enables:
TODO:
router.resolution = 'client' | 'server'
) or sth like thatPlease don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits