Skip to content

[breaking change] Discontinue deprecated core library APIs, part II #49529

Closed

Description

@mit-mit

The following Dart core library APIs, which are all currently deprecated, are now being fully removed.

This is the continuation of previous discontinuation work tracked in #34233

Phase II, scheduled for Dart 3.0

The following APIs are planned to be removed in 3.0, as some breakage is to be expected.

API changes which we believe are minimally breaking

dart:core

dart:async

dart:developer

dart:mirrors

None.

dart:html

API changes which may be more breaking

These are postponed, and not planned for inclusion in Dart 3.

### dart:core

### dart:async

Activity

  1. added
    area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).
    on Jul 26, 2022
  2. self-assigned this
    on Jul 26, 2022
  3. modified the milestone: Dart 3 stable on Sep 7, 2022
  4. mit-mit commented on Sep 13, 2022

    @mit-mit
    MemberAuthor

    @sigmundch is the NoSuchMethodError constructor ready to be removed? There is a comment about dart2js here:
    https://github.com/dart-lang/sdk/blob/main/sdk/lib/core/errors.dart#L492

  5. sigmundch commented on Sep 19, 2022

    @sigmundch
    Member

    Our dependency is still there, but probably can easily be refactored by updating the dart2js patch files without changing the compiler directly
    /cc @rakudrama

  6. srawlins commented on Sep 28, 2022

    @srawlins
    Member

    If we want to ship dart migrate in Dart 3.0, is it ok if that tool does not understand these removed APIs?

    For example, if someone installs Dart 3.0, and uses that Dart's dart migrate to try to migrate code which refers to CastError, is it ok if dart migrate fails in some way? Crashes or something like that on the unresolved element.

    FWIW, dart migrate is implemented in pkg/dartdev, which has a simple import of pkg/nnbd_migration. It does not currently shell out to a separate snapshot.

  7. sigmundch commented on Sep 29, 2022

    @sigmundch
    Member

    @mit-mit efb509c should address the dependency from dart2js, I think the constructor is now ready to be removed.

  8. mit-mit commented on Oct 10, 2022

    @mit-mit
    MemberAuthor

    If we want to ship dart migrate in Dart 3.0, is it ok if that tool does not understand these removed APIs?

    @srawlins I think that is OK. If a developer wants support for migrating away from discontinued APIs, they can use the 2.19 SDK.

  9. mit-mit commented on Oct 10, 2022

    @mit-mit
    MemberAuthor

    @sigmundch @kevmoo is the comment above about the dart:html change accurate (i.e. we're removing that in 2.19)?

  10. sigmundch commented on Oct 17, 2022

    @sigmundch
    Member

    @mit-mit, can you clarify which comment are you referring to?

    We landed changes to mark the APIs deprecated in late July. Those haven't been released yet in the stable channel, so it will first get broad visibility with the 2.19 stable release. Given that, we wont be removing it entirely in 2.19, but the release that follows.

  11. mit-mit commented on Oct 24, 2022

    @mit-mit
    MemberAuthor

    @sigmundch I was looking at an older, stale version, sorry.

    Given that, we wont be removing it entirely in 2.19, but the release that follows.

    sgtm, we'll track that as a 3.0 removal then

  12. 5 remaining items

  13. nshahan commented on Dec 12, 2022

    @nshahan
    Contributor

    @mit-mit Are you expecting there will be tracking issues for the removal of CyclicInitializationError and NullThrownError. Is there already discussion happening somewhere?

  14. mit-mit commented on Dec 12, 2022

    @mit-mit
    MemberAuthor

    Those are expected to be removed next few days; CLs will be linked from the top comment.

  15. mit-mit commented on Dec 19, 2022

    @mit-mit
    MemberAuthor

    All done, closing

  16. dupuchba commented on Apr 16, 2023

    @dupuchba

    hey @mit-mit you forgot MapEntry in your list which cannot be extends anymore (it breaks ClojureDart btw).

  17. lrhn commented on Apr 16, 2023

    @lrhn
    Member

    Making MapEntry a final class will, like all other now-final classes in the platform libraries, only affect code when it migrates to Dart 3.0.

    It's not, technically, considered breaking, even though it prevents some uses from being continued. The existing code, running at language version 2.19, will keep working until support for pre-3.0 code is removed, which is unlikely to be soon.

    The list of classes which have become final are (lifted directly from the source code):

    dart:async

    • final class AsyncError
    • final class DeferredLoadException
    • abstract final class ZoneSpecification
    • abstract final class ZoneDelegate
    • abstract final class Zone

    dart:collection

    • abstract final class HashMap
    • abstract final class HashSet
    • final class HasNextIterator
    • abstract final class LinkedHashMap
    • abstract final class LinkedHashSet
    • final class DoubleLinkedQueue
    • final class ListQueue
    • final class SplayTreeMap
    • final class SplayTreeSet

    dart:convert

    • final class AsciiCodec
    • final class Base64Codec
    • final class Base64Encoder
    • final class Base64Decoder
    • final class HtmlEscapeMode
    • final class HtmlEscape
    • final class JsonCodec
    • final class JsonEncoder
    • final class JsonUtf8Encoder
    • final class JsonDecoder
    • final class Latin1Codec
    • final class Latin1Encoder
    • final class Latin1Decoder
    • final class LineSplitter
    • final class Utf8Codec
    • final class Utf8Encoder
    • final class Utf8Decoder

    dart:core

    • abstract final class BigInt
    • final class OutOfMemoryError
    • final class StackOverflowError
    • abstract final class Function
    • final class MapEntry
    • final class Null
    • abstract final class Record
    • abstract final class String
    • final class Expando
    • abstract final class WeakReference
    • abstract final class Finalizer

    dart:developer

    • abstract final class NativeRuntime
    • final class ServiceExtensionResponse
    • abstract final class UserTag
    • final class ServiceProtocolInfo
    • final class Service
    • final class Flow
    • abstract final class Timeline
    • final class TimelineTask

    dart:ffi

    • final class AbiSpecificIntegerMapping
    • final class DartRepresentationOf
    • final class Unsized
    • final class Char
    • final class SignedChar
    • final class UnsignedChar
    • final class Short
    • final class UnsignedShort
    • final class Int
    • final class UnsignedInt
    • final class Long
    • final class UnsignedLong
    • final class LongLong
    • final class UnsignedLongLong
    • final class IntPtr
    • final class UintPtr
    • final class Size
    • final class WChar
    • final class DynamicLibrary
    • final class Pointer
    • final class Array
    • final class Dart_CObject
    • abstract final class NativeApi
    • final class FfiNative
    • final class Native
    • final class DefaultAsset
    • abstract final class NativeFinalizer
    • abstract final class NativeType
    • final class Int8
    • final class Int16
    • final class Int32
    • final class Int64
    • final class Uint8
    • final class Uint16
    • final class Uint32
    • final class Uint64
    • final class Float
    • final class Double
    • final class Bool
    • abstract final class Void
    • abstract final class Handle
    • abstract final class NativeFunction
    • abstract final class VarArgs
    • final class Packed

    dart:io and dart:html

    • abstract final class HttpClientBasicCredentials
    • abstract final class HttpClientDigestCredentials
    • final class HttpProfiler

    dart:io

    • abstract final class ZLibOption
    • final class ZLibCodec
    • final class GZipCodec
    • final class ZLibEncoder
    • final class ZLibDecoder
    • final class FileSystemEntityType
    • final class FileSystemEvent
    • final class FileSystemCreateEvent
    • final class FileSystemModifyEvent
    • final class FileSystemDeleteEvent
    • final class FileSystemMoveEvent
    • abstract final class Platform
    • abstract final class ProcessInfo
    • final class ProcessStartMode
    • final class ProcessResult
    • final class InternetAddressType
    • final class SocketDirection
    • final class SocketOption
    • final class RawSocketOption
    • final class ConnectionTask
    • final class Datagram
    • final class SocketMessage
    • final class StdioType
    • final class SystemEncoding

    dart:isolate

    • final class Isolate
    • final class RemoteError
    • abstract final class TransferableTypedData

    dart:typed_data

    • abstract final class ByteBuffer
    • abstract final class TypedData
    • final class Endian
    • abstract final class ByteData
    • abstract final class Int8List
    • abstract final class Uint8List
    • abstract final class Uint8ClampedList
    • abstract final class Int16List
    • abstract final class Uint16List
    • abstract final class Int32List
    • abstract final class Uint32List
    • abstract final class Int64List
    • abstract final class Uint64List
    • abstract final class Float32List
    • abstract final class Float64List
    • abstract final class Float32x4List
    • abstract final class Int32x4List
    • abstract final class Float64x2List
    • abstract final class Float32x4
    • abstract final class Int32x4
    • abstract final class Float64x2
    • abstract final class UnmodifiableByteBufferView
    • abstract final class UnmodifiableByteDataView
    • abstract final class UnmodifiableUint8ListView
    • abstract final class UnmodifiableInt8ListView
    • abstract final class UnmodifiableUint8ClampedListView
    • abstract final class UnmodifiableUint16ListView
    • abstract final class UnmodifiableInt16ListView
    • abstract final class UnmodifiableUint32ListView
    • abstract final class UnmodifiableInt32ListView
    • abstract final class UnmodifiableUint64ListView
    • abstract final class UnmodifiableInt64ListView
    • abstract final class UnmodifiableInt32x4ListView
    • abstract final class UnmodifiableFloat32x4ListView
    • abstract final class UnmodifiableFloat64x2ListView
    • abstract final class UnmodifiableFloat32ListView
    • abstract final class UnmodifiableFloat64ListView

    It's possible, dart:mirrors might also be made entirely final, if time permits.

  18. dupuchba commented on Apr 16, 2023

    @dupuchba

    @lrhn I appreciate your perspective, but I must disagree with the assertion that It's not, technically, considered breaking.... Allow me to share my viewpoint:

    As a library creator, supporting all major Dart version updates is crucial to prevent the library from becoming obsolete.
    What occurred to libraries that failed to transition from Dart 1 to 2.X?

    The final class example is an excellent illustration. Introducing final class in Dart standard libraries disrupts all code dependent on those classes when transitioning to Dart 3, generating unplanned work for library authors.
    When I examine the decision to make MapEntry a final class, it appears to be final for the sake of precaution rather than necessity.

    Please don't misunderstand me; I adore Dart and the team behind it, and I will always be thankful for the impact it had on my life when I chose it for ClojureDart.

    I would simply prefer minimal Breaking Changes.

    Thanks for all your work 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).enhancement-breaking-changeAn enhancement which is breaking.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions