Skip to main content

Posts

Showing posts from August, 2015

New site for Dart news and articles

For the latest Dart news, visit our new blog at  https://medium.com/dartlang .

Dart 1.12 Released, with Null-Aware Operators and more

Dart 1.12.0 is now released ! It contains the new null-aware operators language feature, and enhancements to pub, Observatory, dartdoc, and much more. Null-aware operators The new null-aware operators help you reduce the amount of code required to work with references that are potentially null. This feature is a collection of syntactic sugar for traversing (potentially null) object calls, conditionally setting a variable, and evaluating two (potentially null) expressions. Click or tap the red Run button below to see them in action. ??   if null operator. `expr1 ?? expr2` evaluates to `expr1` if not `null`, otherwise `expr2`. ??=   null-aware assignment. `v ??= expr` causes `v` to be assigned `expr` only if `v` is `null`. x?.p   null-aware access. `x?.p` evaluates to `x.p` if `x` is not `null`, otherwise evaluates to `null`. x?.m()      null-aware method invocation. `x?.m()` invokes `m` only if `x` is not `null`. Learn more ...

A New Way to Share with DartPad

Back in May, we announced the release of DartPad 1.0 , a clean and zero-install tool that helps you explore Dart . To create a seamless learning experience for both experienced and new developers, today we released embeddable pads! You can now add live Dart code to web pages. Embeddable pads have the full power of the standalone DartPad: Tutorials and guides can use embeddings to quickly demonstrate concepts on the fly: You can also open embedded pads in DartPad to further edit and share code. For more information, view the embedding guide . Head over to dartpad.dartlang.org and share your first pad! We hope you enjoy this new addition and provide us with feedback—remember, sharing is caring! Posted by George He, Chief Sharing Operator

5% smaller output from dart2js

dart2js now produces up to 5% smaller output in the latest dev channel release of the Dart SDK. We measured a 5% reduction on the minified and zipped dart2js output for one of the larger Dart-based apps in Google with source code size around 17MB. While we’ve seen a 5% reduction on a large app, your milage may vary and improvements are expected to increase with the size of your app. This improvement comes on top of a previous 3% reduction since the beginning of this year. The idea behind the latest improvement is quite simple: The symbols that will occur most often in the generated output should be assigned the shortest minified names. So when minifying the code, we rename according to the frequency of each symbol in such a way that a high frequency results in a short name in the output. This new frequency-based namer generally produces smaller output, which is great for deployment. It does however also result in different name allocations and thus “diffing” before/after the c...