Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Deprecate whereNotNull from IterableNullableExtensions #332

Merged
merged 4 commits into from
Jun 9, 2024
Merged

Conversation

oprypin
Copy link
Contributor

@oprypin oprypin commented Jan 25, 2024

Dart SDK since 3.0 has an exact equivalent extension nonNulls in the core.



  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

Dart SDK since 3.0 has an exact equivalent extension `nonNulls` in the core.
@natebosch natebosch requested a review from lrhn January 25, 2024 23:00
@natebosch
Copy link
Contributor

cc @bwilkerson - would it be feasible to add support in dart_fix.yaml to replace a method with no arguments with a field? I don't think we currently have a way to automate the fix we need:

import 'package:collection/collection.dart';

void main() {
  [].whereNotNull().join('');
}

Should become

void main() {
  [].nonNulls.join('');
}

The transform I think I want, but is currently an error:

  - title: 'Replace whereNotNull() with core nonNulls'
    date: 2024-01-25
    element:
      uris: ['collection.dart']
      method: 'whereNotNull'
      inExtension: 'IterableExtension'
    changes:
      - kind: 'replacedBy'
        newElement:
          uris: ['dart:core']
          field: 'nonNulls'
          inClass: 'NullableIterableExtensions'

@kevmoo
Copy link
Contributor

kevmoo commented Jun 8, 2024

Are we going to move forward with this – or should we wait until after 1.19.0? @natebosch

@lrhn
Copy link
Contributor

lrhn commented Jun 9, 2024

We can remove it in the next major version, which may be the one which switches to Dart 3.0. Maybe.

@kevmoo
Copy link
Contributor

kevmoo commented Jun 9, 2024

Well the constraint @ master right now is ^3.1.0 – so this would be as good a time as any.

@kevmoo kevmoo merged commit e9219c7 into master Jun 9, 2024
7 checks passed
@kevmoo kevmoo deleted the iterablex2 branch June 9, 2024 20:03
mosuem pushed a commit to dart-lang/core that referenced this pull request Oct 18, 2024
…collection#332)

Dart SDK since 3.0 has an exact equivalent extension `nonNulls` in the core.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

rewrite whereNotNull without sync*
4 participants