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

Unified Diff: lib/polymer.dart

Issue 22962005: Merge pull request #581 from kevmoo/polymer (Closed) Base URL: https://github.com/dart-lang/web-ui.git@polymer
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/observe_html.dart ('k') | lib/polymer_element.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/polymer.dart
diff --git a/lib/polymer.dart b/lib/polymer.dart
index c949a496aef00d73ddcebf859d63c681413efd17..b4265bd32581deed2c92bc216240ce490f4f01da 100644
--- a/lib/polymer.dart
+++ b/lib/polymer.dart
@@ -15,19 +15,18 @@ import 'dart:async';
import 'dart:mirrors';
import 'package:mdv/mdv.dart' as mdv;
-import 'package:observe/observe.dart' show Observable;
+import 'package:observe/src/microtask.dart';
import 'package:path/path.dart' as path;
import 'polymer_element.dart' show registerPolymerElement;
export 'package:custom_element/custom_element.dart';
export 'package:observe/observe.dart';
+export 'package:observe/src/microtask.dart';
-export 'event.dart';
export 'observe.dart';
export 'observe_html.dart';
export 'polymer_element.dart';
export 'safe_html.dart';
-export 'scoped_css.dart';
/** Annotation used to automatically register polymer elements. */
@@ -54,20 +53,23 @@ const polymerInitMethod = const _InitPolymerAnnotation();
*
* The urls in [elementLibraries] can be absolute or relative to [srcUrl].
*/
-initPolymer(List<String> elementLibraries, void userMain(), [String srcUrl]) {
- new Timer.periodic(new Duration(milliseconds: 125),
- (_) => Observable.dirtyCheck());
-
- // TODO(jmesserly): mdv should use initMdv instead of mdv.initialize.
- mdv.initialize();
- for (var lib in elementLibraries) {
- _registerPolymerElementsOf(lib, srcUrl);
- }
- userMain();
+void initPolymer(List<String> elementLibraries, void userMain(), [String srcUrl]) {
+ wrapMicrotask(() {
+ // DOM events don't yet go through microtasks, so we catch those here.
+ new Timer.periodic(new Duration(milliseconds: 125),
+ (_) => performMicrotaskCheckpoint());
+
+ // TODO(jmesserly): mdv should use initMdv instead of mdv.initialize.
+ mdv.initialize();
+ for (var lib in elementLibraries) {
+ _registerPolymerElementsOf(lib, srcUrl);
+ }
+ userMain();
+ })();
}
/** All libraries in the current isolate. */
-var _libs = currentMirrorSystem().libraries;
+final _libs = currentMirrorSystem().libraries;
/**
* Reads the library at [uriString] (which can be an absolute URI or a relative
« no previous file with comments | « lib/observe_html.dart ('k') | lib/polymer_element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698