Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Issue 14732003: Implement Model-Driven-Views spec for Dart (Closed)

Created:
7 years, 7 months ago by Jennifer Messerly
Modified:
7 years, 7 months ago
CC:
reviews_dartlang.org, sethladd
Visibility:
Public.

Description

Implement Model-Driven-Views spec for Dart This has code ported from a few different sources: * a port of https://github.com/toolkitchen/mdv polyfill * a port of the observable layer: https://github.com/dart-lang/web-ui/tree/master/lib/observe * a port of list change summary: https://github.com/rafaelw/ChangeSummary/blob/master/change_summary.js The observePath/PathObserver code is written from scratch, but inspired by change_summary. I tried to keep it simpler; it does not support dirty checking. There's no good way to do that until we get dart:mirrors. R=floitsch@google.com, sigmund@google.com Committed: https://code.google.com/p/dart/source/detail?r=22561 Committed: https://code.google.com/p/dart/source/detail?r=22570

Patch Set 1 #

Patch Set 2 : trying upload again #

Total comments: 68

Patch Set 3 : update to tip #

Patch Set 4 : dartium fixes #

Patch Set 5 : passing on IE9 #

Patch Set 6 : round 1! #

Patch Set 7 : small fix #

Total comments: 62

Patch Set 8 : work in progress. reworked observable. tests not ported yet. #

Patch Set 9 : comment tweaks #

Total comments: 1

Patch Set 10 : tests passing again #

Patch Set 11 : merged #

Total comments: 4

Patch Set 12 : dartium changes #

Patch Set 13 : generate dom bindings, file bug about api_analyze_test #

