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 .

New try/catch syntax ready to use

Posted by Kasper Lund We're very close to being able to turn off the support for the old try-catch syntax. Early next week attempts to use the old syntax will lead to compile-time errors. The new syntax already works today so now would be a fantastic time to update your code. The old syntax like:    try { ... } catch (var e) { ... }    try { ... } catch (final e) { ... }    try { ... } catch (T e) { ... }    try { ... } catch (final T e) { ... } translates to new syntax like this:    try { ... } catch (e) { ... }    try { ... } catch (e) { ... }    try { ... } on T catch (e) { ... }    try { ... } on T catch (e) { ... } and the local variable introduced to hold the reference to the caught exception (e) is implicitly final in all cases. Why did we make this change? The M1 Updates article explains it best.

Dart API docs get 83% more awesome

Posted by Seth Ladd There are a lot of classes in the Dart API, and it's now much easier to find what you're looking for thanks to a new "find as you type" search feature on api.dartlang.org . Thanks to Johnni Winther for building this feature. Enjoy! As always, we appreciate your feedback and comments. Please join us on the Dart mailing list and Stack Overflow .

Notes from weekly Dart language review

Posted by Bob Nystrom Here's my notes from this week's meeting. As usual, the meetings are fairly low key as we move towards M1. Instantiating abstract classes We're starting to move code from interfaces to abstract classes. We noticed a nasty pattern some people were doing where they made a private factory constructor just to get rid of the default constructor so that a class couldn't be constructed. We don't want people doing that. So, instead, we'll make it a dynamic error to instantiate an abstract class. (Abstract class meaning a class that defines an abstract method or is explicitly marked "abstract".) This is already a static warning in the editor, but we will make it an outright error at runtime. If you relied on this behavior, now you'll just override any abstract methods with empty bodies or throws or something. Kasper pointed out that we can always loosen this up later if the above proves to be problematic. M...

#resource is going away, update your code

Posted by Seth Ladd Today, Dart team member Kasper Lund notified us of a breaking change. The #resource directive is being removed from the spec and implementations. From the email: We've decided to remove support for the #resource directive and instead rely on metadata annotations for associating external resources with Dart programs. I've submitted a change that removes the support for #resource from dart2js in r11489 and the other implementations (the VM and the analyzer) will also stop supporting the tag in the near future. Now is the time to remove any uses of #resource. Please drop by the mailing list if you have any questions. Thanks for trying Dart!

Dart Editor cleans up your code for M1

Posted by Devon Carew A new Dart Editor build is available at  www.dartlang.org/editor .  Ch anges incl ude: Wondering about M1 language changes? Worried about having to update your code? Worry no more! We have a new M1 language migration wizard which'll do that work for you! Right click on your project and choose 'Clean up...'. We've implemented cleanups for catch blocks, the new getter syntax, operator equals, and library/import/source changes. Please note, the last two changes are not yet supported across all platforms. We've added the ability to write hooks into the Editor's build system. If a build.dart script exists in a project, we'll invoke it as part of the Editor's build process. This allows for custom processing of changed resources, like for templating systems, generating Dart code, or scss --> css processing. There are sample scripts available at dart/samples/buildhook1 and dart/samples/buildhook2, as well as online at  h...

Dart project welcomes new external committer

Posted by Seth Ladd Welcome to our first external committer! Please help us welcome Alexander Aprelev as our first external committer to Dart . Alexander has been working on dart2js, and helping us get ready for M1. Interested in how to contribute to Dart? We're open source, and we encourage patches. Read more at our Contributing to Dart guide . Other Dart projects, like the code for www.dartlang.org and Dart + Web Components , are also open source. Lots of ways to get involved!

Ask the dart2js team

Posted by Seth Ladd This time, we're taking the Dartisans show on the road! We'll be in Denmark next week to chat with members of the dart2js team. Here's your chance to ask and vote for questions about how the Dart project compiles Dart to JavaScript. Past episodes of Dartisans have covered the Dart VM , the Dart community , and more . We look forward to hearing from you! What do you want to ask the dart2js team ?