package vdom

All checked builds pass
  1. Overview
  2. Docs
DOM and VDOM for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

vdom-0.4.tbz
sha256=33216086eeeeed605c4580c83e7615cc7bb5401266b025a014fa470220d111cd
sha512=25da0cfa9f55407867e3b7b7fb39863bfce95762e3315c7298bf669517cc66525cf45b1673fd39e1781b800332b9b75ced98f28f8f1658d70abd6c015261a93e

doc/CHANGES.html

0.4

  • Synchronization algorithm purely based on the VDOM, avoid reading from the real DOM
  • Vdom.autofocus_prevent_scroll
  • Vdom.onauxclick_cancel
  • Js_browser: expose more of the DOM API
  • scroll_to_show: check visibility against the nearest scrollable ancestor (instead of the window) and honour scroll-margin-top/scroll-margin-bottom
  • Vdom.Decoder.mouse_event, key_event, paste_event
  • Vdom_blit.extract_js_object, on_js_event, on_js_event_with_options, Custom.focus_event
  • Decoders: dotted field paths now also work for extra_fields
  • Js_browser.Promise: richer API (return, bind, map, all, catch, binding operators...); error handlers now receive an exn (breaking)
  • Js_browser.FileReader.result now returns Ojs.t, read_as_binary_string replaced by read_as_array_buffer (breaking)
  • Vdom.scroll_to_show: takes optional ?behavior, ?block and ?inline arguments (as the browser's scrollIntoView) instead of ~align_top (~align_top:false becomes ~block:End); ~block:Nearest scrolls by the minimal amount needed (#60) (breaking)
  • Js_browser.Element.scroll_into_view: takes an optional ?options argument instead of a boolean (true becomes (), false becomes ~options:(scroll_into_view_options ~block:End ()) ()); the options are built with scroll_into_view_options ?behavior ?block ?inline (), which replaces both the record of that name and the function scroll_into_view_options that took it (breaking)
  • Js_browser: new bindings (Intl, Selection, URLSearchParams, Notification, ResizeObserver, IntersectionObserver, clipboard, ...)
  • Requires OCaml >= 4.13 and js_of_ocaml-compiler >= 4.0.0

Warning: this version is not fully retro-compatible with the previous one. Existing code should be adapted slightly (see the entries marked "breaking").

0.3

  • Vdom.on: Custom browser event handlers with Elm-style JavaScript decoders
  • Fragments: virtual nodes not associated to a concrete DOM
  • Option to propagate browser events occurring inside custom elements to the VDOM
  • Vdom.to_html: Native conversion of the VDOM to HTML
  • Vdom_blit.Cmd.after_redraw: register a callback for after the next redraw in a command handler
  • Numerous additions to Js_browser including support for the JavaScript modules Base64, Blob, ClassList, FetchResponse, Navigator, TextDecoder

Warning: this version is not fully retro-compatible with the previous one. Existing code should be adapted slightly.

0.2

  • GPR#14: delay rendering (view + DOM updates) with requestAnimationFrame
  • GPR#15: click/dblclick handlers take a mouse_event argument (API change)
  • GPR#16: improve support for checkboxes
  • GPR#18: propagate DOM events upwards until finding a handler
  • GPR#21: bindings for WebSockets (contributed by Levi Roth)
  • GPR#22: Add window.inner{Width,Height} (contributed by 'copy')
  • GPR#23: Add KeyboardEvent.{code,key} (contributed by 'copy')
  • GPR#24: Make the vdom type covariant in the 'msg parameter (contributed by 'copy')
  • GPR#25: Add MouseEvent.{movementX,movementY} (contributed by 'copy')
  • GRP#30: Port build to dune + adds travis support
  • GRP#32: Disposing custom elements

0.1

  • GPR#5: double click handler (contributed by Stéphane Legrand)
  • GPR#10: bindings for Date (contributed by Philippe Veber)
  • GPR#8: binding for windows.location (contributed by Philippe Veber)