Patch Set 14 : try upload again #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+8829 lines, -755 lines) Patch
A pkg/mdv_observe/lib/mdv_observe.dart View 1 2 3 4 5 6 7 8 9 1 chunk +104 lines, -0 lines 0 comments Download
A pkg/mdv_observe/lib/src/observable_box.dart View 1 2 3 4 5 6 7 8 9 1 chunk +37 lines, -0 lines 0 comments Download
A pkg/mdv_observe/lib/src/observable_list.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +288 lines, -0 lines 0 comments Download
A pkg/mdv_observe/lib/src/observable_map.dart View 1 2 3 4 5 6 7 8 9 1 chunk +149 lines, -0 lines 0 comments Download
A pkg/mdv_observe/pubspec.yaml View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -0 lines 0 comments Download
A pkg/mdv_observe/test/list_change_test.dart View 1 2 3 4 5 6 7 8 9 1 chunk +290 lines, -0 lines 0 comments Download
A pkg/mdv_observe/test/observable_list_test.dart View 1 2 3 4 5 6 7 8 9 1 chunk +245 lines, -0 lines 0 comments Download
A pkg/mdv_observe/test/observable_map_test.dart View 1 2 3 4 5 6 7 8 9 1 chunk +241 lines, -0 lines 0 comments Download
A pkg/mdv_observe/test/observe_test.dart View 1 2 3 4 5 6 7 8 9 1 chunk +130 lines, -0 lines 0 comments Download
A + pkg/mdv_observe/test/utils.dart View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -10 lines 0 comments Download
M pkg/pkg.status View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -0 lines 0 comments Download
M sdk/lib/_internal/libraries.dart View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M sdk/lib/html/dart2js/html_dart2js.dart View 1 2 3 4 5 6 7 8 9 10 11 12 18 chunks +1544 lines, -179 lines 0 comments Download
M sdk/lib/html/dartium/html_dartium.dart View 1 2 3 4 5 6 7 8 9 10 11 12 16 chunks +1520 lines, -169 lines 0 comments Download
A sdk/lib/mdv_observe_impl/mdv_observe_impl.dart View 1 2 3 4 5 6 7 8 9 1 chunk +226 lines, -0 lines 0 comments Download
M tests/compiler/dart2js/analyze_api_test.dart View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 2 comments Download
A tests/html/binding_syntax_test.dart View 1 2 3 4 5 6 7 8 9 1 chunk +146 lines, -0 lines 0 comments Download
A tests/html/element_bindings_test.dart View 1 2 3 4 5 6 7 8 9 1 chunk +344 lines, -0 lines 0 comments Download
A tests/html/mdv_observe_utils.dart View 1 2 3 4 5 6 7 8 9 1 chunk +16 lines, -0 lines 0 comments Download
A tests/html/node_bindings_test.dart View 1 2 3 4 5 6 7 8 9 1 chunk +156 lines, -0 lines 0 comments Download
D tests/html/node_model_test.dart View 1 chunk +0 lines, -192 lines 0 comments Download
A tests/html/path_observer_test.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +255 lines, -0 lines 0 comments Download
A tests/html/template_element_test.dart View 1 2 3 4 5 6 7 8 9 1 chunk +1503 lines, -0 lines 0 comments Download
M tools/create_sdk.py View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -4 lines 0 comments Download
M tools/dom/dom.py View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -1 line 0 comments Download
M tools/dom/scripts/dartmetadata.py View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +8 lines, -0 lines 0 comments Download
M tools/dom/scripts/htmlrenamer.py View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M tools/dom/scripts/systemhtml.py View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
D tools/dom/src/ModelTreeObserver.dart View 1 chunk +0 lines, -100 lines 0 comments Download
A tools/dom/src/PathObserver.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +286 lines, -0 lines 0 comments Download
A tools/dom/src/TemplateBindings.dart View 1 2 3 4 5 6 7 8 9 1 chunk +776 lines, -0 lines 0 comments Download
M tools/dom/src/dart2js_Conversions.dart View 1 chunk +1 line, -0 lines 0 comments Download
M tools/dom/templates/html/dart2js/html_dart2js.darttemplate View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -2 lines 0 comments Download
M tools/dom/templates/html/dartium/html_dartium.darttemplate View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -2 lines 0 comments Download
M tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M tools/dom/templates/html/impl/impl_Element.darttemplate View 1 2 3 4 5 6 7 8 9 4 chunks +260 lines, -15 lines 0 comments Download
M tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M tools/dom/templates/html/impl/impl_HTMLInputElement.darttemplate View 1 2 3 4 5 6 7 8 9 10 1 chunk +60 lines, -0 lines 0 comments Download
A tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate View 1 2 3 4 5 1 chunk +119 lines, -0 lines 0 comments Download
M tools/dom/templates/html/impl/impl_Node.darttemplate View 2 chunks +32 lines, -79 lines 0 comments Download
M tools/dom/templates/html/impl/impl_Text.darttemplate View 1 2 3 4 5 6 7 8 9 1 chunk +38 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
Jennifer Messerly
At long last, here it is. *Real MDV for Dart*! Since it's a lot of ...
7 years, 7 months ago (2013-05-01 00:42:43 UTC) #1
Jennifer Messerly
https://codereview.chromium.org/14732003/diff/2001/tools/dom/src/TemplateBindings.dart File tools/dom/src/TemplateBindings.dart (right): https://codereview.chromium.org/14732003/diff/2001/tools/dom/src/TemplateBindings.dart#newcode9 tools/dom/src/TemplateBindings.dart:9: // The code mostly comes from src/template_element.js What's up ...
7 years, 7 months ago (2013-05-01 00:44:58 UTC) #2
Jennifer Messerly
FYI, Dartium build change: https://codereview.chromium.org/14744002
7 years, 7 months ago (2013-05-01 02:33:52 UTC) #3
blois
Some initial comments https://codereview.chromium.org/14732003/diff/2001/sdk/lib/observe/list_diff.dart File sdk/lib/observe/list_diff.dart (right): https://codereview.chromium.org/14732003/diff/2001/sdk/lib/observe/list_diff.dart#newcode37 sdk/lib/observe/list_diff.dart:37: // ListChangeDeltas straight from ObservableList? Then ...
7 years, 7 months ago (2013-05-01 17:00:42 UTC) #4
Jennifer Messerly
https://codereview.chromium.org/14732003/diff/2001/sdk/lib/observe/observable.dart File sdk/lib/observe/observable.dart (right): https://codereview.chromium.org/14732003/diff/2001/sdk/lib/observe/observable.dart#newcode21 sdk/lib/observe/observable.dart:21: toObservable(value, {bool deep: true}) { On 2013/05/01 17:00:42, blois ...
7 years, 7 months ago (2013-05-01 17:56:34 UTC) #5
Jennifer Messerly
https://codereview.chromium.org/14732003/diff/2001/tools/dom/dom.py File tools/dom/dom.py (right): https://codereview.chromium.org/14732003/diff/2001/tools/dom/dom.py#newcode103 tools/dom/dom.py:103: os.chdir(os.path.join('..', '..', '..')) On 2013/05/01 17:00:42, blois wrote: > ...
7 years, 7 months ago (2013-05-01 18:03:44 UTC) #6
Jennifer Messerly
https://codereview.chromium.org/14732003/diff/2001/tools/dom/dom.py File tools/dom/dom.py (right): https://codereview.chromium.org/14732003/diff/2001/tools/dom/dom.py#newcode103 tools/dom/dom.py:103: os.chdir(os.path.join('..', '..', '..')) On 2013/05/01 18:03:44, John Messerly wrote: ...
7 years, 7 months ago (2013-05-01 18:11:46 UTC) #7
Siggi Cherem (dart-lang)
John this is looking awesome... just some minor comments on the observable side of things. ...
7 years, 7 months ago (2013-05-01 18:57:56 UTC) #8
Jennifer Messerly
PTAL, initial feedback addressed. Also passes on Dartium and IE9 now (+Firefox +Chrome). https://codereview.chromium.org/14732003/diff/2001/sdk/lib/observe/list_diff.dart File ...
7 years, 7 months ago (2013-05-02 02:58:33 UTC) #9
floitsch
We are trying to avoid new "dart:" libraries. In fact, we are trying to remove ...
7 years, 7 months ago (2013-05-02 13:21:45 UTC) #10
Siggi Cherem (dart-lang)
lgtm for the observable implementation https://codereview.chromium.org/14732003/diff/2001/sdk/lib/observe/list_diff.dart File sdk/lib/observe/list_diff.dart (right): https://codereview.chromium.org/14732003/diff/2001/sdk/lib/observe/list_diff.dart#newcode247 sdk/lib/observe/list_diff.dart:247: return [ splice ]; ...
7 years, 7 months ago (2013-05-02 16:21:08 UTC) #11
Jennifer Messerly
On 2013/05/02 13:21:45, floitsch wrote: > We are trying to avoid new "dart:" libraries. In ...
7 years, 7 months ago (2013-05-02 17:59:06 UTC) #12
blois
On 2013/05/02 17:59:06, John Messerly wrote: > On 2013/05/02 13:21:45, floitsch wrote: > > We ...
7 years, 7 months ago (2013-05-02 18:12:56 UTC) #13
Jennifer Messerly
https://codereview.chromium.org/14732003/diff/2001/sdk/lib/observe/observable_list.dart File sdk/lib/observe/observable_list.dart (right): https://codereview.chromium.org/14732003/diff/2001/sdk/lib/observe/observable_list.dart#newcode82 sdk/lib/observe/observable_list.dart:82: // TODO(jmesserly): do we need this now that we ...
7 years, 7 months ago (2013-05-02 19:48:04 UTC) #14
Jennifer Messerly
On 2013/05/02 18:12:56, blois wrote: > On 2013/05/02 17:59:06, John Messerly wrote: > > On ...
7 years, 7 months ago (2013-05-02 19:57:28 UTC) #15
Jennifer Messerly
I redid this change in package form: https://github.com/dart-lang/web-ui/tree/mdv/observe https://github.com/dart-lang/web-ui/tree/mdv/mdv Curious to hear opinions. Note: to ...
7 years, 7 months ago (2013-05-03 01:26:24 UTC) #16
blois
On 2013/05/03 01:26:24, John Messerly wrote: > I redid this change in package form: > ...
7 years, 7 months ago (2013-05-03 17:49:40 UTC) #17
Lasse Reichstein Nielsen
drive-by comments. https://codereview.chromium.org/14732003/diff/25038/sdk/lib/observe/observable.dart File sdk/lib/observe/observable.dart (right): https://codereview.chromium.org/14732003/diff/25038/sdk/lib/observe/observable.dart#newcode149 sdk/lib/observe/observable.dart:149: if (oldValue == newValue) return newValue; Consider ...
7 years, 7 months ago (2013-05-06 10:58:58 UTC) #18
Lasse Reichstein Nielsen
https://codereview.chromium.org/14732003/diff/25038/sdk/lib/observe/observe_path.dart File sdk/lib/observe/observe_path.dart (right): https://codereview.chromium.org/14732003/diff/25038/sdk/lib/observe/observe_path.dart#newcode20 sdk/lib/observe/observe_path.dart:20: // var path = observePath(123, 'foo.bar.baz.qux'); This needs to ...
7 years, 7 months ago (2013-05-06 11:08:21 UTC) #19
floitsch
LGTM with comments. https://codereview.chromium.org/14732003/diff/25038/sdk/lib/observe/observable.dart File sdk/lib/observe/observable.dart (right): https://codereview.chromium.org/14732003/diff/25038/sdk/lib/observe/observable.dart#newcode21 sdk/lib/observe/observable.dart:21: toObservable(value, {bool deep: true}) => This ...
7 years, 7 months ago (2013-05-06 17:37:46 UTC) #20
Jennifer Messerly
Hey guys, thanks for feedback. PTAL at API changes. High level: * dart:observe renamed observe_impl, ...
7 years, 7 months ago (2013-05-07 05:43:38 UTC) #21
Lasse Reichstein Nielsen
https://codereview.chromium.org/14732003/diff/25038/sdk/lib/observe/observable.dart File sdk/lib/observe/observable.dart (right): https://codereview.chromium.org/14732003/diff/25038/sdk/lib/observe/observable.dart#newcode240 sdk/lib/observe/observable.dart:240: int _hash4(w, x, y, z) => _hash2(_hash2(w, x), _hash2(y, ...
7 years, 7 months ago (2013-05-07 07:35:45 UTC) #22
floitsch
Thought a little bit more about this. Could we?: - rename it to dart:mdv_observe - ...
7 years, 7 months ago (2013-05-07 13:40:47 UTC) #23
floitsch
LGTM. This version of the CL is much easier to digest... I already replied earlier ...
7 years, 7 months ago (2013-05-07 14:46:47 UTC) #24
blois
https://codereview.chromium.org/14732003/diff/25038/sdk/lib/observe/observable.dart File sdk/lib/observe/observable.dart (right): https://codereview.chromium.org/14732003/diff/25038/sdk/lib/observe/observable.dart#newcode149 sdk/lib/observe/observable.dart:149: if (oldValue == newValue) return newValue; On 2013/05/07 05:43:38, ...
7 years, 7 months ago (2013-05-07 16:04:49 UTC) #25
Jennifer Messerly
On 2013/05/07 13:40:47, floitsch wrote: > Thought a little bit more about this. > Could ...
7 years, 7 months ago (2013-05-07 16:29:57 UTC) #26
Jennifer Messerly
Meant to sent this out again yesterday. I think I've got the final version; no ...
7 years, 7 months ago (2013-05-09 18:01:29 UTC) #27
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/14732003/diff/70002/pkg/mdv_observe/lib/src/observable_list.dart File pkg/mdv_observe/lib/src/observable_list.dart (right): https://codereview.chromium.org/14732003/diff/70002/pkg/mdv_observe/lib/src/observable_list.dart#newcode244 pkg/mdv_observe/lib/src/observable_list.dart:244: items.removeRange(r.index, r.index + r.removedCount); I assume items.removeRange(x, x) ...
7 years, 7 months ago (2013-05-09 18:49:35 UTC) #28
Jennifer Messerly
https://codereview.chromium.org/14732003/diff/70002/pkg/mdv_observe/lib/src/observable_list.dart File pkg/mdv_observe/lib/src/observable_list.dart (right): https://codereview.chromium.org/14732003/diff/70002/pkg/mdv_observe/lib/src/observable_list.dart#newcode244 pkg/mdv_observe/lib/src/observable_list.dart:244: items.removeRange(r.index, r.index + r.removedCount); On 2013/05/09 18:49:35, Siggi Cherem ...
7 years, 7 months ago (2013-05-09 18:55:40 UTC) #29
Jennifer Messerly
Committed patchset #12 manually as r22561 (presubmit successful).
7 years, 7 months ago (2013-05-09 20:29:30 UTC) #30
Jennifer Messerly
Committed patchset #14 manually as r22570 (presubmit successful).
7 years, 7 months ago (2013-05-09 21:39:16 UTC) #31
ahe
https://codereview.chromium.org/14732003/diff/81001/tests/compiler/dart2js/analyze_api_test.dart File tests/compiler/dart2js/analyze_api_test.dart (right): https://codereview.chromium.org/14732003/diff/81001/tests/compiler/dart2js/analyze_api_test.dart#newcode30 tests/compiler/dart2js/analyze_api_test.dart:30: 'html_dart2js.dart': const ['Warning: Using "new Symbol"'], // Issue 10565. ...
7 years, 7 months ago (2013-05-15 12:46:00 UTC) #32
Jennifer Messerly
7 years, 7 months ago (2013-05-15 17:59:30 UTC) #33
Message was sent while issue was closed.
https://codereview.chromium.org/14732003/diff/81001/tests/compiler/dart2js/an...
File tests/compiler/dart2js/analyze_api_test.dart (right):

https://codereview.chromium.org/14732003/diff/81001/tests/compiler/dart2js/an...
tests/compiler/dart2js/analyze_api_test.dart:30: 'html_dart2js.dart': const
['Warning: Using "new Symbol"'], // Issue 10565.
On 2013/05/15 12:46:00, ahe wrote:
> This change is not cool.
> 
> By supressing this warning and using new Symbol in dart:html, you're making it
> impossible for the dart2js team to implement mirrors and minification without
> bloating *all* programs.

This is not correct. "new Symbol" is only required for *some* of the dart:html
APIs. If you aren't using them, you shouldn't pay for it.

In any case, as I have explained elsewhere, Model-Driven-Views needs mirrors. So
we must figure out a way to make mirrors not all-or-nothing.

Powered by Google App Engine
This is Rietveld 408576698