From 2761a354ff6892a64b64dca0c037f8d905d67941 Mon Sep 17 00:00:00 2001 From: Chris Arderne Date: Thu, 25 Jun 2026 16:19:43 +0100 Subject: [PATCH 1/8] chore(webapp): upgrade @conform-to to v1 Migrate the dashboard form layer from @conform-to 0.9 to the 1.x API. conform 1.x peer-depends on zod ^3.21 || ^4, so it runs on the current zod 3 and unblocks the zod 4 upgrade (conform 0.9 cannot bundle against zod 4, which removed ZodNativeEnum, ZodEffects, and ZodPipeline). --- .server-changes/conform-v1.md | 6 + apps/webapp/app/components/Feedback.tsx | 27 +- .../errors/ConfigureErrorAlerts.tsx | 29 +- .../components/runs/v3/ReplayRunDialog.tsx | 98 ++++--- .../schedules/PurchaseSchedulesModal.tsx | 16 +- .../route.tsx | 27 +- .../route.tsx | 44 ++-- .../route.tsx | 37 ++- .../route.tsx | 72 ++--- .../route.tsx | 76 +++--- .../route.tsx | 87 +++--- .../route.tsx | 63 +++-- .../route.tsx | 8 +- .../route.tsx | 8 +- .../route.tsx | 8 +- .../route.tsx | 34 +-- .../route.tsx | 35 ++- .../route.tsx | 247 +++++++++--------- .../route.tsx | 34 +-- .../route.tsx | 39 +-- .../route.tsx | 28 +- .../route.tsx | 61 ++--- .../route.tsx | 24 +- .../webapp/app/routes/_app.orgs.new/route.tsx | 20 +- .../app/routes/account._index/route.tsx | 31 ++- .../app/routes/account.tokens/route.tsx | 30 +-- .../app/routes/confirm-basic-details.tsx | 32 +-- apps/webapp/app/routes/invite-resend.tsx | 8 +- apps/webapp/app/routes/invite-revoke.tsx | 8 +- apps/webapp/app/routes/invites.tsx | 28 +- ...deployments.$deploymentShortCode.cancel.ts | 8 +- ...eployments.$deploymentShortCode.promote.ts | 14 +- ...ployments.$deploymentShortCode.rollback.ts | 14 +- ...urces.batches.$batchId.check-completion.ts | 8 +- .../app/routes/resources.branches.archive.tsx | 20 +- apps/webapp/app/routes/resources.feedback.ts | 15 +- ...cts.$projectParam.env.$envParam.github.tsx | 40 +-- ...ectParam.env.$envParam.runs.bulkaction.tsx | 6 +- .../route.tsx | 44 ++-- ...cts.$projectParam.env.$envParam.vercel.tsx | 18 +- .../route.tsx | 8 +- ....orgs.$organizationSlug.schedules-addon.ts | 18 +- .../resources.sessions.$sessionParam.close.ts | 14 +- .../resources.taskruns.$runParam.cancel.ts | 14 +- .../resources.taskruns.$runParam.replay.ts | 8 +- apps/webapp/package.json | 4 +- pnpm-lock.yaml | 35 +-- 47 files changed, 779 insertions(+), 774 deletions(-) create mode 100644 .server-changes/conform-v1.md diff --git a/.server-changes/conform-v1.md b/.server-changes/conform-v1.md new file mode 100644 index 00000000000..5e187829460 --- /dev/null +++ b/.server-changes/conform-v1.md @@ -0,0 +1,6 @@ +--- +area: webapp +type: improvement +--- + +Upgrade the dashboard form layer from `@conform-to` 0.9 to 1.x. conform 1.x supports both zod 3 and zod 4, which unblocks the upcoming zod 4 upgrade. diff --git a/apps/webapp/app/components/Feedback.tsx b/apps/webapp/app/components/Feedback.tsx index 0848359e219..f8b4e8b3985 100644 --- a/apps/webapp/app/components/Feedback.tsx +++ b/apps/webapp/app/components/Feedback.tsx @@ -1,5 +1,5 @@ -import { conform, useForm } from "@conform-to/react"; -import { parse } from "@conform-to/zod"; +import { getFormProps, getSelectProps, getInputProps, getTextareaProps, useForm } from "@conform-to/react"; +import { parseWithZod } from "@conform-to/zod"; import { InformationCircleIcon, ArrowUpCircleIcon } from "@heroicons/react/20/solid"; import { EnvelopeIcon, ShieldCheckIcon } from "@heroicons/react/24/solid"; import { Form, useActionData, useLocation, useNavigation, useSearchParams } from "@remix-run/react"; @@ -34,11 +34,11 @@ export function Feedback({ button, defaultValue = "bug", onOpenChange }: Feedbac const navigation = useNavigation(); const [type, setType] = useState(defaultValue); - const [form, { path, feedbackType, message }] = useForm({ + const [form, fields] = useForm({ id: "accept-invite", - lastSubmission: lastSubmission as any, + lastResult: lastSubmission as any, onValidate({ formData }) { - return parse(formData, { schema }); + return parseWithZod(formData, { schema }); }, shouldRevalidate: "onInput", }); @@ -47,8 +47,7 @@ export function Feedback({ button, defaultValue = "bug", onOpenChange }: Feedbac if ( navigation.formAction === "/resources/feedback" && navigation.state === "loading" && - form.error === undefined && - form.errors.length === 0 + (form.errors === undefined || form.errors.length === 0) ) { setOpen(false); } @@ -90,9 +89,9 @@ export function Feedback({ button, defaultValue = "bug", onOpenChange }: Feedbac type === "concurrency" || type === "hipaa" ) &&
} -
+
- + {type === "feature" && ( )} - {feedbackType.error} + {fields.feedbackType.errors} -