package server-reason-react
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=557e215377660a5c48c0494704d3d149ff249d4a5669f1749b393176b963ea05
sha512=cc3dd53dd21d2564ad031ca74552587f4a8200833ec80392fd190a55d7a7f83bec0fc57d2ec0e262c0c3ef2e78a89914872ea1588921c3cb8836e8e5f67b4cef
doc/index.html
server-reason-react
This is the documentation and API for server-reason-react, an implementation of react
, react-dom
and react-dom/server
to run on the server with Reason/OCaml, with the purpose to Server-side render HTML markup from a reason-react application natively (for both SSR and SSG).
The entire model is designed to share components (and code) between the client and the server. To achieve this goal server-reason-react
also contains other libraries and ppxes that are useful to share code between the two architectures. Makes rendering React components on the server much simpler.
Why
Explained more about the motivation in this blog post sancho.dev/blog/server-side-rendering-react-in-ocaml and also in my talk about Server side rendering React natively with Reason at ReactAlicante 2023.
Guides
Core API
Those are the core libraries of server-reason-react
.
React
The React libraryreactDom
Other libraries
Aside from the core, server-reason-react
exposes some needed known libraryes from melange or melange-community to help make components universal.
Belt
server-reason-react.belt
(equivalent toBelt
frommelange
)Js
server-reason-react.js
(equivalent toJs
frommelange
, very unsafe)URL
server-reason-react.url
Webapi
server-reason-react.webapi
(equivalent toWebapi
frommelange-webapi
)
This would eventually be extracted into their own packages