Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ml-in-barcelona/jsoo-react
js_of_ocaml bindings for ReactJS. Based on ReasonReact.
https://github.com/ml-in-barcelona/jsoo-react
js-of-ocaml ocaml ppx react reasonml
Last synced: 2 days ago
JSON representation
js_of_ocaml bindings for ReactJS. Based on ReasonReact.
- Host: GitHub
- URL: https://github.com/ml-in-barcelona/jsoo-react
- Owner: ml-in-barcelona
- License: mit
- Created: 2018-11-20T22:39:35.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-10-09T09:45:09.000Z (about 1 year ago)
- Last Synced: 2024-11-08T13:03:34.870Z (8 days ago)
- Topics: js-of-ocaml, ocaml, ppx, react, reasonml
- Language: OCaml
- Homepage: https://ml-in-barcelona.github.io/jsoo-react
- Size: 1.9 MB
- Stars: 137
- Watchers: 10
- Forks: 19
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-list - jsoo-react - in-barcelona | 105 | (OCaml)
README
# jsoo-react
[![Actions Status](https://github.com/ml-in-barcelona/jsoo-react/workflows/CI/badge.svg?branch=main)](https://github.com/ml-in-barcelona/jsoo-react/actions?query=branch%3Amain)
Bindings to [React](https://reactjs.org/) for [js_of_ocaml](https://ocsigen.org/js_of_ocaml/), including the JSX ppx.
> **Status**: experimental phase
>
> The library is expected to break backwards compatibility on minor releases.Adapted from [ReasonReact](https://github.com/reasonml/reason-react/).
Bug reports and contributions are welcome!
## Getting started
### New project
For new projects, the best way to start is by using [the jsoo-react template](https://github.com/ml-in-barcelona/jsoo-react-template).
### Existing project
1. Install the `jsoo-react` package:
```bash
opam install jsoo-react
```2. Add `jsoo-react` library and ppx to [dune](https://dune.readthedocs.io/en/stable/) file of your executable JavaScript app:
```dune
(executables
(names index)
(modes js)
(libraries jsoo-react.lib)
(preprocess
(pps jsoo-react.ppx)))
```3. Provision React.js library
`jsoo-react` uses `require` to import React and ReactDOM. This means that you will likely need to use a bundler such as Webpack or rollup.js.
Note that at this moment, `jsoo-react` is compatible with **React 16**, so be sure to have the appropriate constraints in your `package.json`.
## Contributing
Take a look at our [Contributing Guide](CONTRIBUTING.md).
## Acknowledgements
Thanks to the authors and maintainers of ReasonReact, in particular [@rickyvetter](https://github.com/rickyvetter) for his work on the v3 of the JSX ppx.
Thanks to the authors and maintainers of Js_of_ocaml, in particular [@hhugo](https://github.com/hhugo) who has been answering many many questions in GitHub threads.
Thanks to the Lexifi team for creating and maintaining [gen_js_api](https://github.com/LexiFi/gen_js_api).
Thanks to [@tmattio](https://github.com/tmattio/) for creating Spin and the jsoo-react template :raised_hands:
And thanks to the team behind React.js! What an amazing library :)