Skip to content

Instantly share code, notes, and snippets.

@sethladd
Created March 24, 2014 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethladd/9744677 to your computer and use it in GitHub Desktop.
Save sethladd/9744677 to your computer and use it in GitHub Desktop.
dart:js and package:js test for code size
name: testjsinterop
description: A sample web application
dependencies:
browser: any
js: any
quiver: any
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');
});
}
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');
});
}
@sethladd
Copy link
Author

Using 1.3 dev, I see 133kb for dart:js and 188kb for package:js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment