dart-lang/spark — pull request #397 by ussuri (2013-12-09 07:31:54+00:00)
Title: Encapsulate app's UI in a top-level Polymer widget

This is a giant CL: let me know if it's too scary to review as is - I might be able to break it up into 2-3 chained parts.

This CL wraps most of the app's UI into a single top-level Polymer widget, , and binds the logic to the elements from its shadowDOM, instead of elements direct from the DOM, as before.

This solves a few problems with getting the Polymer widgets to work and display nicely (e.g., spark-menu works with this in a not-yet-committed build on my disk; all widgets display nicely and at once, avoiding FOUC; etc.). In addition, it almost 100% separates the app's UI and logic (should become 100% in a follow-up with data-binding and a complete switch to spark_widgets).

I think spark.dart has been nicely improved as an indirect consequence, with more code reuse, more localized dependencies on the UI, etc.

The way the elements from the shadowDOM are passed directly to the components such as FileController is going to change to MVC scheme with data binding, where FileController will just populate a treeview model bound to the underlying Polymer element via an attribute, to be rendered by the element itself.

The dropdown menu is currently a hack: it looks ugly, but it's working; it's just to verify the functionality for now - it will be replaced by spark-menu soon.

@terrylucas: ide/app/spark_polymer.*, ide/app/lib/polymer_ui/*.*
@devoncarew: ide/app/spark.*, ide/app/lib/ui/files_controller*.*
@dinhviethoa: anything you'd like, since you wanted to be added on code reviews of Polymer-related stuff