diff --git a/dune-project b/dune-project index 335194ae48..dae50bd073 100644 --- a/dune-project +++ b/dune-project @@ -21,6 +21,7 @@ ; (tags ; (topics "to describe" your project)) (depends + brr (ocaml (>= 5.2.0)) (menhir diff --git a/hazel.opam b/hazel.opam index 36a81b933a..78edd3c215 100644 --- a/hazel.opam +++ b/hazel.opam @@ -8,6 +8,7 @@ homepage: "https://github.com/hazelgrove/hazel" bug-reports: "https://github.com/hazelgrove/hazel/issues" depends: [ "dune" {>= "3.16"} + "brr" "ocaml" {>= "5.2.0"} "menhir" {>= "2.0"} "yojson" diff --git a/hazel.opam.locked b/hazel.opam.locked index 31fd8b2c15..a6715844a6 100644 --- a/hazel.opam.locked +++ b/hazel.opam.locked @@ -29,6 +29,7 @@ depends: [ "bignum" {= "v0.16.0"} "bigstringaf" {= "0.9.1"} "bin_prot" {= "v0.16.0"} + "brr" {= "0.0.6"} "camlp-streams" {= "5.0.1"} "chrome-trace" {= "3.16.0"} "cmdliner" {= "1.3.0"} @@ -65,6 +66,7 @@ depends: [ "js_of_ocaml" {= "5.8.2"} "js_of_ocaml-compiler" {= "5.8.2"} "js_of_ocaml-ppx" {= "5.8.2"} + "js_of_ocaml-toplevel" {= "5.8.2"} "js_of_ocaml_patches" {= "v0.16.0"} "jsonrpc" {= "1.19.0"} "jst-config" {= "v0.16.0"} diff --git a/src/haz3lweb/Main.re b/src/haz3lweb/Main.re index cf0269bf45..45d7ed908c 100644 --- a/src/haz3lweb/Main.re +++ b/src/haz3lweb/Main.re @@ -2,7 +2,6 @@ open Util; open Js_of_ocaml; open Incr_dom; open Haz3lweb; - let scroll_to_caret = ref(true); let edit_action_applied = ref(true); let last_edit_action = ref(JsUtil.timestamp()); @@ -76,6 +75,7 @@ module App = { module State = State; let on_startup = (~schedule_action, m: Model.t) => { + Brr_poke.define(); let _ = observe_font_specimen("font-specimen", fm => schedule_action(Haz3lweb.Update.SetMeta(FontMetrics(fm))) diff --git a/src/haz3lweb/dune b/src/haz3lweb/dune index 8d25155dc5..1d24323cc9 100644 --- a/src/haz3lweb/dune +++ b/src/haz3lweb/dune @@ -9,6 +9,9 @@ (name workerServer) (modules WorkerServer) (libraries + brr + brr.poke + str incr_dom virtual_dom.input_widgets util @@ -59,7 +62,10 @@ (name main) (modules Main) (libraries ppx_yojson_conv.expander haz3lweb) + (link_flags -linkall) (modes js) + (js_of_ocaml + (flags :standard --toplevel)) (preprocess (pps ppx_yojson_conv @@ -73,13 +79,17 @@ (modules Worker) (libraries workerServer) (modes js) + (link_flags -linkall) + (js_of_ocaml + (flags :standard --toplevel)) (preprocess (pps js_of_ocaml-ppx))) (env (dev (js_of_ocaml - (flags :standard --debuginfo --noinline --dynlink --linkall --sourcemap))) + (flags + (:standard --debuginfo --noinline --dynlink --linkall --sourcemap)))) (release (js_of_ocaml (flags (:standard)))))