-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Make trailingSlash
a page/endpoint option, like prerender
#7719
Conversation
trailingSlash
a page/endpoint option, like prerender
🦋 Changeset detectedLatest commit: 0b5da1b 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 |
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.
Looks good code-wise. Question I have though: How likely is it that people are pissed off by this because they now have to add export const trailingSlash = ".."
to all of their +server.js
files? Previously, you had it to set it only once in the config, and it applied to endpoints as well.
Not quite — trailing slashes were completely ignored for endpoints. Now they'll be treated as |
* feat: semver management update * fix: update svelte for vercel adapter dependency * fix: vercel adapter needs to be pre-installed * fix: trailingHash alaways handled differently in sveltekit v1 sveltejs/kit#7719 * fix: update all +server.js files for trailing slash sveltejs/kit#7719 * fix: remove trailing slash from proxy endpoint * fix: vercel deployment * fix: rollback: re-enabling proxy trailing slash * chore: add depth to sentry log * chore: added proxy debugging * chore: refined sentry * chore: refined sentry * fix: refine logging for auth testing * chore: logging adjustments * chore: different logging, auth proxy issue * chore: console res body in proxy * chore: console res body in proxy * fix: correct auth issues, remove console statements, turn off bot mode at CloudFlare on api
How to migrate
svelte.config.js
src/routes/+layout.js
:PR description
Closes #7302. This moves
trailingSlash
configuration fromsvelte.config.js
and into pages. Benefits:/blog/
and/blog/my-post
It has very limited impact on client-side bundle size or data transfer.
The downside is that on the server, we need to load code for the route before we can return a redirect response. In practice the impact is negligible (since we don't need to render anything, just import/evaluate it) and in any case it's not the most important thing to optimise.
TODO:
packages/kit/test/prerendering/trailing-slash
etc — no longer necessary, the tests can be moved into other appsPlease 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. All changesets should bepatch
until SvelteKit 1.0