Skip to content

[dart 4.0] Drop support for dart_internal #4744

Description

@munificent

The move to strong mode made, for example, Iterable<dynamic> no longer a subtype of Iterable<String>. The observable package (and likely a few other corners of the ecosystem) relied on this. To workaround that, we introduced the dart_internal package which gives you a very limited API to extract the type arguments from an Iterable or Map.

This was always intended to be a short-term solution. To that end, the package has a narrow version constraint which we bump every single time a new Dart SDK release comes out, just to give us the ability to remove it in a minor version of the SDK. And yet, here we are many versions later and it's still around.

We had hoped to add real language support for this capability (#4215) when we shipped pattern matching, but it didn't make it in. We mostly seem to get by fine without it, and the complexity is potentially high, so it seems unlikely that we'll add that any time soon.

I believe very little code still relies on the observable package, so I suspect we could simply remove support for dart_internal in Dart 4.0 and the ecosystem will route around its absence.

See go/how-to-update-dart-internal for more background.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    dart-4.0Features considered for the Dart 4.0 release.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions