Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate the export of package:matcher APIs #1978

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

natebosch
Copy link
Member

@natebosch natebosch commented Mar 28, 2023

Tests should import the matching framework, either
package:matcher/expect.dart, or package:checks/checks.dart, or some
third party alternative.

  • Add fix data for every member of package:matcher/expect.dart to
    replace the member with the package:test/test.dart URI.
  • Mark the export deprecated`.
  • Add a library directive so the deprecation annotation is
    unambiguously applied to the export and not the entire library.
  • Apply bulk fixes in tests. This adds the matcher dependency and
    import. Manually sort dependencies to satisfy a separate lint.

Add a `replacedBy` transform for every member of the
`package:matcher/expect.dart` library which changes only the URI.
Copy link

github-actions bot commented Nov 8, 2024

PR Health

@natebosch
Copy link
Member Author

@keertip @bwilkerson - Is there a way to handle a class moved to a different import?

This seems to be working well to use replacedBy for the top level functions and variables, but I cannot find any allowed configuration which handles the moved classes.

A change of type 'replacedBy' can't be used for an element of kind 'class'

@bwilkerson
Copy link
Member

It appears that we don't currently support using replacedBy with class-like declarations.

I know that at one point we discussed adding a movedTo transform that would support moving top-level declarations to a different library, but it looks like we haven't implemented that yet.

@natebosch
Copy link
Member Author

I filed dart-lang/sdk#57057 to track. Either solution sounds great.

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

Successfully merging this pull request may close these issues.

2 participants