chore(webapp): upgrade @conform-to to v1#4044
Conversation
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).
|
WalkthroughThe PR upgrades the webapp to Conform 1.x. It updates shared components and many routes to use 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Address CodeRabbit feedback on the conform 1.x migration: use defaultValue (not value) on hidden inputs so they stay uncontrolled, return the env-var project-lookup failure as a form-level error, join multi-message field errors when rendering, and clone alerts.emails before using it as mutable field-list state.
6a023d4 to
971ffea
Compare
The schedules and branches add-on purchase modals detected conform responses with "intent" in fetcher.data, but conform v1's submission.reply() returns a status field, not intent, so lastResult was always undefined and server-side errors never rendered. Switch the guard to "status" in fetcher.data, matching the rest of the migration.
Summary
Upgrades the dashboard form layer from
@conform-to0.9 to 1.x. No behaviour change is intended; this is the conform API migration only.conform 1.x peer-depends on
zod^3.21 || ^4, so it runs on the current zod 3 and is a prerequisite for upgrading the repo to zod 4: conform 0.9 importsZodNativeEnum,ZodEffects, andZodPipeline, all removed in zod 4, so the webapp cannot build against zod 4 until conform is on 1.x. Landing this first (on zod 3) keeps the zod 4 PR focused on zod alone.Migration
The standard 0.9 to 1.x API changes across the form files:
parsetoparseWithZod, theconform.*helpers togetInputProps/getFormProps/etc.,useFieldList/useFieldsettofield.getFieldList()/field.getFieldset(),list/requestIntentto theform.insert/form.removeintents, immutablesubmission.reply({ fieldErrors })in actions, andfield.error(string) tofield.errors(string[]).Verified locally: webapp typecheck and build are green, and the full repo typecheck passes. There are no conform unit tests; form behaviour still needs manual/E2E QA before this comes out of draft.
TODO before merging