package server-reason-react
Rendering React components on the server natively
Install
Dune Dependency
Authors
Maintainers
Sources
server-reason-react-0.3.1.tbz
sha256=b97fbe6a7c3e5e1a7775e0f6498f257acaaa7e272177a9a3e0e50b7a49408d7c
sha512=b27a94618c367c80efef83a41c2a59c9cc7848fd753049ed40fa1f2cface1ef34cf3a995835bf08e2eb59c3186911f429b4706ed07dcb9724df6af5eb012a31d
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).
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
- Get started
- How universal code works
- How to structure the code
- Exclude client code from the native build
- Externals and melange attributes
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 libraries 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
Next
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page