I'm sure that, given enough time, they'll solve these problems, but as for right now... it isn't ready for primetime. Not by a longshot.
I'm sure that, given enough time, they'll solve these problems, but as for right now... it isn't ready for primetime. Not by a longshot.
Seth Ladd has a couple of posts about Tree Shaking and Minification if you're interested http://blog.sethladd.com/2013/01/minification-is-not-enough-... http://blog.sethladd.com/2013/03/i-shrunk-my-dart-to-js-code...
I did. I'm no stranger to Closure Compiler, and even after fiddling around with ADVANCED_OPTIMIZATIONS for an hour, those ridiculous $variables persisted. What was even weirder was, just as a test, I imported a module I wasn't even using at all, and for some reason, Closure Compiler still refused to remove its code...
function I(){} init() var $=I.p var $$={}
Dart source -> dart2js -> JavaScript (530K)
Dart source -> dart2js -> JavaScript (530K) -> Closure Compiler -> *error*
Dart source -> dart2js --minify -> JavaScript (240K)
If I import a module and don't use it, such as 'dart:utf', the resulting JavaScript output size does not go up. If I call a function in dart:utf the JavaScript size goes up. If I stop calling the function, the size goes down. If I create a function but don't call it, the size stays the same. If I call it, the size goes up. Everything seems to be working. They just release a new version a few days ago and I'm on the latest.EDIT: Well, technically, Dart is actually designed to be interpreted (or JIT compiled, or what have you) by the Dart VM, so calling it a "compiled language" was incorrect on my part. However, dart2js is a compiler, so, it should be doing compiler-y shit.