angulardart-community / angular

Fast and productive web framework provided by Dart.
https://pub.dev/packages/ngdart
MIT License
114 stars 14 forks source link

Bump analyzer to v5 #32

Closed GZGavinZhao closed 1 year ago

GZGavinZhao commented 2 years ago

Previously we just add deprecated_member_use: ignore to the analysis_options.yaml file in the monorepo root. Now analyzer has gone to v5 so the usage of deprecated APIs must be dealt with now.

The hardest parts are the last three, since they change the class returned or require another variable, so likely we'll have to work around them.

denniskaselow commented 2 years ago

Replace element with element2. Note that the return type changes from ClassElement to InterfaceElement, so it requires a bit more work. Most times we should be able to just cast it to ClassElement since ClassElement implements InterfaceElement.

FYI in case you want to migrate to the current version of analyzer and plan to have no lints about deprecated members: with analyzer 5.2 element2 is deprecated and element is the new one (The old element is removed in 5.0).

GZGavinZhao commented 1 year ago

Yeah, so my process will be:

  1. Migrate deprecated API's in analyzer v4
  2. Upgrade analyzer to v5, ensure everything is still working
  3. Migrate deprecated API's again
  4. Then I'll probably have to repeat these steps for analyzer v6

As I might've said previously, unfortunately the analyzer is probably one of the most tiresome packages to keep up-to-date with.

ykmnkmi commented 1 year ago

Any progress? I'm now doing the same, fixing all static analysis warnings and upgrading to the new analyzer. PS: ngast and ngcompiler.

GZGavinZhao commented 1 year ago

Sorry, not really. It's the busiest time of the year for me and I've been having a bad cold/flu. I am blocked on the resolveToBound issue, particularly with the case when dartType is FunctionType (see where resolveToBound is defined).

GZGavinZhao commented 1 year ago

@ykmnkmi Also, I'm absolutely okay if you want to use the existing changes from my PR in yours. You don't need to let me know.

GZGavinZhao commented 1 year ago

Fixed by #37.