Soundor
Web Runtime

Web Runtime 0.12.0 Contains breaking changes

Release notes for Web Runtime 0.12.0.

All Web Runtime releases

7 changes — 3 features, 3 fixes, 1 breaking change

Minor Changes

  • #238 2daa8a0 Thanks @dm-balakin! - ResizeObserver is a global that observes nodes, as on the Web: its callback is told after a frame's requestAnimationFrame callbacks and layout of each node whose content, border or device-pixel content box changed size. In the web runtime it takes the browser's place for nodes, and passes DOM elements on to it. The simulated runtime's observes nodes and never calls back, as nothing is laid out there. useScrollbar no longer reads sizes every frame: it is told of changes by a ResizeObserver and by scroll events. New useCanvasSize keeps a canvas's drawing buffer exactly the device pixels its box covers.

  • #240 ca0158b Thanks @dm-balakin! - Any view scrolls when its style says so, an Animated.View too: overflow: 'scroll' scrolls, as in CSS, and overflowX and overflowY scroll one axis (they win over overflow). ScrollView is now a view with that style, its children in a content container, and it always scrolls; scrollIndicators and onScroll are props of every View. Nodes scroll smoothly with scrollTo()/scrollBy() and behavior: 'smooth', and scrollIntoView() brings a node into view in every view around it that scrolls.

    Breaking:

    • createScrollView() and the 'scroll' node type are gone: create a view with overflow: 'scroll'.
    • overflow: 'scroll' on a view scrolls it; it used to only clip, as 'hidden' still does.
    • scrollTo() on a node that does not scroll does nothing, as in browsers, instead of throwing.
    • useScrollbar(ref) returns { vertical, horizontal }, a bar for each axis, and no longer takes axis: useScrollbar(ref, { axis: 'horizontal' }) is useScrollbar(ref).horizontal.
  • #235 9110364 Thanks @dm-balakin! - useScrollbar makes a scrollbar of your own from ordinary nodes, and ScrollView's scrollIndicators={false} leaves out the built-in one. Nodes gain scrollIndicators, clientWidth and clientHeight.

  • #234 5964ac0 Thanks @dm-balakin! - The web runtime now lays out with Yoga, the engine's own, compiled to WebAssembly: a plugin UI gets the same boxes in the browser as in a plugin. CSS only draws them. Text wraps as natively, only at spaces and line breaks, text and inputs sit on the same baselines, and scroll views draw the JUCE runtime's thin indicators in place of the browser's scrollbar. Under a strict Content Security Policy the page needs wasm-unsafe-eval.

Patch Changes

  • #239 8a8f912 Thanks @dm-balakin! - The wheel with Control, which is how a browser reports a trackpad's pinch, no longer scrolls a scroll view: the browser zooms the page as it does elsewhere, unless plugin code calls preventDefault() to zoom something of its own. Before, a pinch over the plugin scrolled its content and the page could not be zoomed from there. And a wheel no scroll view can use any more, at the end of its content, now goes on to the page, as natively to the host: a page zoomed past the window can be scrolled with the pointer over the plugin.

  • #238 2daa8a0 Thanks @dm-balakin! - Scrolling a scroll view from code (scrollTo, scrollBy, scrollTop, scrollLeft) now fires its scroll event in the web runtime too, once, on the browser's next frame, as in the JUCE runtime; dragging or pressing its scrollbar fires it at once, as the wheel does.

  • #235 9110364 Thanks @dm-balakin! - A mouse can use a scroll view's indicators: near the scroll view's edge a track appears under a grown bar, which can be dragged, and a press on the track jumps there. After touch, indicators show only while scrolling.

On this page