package server-reason-react
Rendering React components on the server natively
Install
Dune Dependency
Authors
Maintainers
Sources
server-reason-react-0.3.0.tbz
sha256=2a6fc7197d251dc91babcf22cb6987e1d07e91ae631cc62a893df2c6da6b49b5
sha512=c6ed6eb39b046b698844e561cf9a42a866e4df632a6e495a6473ba629ecd9ee534db0b5b42737776d9a4b15376bea1380b77749228c88a0fc0f6b10ead4b3a01
doc/server-reason-react.url_native/URL/index.html
Module URL
URL
module is universal and has 2 implementations with the same API:
url_js
library is a wrapper around theURL
API in the browser binded with Melange.url_native
library is a native implementation with ocaml-uri (RFC3986 URI parsing library for OCaml).
Setup with dune
Depending on you setup, you would need to add the following dependencies to your `dune` stanzas:
(library
(name ...)
(modes melange)
(libraries (server-reason-react.url_js))
(library
(name ...)
(modes native)
(libraries (server-reason-react.url_native))
Usage
let url = URL.make("https://example.com:8080/path?query=1#hash");
URL.protocol(url); (* => Some("https:") *)
URL.hostname(url); (* => "example.com" *)
URL.port(url); (* => Some("8080") *)
URL.pathname(url); (* => "/path" *)
URL.search(url); (* => Some("?query=1") *)
URL.hash(url); (* => Some("#hash") *)
URL.SearchParams
module SearchParams : sig ... end
URL
val makeExn : string -> t
val make : string -> t option
val makeWith : string -> base:string -> t
val hash : t -> string option
val host : t -> string option
val hostname : t -> string
val href : t -> string
val origin : t -> string option
val password : t -> string option
val pathname : t -> string
val port : t -> string option
val protocol : t -> string option
val search : t -> string option
val searchParams : t -> SearchParams.t
val username : t -> string option
val toString : t -> string
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page