Dart SDK version 1.19 has been released.
The release announcement and the changelog have all of the details!
dartfmt
- upgraded to v0.2.9+1
Pub
Added a --no-packages-dir
flag to pub get
, pub 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).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).
Pub
Added a
--no-packages-dir
flag topub get
,pub upgrade
, andpub downgrade
. When this flag is passed, pub will not generate apackages/
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?
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
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.
--
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.
- 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.