Skip to main content

Posts

Showing posts from 2016

New site for Dart news and articles

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

Enhancing the Flutter developer experience

At the Dart Developer Summit we introduced our fast and powerful Flutter developer experience. But our ambitions don’t stop here, so we have been hard at work developing several updates that further improve the experience. Faster startup during development Hot reload means you only have to launch your app once; after that changes are simply reloaded into the running app. But even that initial launch should be really fast. Previously we used a loader application to bootstrap the device with your application sources. Thanks to recent improvements made to the reload engine inside the VM this is no longer necessary and your application will be booted immediately, and you will see the real launch experience of your app. IntelliJ improvements We have published an update to our IntelliJ plugin, version 0.1.6 that has several exciting changes : Launching the app with hot reload support (see details below) A new flutter action pane has been added on flutter.yaml files (see de...

Dart 1.21: Generic Method Syntax

Dart 1.21 is now available. It introduces support for generic method syntax along with a few popular convenience features. Get it now! Generic method syntax Until now, Dart's generic support was limited to classes, such as List<T> . Dart 1.21 introduces syntax allowing type arguments on methods and functions.    T first<T>(List<T> ts) {      return ts.length == 0 ? throw new ArgumentError('Empty list!') : ts[0];    } Note the return type, T . This enables call sites to preserve type information from arguments. Try to write the same function without a type argument, and you'll see that the return type must be Object – there is no other way we can make it work on all lists. For more examples, check out the Using Generic Methods article . For even more details, the informal specification is the place to go. We've had generic methods and functions for a while in strong mode . 1.21 introduces support for generic method s...

StageXL 1.0: a chat with Bernhard Pichler

To contribute to the celebration of the recent 1.0 launch of StageXL , we had a chat with Bernhard Pichler to learn more. Here we go. --- First and foremost huge congrats on the 1.0 launch! People are already raving over it on Hacker News and Reddit . This is really a great accomplishment. I was wondering if you could start by telling us a bit about who you are? Thanks. Sure. My name is Bernhard Pichler, I'm 42 years old and I'm from Austria - you know Sound Of Music but no kangaroos. In my day job I work as a developer for a company in the gaming and betting industry. Nowadays I mostly do stuff on the backend but I used to work on the frontend in the past. That's why I still love to do computer graphics and why I work on StageXL in my spare time. How would you explain in less than 54 words, what StageXL is?  StageXL is a 2D rendering engine mainly built for casual games. Games like Farmville or Bejeweled are good examples. More people are playing this ki...

Dart Strong Mode and ahead-of-time compilation

Dart is increasingly being used as a cross platform language, and on most of these platforms ahead-of-time (AOT) compilation is a key part of the development and deployment story. The dynamic nature of Dart limits the effectiveness of ahead-of-time compilation, particularly as applications scale up in size. We therefore designed Strong Mode Dart  to allow ahead-of-time compilers to generate better code by taking full advantage of the type information that programmers write. While the initial goal of Strong Mode was to enable better ahead-of-time compilation, we've also seen strong uptake of Strong Mode from users who just like the stronger static checking because of it’s ability to make writing, reading, and refactoring Dart code more reliable. The recent talk from the Dart Developer Summit gives an overview of Strong Mode: what it is, why having a sound type system is useful, and how it benefits developers by making their IDE experience better, and their errors more ...

AngularDart 2.1 and new Components

AngularDart  got its own dedicated team 5 months ago. Last month, we launched 2.0 final on the Dart Developer Summit. Today, we’re releasing the first minor release after that: 2.1. Since the focus of AngularDart is Productivity, Performance, Stability , there are no major breaking changes (see the changelog ) — but a lot of behind-the-scenes improvements. Your apps will get slightly smaller and faster (even relative to 2.0 which already made huge strides in size and performance since the compiled-from-TypeScript days). Many features that AngularJS had to implement for JavaScript and TypeScript are not needed in Dart (because Dart already has those features out-of-the-box). So we’re removing them from AngularDart. Renderer is deprecated in favor of plain-old dart:html . NgPlural is going away — Dart programs can use the package:intl library. New components On the Dart Developer Summit, we launched AngularDart Components  — the material design widgets Google is using ...

Making app development easier: Interview with Jerry Bowerman of sonarDesign

sonarDesign  is an Austin-based company that builds an exciting app platform, in Dart. Jerry Bowerman , the company’s CEO, previously worked at Sierra Online, EA Sports and LucasArts. I asked him some questions about the company’s vision… and tech stack. — Filip Hráček Why did you start sonarDesign? We believe the app store model is broken. It's a nice refinement of a 40 year old paradigm of installing and updating software. It introduces friction between the app creator and end user. The app store model served a purpose in the early days. I haven’t found anyone that actually enjoys the app-cycle (discovery, install, daily updates, deleting photos or apps to make space, etc.). The Sonar platform is a contrarian bet on the app store model. We believe for the majority of use cases, delivering apps instantly via open standards is the right model. The challenge for most app creators, however, is learning open standards, like HTML5, at the specification layer so you can deliver ...

Building web apps with Firebase and Dart

Jana Moudra is one of the many developers who joined us for the Dart Summit this year. Not only was she helping organize the new, shiny Code Lab showing off the brand new AngularDart Components , she was also giving a talk on “ How to build a Dart and Firebase app in 30 mins ”. We thought it’d be great to hear more about this and we’re therefore happy to share this brief chat with Jana. --- So, Jana, this was the second time you attended the Dart Summit. We were really pleased to have you join us again this year and very thankful for all your hard work, help, and support. In the interest of people who maybe weren’t able to be at the summit this year, I was wondering if you could talk a bit about your overall impression of the event? The Dart Developer Summit was a really great event and I was really happy there. I met a lot of Dart developers, had fun and saw really nice talks on topics which interest me. I filled my personal todo list with a lots of "must try"...

Dart Developer Summit 2016 Videos: Soundness, AngularDart 2.0, and the Fastest Growing Language at Google

Videos from last month’s Dart Developer Summit are up on YouTube  and we thought we’d cherry-pick the highlights for you. The summit keynote  is a summary of all the major news and of the direction the team is taking now. It’s where we announced that Dart is the fastest growing language at Google. Teams switching to Dart report up to twice the productivity and development speed of what they had previously. Next, AngularDart 2.0  was launched in a presentation  by Ferhat Buyukkokten and Matan Lurey. They showed how they made the framework’s output 40% smaller and 15% faster in the 4 months since AngularDart got its own dedicated team . They also showed our 60 fps table using setState(), and the new testing framework called NgTestBed. Later in the day, Ted Sander launched AngularDart Components  — the material design widgets Google is using in customer-facing apps like AdWords and AdSense. Hundreds of Google engineers work with these components ever...

Flutter: The best mobile development experience?

Developing for mobile just got a lot more fun with Flutter ’s live developer workflow. At the heart of this new workflow is the Dart VM’s latest feature ‘ hot reload ’. Hot reloading your program allows you to update the code without restarting your application. Make changes to your program and see them instantly on your Android or iOS device. Many programming languages support updating the running program but these all suffer from limitations that make using the feature difficult and error prone. The Dart VM’s hot reload is safe and fast. First, we designed the system to be safe and be reversible. If we detect issues at reload time, the VM will restore the original source code as if nothing happened. It’s fast because you can import new libraries, create new classes, and even add fields to existing classes without restarting your application. Flutter works naturally with hot reload and you can see your changes on your mobile device in less than a second. And because we reload the...

Aqueduct - a server-side web framework written in Dart

On the Dart summit last month, Joe Conway gave a great talk about Aqueduct, a server-side web framework written in Dart by stable|kernel. We asked Sarah from stable|kernel to write a blogpost as well. — Filip Hráček After spending a year building Aqueduct in a relative vacuum, the stable|kernel team went into the Dart Summit with a lot excitement! Finally, we got to share our server-side web framework with the community it was built for: web and mobile developers who want to build an entire stack in Dart. If you missed stable|kernel CEO Joe Conway  present Aqueduct at the Dart Summit, you can watch it here . Our team began exploring Dart about 18 months ago and we quickly realized the potential for supercharging our team’s productivity due to Dart’s power and speed. In October 2015 Joe wrote : “It is important to us and our clients that we use platforms that allow for a high degree of productivity, testability and maintainability. In order to identify a platform that we...

AngularDart: The best Angular for you?

Ferhat and Matan recently announced the release of AngularDart 2.0 with some pretty dramatic performance improvements at the Dart Developer Summit in Munich. We figured we’d have a chat with them to better understand — straight from the horse’s mouth — what this means for developers looking to write a web app. What is the single most important reason for people to try out the new AngularDart 2.0 release? That would be better performance. And really — as we talked about at the Dart Summit recently — AngularDart is mainly about providing developers with three things: Productivity, Performance, and Stability . AngularDart is an amazing framework for building web apps and we have internal teams reporting doubling their productivity. With the new release just out, AngularDart output is 40% smaller and 10% faster. Finally, with major teams depending on the framework for their products, we work hard to ensure stability throughout when implementing these improvements. Indeed, y...

Sub-second reloads for mobile developers with Flutter and Dart

Developers inside and outside of Google have told us they are looking for a better way to build apps that delight all their users, without having to build the app twice. To help, we've been working closely with the Flutter team to build an open-source SDK that helps developers write beautiful UIs for all of mobile from a single codebase. Currently in technology preview, Flutter is being used by teams inside of Google. At the previous Dart Developer Summit, the Flutter team showed how they used Dart to render mobile graphics and spinning square. Fast-forward to today: the Flutter team demoed their near-complete implementation of material design and showed real apps built with Flutter running on iOS and Android. Flutter is different than other mobile SDKs. It's built with a best-in-class text rendering engine and the same 2D-to-GL library  that Chrome (and others) use, which means its lowest layers are battle-hardened and proven. Flutter does not use the OEM widge...

Dart in 2017 and beyond

We’re here at the Dart Developer Summit  in Munich, Germany. Over 250 developers from more than 50 companies from all over the world just finished watching the keynote. This is a summary of the topics we covered: Dart is the fastest growing programming language at Google, with a 3.5x increase in lines of code since last year. We like to think that this is because of our focus on developer productivity: teams report 25% to 100% increase in speed of development. Google has bet its biggest business on Dart — the web apps built on Dart bring over $70B per year. Google AdSense recently launched a ground-up redesign  of their web app, built with Dart. Earlier this year, we announced  that the next generation of AdWords is built with Dart. There are more exciting Dart products at Google that we’re looking forward to reveal. Outside Google, companies such as Wrike, Workiva, Soundtrap, Blossom, DG Logic, Sonar Design have all been using and enjoying Dart for years. ...

Good-bye symlinks

Dart 1.20 is now available. Get it now! Back in the Dart 1.19 release we introduced support for the .package file; our replacement for the /packages/ directory often filled with hundreds of symlinks. In 1.19 this support was opt-in via passing an option to pub get . Now that it has had time to mature, and based on favorable feedback, we have gone ahead and made it the default. If for some reason this causes issues, you can still get symlinks by using the pub get --packages-dir command; in such cases make sure to file an issue . One common question we have received is how to handle resource loading in a world without packages symlinks. The symlinks blog post covers this in detail. In summary you can either resolve a Uri to a resource using the new resolvePackageUri API (e.g., Uri actualURI =      await Isolate.resolvePackageUri(Uri.parse("package:foo/bar.txt")) ), or you can use the new package:resource that provides a more abstract API. Finally, the VM has b...

The new Google AdSense user interface: built with AngularDart

AdSense is a free, simple way to earn money by placing ads on your website. The team just launched a completely new version of their app for publishers. Read all about it here . We asked Daniel White, the tech lead for the project, some questions because the new UI happens to be built with Dart and Angular2. AdSense launched way back in 2003. How long is it since the last big redesign? Last big redesign was called ‘AdSense 3’ and launched about 6 years ago. It was written in Google Web Toolkit (GWT) and the UI has evolved through several iterations - but this is the first ground-up redesign in 6 years. There are a number of long-standing UX issues that we’ve taken the opportunity to solve. A big shout-out to our UX team who’ve been 100% behind this project. We couldn’t have done it without them! How many software engineers worked on the project? Purely on the AdSense applications, we have a team of close to 100. Around 25% of them write Dart. How many lines of code? We have a...

What’s your favorite Dart feature?

Earlier this year we had an ongoing thread where Googlers shared their favorite Dart feature—perhaps a less known one. We wanted to share these insights from some of our most engaged internal users more broadly. Hence this post. The names have been changed to protect the innocent, but the contents should constitute some fine reading. Here we go: What's your favorite "less known" (or undocumented) feature of Dart? Any particular syntax trick or library function? Java has loads of these, tricks ranging from the double-paren . init ( Map<String,String> {{ put("a", "1"); }}; ) to "sneaky throwing" ANY exception. Anything similar in Dart? Cheers, Agile Analyzer As a Java developer, my opinion of both of those is: this is clever, but don't do it in real code under any circumstances. -Bug Basher I'm not a fan of tricks, and from what I've seen so far Dart needs very few. There are some features of the ...

Dart Developer Summit announcements: AngularDart 2.0 and more

The Dart Developer Summit is only 5 weeks ahead, and we’re excited about its agenda: 17 talks, many demos, 25 speakers, plus a lightning talks session and a panel discussion. Expect the full program soon on the site, but here’s a teaser: Major improvements to the type system Much better interoperability with JavaScript Improved developer workflow AngularDart 2.0 And much more We will share more details as we approach the summit. Because the TypeScript flavor of Angular just released  version 2.0 last week, we think it’s a good opportunity to share more details about AngularDart 2.0. Besides the changes you’d expect, such as faster execution and reduced size (on which we’re already making a lot of progress ), we will also have a better template compiler and some nice surprises for you. The beta releases of AngularDart have been in production use at Google since January, in MLOC-sized apps. This has helped us to see what works well for large apps, and to improve...

Configuring Static Analysis using an Analysis Options File

Static analysis allows you to find problems before executing a single line of code. It’s a powerful tool used to prevent bugs and ensure that code conforms to style guidelines. With the help of the analyzer, you can find simple typos. For example, an accidental semicolon made its way into an if statement: The analyzer can also help you find more subtle problems. For example, perhaps you've forgotten to close a sink instance: In the Dart ecosystem, the Dart Analysis Server and other tools use the analyzer package to perform static analysis. You can configure the analyzer using an analysis options file. For more information, see our new page, Customize Static Analysis .

Dart 1.19: Improved developer experiences

Dart 1.19 is now available. Get it now! We closely collaborate with the Flutter team on providing the best developer experience for Dart for Mobile. This includes language changes that optimize the Flutter development experience. Dart code for Flutter apps commonly have long argument lists. Before 1.19, a trailing comma was not allowed after the last argument. This made it really tedious when removing the last argument, or when reordering the arguments. With 1.19 we introduce support for an optional trailing comma after the last argument of a call and the last parameter of a function declaration. This makes code editing much easier: If you've struggled with package directory symlinks, you're in luck. You can now opt-out of creating a package directory and the associated symlinks scattered around your project directories. The flag to provide to pub get and pub upgrade is --no-packages-dir . We've posted a detailed writeup of the changes if you'd like more infor...

So Long, Symlinks!

Long ago, back in the dawn of time, when nary a Dart file was to be found outside of the SDK repository , imports in Dart only supported file paths. As the language got older and an ecosystem began to grow around it, it quickly became clear that paths weren’t enough: Dart needed a way to import libraries that didn’t care about the location of the file doing the importing. The language team talked to the VM team and they came up with a solution. In addition to file: URIs, Dart would support a new package: scheme by looking for packages in a packages/ directory next to the entrypoint, wherever that happened to be. This worked pretty well—well enough to form the foundation for the pub package manager, written by Bob and myself. But it also had flaws. A lot of symlinks had to be generated all over every package—the test package currently contains about four hundred. Not only was this messy, many tools ended up following the symlinks and corrupting the package cache. So the team cam...