Skip to main content

Posts

New site for Dart news and articles

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

Enums and Async primitives in Dart

Support for enums, async, and deferred loading are now officially part of the 2nd revision of the Ecma-408 standard , the Dart Programming Language Specification. The second revision was approved last week at the Ecma General Assembly. You can find more information about using the new features in our language tour on dartlang.org: Enumerations ( enum )  Asynchrony ( async , await , and more) Deferred loading ( import ... deferred as ) Enums Enums help developers express clear intent with minimal code, and help tools catch potential bugs. Here is an example of an enumeration of form states:      enum FormState { OPEN, INPROGRESS, CLOSED } Tools can even warn developers if they omit an enum value from a switch statement, which helps identify potential bugs. Async Dart has always had strong support for asynchronous programming, with core library features such as Future and Stream . Now, with the new language primitives async  and await , asynchronous code

Dart 1.8: library improvements and experimental support for enums

Would you like to try out Dart’s upcoming support for enums? In Dart Editor under Tools > Preferences > Experimental you can “Enable Enums Support” and start experimenting with code like: With Dart 1.8, a number of library improvements have also landed.  In dart:collection, SplayTree added toSet() method, and in dart:convert a JsonUtf8Encoder class was added.  In dart:core, the following three things were added:  New properties and constructors for RangeError A new IndexError class - used by the RangeError.index constructor Optional start and end arguments for the String.fromCharCodes constructor. In dart:io we added support for the ALPN extension of the TLS secure networking protocol for Client and Server. For a summary of these and others changes see the release notes . You can download Dart 1.8 from the Download Dart page . If you are running the Dart Editor, you can update by checking "About Dart Editor". Check out the Dart support page for i

Running Dart server applications on Google Cloud Platform

Today you can develop and deploy Dart server applications that run on the Google App Engine Managed VMs beta. The productivity of the Dart language and libraries are a great fit for server applications. You get the competitive performance of the Dart VM while leveraging powerful tools like Observatory –all while easily sharing code with your browser application. Now you can try Dart on Google App Engine, which lets you build and run applications on Google’s infrastructure. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs change. With App Engine, there are no servers for you to maintain. You simply upload your application and it’s ready to go. Managed VMs extend App Engine to support user-defined custom runtimes. The Dart team is building on custom runtimes to allow you to easily develop and deploy Dart server applications that run on Google’s infrastructure. Once you have set up your local development envi

WebStorm 9 released with improved Dart support

Today, JetBrains announced WebStorm 9 , an update to their powerful web development editor. Highlights for the Dart developer include: pub serve support, improved isolates debugging, Observatory support, new syntax support, and more. WebStorm 9 now launches pub serve, Dart's development server, when the developer runs a Dart web app. Pub serve takes care of generating assets, compiling to JavaScript, and more. Developing and debugging apps that run multiple computations in parallel is now easier, thanks to the new ability to set breakpoints inside of isolates. For deep insight into your app running on the Dart VM, you can now open the Observatory directly from WebStorm 9. Use the Observatory to learn how memory is used, where CPU time is spent, and more. It's now easier to debug apps that use collections (which is every app), thanks to the debugger's logical view of maps and lists. Developers now see the logical data structure instead of internal implementation details. W

Dart 1.7: easily share and use command-line applications built with Dart

The Dart language, libraries, and runtime make it easy to create command-line applications. In fact, all of the core tools in the Dart SDK – dart2js, pub, and dartanalyzer – are written in Dart. We wanted to allow developers to easily get their own Dart scripts and command-line apps into users' hands. With Dart 1.7, users now have an easy way to install and run scripts built with Dart, making first-class command-line Dart apps a reality. Developers can specify executables (Dart scripts) in their pub package, which are made available to a user when the package is installed. Before: $> git clone https://git.example.com/my_cool_app $> cd my_cool_app $> pub install $> dart bin/my_cool_app.dart Now: $> pub global activate my_cool_app $> my_cool_app Dart 1.7 also includes improvements to our code isolation models. You can now launch isolates with a different package root than the host application, allowing for composition of Dart applications w

Dart plugin for Sublime updated with many new features

Many of our developers enjoy using lightweight text editors, but still want to use features traditionally found in powerful IDEs. Today, in partnership with Guillermo López-Anglada , lead developer of the Dart plugin for Sublime , we are announcing many new features to help Dart developers stay productive in Sublime Text 3. With the Dart plugin, Sublime understands your Dart code and projects. Dart code is syntax highlighted, with support for the latest language keywords like async/await and deferred . To provide you with feedback on code quality, the plugin displays errors and warnings from static analysis. You can run web applications, command-line scripts, and servers without leaving Sublime. The Dart plugin starts and manages pub serve , Dart's development server, making it easy to launch your web app into Dartium or any browser. Integration with various Dart SDK tools is now more complete. Keep your Dart code in sync with the Dart Style Guide with the new

Google Elections Launches New App Built with Dart, Polymer

This past weekend, the Google Elections team introduced their Elections Explorer for Brazil : a live, real-time election results experience for the presidential, gubernatorial, senate, and chamber races in Brazil. This is the Google Elections team's second app built with Dart , and their first to use Polymer . The Google Elections team is happy with their experience. They write: "We love writing Dart because it's fast, compact, and sane. Great tools and a readable language give us the confidence we need to move quickly. But adding Polymer to the mix is pure gold. After years of writing code for the web, this was the first time I've felt like I'm working with a real platform. We threw away tons of the boilerplate we've built up over time and just focused on the app itself. This was awesome." Sean Diamond, new to our team this year, said, "Being new to web development, but having done years of UI development on native platforms, writing Polyme