Repository navigation
Conversation
|
@dodoshell is attempting to deploy a commit to the Andreas Sderlund's projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
Fixes #706
parseSearchParamscopied every search param into aFormDatawithdata.entries(). SvelteKit tracksentries()onurl.searchParamsas reading all params, so a load function callingsuperValidate(url, ...)reran whenever any param changed, also ones that aren't in the schema.It now reads only the keys the schema knows with
getAll: the schema properties, the properties of all union variants, plus__superform_idand__superform_json. The key list is the one_parseFormDataalready built, which I moved into a smallformDataKeyshelper so both use it. Withstrict: true, or a schema withadditionalProperties, every param can end up in the data, so those cases still read all params like before.Added
src/tests/issue-706.test.ts, which uses aURLSearchParamssubclass that records reads the way SvelteKit tracks them (get/getAll/hasper key, iteration as all keys). The tests check that params outside the schema aren't read, for a plain object and a discriminated union, that the form id is still read, and that the parsed data is the same as with a plainURLSearchParams. All three fail on main and pass with the change.pnpm test(446 passed),pnpm checkandpnpm lintare clean. I added an[Unreleased]entry to the changelog as AGENTS.md asks; feel free to drop or reword it.