Closed glennsl closed 2 years ago
@glennsl I am confused by this PR, a lot of the changes were already part of https://github.com/ml-in-barcelona/jsoo-react/pull/141 right?
Yes, sorry, I have no idea why I based it off that. I'll rebase it shortly, but it's just the three last commits that are relevant.
CI is fun, huh? Ubuntu fails almost immediately with some fetch error, Windows complains about formatting while MacOS is fine with the exact same formatting...
The ubuntu issue seems more on Github side (based on "Not Found [IP: 52.252.75.106 80]" error).
But the formatting one? maybe some bug in ocamlformat? 🤔 https://github.com/ocaml-ppx/ocamlformat/issues/1773
I think it's with the Ubuntu repositories. It was reported now on Discord as well. It'll probably sort itself out eventually.
The windows formatting error seems to be just with this PR, in files that it doesn't even touch. And it seems to be complaining about blank lines following end-of-line comments, which (annoyingly) is enforced by the formatter locally. I know because I tried to remove them too. Maybe by some fluke this CI box got a newer version of ocamlformat? Will probably sort itself out next round as well then.
I am wondering if the old bindings should remain available in
Core
? If not, how could it be made available inreason-react
compat layer without making it public?
Good point. I wonder if virtual libraries somehow could make it possible to expose these to other "internal" libraries without making it part of the public API.
I don't know why the ppx output is suddenly formatted differently on CI now... :shrug:
Thanks!
I don't know why the ppx output is suddenly formatted differently on CI now... 🤷
Fixed in #163 hopefully.
Builds on #141, Addresses #153
This adds a
use_effect
hook that uses OCaml equality semantics, and partly because of that also provides a much nicer API, in my opinion.I also added a
use_ref
hook using an actualref
, because I needed that foruse_effect
and got tired of having to dealing withReact.Ref
when OCaml already has a first class ref cell.If this API style agrees with y'all too I can go on to add equivalent hooks for
use_memo
anduse_callback
. I also suppose this is a good opportunity to move the old bindings to the reason-react compatibility layer.