Skip to main content

Posts

Showing posts with the label library

New site for Dart news and articles

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

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 ...

Dart Libraries for Google APIs and Protobufs Available

Dart libraries for both Google APIs and Protobufs are available for download. You can use Dart to access APIs from services such as Google+, YouTube, Drive, and more. You can also use Dart to interact with Protocol Buffers, Google's structured data encoding format. The libraries are open source and available today. The Dart client libraries for Google APIs cover a wide range of Google APIs . Each client library is bundled as a pub package and uploaded to pub.dartlang.org , Dart's package hosting service. For example, check out the Dart library for the YouTube API on pub . These libraries are maintained by a dedicated group of Dart community developers. Bonus: learn how to generate Dart client libraries for your own Cloud Endpoint service  in this post from the Dartwatch blog. Protocol Buffers , or protobufs, are a way to encode and decode structured data for interop between various systems. Both the protobuf runtime and code generator are available for Dart, and are o...

Goodbye InvocationMirror, Hello Invocation and Symbol

TL;DR: We added a class Symbol to dart:core, renamed the class InvocationMirror to Invocation (keeping it in dart:core ), and moved Invoke.invokeOn to InstanceMirror.delegate (moving this functionality from dart:core to dart:mirrors ). Furthermore, Function.apply and InstanceMirror.invoke take a Map<Symbol,dynamic> to represent named arguments. Finally, dart:mirror uses Symbol instead of String to represent names. Previously, InvocationMirror looked like this: abstract class InvocationMirror {  String get memberName;  List get positionalArguments;  Map<String, dynamic> get namedArguments;  bool get isMethod;  bool get isGetter;  bool get isSetter;  bool get isAccessor => isGetter || isSetter;  invokeOn(Object receiver); } This creates problems when minifying, both when compiling to JavaScript and when minifying Dart code.  For example, a method call like foo() , may...

List of Last Minute M4 Breaking Changes

The M4 release saw the Core, Async, and Collection libraries stabilize. Dan Grove has compiled a list of the   last minute breaking changes : The separator argument in Iterable.join defaults to “” (instead of `null`). All DateTime constants are non-abbreviated. Also changed DAYS_IN_WEEK to DAYS_PER_WEEK. Removed deprecated classes and methods CollectionSink Stream.pipeInto Iterable/Stream . max/min Collection (List, Set and Queue now extend Iterable directly) Datetime.</<=/>/>= IOSink.writeStream (renamed to IOSink.addStream) IOSink.writeBytes (renamed to IOSink.add) StreamSink (renamed to EventSink) Iterable.reduce/Stream.reduce introduced that does not require an initial value. List range functions were refactored: List.getRange takes an endIndex argument and returns an Iterable. List.setRange takes an endIndex and an iterable (plus an optional skipCount). List.removeRange takes an endIndex. List.insertRan...

New Dart Editor Release with Dedicated WebGL Library

Eric Clayberg fills us in on the  release details : A new Dart Editor build is available at  www.dartlang.org/editor .  Ch anges include: New preference to disable auto-activation of code completion. Theme preview works with new analysis engine. Many performance and memory improvements with new analysis engine. Breaking Change List: Existing base64 encoder method CryptoUtils.bytesToBase64( List<int> bytes, [int lineLength]) is changed to CryptoUtils.bytesToBase64( List<int> bytes, {bool urlSafe : false, bool addLineSeparator : false}) Remove the (long deprecated) List.addLast method. Stream subscriptions are now more lenient about calling methods after canceling and resuming when not paused - it's no longer an error, it just doesn't do anything. WebGL types have been moved out of dart:html and into dart:web_gl. All WebGL prefixes have been removed (WebGLRenderingContext is now RenderingContext). dart:html’s WheelEvent.deltaX...

An Important New Article on Working with Streams in Dart

Read  Getting Your Feet Wet with Streams ,  the latest article at  dartlang.org  and learn about Streams in Dart . How do you model values that vary over continuous time? Or deal with events which occur at finite points in time? In the Javascript world, the answer often involves using Functional Reactive Programming (FRP), with frameworks like  RxJs, bacon.js and Flapjax providing elegant approaches to traditional event-driven programming.  In Dart,  Streams provide a consistent interface for working with repeating events. Streams are everywhere in Dart!  In an important new article, Chris Buckett details ways in which you can subscribe to (and unsubscribe from) a Stream. He shows how to transform, validate and consume Stream data, and handle errors using a StreamSubscription.  This article demystifies the subject of Streams: read it if you want to know more about this important topic. Your feedback really counts. Please j...

Significant Dart Editor Release Brings Back String Plus Operator

Dart Editor has a new build. This is a significant release with a long list of breaking changes. You are urged to update your Dart code accordingly.  Due to popular demand, the Dart team brought back the plus operator for string concatenation. That change has now landed in the Editor. Before this release, using + to concatenate strings produced this error: Now, you can use + for concatenation. The concat() method has been deprecated: There are numerous other changes in the core libraries, the dart:html library, and the dart:io library.  Eric Clayberg  fills us in on the details  of this release : A new Dart Editor build is available at  www.dartlang.org/editor .  Ch a nges  include: New analyzer available via experimental preference. (work in progress, all features not enabled yet). Package root preferences removed in favor of --package-root cmd line option. Reduced heap usage by ~25%. Fixed a memory leak ...