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

feat(conform-zod): bigint coercion support #726

Merged

Conversation

lifeiscontent
Copy link
Contributor

@lifeiscontent lifeiscontent commented Aug 2, 2024

this change follows the same pattern as how booleans are coerced.

it also fixes issues with BigInt where if the value is not of a convertable value it doesn't break the app because BigInt/Symbol throw unlike the rest of the type constructors.

Copy link

changeset-bot bot commented Aug 2, 2024

🦋 Changeset detected

Latest commit: 43ed549

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@conform-to/zod Minor
@conform-to/dom Minor
@conform-to/react Minor
@conform-to/yup Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lifeiscontent lifeiscontent force-pushed the chore/fix-number-and-bigint-coercion branch from 428e174 to f2aed72 Compare August 2, 2024 03:12
Copy link
Owner

@edmundhung edmundhung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! The changes for BigInt makes sense to me but maybe we should keep the number coercion untouched.

Can you help adding some tests for BigInt?

packages/conform-zod/coercion.ts Show resolved Hide resolved
tests/conform-zod.spec.ts Outdated Show resolved Hide resolved
@lifeiscontent lifeiscontent force-pushed the chore/fix-number-and-bigint-coercion branch from f2aed72 to 790c192 Compare August 9, 2024 19:58
@lifeiscontent
Copy link
Contributor Author

@edmundhung fixed

@lifeiscontent lifeiscontent force-pushed the chore/fix-number-and-bigint-coercion branch 3 times, most recently from 3698934 to 9b5f6ad Compare August 9, 2024 20:05
edmundhung
edmundhung previously approved these changes Aug 10, 2024
Copy link
Owner

@edmundhung edmundhung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you!

@edmundhung edmundhung force-pushed the chore/fix-number-and-bigint-coercion branch from 9b5f6ad to e4ceab9 Compare August 17, 2024 13:22
Copy link

pkg-pr-new bot commented Aug 17, 2024

Open in Stackblitz

More templates

@conform-to/dom

pnpm add https://pkg.pr.new/@conform-to/dom@726

@conform-to/react

pnpm add https://pkg.pr.new/@conform-to/react@726

@conform-to/validitystate

pnpm add https://pkg.pr.new/@conform-to/validitystate@726

@conform-to/yup

pnpm add https://pkg.pr.new/@conform-to/yup@726

@conform-to/zod

pnpm add https://pkg.pr.new/@conform-to/zod@726

commit: 43ed549

@edmundhung edmundhung changed the title chore: fix number and bigint coercion feat(conform-zod): bigint coercion support Sep 10, 2024
@edmundhung edmundhung merged commit 207f27c into edmundhung:main Sep 10, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants