-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[breaking] strip __data.json from url #7979
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
Conversation
🦋 Changeset detectedLatest commit: 404c39a 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 |
4b29591 to
5d9951e
Compare
| }, | ||
| ({ event, resolve }) => { | ||
| if ( | ||
| event.request.url.includes('__data.json') && |
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.
this would prevent contrived-but-allowed things like /__data.json/wheee, no? Don't we just want to check the end of the pathname?
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.
This is just part of a test, not the code that users are going to run.
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.
i definitely knew that and wasn't just being absent-minded
This is breaking change for people who relied on the
__data.jsonsuffix being present onevent.urlwhich is now no longer the case. Use the newisDataRequestboolean instead.export function handle({ event, resolve }) { - if (event.url.pathname.endsWith('__data.json') { + if (event.isDataRequest) { // .. } return resolve(event); }closes #7926
Open question: Should we also remove those things from the original
requestobject? I vote for "no".Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. All changesets should bepatchuntil SvelteKit 1.0