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.
The move to strong mode made, for example,
Iterable<dynamic>no longer a subtype ofIterable<String>. The observable package (and likely a few other corners of the ecosystem) relied on this. To workaround that, we introduced thedart_internalpackage which gives you a very limited API to extract the type arguments from anIterableorMap.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_internalin Dart 4.0 and the ecosystem will route around its absence.See go/how-to-update-dart-internal for more background.