Created
March 24, 2014 17:12
-
-
Save sethladd/9744677 to your computer and use it in GitHub Desktop.
dart:js and package:js test for code size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: testjsinterop | |
description: A sample web application | |
dependencies: | |
browser: any | |
js: any | |
quiver: any |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:html'; | |
import 'dart:js' show JsObject, context; | |
import 'package:quiver/collection.dart' show listsEqual; | |
import 'dart:async'; | |
void main() { | |
var hug = new JsObject(context['Hug']); | |
var result = hug.callMethod('embrace', [10]); | |
querySelector('#output').text = result; | |
var list1 = [1,2,3,4,5]; | |
var list2 = [1,2,3,4,5]; | |
print(listsEqual(list1, list2)); | |
Future.wait([new Future.value(1), new Future.value(2)]).then((_) { | |
print('all done'); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:html'; | |
import 'package:js/js.dart' as js; | |
import 'package:quiver/collection.dart'; | |
import 'dart:async'; | |
void main() { | |
var context = js.context; | |
var hug = new js.Proxy(context.Hug); | |
var result = hug.embrace(10); | |
querySelector('#output').text = result; | |
var list1 = [1,2,3,4,5]; | |
var list2 = [1,2,3,4,5]; | |
print(listsEqual(list1, list2)); | |
Future.wait([new Future.value(1), new Future.value(2)]).then((_) { | |
print('all done'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using 1.3 dev, I see 133kb for dart:js and 188kb for package:js