[dart-announce] Dart 1.19 is now available

122 views
Skip to first unread message

'Michael Thomsen' via Dart Announcements

unread,
Aug 26, 2016, 7:14:28 PM8/26/16
to Dart Announcements

Dart SDK version 1.19 has been released.


The release announcement and the changelog have all of the details!


---

1.19.0

Language changes

  • The language now allows a trailing comma after the last argument of a call and the last parameter of a function declaration. This can make long argument or parameter lists easier to maintain, as commas can be left as-is when reordering lines. For details, see SDK issue 26644.

Tool Changes

  • dartfmt - upgraded to v0.2.9+1

    • Support trailing commas in argument and parameter lists.
    • Gracefully handle read-only files.
    • About a dozen other bug fixes.
  • Pub

    • Added a --no-packages-dir flag to pub getpub upgrade, and pub downgrade. When this flag is passed, pub will not generate a packages/ directory, and will remove that directory and any symlinks to it if they exist. Note that this replaces the unsupported --no-package-symlinks flag.

    • Added the ability for packages to declare a constraint on the Flutter SDK:

      environment:
        flutter: ^0.1.2
        sdk: >=1.19.0 <2.0.0

      A Flutter constraint will only be satisfiable when pub is running in the context of the flutter executable, and when the Flutter SDK version matches the constraint.

    • Added sdk as a new package source that fetches packages from a hard-coded SDK. Currently only the flutter SDK is supported:

      dependencies:
        flutter_driver:
          sdk: flutter
          version: ^0.0.1

      A Flutter sdk dependency will only be satisfiable when pub is running in the context of the flutter executable, and when the Flutter SDK contains a package with the given name whose version matches the constraint.

    • tar files on Linux are now created with 0 as the user and group IDs. This fixes a crash when publishing packages while using Active Directory.

    • Fixed a bug where packages from a hosted HTTP URL were considered the same as packages from an otherwise-identical HTTPS URL.

    • Fixed timer formatting for timers that lasted longer than a minute.

    • Eliminate some false negatives when determining whether global executables are on the user's executable path.

  • dart2js

    • dart2dart (aka dart2js --output-type=dart) has been removed (this was deprecated in Dart 1.11).

Dart VM

  • The dependency on BoringSSL has been rolled forward. Going forward, builds of the Dart VM including secure sockets will require a compiler with C++11 support. For details, see the Building wiki page.

Strong Mode

  • New feature - an option to disable implicit casts (SDK issue 26583), see the documentation for usage instructions and examples.

  • New feature - an option to disable implicit dynamic (SDK issue 25573), see the documentation for usage instructions and examples.

  • Breaking change - infer generic type arguments from the constructor invocation arguments (SDK issue 25220).

    var map = new Map<String, String>();
    
    // infer: Map<String, String>
    var otherMap = new Map.from(map);
  • Breaking change - infer local function return type (SDK issue 26414).

    void main() {
      // infer: return type is int
      f() { return 40; }
      int y = f() + 2; // type checks
      print(y);
    }
  • Breaking change - allow type promotion from a generic type parameter (SDK issue 26414).

    void fn/*<T>*/(/*=T*/ object) {
      if (object is String) {
        // Treat `object` as `String` inside this block.
        // But it will require a cast to pass it to something that expects `T`.
        print(object.substring(1));
      }
    }
  • Breaking change - smarter inference for Future.then (SDK issue 25944). Previous workarounds that use async/await or.then/*<Future<SomeType>>*/ should no longer be necessary.

    // This will now infer correctly.
    Future<List<int>> t2 = f.then((_) => [3]);
    // This infers too.
    Future<int> t2 = f.then((_) => new Future.value(42));
  • Breaking change - smarter inference for async functions (SDK issue 25322).

    void test() async {
      List<int> x = await [4]; // was previously inferred
      List<int> y = await new Future.value([4]); // now inferred too
    }
  • Breaking change - sideways casts are no longer allowed (SDK issue 26120).

--
For more news and information, visit https://plus.google.com/+dartlang
 
To join the conversation, visit https://groups.google.com/a/dartlang.org/

Danny Tuppeny

unread,
Aug 27, 2016, 4:24:43 AM8/27/16
to mi...@dartlang.org
On Sat, 27 Aug 2016 at 00:14 'Michael Thomsen' via Dart Announcements <anno...@dartlang.org> wrote:
  • Pub

    • Added a --no-packages-dir flag to pub getpub upgrade, and pub downgrade. When this flag is passed, pub will not generate a packages/ directory, and will remove that directory and any symlinks to it if they exist. Note that this replaces the unsupported --no-package-symlinks flag.

I really hate that packages folder (or rather, all 50 of them that appear in my editors tree! :)). I was excited by this change but it seems that debugging via pub is not possible and this resolution only works using pub run? There's two-year-old issue about  this year:


Which is marked as blocked on this issue:


Yet that issue was closed as NotPlanned.

Does this mean we won't get support for attaching debuggers via pub? Will there be an alternative?

Bob Nystrom

unread,
Aug 29, 2016, 11:55:04 AM8/29/16
to General Dart Discussion
On Sat, Aug 27, 2016 at 1:24 AM, Danny Tuppeny <da...@tuppeny.com> wrote:
I really hate that packages folder (or rather, all 50 of them that appear in my editors tree! :)).

Me too. I never ever ever liked them.
 
I was excited by this change but it seems that debugging via pub is not possible and this resolution only works using pub run?

If your command line app supports running directly in the VM without going through pub run—in other words, it doesn't use transformers—it should work without a packages directory as well. As long as you have a .packages file, you should be able to do:

$ dart bin/your_app.dart

Cheers!

– bob

Kevin Moore

unread,
Aug 29, 2016, 12:14:42 PM8/29/16
to Dart Misc
Danny: we're looking to bring this request back for related reasons. Stay tuned.
 

Danny Tuppeny

unread,
Aug 29, 2016, 12:16:51 PM8/29/16
to mi...@dartlang.org
On Mon, 29 Aug 2016 at 16:55 'Bob Nystrom' via Dart Misc <mi...@dartlang.org> wrote:
If your command line app supports running directly in the VM without going through pub run—in other words, it doesn't use transformers—it should work without a packages directory as well. As long as you have a .packages file, you should be able to do:

$ dart bin/your_app.dart

Yeah, Devon told me the VM was able to read .packages... From the blog post I thought it was only pub. This will probably do fine then :-)

Danny Tuppeny

unread,
Aug 29, 2016, 12:17:58 PM8/29/16
to mi...@dartlang.org
On Mon, 29 Aug 2016 at 17:15 'Kevin Moore' via Dart Misc <mi...@dartlang.org> wrote:
Does this mean we won't get support for attaching debuggers via pub? Will there be an alternative?

Danny: we're looking to bring this request back for related reasons. Stay tuned.

I'm curious now... Since the VM can read .packages and tests can already be run using dart.exe instead of via pub; what are the remaining advantages/reasons to use "pub run" over just "dart"?

Kevin Moore

unread,
Aug 29, 2016, 12:23:18 PM8/29/16
to Dart Misc, Natalie Weizenbaum
You ask good questions. :-)

  • Will make sure your pubspec.lock file is up-to-date given the pubspec.yaml and your current VM
  • Allows running transformers (which is not something we encourage at this point)
The big win is running something like 'pub test' where test is a package you depend on, not a binary in your app.

If you're just running 'myapp/bin/my_binary.dart' just use 'dart bin/my_binary.dart'
 

--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to a topic in the Google Groups "Dart Misc" group.
To unsubscribe from this topic, visit https://groups.google.com/a/dartlang.org/d/topic/misc/jlyTSLM5eyI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to misc+uns...@dartlang.org.

Danny Tuppeny

unread,
Aug 29, 2016, 12:27:51 PM8/29/16
to mi...@dartlang.org
On Mon, 29 Aug 2016 at 17:23 'Kevin Moore' via Dart Misc <mi...@dartlang.org> wrote:
  • Will make sure your pubspec.lock file is up-to-date given the pubspec.yaml and your current VM
  • Allows running transformers (which is not something we encourage at this point)
Gotcha, ta!

 
The big win is running something like 'pub test' where test is a package you depend on, not a binary in your app.

Is "pub test" supposed to work? I thought it did, but I always seem to have to do "pub run test"? I assumed it had changed but now I wonder if I've just missed setting something up?

Kevin Moore

unread,
Aug 29, 2016, 12:33:21 PM8/29/16
to Dart Misc
Sorry, yes "pub run test" :-)
Reply all
Reply to author
Forward
0 new messages