Current implementation of server-reason-react depends on Lwt
After the RSC work, big dependencies are introduced in the project, which means that users of server-reason-react might need to install it regardless if they don't use it; and in the worst-case scenario it won't be compatible with their set of dependencies.
If @tjdevries wants to use it with Eio for example, he would need a new package server-reason-react-eio (?) with a new implementation.
Similarly if someone doesn't want to use yojson and want to use jsont they won't be able to.
Based on discovering OCaml packages, I found lot packages using pattern like this:
pkg
pkg-unix
pkg-lwt
pkg-eio
# h2
h2-eio
h2-lwt
h2-lwt-unix
What do you think @davesnx?
Yep, I can provide an -eio and -picos implementation, but I don't have a way to abstract the io layer yet.
Do you know how those are done?
I only know a little about how h2 abstracts that from this interface.
https://github.com/anmonteiro/ocaml-h2/blob/master/eio/h2_eio.mli https://github.com/anmonteiro/ocaml-h2/blob/master/lwt/h2_lwt.mli
I think it similar way react server implemented here
That's only one part of the story. h2 uses gluten and has as well all implementations for each https://github.com/anmonteiro/gluten/blob/ea5b353be189592ef1cbdc6dbc20d582c54858c7/lwt/gluten_lwt.ml
We would need a similar abstraction for our "fiber"