Takes a new approach to bindings (explored in jsoo-is-sorted) which streamlines the dependency on JavaScript libraries like react and react-dom by injecting them in js_of_ocaml global scope, so the bindings can find them in any case, even if they are exposed as a library
Uses gen_js_api and moves away from the .js-based approach, which was error prone and more boilerplaty. gen_js_api allows to declare the functions in regular interface files, and generates the "glue code" automatically behind the scenes.
Updates the ppx code to make it compatible with latest OCaml AST types and also to make it compatible with requirements from gen_js_api (e.g. the conversion of key prop to js_string has to be handled now at the ppx level).
The largest change from the API perspective is that children has type list(element) now, instead of array(element), due to gen_js_api only allowing lists for variadic arguments.
This PR:
jsoo-is-sorted
) which streamlines the dependency on JavaScript libraries likereact
andreact-dom
by injecting them in js_of_ocaml global scope, so the bindings can find them in any case, even if they are exposed as a librarygen_js_api
and moves away from the.js
-based approach, which was error prone and more boilerplaty.gen_js_api
allows to declare the functions in regular interface files, and generates the "glue code" automatically behind the scenes.key
prop tojs_string
has to be handled now at the ppx level).The largest change from the API perspective is that
children
has typelist(element)
now, instead ofarray(element)
, due to gen_js_api only allowing lists for variadic arguments.