eclipsesource / eclipsesource/tabris-js

Implement property change detection for non-primitive values

Open
#800 1 comment 1 reaction 1 assignee Claimed by @ralfstx View on GitHub
js
Dominant language
JavaScript
Stars
1.4k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

When setting values to a widget, they always get pushed through the native bridge.
If for example I have an `ImageView` and I `.set({image: same_url_its_showing_already})`, the image reloads which is quite heavy.
Most frameworks for web abstract having to handle this is with some implementation of a virtual DOM so that if you set a property of a widget to it’s currently active value (i.e. no state change), nothing gets propagated to the rendering layer.

Solution :
Change detection for primitive values exists, but only for event triggering, not for the native bridge.
We would like all updates to primitive values that don’t change the value ( exactly equal === ) , not to propagate changes to the native bridge.

We would also like this to work with shortcuts:
`.set({image: {src: same_url_its_showing_already}})`
`.set({image: same_url_its_showing_already})`
Would do the same.

Also
`.set({layoutData: {left: same_left_its_showing_already}})`
`.set({left: same_left_its_showing_already})`
Would do the same.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.