[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ Skip to main content

Posts

Showing posts with the label sdk

New site for Dart news and articles

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

Dart 2.0 pre-releases: What they mean to you

If you publish Dart packages or like to use early releases of the Dart SDK, the next few months are going to be interesting, as apps and packages adapt to the changes required by Dart 2.0 . To make the process smoother, the pub tool that’s in Dart 2.0 pre-releases allows developers to download (and attempt to use) packages that don’t explicitly support Dart 2.0. The upshot: Use a stable Dart SDK if you need reliability . Use a pre-release Dart 2.0 SDK if you’d like to test published packages with Dart 2.0. Report any issues you find to the package maintainer. If you publish packages , be careful about SDK constraints, and expect feedback from developers trying your packages with Dart 2.0. The Dart 2.0 update page has all the details, but here’s an overview of what to expect, based on your development environment and the kind of code you write. If you use Flutter: In the short term, your Flutter code isn’t affected. When Flutter updates its Dart SDK to a ...

Dart 1.24: Faster edit-refresh cycle on the web & new function type syntax

Dart 1.24 is now available. It includes the Dart Development Compiler and supports a new generic function type syntax. Get it now ! Figure 1: DDC debugging in Chrome. Some notable changes in this release: pub serve now has support for the Dart Development Compiler. Unlike dart2js, this new compiler is modular, which allows pub to do incremental re-builds for pub serve. In practice what that means is you can edit your Dart files, refresh in Chrome (or other supported browsers), and see your edits almost immediately. This is because pub is only recompiling your package, not all packages that you depend on. There is one caveat with the new compiler, which is that your package and your dependencies must all be strong mode  clean. You can also use the new compiler to run your tests in Chrome much more quickly than you can with dart2js. Read more  in the changelog. You can now publish packages that depend on the Flutter SDK to pub. Moreover, pub.dartlang.org  has st...

Dart 1.22: Faster tools, assert messages, covariant overrides

Dart 1.22 is now available. It introduces a sync/async union type, assert messages, covariant parameter overrides, and much more. Tool startup is now much faster. Get it now! Faster tool startup We have switched to using application snapshots for running our SDK tools like dart2js, analyzer, and pub. This improves startup performance. See the AOT compiling talk  at Dart Dev Summit 2016 for more information. Information about how to use application snapshots can be found in the SDK wiki . Here are the improved performance numbers we see with the switch. Assert messages The fail-fast  principle is crucial for building high-quality software, and assert  is the simplest way to fail fast. But until now, it wasn’t possible to attach messages to asserts, so if you wanted to make your error useful, you were forced to throw a full exception. Like this: num measureDistance(List waypoints) { if (waypoints.any((point) => point.isInaccessible)) { throw new Ar...

Dart 1.18: Laying foundations

Dart 1.18 is now available. Go get it! The team has been focused on implementation details over the last six weeks. The API changes to the SDK are very light – see the CHANGELOG – but we have been working hard laying the foundation for a number of important projects. Improve the development and runtime experience for  Flutter . Improve the speed and stability of Dart Analyzer, especially as it relates to dev_compiler . Work to finalize two language tweaks Initializing formals: https://github.com/dart-lang/sdk/issues/26655 Allow trailing commas: https://github.com/dart-lang/sdk/issues/26644 Download the latest release. Let us know what you think!

Dart 1.16: Faster tools, updated HTML APIs

Dart 1.16 is now available . This release includes important updates to our tools. Faster developer tools In this release, we've been working closely with our users at Google to make sure Dart is even more productive for developers. We've optimized how Dartium loads applications, improving the time it takes to open an application up to 40%. We also continue to invest in faster code analysis and quicker JavaScript compile times. You should see improved performance in this and future releases. Updated HTML APIs In Dart 1.15 we updated Dartium to Chrome 45 from Chrome 39. In this release, we've updated our browser APIs – dart:html, dart:svg, etc. – to align with these changes. While most of these changes involve new and lesser used APIs, you should verify your application code to find and fix possible breaks. And more... The SDK changelog has details about all of the updates in Dart 1.16 SDK. Get it now .

Dart 1.15: Updated Dartium and improved live code analysis

Dart 1.15 is now available . This release includes important updates to our tools. Updated Dartium version Dartium has been updated from Chrome 39 to Chrome 45. While the underlying browser has been changed, there have been no changes  in this release to the corresponding APIs in dart:html, dart:svg, etc. We will roll out API updates in a future release to maximize stability and ease migration. Improved live code analysis The Dart analyzer service, used by WebStorm, IntelliJ, and Atom has been hardened in 1.15. Using error reports from Dart users within Google, we've been able to eliminate many common sources of instability. You should notice a much more reliable experience within your favorite Dart IDE. Release cadence changes Historically the Dart SDK has released a new stable release roughly every 2-3 months. The release duration has varied from release to release. Going forward we are going to attempt to ship on a more predictable schedule with a new release of ...

Dart 1.14 continues to improve core APIs and tools

Dart 1.14 is now available . This release contains a number of additions and improvements across our core libraries and our tools. Progress towards eliminating symbolic links Symbolic links for package resources can cause problems, especially on Windows. Since Dart 1.12, we’ve been working to support a Package Configuration File . The goal of this work is to provide a better model for package access. Dart 1.14 contains new APIs in both dart:io and dart:isolate to provide code access to the configuration file if it’s being used. You should consider these APIs experimental as we update the test package and pub to validate the implementation. Access package assets easily and reliably Developers frequently need to directly access assets within packages. In the past this has lead to confusion when supporting the many ways in which a Dart program can be executed. Along with the new Package Configuration APIs added in Dart 1.14, we’ve also released a resource package . This packa...

Dart 1.13 brings improved JavaScript interoperability and more

Dart 1.13 is now available . With this release, you can more easily access JavaScript APIs from Dart code. We've also improved secure networking on the server. Easier JavaScript interoperability Dart 1.13 provides a new syntax for creating Dart API facades for existing JavaScript libraries. Facades have the benefits you expect from a Dart library: errors, warnings, and code navigation. They also provide the Dart-to-JavaScript compiler the structure needed to provide interoperability with low code size and runtime cost. Example facade for Chart.js library Use the js package to create Dart APIs for your favorite JavaScript libraries. We have an example port of the Chart.js library if you'd like to see how to use these new features in your code. Graph generated with Chart.js and Dart We're actively working on tools to generate JS facades from other typed-JavaScript implementations. To track progress, subscribe to this GitHub issue . Improved secure netwo...

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 ...

Beautiful automated code formatting for Dart

I spend a lot of time reviewing Dart code. At Google, we use the Dart style guide , but we humans are poor at consistently following rules. I end up writing a lot of review comments like "put a newline here" and "remove this space". Although we have an automated formatter, dartfmt, to address this problem, I wasn’t happy with its output. Over the past few months, I spent a bunch of time adding a sophisticated rule engine to the formatter, helping it choose how best to format a chunk of code. There are still improvements to make, but I believe the formatter is now good enough to be run on all of the world's Dart code. We've been using this version of the formatter internally for a while, and people really like it. Everyone loves that it ends style debates and makes code reviews easier. Today, I'm happy to announce that the new formatter has landed in the dev channel SDK . Using it is as simple as:     $ dartfmt -w <file or directory> I'd...