-
Notifications
You must be signed in to change notification settings - Fork 42
Conversation
I'll take a look, but @vsmenon for FYI - |
b9c15e9
to
821e65c
Compare
|
||
import 'dart:io'; | ||
|
||
void main() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no action necessary, but this example will get crazy out of date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to re-do this in markdown, as a few lines diffs to the std flutter hello-world app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to add a check for the opt-in flag, so it should become more different from the Flutter example
|
||
# Measure the size of the compiled JS, for the dart:html version of the library. | ||
dart tool/grind.dart build | ||
#dart tool/grind.dart build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this fail? This should be compiling with dart2js, not DDC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was failing for me, but maybe I'm doing something wrong.
dart2js --minify -obuild/example/example.dart.js example/example.dart
example/example.dart:12:1:
Error: Library not found 'package:usage/usage_html.dart'.
import 'package:usage/usage_html.dart';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
example/example.dart:37:17:
Warning: Cannot resolve type 'Analytics'.
void _handleFoo(Analytics analytics) {
^^^^^^^^^
example/example.dart:26:1:
Warning: Cannot resolve type 'Analytics'.
Analytics getAnalytics() {
^^^^^^^^^
example/example.dart:41:17:
Warning: Cannot resolve type 'Analytics'.
void _handleBar(Analytics analytics) {
^^^^^^^^^
example/example.dart:45:18:
Warning: Cannot resolve type 'Analytics'.
void _changePage(Analytics analytics) {
^^^^^^^^^
example/example.dart:14:1:
Warning: Cannot resolve type 'Analytics'.
Analytics _analytics;
^^^^^^^^^
example/example.dart:29:22:
Warning: Cannot resolve 'AnalyticsHtml'.
_analytics = new AnalyticsHtml(_lastUa, 'Test app', '1.0');
^^^^^^^^^^^^^
example/example.dart:14:1:
Warning: Cannot resolve type 'Analytics'.
Analytics _analytics;
^^^^^^^^^
Error: Compilation failed.
failed with exit code 1
#0 run (package:grinder/src/run.dart:48:5)
#1 Dart2js.compile (package:grinder/grinder_sdk.dart:344:5)
#2 build (file:///Volumes/skynet/usage/tool/grind.dart:30:11)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely dart2js is not fully happy with conditional imports, or we've specified something incorrectly here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to add --conditional_directives to the call to dart2js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Done here: #64
lgtm |
No description provided.