server-reason-react icon indicating copy to clipboard operation
server-reason-react copied to clipboard

Any way to ensure interfaces remain valid from reason-react?

Open davesnx opened this issue 2 years ago • 3 comments

If we have a way to ensure our React.ml (and Belt.ml, Js.ml, etc) match with the interface we would avoid those breakages https://github.com/ml-in-barcelona/server-reason-react/pull/41 and be compatible would be a matter of following the interface.

Is there any way to depend on an interface from a dependency?

PS: Asked for help here https://discuss.ocaml.org/t/is-there-any-way-to-depend-on-an-interface-file-from-a-dependency/13077

davesnx avatar Sep 23 '23 12:09 davesnx

This was one approach https://github.com/ml-in-barcelona/server-reason-react/pull/82 but still don't have a clear solution here.

Maybe splitting what's React public library and what's ppx_runtime_lib might help, but still can face issues while users might want to use React.jsx (or other runtime_lib stuff)

davesnx avatar Oct 25 '23 16:10 davesnx

cc @jchavarri

davesnx avatar Oct 25 '23 16:10 davesnx

To check inclusion module M : module type of T = T2 and equality module M : module type of T2 = T.

When you don't want to keep type equalities module type of struct include T end

Extracted from https://www.reddit.com/r/ocaml/comments/448xdl/ocamlsafestringbuffer_a_buffer_implementation/

Unsure if there's a way now to have both libs on the same scope (melange/native)

davesnx avatar Aug 09 '24 10:08 davesnx