Skip to content
This repository has been archived by the owner on Apr 24, 2021. It is now read-only.

Revisit: changing @published properties on widgets not working as advertised #2252

Open
ussuri opened this issue Jun 2, 2014 · 6 comments
Open

Comments

@ussuri
Copy link
Contributor

ussuri commented Jun 2, 2014

There are currently multiple issues with programmatic changes to @published properties on widgets not properly propagating to the HTML side. A property would be changed either by an external client or internally by the widget itself, but that's not reflected in the HTML/CSS (attributes don't get set, CSS rules don't get applied etc.).

It seems like there is a fix coming from the Polymer side:

https://codereview.chromium.org/222203009/ which is the fix for https://code.google.com/p/dart/issues/detail?id=17301

Track that and revisit the widgets. Some markers to look for:

  • Explicit deliverChanges() invoked on the widgets
  • setAttr() calls on the widgets replacing simple property assignment
  • Properties set internally in a widget's script rather than simply data-bound in its markup using "{{attr}}"

cc @devoncarew

@ussuri ussuri added this to the MVP1.0: Chrome App dev (Dev preview) milestone Jun 2, 2014
@ussuri ussuri self-assigned this Jun 2, 2014
@adam-singer
Copy link
Contributor

@ussuri 8411d93 seemed to break ide. Reverting that change seems to unbreak it.

WARNING: more than one child with 'focused' attribute (:1)
Failed to load resource: net::ERR_FILE_NOT_FOUND
  chrome-extension://kcjgcakhgelcejampmijgkjkadfcncjl/user.json
[INFO] spark.launch: embedded web server listening on port 64929
[INFO] spark.workspace: Workspace restore took 839ms.
Uncaught Error: type 'Null' is not a subtype of type 'bool' of 'boolean expression'.
Stack Trace: 
#0      dirtyCheckObservables (package:observe/src/dirty_check.dart:61:36)
#1      Observable.dirtyCheck (package:observe/src/observable.dart:35:52)
#2      SparkPolymerUI.refreshFromModel (chrome-extension://kcjgcakhgelcejampmijgkjkadfcncjl/spark_polymer_ui.dart:71:26)
#3      SparkPolymerUI.modelReady (chrome-extension://kcjgcakhgelcejampmijgkjkadfcncjl/spark_polymer_ui.dart:60:21)
#4      _SparkSetupParticipant.applicationStarted (chrome-extension://kcjgcakhgelcejampmijgkjkadfcncjl/spark_polymer.dart:338:25)
#5      Application._transition.<anonymous closure> (chrome-extension://kcjgcakhgelcejampmijgkjkadfcncjl/lib/app.dart:95:46)
#6      Future.forEach.nextElement.<anonymous closure> (dart:async/future.dart:300)
#7      Future.Future.sync (dart:async/future.dart:168)
#8      Future.forEach.nextElement (dart:async/future.dart:300)
#9      Future.forEach (dart:async/future.dart:306)
#10     Application._transition (chrome-extension://kcjgcakhgelcejampmijgkjkadfcncjl/lib/app.dart:91:26)
#11     Application.start.<anonymous closure> (chrome-extension://kcjgcakhgelcejampmijgkjkadfcncjl/lib/app.dart:64:25)
#12     _rootRunUnary (dart:async/zone.dart:730)
#13     _RootZone.runUnary (dart:async/zone.dart:864)
#14     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:488)
#15     _Future._propagateToListeners (dart:async/future_impl.dart:571)
#16     _Future._complete (dart:async/future_impl.dart:317)
#17     Future.forEach.nextElement (dart:async/future.dart:303)
#18     _rootRunUnary (dart:async/zone.dart:730)
#19     _RootZone.runUnary (dart:async/zone.dart:864)
#20     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:488)
#21     _Future._propagateToListeners (dart:async/future_impl.dart:571)
#22     _Future._completeWithValue (dart:async/future_impl.dart:331)
#23     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:393)
#24     _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:23)
#25     _asyncRunCallback (dart:async/schedule_microtask.dart:32)
#26     _handleMutation (dart:html:38464)


Exception: type 'Null' is not a subtype of type 'bool' of 'boolean expression'.
[INFO] preferences: saved preferences: (editorStates, lastFileSelection)

@dinhvh
Copy link
Contributor

dinhvh commented Jun 7, 2014

@financecoding: @devoncarew fixed it already.

@gaurave
Copy link
Contributor

gaurave commented Jun 7, 2014

Possibly fixed here #2367

@devoncarew
Copy link
Contributor

I wonder if the (fairly pervasive) problem of polymer not reacting to changes is due to us not properly setting up the Zone for polymer? We used to have explicit setup for the polymer zone, and now we don't.

It may also be worth exploring having the components be responsible for firing events when their properties change, instead of replying on polymer's automagic detection.

@ussuri
Copy link
Contributor Author

ussuri commented Jun 8, 2014

Based on @jmesserly's comment to #2247, you're right. We can wait for "https://codereview.chromium.org/222203009/ which is the fix for https://code.google.com/p/dart/issues/detail?id=17301", or indeed fix the Zone on our end. I know very little about Zones, so if you know how, could you do that?

@srsaroop srsaroop modified the milestones: Later, MVP1.0: Chrome App dev (Dev preview) Jul 1, 2014
@ussuri ussuri modified the milestones: Later, M16 Aug 29, 2014
@ussuri
Copy link
Contributor Author

ussuri commented Sep 16, 2014

https://codereview.chromium.org/222203009/ is still not fixed (I've just pinged that bug). Moving this further out.

@ussuri ussuri modified the milestones: M17, M16 Sep 16, 2014
@ussuri ussuri modified the milestones: M17, Later Oct 8, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants