Dartosphere Aggregate

14 Nov 2017 | Kathy

Dart Language and Library Newsletters

Unless you're a member of the Dart misc group, you may be missing Florian Loitsch's weekly newsletters, which started in July. They live in the SDK repo (docs/newsletter), but Florian also posts them in the misc group.

These newsletters cover the Dart language and some of the core libraries. Read them to learn about existing features ("Did you know"), planned changes, and how the Dart team considers and implements changes. For example:

  • The July 28 newsletter (the first) starts with some 1.24 language changes that you might have missed: function types and changes to void. It also talks about the unified front end, and what that means for language changes. Finally, the letter lists features in active development, such as zones that work well with strong mode, void as a type, and changes to the core libraries.

  • The September 29 newsletter covers 1.x JSON encoding, and plans for fixed-size integers.

  • The October 13 newsletter covers 1.x double.toString methods and planned changes to evaluation order. It also describes why even simple language and library changes require so much thought, and why they often take so much time.

  • The October 20 newsletter covers DateTime refactoring, pointing you to Florian's Date-Time Medium article for more details.

  • The October 27 newsletter points you to planned library changes for Dart 2.0 (docs/newsletter/lib/lib.md).

That's just a sampling. You can find all the newsletters in the SDK repo under docs/newsletter. The README for that directory lists what's in each article.

If you'd like to be notified of new issues of the newsletter, join the Dart misc group. To find other ways to stay in touch, see Dart's community page.

13 Nov 2017 | - Source

Flutter IntelliJ plugin v19: Fit and Finish

IntelliJ EAP support

This month’s release now supports the public preview release of Intellij 2017.3. With this release, you’ll get a new version of the Dart plugin. That release includes features to help you better navigate and understand large build() methods, including things like showing synthetic text ‘closing labels’ at the end of nested constructors.


Android Studio support improvements

We’ve continued to work on our Android Studio integration (first available in the last month’s release). The fixes and improvements here include:

  • fixes to the language selector in the project wizard
  • fixes to the label on the project location directory picker
  • showing when a valid path is entered in the SDK field of the project wizard
  • displaying a warning when installing the plugin into canary builds of Android Studio 3.1
  • minor UI tweaks, like using consistent punctuation

Fit and Finish

We’ve also polished the plugin generally, and closed out many issues in:

  • the hot reload integration and reload on save feature
  • the support for running Flutter unit tests
  • the new project wizard and the getting started experience, and
  • ensuring that Flutter-specific features aren’t exposed in non-Flutter (regular Dart) projects
06 Nov 2017 | - Source

You are invited to DartConf Los Angeles!

Tickets (for free) are available for DartConf Los Angeles on January 23 & 24th! In addition to hearing about Dart 2.0, you might also enjoy:

  • Access to Dart, Flutter, and AngularDart engineers via office hours and unconference rooms.
  • In-depth talks about Dart, Flutter, and AngularDart, including how the latter two overlap.
  • Practical guides for Dart, Flutter, and AngularDart developers.
  • Insight into what the teams are working on and how it will affect your projects.

You might also enjoy the average high temperatures in Los Angeles for January (68°F / 20°C).

Learn more and sign up at events.dartlang.org.

We hope to see you there!

09 Oct 2017 | - Source

Flutter IntelliJ plugin v18: Android Studio support

Android Studio support

You can now install the Flutter plugin into Android Studio, and create, edit, and run your Flutter apps there. The plugin requires at least Android Studio 3.0 (currently at Android Studio 3.0 Preview beta 7). As this is the first Flutter plugin release to support Android Studio it should be considered beta; your feedback will help us improve the integration.



Improved support for developing and consuming Flutter plugins

For this release we worked on improving the support for developing and consuming Flutter plugins. In addition to minor fixes and workflow improvements, we show referenced Flutter plugins in the ‘External Libraries’ part of the project view. From here, it’s easy to dig into the native iOS and Android implementations of a plugin, if desired.


Reload on save is now the default behavior

The ‘hot reload on save’ feature is now enabled by default. When running an app, hitting save or pressing the save keyboard shortcut will trigger a hot reload. Thanks for your feedback on this feature! We fixed the few reported issues, and added a hyperlink in the analysis issues toast to open the analysis view. You can control the setting for this feature from Languages & Frameworks > Flutter > General.

Miscellaneous

In addition to bug fixes, Flutter app launches now support passing in a --flavor param and we’ve improved and reorganized the Flutter view's toolbar. You can see more details in the project plan and the changelog.
25 Sep 2017 | Kathy

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 2.0 pre-release, the Flutter team will tell you how to manage your dependencies.

If you use a stable Dart SDK: When running pub upgrade, you might notice that you aren’t getting the latest releases of some packages. This might happen because the packages have versions that require a Dart 2.0 feature. Consider checking the release notes of critical packages to see whether the packages have important fixes or new features.

If you use a dev channel Dart SDK: When running pub get, pub upgrade, or other pub commands from a 2.0 pre-release, you might get packages that haven’t been verified to work with 2.0. If you find a package that has 2.0 issues, please report those issues immediately to the package maintainer, and let the Dart community know about any workarounds you find.

If you publish packages: Don’t change your already-published packages just to add SDK constraints to the pubspec. If you do need to change a package, try to make your changes backward compatible with Dart 1.x. Before publishing a package, make sure that the pubspec has correct lower and upper SDK constraints. Use <2.0.0 as the upper constraint, for now. Examples:


# Works in 1.20.1+; might work in 2.0.0-dev:
sdk: '>=1.20.1 <2.0.0'

# Backward incompatible change requires at least 2.0.0-dev.1.2:
sdk: '>=2.0.0-dev.1.2 <2.0.0'

For more information about how to adapt your code for Dart 2.0, see the Dart 2.0 update page.

05 Sep 2017 | Kevin Moore

AngularDart 4

AngularDart v4 is now available. We've been busy since the release angular2 v3.1.0 in May. Not only did we "drop the 2", but we also improved the compiler and tightened up the framework to give you smaller code, we updated the package structure to improve usability, and we added several new features. Check out the updated documentation to get started.

Just angular

Upgrading to v4 will require more than updating your version constraint. The package has changed names (back) to angular – dropping the 2. You'll need to update your pubspec.yaml and the corresponding imports in your code. In most instances, find-and-replace should do the trick. Going forward, the package will be called package:angular. We'll just update the version number.

Smaller code

The updated compiler in 4.0 allows type-based optimizations that not only improve runtime performance but generate better code because we are able to strongly type templates. A big result of the update is that many applications will see compiled JavaScript sizes drop. In one case, we saw a 40KB (~10%) size drop in minified JavaScript by simply upgrading to v4. Every application is different, but we expect most applications will experience some code size reduction.

Separation of concerns

Until now, AngularDart was a single package that contained not only core functionality, but also routing, forms, and testing. We've separated these libraries into separate packages:
The code is managed under one repository, but each package can be used, versioned, and released separately. A breaking change in package:angular_forms won't require a breaking release of package:angular, for example. Having clear boundaries between packages also simplifies interdependencies between libraries, allowing dart2js to generate more efficient JavaScript.

New features

Besides being renamed and refactored, AngularDart v4 includes a number of new features. A couple of examples:
Functional directives. A lightweight and stateless way to apply one-time transformations.
@Directive(selector: '[autoId]')
void autoIdDirective(Element element,
IdGenerator generator) {
element.id = generator.next();
}
Metadata inheritance. Inheritance for both component and directive metadata is now complete! Any field- or method-level annotations are now inherited through supertypes. Check out Leon's write-up of this feature and how it can help you.

Updated components

The angular_components package has also been updated to use AngularDart v4. The update contains new components and updates for existing components. Go to the component gallery to see examples of many of the components in action.

Jump in

To get started with AngularDart, check out the documentation. Post questions to StackOverflow and Gitter. Check out the code and file issues on our GitHub repository.
01 Sep 2017 | - Source

Happy Birthday NP8080!

NP8080 turns 1 year old! Yes it was just over a year ago that I decided to combine a TextArea + Local Storage to make a little app. It's grown a lot and been a good project to try out new features and packages. I've found it a useful daily tool too from simple notes, examining stacktraces and composing web posts etc.

With Dart 2.0 coming, Angular Dart 5 and web browsers advancing, it looks like there'll be another year of text editor coding ahead.

31 Aug 2017 | - Source

Flutter IntelliJ plugin v17.0: Hot reload on save and improved project wizard

Hot reload on save


By request, we now support doing a hot reload on file save. On an explicit save (cmd-s / ctrl-s or File > Save All), if there’s an app currently running we will try to reload changes into that app. This integrates well with how IntelliJ’s save action works — the default behavior of the action maps to a save-all command.


If there are analysis errors on save, instead of reloading we will highlight errors in the analysis view.


This behavior is off by default and can be turned on in Settings > Languages & Frameworks > Flutter. Feedback on this feature is much appreciated and will help us make additional improvements to the workflow. In particular, should we enable this feature by default?

Improved project wizard

We’ve updated the new project wizard! You can now choose which type of Flutter project to create:
  • an app,
  • a plugin project – to expose native services, or
  • a package – to create a reusable Dart library.
In addition, you can choose between generating a project with Java or Kotlin code, or Objective-C or Swift.


The lion’s share of this work was done by an external contributor — Brandon Donnelson — many thanks!

Miscellaneous

Additional changes include UI improvements to the Flutter view, fixes to icon decorations in the editor’s ruler, fixes to group handling for widget tests, and better highlighting of analysis errors when launching apps. For more detailed info on the version 17.0 release, see our project plan, or the changelog.
01 Aug 2017 | - Source

Getting your apps ready for Dart 2.0

One of the most important features for Dart 2.0, strong mode, has been available for several releases. Migrate to strong mode now to take advantage of the new sound type system that finds errors at compile time (rather than letting your users discover them). You may even find bugs that have been lurking in your code. 

If you are using Flutter, it already uses strong mode, so you have met this requirement. 

Strong mode is the primary breaking change for 2.0, but there are likely to be other updates. For more information, see Dart 2.0 Updates.

31 Jul 2017 | - Source

Flutter IntelliJ plugin v16.0: Testing and app launching!

New testing support

We’ve added the ability to run individual Flutter tests via actions in the editor’s gutter:


And now support running Flutter’s widget tests; see https://flutter.io/testing/#widget-testing.

Project structure

We re-worked how we define Flutter project and module types in IntelliJ. This addresses a few outstanding issues and will let us more easily go into more IntelliJ based products in the future. The next time you open an existing project with the new version of the plugin, you’ll see a one-time ‘module type updated’ message:

Screen Shot 2017-07-26 at 11.09.56 AM.png

Launching improvements

This release sports several improvements to app launching:
  • Launch your app in profile and release modes (available via the ‘Run’ menu)
  • Start Android emulators from the device dropdown; this requires the Android AVDs to have been already created in something like Android Studio
  • Tweaks to when the run and reload buttons are enabled

Screen Shot 2017-07-27 at 12.06.12 PM.png

For more detailed info on the version 16.0 release, see our project plan, or the changelog. Thanks!