-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: use validated args in batch resolver (alternative approach) #15215
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8c2013d
fix: use validated args in batch resolver
Rishab49 53335f6
fix: use validated args in batch resolver in both csr and ssr
Rishab49 c830c38
fixing linting issues
Rishab49 a467325
chore: rework/tidy
elliott-with-the-longest-name-on-github 43c0f8b
fix: error handling
elliott-with-the-longest-name-on-github 1177e0d
changeset
elliott-with-the-longest-name-on-github 2b5a398
overhaul tests
elliott-with-the-longest-name-on-github 5280ba9
Merge branch 'main' into pr/15114
Rich-Harris 562a5e1
revert
Rich-Harris 058e219
unstash
Rich-Harris 534cff5
move some logic
Rich-Harris 7a5d04b
tweak
Rich-Harris 206d7b3
simplify
Rich-Harris 7477105
prettier
Rich-Harris 1ac59ad
do it without the weird side-effecty validator
Rich-Harris 4333943
prettier
Rich-Harris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@sveltejs/kit': patch | ||
| --- | ||
|
|
||
| fix: use validated args in batch resolver in both csr and ssr |
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
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
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
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
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
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
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
13 changes: 13 additions & 0 deletions
13
packages/kit/test/apps/async/src/routes/remote/batch-validation/+page.svelte
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <script lang="ts"> | ||
| import { reverse } from './batch.remote.js'; | ||
|
|
||
| let phrase = $state('ecrof eht esu'); | ||
| const words = $derived(phrase.split(' ').reverse()); | ||
| </script> | ||
|
|
||
| <div id="phrase"> | ||
| {#each words as word, i} | ||
| {await reverse(word)}{i === words.length - 1 ? '' : ' '} | ||
| {/each} | ||
| </div> | ||
| <button onclick={() => (phrase = 'rehtaf ruoy ma i')}>get dramatic</button> |
12 changes: 12 additions & 0 deletions
12
packages/kit/test/apps/async/src/routes/remote/batch-validation/batch.remote.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { query } from '$app/server'; | ||
| import * as v from 'valibot'; | ||
|
|
||
| export const reverse = query.batch( | ||
| v.pipe( | ||
| v.string(), | ||
| v.transform((val) => val.split('').reverse().join('')) | ||
| ), | ||
| () => { | ||
| return (x) => x; | ||
| } | ||
| ); |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.