iway1 / react-ts-form

https://react-ts-form.com
MIT License
2.01k stars 33 forks source link

fixes issue with typing nullish and nullable optional types #123

Closed iway1 closed 1 year ago

iway1 commented 1 year ago

closes #110

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-ts-form ✅ Ready (Inspect) Visit Preview Jun 18, 2023 8:59pm
iway1 commented 1 year ago

@scamden if you have time could you review this? All good if not - it touched some scary types just wanted to extra eyes on it if you feel like it

Had to mess with the unwrap types type to fix the typescript issues... Seems that the type wasn't able to unwrap types that had the first inner type of optional followed by a second order inner type of nullable ( which is what .nullish() does )

also started adding some type tests

scamden commented 1 year ago

I'm OOO but will take a look when I'm back in a couple weeks!

bastibuck commented 1 year ago

If I might jump in here as well. The changes look good to me.

also started adding some type tests

On the issue of type tests maybe this is worth taking a look at https://www.totaltypescript.com/how-to-test-your-types as this might reflect "type tests" more closely.

scamden commented 1 year ago

this LGTM! i literally ran into this bug with a coworker today so good time to remember to do this review ha.

scamden commented 1 year ago

@iway1 shall i go ahead and merge?

iway1 commented 1 year ago

@scamden go for it! 😄

scamden commented 1 year ago

@iway1 great! what's the workflow for creating a release btw?

iway1 commented 1 year ago

@scamden create a new release with the tag being the version name and it'll run and deploy the package to npm with the tag as the version (IE a tag of 1.20.5 would deploy the package with version 1.20.5)

I've just been doing auto generate for the release notes

iway1 commented 1 year ago

For patches definitely feel free to create releases whenever you want

scamden commented 1 year ago

Got it :)

iway1 commented 1 year ago

image

Success! @scamden