Skip to content

Commit c494d96

Browse files
committed
Upgrade svelte example
1 parent b2b0278 commit c494d96

3 files changed

Lines changed: 33 additions & 18 deletions

File tree

examples/svelte/package-lock.json

Lines changed: 28 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/svelte/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"vite": "^7.0.4"
2222
},
2323
"dependencies": {
24-
"conformal": "^1.3.1",
25-
"zod": "^4.1.5"
24+
"conformal": "^2.0.0",
25+
"zod": "^4.1.11"
2626
}
2727
}

examples/svelte/src/routes/+page.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { parseWithSchema, type Submission } from "conformal";
1+
import { parseFormData, type Submission } from "conformal";
22
import * as z from "zod";
33
import * as zf from "conformal/zod";
44
import type { Actions, PageServerLoad } from "./$types";
55

6-
const schema = z.object({
6+
const schema = zf.object({
77
name: zf.string(),
88
age: zf.number(),
99
acceptTerms: zf.boolean(),
@@ -27,7 +27,7 @@ export const load: PageServerLoad = async () => {
2727
export const actions: Actions = {
2828
default: async ({ request }): Promise<FormSubmission> => {
2929
const formData = await request.formData();
30-
const submission = parseWithSchema(schema, formData).submission();
30+
const submission = parseFormData(schema, formData).submission();
3131

3232
if (submission.status !== "success") {
3333
return submission;

0 commit comments

Comments
 (0)