Skip to content

v0.16.0

Choose a tag to compare

@github-actions github-actions released this 12 Aug 07:56
· 386 commits to main since this release
006ea21

This release contains breaking changes that affect the normal surface API. All changes are trivial to fix, its mostly a job for find & replace.

These changes where necessary to fix the rampant code bloat issue. Release builds of the example projects are now 55% smaller on average.
Optimized release builds (following the ./docs/optimized-release.md guide) are now 30% smaller.

  • Breaking Refactor zng::widget::node API.

    Unified UI node (and list) types into a new UiNode struct, most node types are implemented using match_node and not affected,
    custom node types now must implement UiNodeImpl, it is a simplified version of the previous API. The main motivation
    for this refactor is reduction of generics code bloat, the usage of -> impl UiNode scales extremely bad as the anonymous
    type is monomorphised for each generic input, this combined with node nesting causes an explosion of code copies.

    To migrate UiNode:

    • Replace output -> impl UiNode with just UiNode.
    • Replace input _: impl UiNode with _: impl IntoUiNode.
    • Replace NilUiNode with UiNode::nil().
    • Custom nodes now must implement UiNodeImpl.
    • Replace #[ui_node] impls with manual impl of UiNodeImpl. The proc-macro attribute was removed, the new
      UiNodeImpl provides default impls for methods.

    To migrate UiNodeList:

    • Replace output -> impl UiNodeList with just UiNode.
    • Replace input _: impl UiNodeList with _: impl IntoUiNode.
    • Replace EditableUiNodeList with EditableUiVec.

    UI nodes and lists are the same thing now, panel widgets use UiNode::is_list to distinguish, normal nodes are layout and rendered
    as a list with a single item. You can also set lists directly on single child widgets, the multiple nodes will be Z-stacked.

  • Fix accepts_enter and accepts_tag in text editor widgets.

  • Fix zero sized gradients causing render panic.

  • Breaking Refactor zng::var API.

    Unified var types to new Var<T> and AnyVar structs. Variables still behave the same
    and everything that could be done before can still be done with the new API. The main motivation
    for this refactor is reduction of generics code bloat, and since a breaking change is already happening
    some poorly named methods and functions where also renamed.

    To migrate:

    • Replace impl Var<T> and other var structs with Var<T>.
    • Replace impl AnyVar with AnyVar.
    • Replace LocalVar(_) with const_var(_).
    • Replace ContextualizedVar::new(_) with contextual_var(_).
    • Replace Var::wait_value with Var::wait_match.
    • Replace Var::map_ref with Var::map, map_ref_bidi with map_bidi or new map_bidi_modify in cases where
      the mapped value is a subset of the source value.
    • Now always use Var::capabilities to inspect kind of var.
    • Modify methods Var::{set, update, modify} now simply DEBUG log if the variable is read-only,
      use try_set, try_update, try_modify to get the error.
  • Breaking zng::command_property::command_property! now also generates contextual property and var that enable/disable the handlers.

    • Adds zng::clipboard::{can_cut, can_copy, can_paste}.
    • Adds zng::config::settings::can_settings.
    • Adds zng::app::{can_new, can_open, can_save, can_save_as}.
    • Will not generate this if enabled: is set.
  • Breaking Refactor MONITORS state reporting to use variables.

  • Fix deserialization of PxConstraints failing when the max field is not set and format is "human readable".

  • Breaking Refactor zng::config::SyncConfig to use a map of RawConfigValue directly.

    • Removed ConfigMap trait, now use SyncConfigBackend to implement custom formats.
    • All provided formats work the same on the surface, this is only breaking for custom format implementers.
  • Breaking Refactor zng::config::RawConfigValue to represent the full serde data model.

    • Removed default JSON support, use the new "config_json" feature to enable JSON config files.
    • Remove conversion implementations and related error types, can now (de)serialize directly to RawConfigValue.
  • Breaking Refactor how view-process config events notify.

    • Initial non default config state now reported as events on init.
    • All config and monitors info removed from ViewProcessInitedArgs and related API.
  • Fix VARS.animations_enabled not updating when it is not set and the sys_animations_enabled changes.

  • Breaking Refactor how raw device events are enabled on the view-process.

    • Now can dynamically enable/disable and with more precision of what kind of events.
    • Removed enable_input_device_events and all related API from view-process controller.
    • Added APP.device_events_filter variable that can be set to enable/disable device events.
  • Breaking Remove all deprecated items.

  • Breaking Refactor zng::slider API.

    • Removed direct support to std range type, use Selector::many with two values.
    • Selector value_with and many_with now expects Sync closures.
    • Thumb args now uses a variable to track the position.
  • Fix Slider! not reacting to value changes.

  • Fix inherited widget properties not showing in documentation.

  • Breaking Add unimplemented audio decoding and playback to the view-process API in preparation of a future release.