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

Issue 11824072: Adding streams to dart:html. (Closed)

Created:
7 years, 11 months ago by blois
Modified:
7 years, 11 months ago
CC:
reviews_dartlang.org, Mads Ager (google)
Visibility:
Public.

Description

Adding streams to dart:html. This exposes all DOM events as streams. This keeps the current DOM event syntax as well, I'd like to make sure this API is stable before deprecating the old syntax, then we'll remove it a while after that. I made an initial stab at getting the event types correct for the streams, though it's not documented very well and frequently inconsistent between browsers. Hopefully it's close, and I imagine there will be changes to come. BUG= Committed: https://code.google.com/p/dart/source/detail?r=17028

Patch Set 1 #

Total comments: 14

Patch Set 2 : Review feedback. #

Patch Set 3 : StreamController -> Stream #

Total comments: 18

Patch Set 4 : Implementing asMultiSubscriberStream #

Patch Set 5 : Review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3769 lines, -6 lines) Patch
M sdk/lib/html/dart2js/html_dart2js.dart View 1 2 3 4 62 chunks +1380 lines, -4 lines 0 comments Download
M sdk/lib/html/dartium/html_dartium.dart View 63 chunks +1382 lines, -2 lines 0 comments Download
M sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart View 1 2 9 chunks +45 lines, -0 lines 0 comments Download
M sdk/lib/indexed_db/dartium/indexed_db_dartium.dart View 1 2 9 chunks +45 lines, -0 lines 0 comments Download
M sdk/lib/svg/dart2js/svg_dart2js.dart View 1 2 3 chunks +161 lines, -0 lines 0 comments Download
M sdk/lib/svg/dartium/svg_dartium.dart View 1 2 3 chunks +161 lines, -0 lines 0 comments Download
M sdk/lib/web_audio/dart2js/web_audio_dart2js.dart View 1 2 3 chunks +5 lines, -0 lines 0 comments Download
M sdk/lib/web_audio/dartium/web_audio_dartium.dart View 1 2 3 chunks +5 lines, -0 lines 0 comments Download
A tests/html/streams_test.dart View 1 2 3 4 1 chunk +174 lines, -0 lines 0 comments Download
M tools/dom/scripts/htmleventgenerator.py View 1 2 2 chunks +255 lines, -0 lines 0 comments Download
M tools/dom/scripts/systemhtml.py View 2 chunks +11 lines, -0 lines 0 comments Download
A tools/dom/src/EventStreamProvider.dart View 1 2 3 4 1 chunk +137 lines, -0 lines 0 comments Download
M tools/dom/templates/html/dart2js/html_dart2js.darttemplate View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate View 1 chunk +1 line, -0 lines 0 comments Download
M tools/dom/templates/html/dart2js/svg_dart2js.darttemplate View 1 chunk +1 line, -0 lines 0 comments Download
M tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate View 1 chunk +1 line, -0 lines 0 comments Download
M tools/dom/templates/html/dartium/html_dartium.darttemplate View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M tools/dom/templates/html/dartium/indexed_db_dartium.darttemplate View 1 chunk +1 line, -0 lines 0 comments Download
M tools/dom/templates/html/dartium/svg_dartium.darttemplate View 1 chunk +1 line, -0 lines 0 comments Download
M tools/dom/templates/html/dartium/web_audio_dartium.darttemplate View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
blois
Here's an initial implementation of exposing DOM events as streams. The goal here is that ...
7 years, 11 months ago (2013-01-10 22:10:38 UTC) #1
floitsch
Thanks. What do you think of renaming the streams to plural and removing the "on" ...
7 years, 11 months ago (2013-01-11 09:44:06 UTC) #2
Jennifer Messerly
It would be good to try and measure the additional memory overhead of each event. ...
7 years, 11 months ago (2013-01-11 21:57:17 UTC) #3
Jennifer Messerly
by the way -- I do like the APIs for this. Especially the typed event ...
7 years, 11 months ago (2013-01-11 21:59:06 UTC) #4
floitsch
https://codereview.chromium.org/11824072/diff/1/tools/dom/src/HtmlStreamController.dart File tools/dom/src/HtmlStreamController.dart (right): https://codereview.chromium.org/11824072/diff/1/tools/dom/src/HtmlStreamController.dart#newcode10 tools/dom/src/HtmlStreamController.dart:10: class _HtmlStreamController<T extends Event> extends StreamController<T> { On 2013/01/11 ...
7 years, 11 months ago (2013-01-11 22:46:11 UTC) #5
blois
https://codereview.chromium.org/11824072/diff/1/tests/html/streams_test.dart File tests/html/streams_test.dart (right): https://codereview.chromium.org/11824072/diff/1/tests/html/streams_test.dart#newcode34 tests/html/streams_test.dart:34: // Unsubscribe on error handlers still get their events. ...
7 years, 11 months ago (2013-01-11 22:51:30 UTC) #6
floitsch
https://codereview.chromium.org/11824072/diff/1/tests/html/streams_test.dart File tests/html/streams_test.dart (right): https://codereview.chromium.org/11824072/diff/1/tests/html/streams_test.dart#newcode34 tests/html/streams_test.dart:34: // Unsubscribe on error handlers still get their events. ...
7 years, 11 months ago (2013-01-11 22:55:45 UTC) #7
Jennifer Messerly
https://codereview.chromium.org/11824072/diff/1/tests/html/streams_test.dart File tests/html/streams_test.dart (right): https://codereview.chromium.org/11824072/diff/1/tests/html/streams_test.dart#newcode34 tests/html/streams_test.dart:34: // Unsubscribe on error handlers still get their events. ...
7 years, 11 months ago (2013-01-11 23:30:14 UTC) #8
blois
On 2013/01/11 23:30:14, John Messerly wrote: > https://codereview.chromium.org/11824072/diff/1/tests/html/streams_test.dart > File tests/html/streams_test.dart (right): > > https://codereview.chromium.org/11824072/diff/1/tests/html/streams_test.dart#newcode34 ...
7 years, 11 months ago (2013-01-12 00:41:46 UTC) #9
floitsch
On 2013/01/12 00:41:46, blois wrote: > On 2013/01/11 23:30:14, John Messerly wrote: > > https://codereview.chromium.org/11824072/diff/1/tests/html/streams_test.dart ...
7 years, 11 months ago (2013-01-12 00:44:18 UTC) #10
floitsch
https://codereview.chromium.org/11824072/diff/12001/tools/dom/src/EventStreamProvider.dart File tools/dom/src/EventStreamProvider.dart (right): https://codereview.chromium.org/11824072/diff/12001/tools/dom/src/EventStreamProvider.dart#newcode23 tools/dom/src/EventStreamProvider.dart:23: throw new ArgumentError('onError is not supported by DOM events'); ...
7 years, 11 months ago (2013-01-12 00:49:33 UTC) #11
Jennifer Messerly
https://codereview.chromium.org/11824072/diff/12001/tools/dom/src/EventStreamProvider.dart File tools/dom/src/EventStreamProvider.dart (right): https://codereview.chromium.org/11824072/diff/12001/tools/dom/src/EventStreamProvider.dart#newcode38 tools/dom/src/EventStreamProvider.dart:38: class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> { On 2013/01/12 ...
7 years, 11 months ago (2013-01-12 01:11:25 UTC) #12
Jennifer Messerly
One more question -- how is "dispatch" handled in this model? (We used to have ...
7 years, 11 months ago (2013-01-12 01:13:00 UTC) #13
blois
On 2013/01/12 01:13:00, John Messerly wrote: > One more question -- how is "dispatch" handled ...
7 years, 11 months ago (2013-01-12 01:42:15 UTC) #14
blois
https://codereview.chromium.org/11824072/diff/12001/tools/dom/src/EventStreamProvider.dart File tools/dom/src/EventStreamProvider.dart (right): https://codereview.chromium.org/11824072/diff/12001/tools/dom/src/EventStreamProvider.dart#newcode23 tools/dom/src/EventStreamProvider.dart:23: throw new ArgumentError('onError is not supported by DOM events'); ...
7 years, 11 months ago (2013-01-12 01:42:52 UTC) #15
Jennifer Messerly
7 years, 11 months ago (2013-01-12 01:47:00 UTC) #16
lgtm

Powered by Google App Engine
This is Rietveld 408576698