Skip to content
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

Param validators #4334

Merged
merged 38 commits into from
Mar 16, 2022
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5799667
remove fallthrough
Rich-Harris Mar 15, 2022
1e9e2ca
changeset
Rich-Harris Mar 15, 2022
1db07a4
remove fallthrough documentation
Rich-Harris Mar 15, 2022
5fa067b
tweak docs
Rich-Harris Mar 15, 2022
ca3d714
simplify
Rich-Harris Mar 15, 2022
705721b
simplify
Rich-Harris Mar 15, 2022
7a56ac2
simplify a tiny bit
Rich-Harris Mar 15, 2022
29ea702
add failing test of param validators
Rich-Harris Mar 15, 2022
2a480cf
client-side route parsing
Rich-Harris Mar 15, 2022
4ddcc55
tidy up
Rich-Harris Mar 15, 2022
e5245e8
add validators to manifest data
Rich-Harris Mar 15, 2022
273db5f
client-side validation
Rich-Harris Mar 15, 2022
7424b04
simplify
Rich-Harris Mar 15, 2022
098f0e6
server-side param validation
Rich-Harris Mar 15, 2022
eb77dfd
lint
Rich-Harris Mar 15, 2022
e79f4f2
Merge branch 'remove-fallthrough' into param-validators
Rich-Harris Mar 15, 2022
aa415d9
oops
Rich-Harris Mar 15, 2022
ea24c9f
Merge branch 'remove-fallthrough' into param-validators
Rich-Harris Mar 15, 2022
63b7f4a
clarify
Rich-Harris Mar 15, 2022
fc80f31
docs
Rich-Harris Mar 15, 2022
07accf9
minor fixes
Rich-Harris Mar 15, 2022
504ca26
fixes
Rich-Harris Mar 15, 2022
ccc75e3
ease debugging
Rich-Harris Mar 15, 2022
6d6c595
vanquish SPA reloading bug
Rich-Harris Mar 15, 2022
c6ccdf3
simplify
Rich-Harris Mar 15, 2022
bbb1f80
lint
Rich-Harris Mar 15, 2022
ce6efd2
windows fix
Rich-Harris Mar 15, 2022
714f78c
changeset
Rich-Harris Mar 15, 2022
5ab21cd
throw error if validator module is missing a validate export
Rich-Harris Mar 16, 2022
72fcf94
update configuration.md
Rich-Harris Mar 16, 2022
a01d452
Update documentation/docs/01-routing.md
Rich-Harris Mar 16, 2022
d6f12c5
tighten up validator naming requirements
Rich-Harris Mar 16, 2022
31135cc
Merge branch 'param-validators' of github.com:sveltejs/kit into param…
Rich-Harris Mar 16, 2022
316cfca
disallow $ in both param names and types
Rich-Harris Mar 16, 2022
c650933
changeset
Rich-Harris Mar 16, 2022
97c70ae
point fallthrough users at validation docs
Rich-Harris Mar 16, 2022
b45b3d0
add some JSDoc commentsd
Rich-Harris Mar 16, 2022
3555883
merge master
Rich-Harris Mar 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
oops
Rich-Harris committed Mar 15, 2022
commit aa415d9cd2ac5e1d60a294625354efbb343ac711
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/client/client.js
Original file line number Diff line number Diff line change
@@ -639,7 +639,7 @@ export function create_client({ target, session, base, trailing_slash }) {
}

if (node.loaded) {
// TODO remove for 1.9
// TODO remove for 1.0
// @ts-expect-error
if (node.loaded.fallthrough) {
throw new Error('fallthrough is no longer supported');
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/server/endpoint.js
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ export async function render_endpoint(event, mod) {
return error(`${preface}: expected an object, got ${typeof response}`);
}

// TODO remove for 1.9
// TODO remove for 1.0
// @ts-expect-error
if (response.fallthrough) {
throw new Error('fallthrough is no longer supported');
6 changes: 3 additions & 3 deletions packages/kit/src/runtime/server/page/load_node.js
Original file line number Diff line number Diff line change
@@ -327,7 +327,7 @@ export async function load_node({
throw new Error(`load function must return a value${options.dev ? ` (${node.entry})` : ''}`);
}

// TODO remove for 1.9
// TODO remove for 1.0
// @ts-expect-error
if (loaded.fallthrough) {
throw new Error('fallthrough is no longer supported');
@@ -402,7 +402,7 @@ async function load_shadow_data(route, event, options, prerender) {
if (!is_get) {
const result = await handler(event);

// TODO remove for 1.9
// TODO remove for 1.0
// @ts-expect-error
if (result.fallthrough) {
throw new Error('fallthrough is no longer supported');
@@ -431,7 +431,7 @@ async function load_shadow_data(route, event, options, prerender) {
if (get) {
const result = await get(event);

// TODO remove for 1.9
// TODO remove for 1.0
// @ts-expect-error
if (result.fallthrough) {
throw new Error('fallthrough is no longer supported');