v0.16.0
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::nodeAPI.Unified UI node (and list) types into a new
UiNodestruct, most node types are implemented usingmatch_nodeand not affected,
custom node types now must implementUiNodeImpl, 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 UiNodescales 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 UiNodewith justUiNode. - Replace input
_: impl UiNodewith_: impl IntoUiNode. - Replace
NilUiNodewithUiNode::nil(). - Custom nodes now must implement
UiNodeImpl. - Replace
#[ui_node]impls with manual impl ofUiNodeImpl. The proc-macro attribute was removed, the new
UiNodeImplprovides default impls for methods.
To migrate UiNodeList:
- Replace output
-> impl UiNodeListwith justUiNode. - Replace input
_: impl UiNodeListwith_: impl IntoUiNode. - Replace
EditableUiNodeListwithEditableUiVec.
UI nodes and lists are the same thing now, panel widgets use
UiNode::is_listto 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. - Replace output
-
Fix
accepts_enterandaccepts_tagin text editor widgets. -
Fix zero sized gradients causing render panic.
-
Breaking Refactor
zng::varAPI.Unified var types to new
Var<T>andAnyVarstructs. 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 withVar<T>. - Replace
impl AnyVarwithAnyVar. - Replace
LocalVar(_)withconst_var(_). - Replace
ContextualizedVar::new(_)withcontextual_var(_). - Replace
Var::wait_valuewithVar::wait_match. - Replace
Var::map_refwithVar::map,map_ref_bidiwithmap_bidior newmap_bidi_modifyin cases where
the mapped value is a subset of the source value. - Now always use
Var::capabilitiesto inspect kind of var. - Modify methods
Var::{set, update, modify}now simply DEBUG log if the variable is read-only,
usetry_set, try_update, try_modifyto get the error.
- Replace
-
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.
- Adds
-
Breaking Refactor
MONITORSstate reporting to use variables. -
Fix deserialization of
PxConstraintsfailing when themaxfield is not set and format is "human readable". -
Breaking Refactor
zng::config::SyncConfigto use a map ofRawConfigValuedirectly.- Removed
ConfigMaptrait, now useSyncConfigBackendto implement custom formats. - All provided formats work the same on the surface, this is only breaking for custom format implementers.
- Removed
-
Breaking Refactor
zng::config::RawConfigValueto 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.
- Removed default JSON support, use the new
-
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
ViewProcessInitedArgsand related API.
-
Fix
VARS.animations_enablednot updating when it is not set and thesys_animations_enabledchanges. -
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_eventsand all related API from view-process controller. - Added
APP.device_events_filtervariable that can be set to enable/disable device events.
-
Breaking Remove all deprecated items.
-
Breaking Refactor
zng::sliderAPI.- Removed direct support to std range type, use
Selector::manywith two values. - Selector
value_withandmany_withnow expectsSyncclosures. - Thumb args now uses a variable to track the position.
- Removed direct support to std range type, use
-
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.