Tuesday, April 16, 2013

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.insertRange got removed.
    • List.replaceRange was added.
    • List.fillRange was added.
    • List.setAll was added. (not strictly speaking a range function).
  • Stream.hasSubscribers -> Stream.hasListener
  • Removed async:EventSinkView.
  • Removed the AsyncError class.
  • Removed StreamController.broadcast.
  • dart:html has had most Web Worker related APIs removed while the correct API is worked out. The Worker class remains for spawning Javascript workers
  • Renamed InvocationMirror to Invocation
  • Function.apply uses Symbol for named argument
  • dart:mirror now uses Symbol instead of String to represent names

As always, view the changelog for the full list of changes, and to get started with the Editor, see our tutorial.