Skip to content

Commit

Permalink
Merge pull request #11 from kit-ty-kate/500
Browse files Browse the repository at this point in the history
Add support for OCaml 5.0
  • Loading branch information
jtov-js authored Oct 14, 2022
2 parents 0188d1b + 2f53bdb commit ab30e77
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 25 deletions.
3 changes: 1 addition & 2 deletions src/attr.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open! Js_of_ocaml
open Base

(** This type covers both properties and attributes, despite the name. *)
type t
Expand Down Expand Up @@ -64,7 +63,7 @@ val autofocus : bool -> t
val checked : t
val class_ : string -> t
val classes : string list -> t
val classes' : Set.M(String).t -> t
val classes' : Base.Set.M(Base.String).t -> t
val disabled : t
val for_ : string -> t
val href : string -> t
Expand Down
15 changes: 3 additions & 12 deletions src/effect.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ module Define_visibility (VH : Visibility_handler) = struct
let () = visibility_handlers := VH.handle :: !visibility_handlers
end

module Obj = struct
module Extension_constructor = struct
[@@@ocaml.warning "-3"]

let id = Caml.Obj.extension_id
let of_val = Caml.Obj.extension_constructor
end
end

type _ t +=
| Viewport_changed
| Stop_propagation
Expand All @@ -46,21 +37,21 @@ let current_dom_event = ref None
let () =
Hashtbl.add_exn
Expert.handlers
~key:Obj.Extension_constructor.(id (of_val Viewport_changed))
~key:Caml.Obj.Extension_constructor.(id (of_val Viewport_changed))
~data:(fun _ -> List.iter !visibility_handlers ~f:(fun f -> f ()))
;;

let () =
Hashtbl.add_exn
Expert.handlers
~key:Obj.Extension_constructor.(id (of_val Stop_propagation))
~key:Caml.Obj.Extension_constructor.(id (of_val Stop_propagation))
~data:(fun _ -> Option.iter !current_dom_event ~f:Dom_html.stopPropagation)
;;

let () =
Hashtbl.add_exn
Expert.handlers
~key:Obj.Extension_constructor.(id (of_val Prevent_default))
~key:Caml.Obj.Extension_constructor.(id (of_val Prevent_default))
~data:(fun _ -> Option.iter !current_dom_event ~f:Dom.preventDefault)
;;

Expand Down
9 changes: 0 additions & 9 deletions ui_effect/ui_effect.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ type hidden = T : ('a t * ('a -> unit)) -> hidden

let handlers : (hidden -> unit) Hashtbl.M(Int).t = Hashtbl.create (module Int) ~size:8

module Obj = struct
module Extension_constructor = struct
[@@@ocaml.warning "-3"]

let id = Caml.Obj.extension_id
let of_val = Caml.Obj.extension_constructor
end
end

module Define (Handler : Handler) :
S with type action := Handler.Action.t and type 'a t := 'a t = struct
type _ t += C : Handler.Action.t -> unit t
Expand Down
4 changes: 2 additions & 2 deletions virtual_dom.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ build: [
]
depends: [
"ocaml" {>= "4.08.0"}
"base" {>= "v0.15" & < "v0.16"}
"base" {>= "v0.15.1" & < "v0.16"}
"core" {>= "v0.15" & < "v0.16"}
"ppx_jane" {>= "v0.15" & < "v0.16"}
"dune" {>= "2.0.0"}
"gen_js_api" {>= "1.0.8"}
"js_of_ocaml" {>= "3.9.0" & < "4.0.0"}
"js_of_ocaml" {>= "3.9.0"}
"js_of_ocaml-ppx" {>= "3.9.0"}
"lambdasoup" {>= "0.6.3"}
"tyxml" {>= "4.3.0"}
Expand Down

0 comments on commit ab30e77

Please sign in to comment.