Skip to content

Upgrade from 6.3.0 to 6.4.0

Hugo Heuzard edited this page Jun 23, 2026 · 1 revision

This page collects the source-incompatible changes to be aware of when upgrading from js_of_ocaml 6.3 to js_of_ocaml 6.4.

Library (js_of_ocaml)

mediaElement.play returns a promise (#2031)

Dom_html.mediaElement##play now returns unit Promise.t instead of unit. Ignore the result (let _ = video##play) to keep the old behaviour, or use the Promise module to await it.

Dom_svg aligned with SVG 2 (#519)

  • The SVG 1.1-only getTransformToElement method has been removed.
  • nearestViewportElement / farthestViewportElement are now typed optdef (they can be undefined).

Removed Gecko mouse-scroll bindings (#2350)

The non-standard Firefox DOMMouseScroll bindings are gone:

  • the mouseScrollEvent class type,
  • the MouseScrollEvent variant of taggedEvent,
  • Dom_html.CoerceTo.mouseScrollEvent,
  • Dom_html.Event._DOMMouseScroll.

Use the standard wheel event (Dom_html.Event.wheel / wheelEvent) instead.

event_listener return type (#1436)

Event-handler results are now bool Js.t Js.optdef, where undefined means "no opinion" (do not override the default). This came out of the onbeforeunload fix. Handlers that returned Js._true / Js._false still type-check; update any code that pattern-matched on a plain bool t.

Renamed bindings from method-name mangling fixes (#2350)

The method-name mangling was corrected, which renames a few bindings that were previously exposed under the wrong name. If you used any of the following, check #2350 for the exact new spelling:

  • Typed_array._BYTES_PER_ELEMENT_
  • WebGL._MAX_RENDERBUFFER_SIZE_
  • canvasElement##toDataURL_compression

Retyped bindings (#2350)

  • Intl.Collator.compare now returns Js.number_t instead of int.
  • EventSource onopen / onerror now receive a plain Dom.event instead of a messageEvent.
  • IntersectionObserver##takeRecords result is now wrapped in Js.t.
  • Dom.attr##.ownerElement is now typed element t opt readonly_prop.