collection icon indicating copy to clipboard operation
collection copied to clipboard

Update code to Dart 3.0

Open lrhn opened this issue 2 years ago • 7 comments

Add required mixins. Add some appropriate finals.

Should this be a major version increment?

The final modifiers are breaking. (But so is the lack of mixin modifiers on some classes.)

lrhn avatar May 03 '23 09:05 lrhn

Should this be a major version increment?

For most packages, yes.

For this package, which is pinned by flutter, it may be easier to cheat and ship without a major version change.

natebosch avatar May 03 '23 15:05 natebosch

I don't think we're time-bound on this release. The internal need to make the code 3.0 compatible has been fixed, so staying as 2.18.0 is fine for now. We want to release a 3.0 version eventually, where we add modifiers (and the sooner we do so, the sooner people can see which modifiers they need to comply with).

lrhn avatar May 03 '23 15:05 lrhn

(Need to fix CI too.)

lrhn avatar May 03 '23 17:05 lrhn

I'm starting an internal presubmit to see if any usage is impacted by the change.

natebosch avatar May 03 '23 19:05 natebosch

The full set of modifiers in this CL which caused build failures in google3 are CanonicalizedMap, DefaultEquality, MapEquality, DeepCollectionEquality, and HeapPriorityQueue. I think you fixed the usage of HeapPriorityQueue but I think the others will still cause a problem. When I comment out the added modifiers on those classes I can get a TAP global without any related build failures.

natebosch avatar May 26 '23 00:05 natebosch

What's the status of this PR? I'm itching to use Map.pairs in my packages.

nex3 avatar Jan 03 '24 23:01 nex3

Hey all, I'm trying to use collections.dart and am getting errors like:

packages/collection/src/boollist.dart:231:50:
Error: The class 'NonGrowableListMixin' can't be used as a mixin because it isn't a mixin class nor a mixin.
class _NonGrowableBoolList extends BoolList with NonGrowableListMixin<bool> {

This is pulled in via transitive dependencies.

My dart version:

dart --version
Dart SDK version: 3.3.1 (stable) (Wed Mar 6 13:09:19 2024 +0000) on "macos_arm64"

I see above people saying it isnt a problem but how can I mitigate this?

dannnnthemannnn avatar Mar 15 '24 19:03 dannnnthemannnn