Closed johnridesabike closed 4 years ago
@johnridesabike In the next major version all types are defined in the Formality
module. AFAIU it should address this issue, right?
And if you're just starting to use the lib, it makes sense to switch to the next api.
I'm almost finished with the docs: https://github.com/MinimaHQ/re-formality/tree/ppx/docs
And published RC: re-formality@next
Thanks! I just installed the new PPX version and it looks really nice. It does fix this specific issue, since those fields are simply namespaced with Formality
now.
But the new version has created a whole new problem. Any time I access a field in MyForm.input
(e.g. form.input.username
) I get warning 42:
Warning 42: this use of username relies on type-directed disambiguation, it will not compile with OCaml 4.00 or earlier.
I'd rather not turn warning 42 off, since I think it's useful in general.
AFAIU warning 42 exists for backcompat. Not sure if it's useful in context of BuckleScript.
That makes sense. I'll keep it turned off for this project for now.
I didn't see if the new docs mention warning 42, but it's probably a good idea to tell users to turn it off. Especially since there are guides out there advising people to turn it on (like https://dev.to/yawaramin/ocaml-reasonml-best-practice-warnings-and-errors-4mkm).
Thanks for the help, and good luck with the new version!
I didn't see if the new docs mention warning 42, but it's probably a good idea to tell users to turn it off.
Indeed. I'll add it tomorrow. Thanks for suggestion and let me know if you have any questions!
If I have code like this:
I get these warnings:
I can get around it by doing this:
Which is kind of ugly, but I can also do this:
Note that using
open
instead ofopen!
will also cause this warning:Unless I'm missing something, all of these options feel hacky and aren't intuitive. I'm not familiar with the internals of re-formality, but my general suggestions are: