Skip to content

fix(package_info_plus): fixed deprecation warning & updated dependencies#442

Merged
miquelbeltran merged 28 commits intofluttercommunity:mainfrom
juliansteenbakker:deprecation
Oct 6, 2021
Merged

fix(package_info_plus): fixed deprecation warning & updated dependencies#442
miquelbeltran merged 28 commits intofluttercommunity:mainfrom
juliansteenbakker:deprecation

Conversation

@juliansteenbakker
Copy link
Copy Markdown
Contributor

Description

This PR removes the deprecated embedding V1 from package_info_plus. Besides that it updates the dependencies and fixes a deprecation issue with regards to getBuildSignature method.

Related Issues

Probably fixes #301

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@mhadaily
Copy link
Copy Markdown
Member

mhadaily commented Oct 1, 2021

I just updated main branch can you please update with main. and then let's merge your branch.

@mhadaily mhadaily self-requested a review October 1, 2021 19:21
@mhadaily mhadaily added the Hacktoberfest Issues taking part in Hacktoberfest label Oct 1, 2021
@juliansteenbakker
Copy link
Copy Markdown
Contributor Author

I just updated main branch can you please update with main. and then let's merge your branch.

I will but before merging, should we remove the deprecated registerwith function, or just leave it in and annotate so it hides the warning? Because whatever we chose, we should apply it to all other packages aswell.

@mhadaily
Copy link
Copy Markdown
Member

mhadaily commented Oct 1, 2021

Well, I'd say if we have a solution to replace it with a new API, let's do that, that much better, however, if we don't lets at least annotate it so later we will remove depreciated API and replace them with a new one.

I prefer to implement a new API if possible.

@juliansteenbakker
Copy link
Copy Markdown
Contributor Author

Currently v1 embedding with registerWith is only kept for backwards compatibility. However it seems that it isn't included in new releases according to official Flutter documentation. So i'd say it's safe to remove it.

@nohli
Copy link
Copy Markdown
Member

nohli commented Oct 1, 2021

@juliansteenbakker
It is my understanding that it is good to keep the registerWith() method to remain compatible:

Also, note that the plugin should still contain the static registerWith() method to remain compatible with apps that don’t use the v2 Android embedding. (See Upgrading pre 1.12 Android projects for details.) The easiest thing to do (if possible) is move the logic from registerWith() into a private method that both registerWith() and onAttachedToEngine() can call. Either registerWith() or onAttachedToEngine() will be called, not both.

https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration#upgrade-steps

@mhadaily
I added PRs that suppress the build warnings for all remaining packages. Didn't see that for package_info_plus there is already this one. I can close mine probably?

@juliansteenbakker
Copy link
Copy Markdown
Contributor Author

@nohli It's more a question of choice i think. The flutter team encourages everyone to upgrade to V2, and right now only 20% of the projects use V1. You can keep providing support for V1 but where are you going to draw the line? Besides that, is it even possible for Flutter applications that only support V1 embedding to also support null-safety, like all packages here does?

@juliansteenbakker
Copy link
Copy Markdown
Contributor Author

@nohli You can close your pr for this package. I'll update this to leave the registerWith in it if thats what we're deciding.

@mhadaily
Copy link
Copy Markdown
Member

mhadaily commented Oct 2, 2021

@nohli @juliansteenbakker let's discuss there and make a decision, I don't think it's very critical to support V1. what we can do we can remove this and release a new Major version for packages so if anyone likes to use older version so still, they can but we will not support it?

what do you think?

question for you @nohli if you think this PR is covering your PRs, let's close yours and focus on this one if you agree?

@mhadaily
Copy link
Copy Markdown
Member

mhadaily commented Oct 2, 2021

@juliansteenbakker build failed, I think you need to rebase with main

@nohli
Copy link
Copy Markdown
Member

nohli commented Oct 2, 2021

Already closed.

So you want me to close all the other PRs, and open a new one, removing the registerWith method, for all other packages?

@juliansteenbakker juliansteenbakker mentioned this pull request Oct 3, 2021
9 tasks
@juliansteenbakker
Copy link
Copy Markdown
Contributor Author

As discussed in #461 i've deleted the v1 embedding once again and bumped the version number.

Currently blocked by #489

@juliansteenbakker juliansteenbakker changed the title fix(package_info_plus): fixed deprecation warning & updated dependencies fix(package_info_plus): fixed deprecation warning & updated dependencies (blocked by #489) Oct 4, 2021
@mhadaily
Copy link
Copy Markdown
Member

mhadaily commented Oct 5, 2021

@juliansteenbakker PR is merged.

btw, since we have now this PR #495 do you think your PR will be still valid?

# Conflicts:
#	packages/sensors_plus/sensors_plus/test/sensors_test.dart
#	packages/sensors_plus/sensors_plus_platform_interface/test/sensors_plus_platform_interface_test.dart
#	packages/share_plus/share_plus_platform_interface/test/share_plus_platform_interface_test.dart
@juliansteenbakker juliansteenbakker changed the title fix(package_info_plus): fixed deprecation warning & updated dependencies (blocked by #489) fix(package_info_plus): fixed deprecation warning & updated dependencies Oct 5, 2021
@juliansteenbakker
Copy link
Copy Markdown
Contributor Author

btw, since we have now this PR #495 do you think your PR will be still valid?

Yes because that PR doesn't contain changes for package_info_plus. Also, this PR solves other deprecation problems besides embedding V1.

@juliansteenbakker
Copy link
Copy Markdown
Contributor Author

@mhadaily this is ready to be merged

@nohli
Copy link
Copy Markdown
Member

nohli commented Oct 5, 2021

@juliansteenbakker could you also use 30 for compileSdkVersion and targetSdkVersion?
31 is Android 12 which is still in beta.

@vbuberen
Copy link
Copy Markdown
Collaborator

vbuberen commented Oct 5, 2021

31 is Android 12 which is still in beta.

It is not in beta since yesterday, but I would be careful with pushing to 31, because it has some behavior changes. For example, android_alarm_manager should be upgraded carefully, considering this change https://developer.android.com/about/versions/12/behavior-changes-12#exact-alarm-permission
Haven't checked if other packages would need the same though

@juliansteenbakker
Copy link
Copy Markdown
Contributor Author

@nohli Android 12 is not in beta anymore. Besides, when a new number is available in compileSdkVersion, it means that the API is stable. Otherwise it would be marked as such: compileSdkVersion 'android-R'. compileSdkVersion 31 has been stable since 14 July.

@juliansteenbakker
Copy link
Copy Markdown
Contributor Author

31 is Android 12 which is still in beta.

It is not in beta since yesterday, but I would be careful with pushing to 31, because it has some behavior changes. For example, android_alarm_manager should be upgraded carefully, considering this change https://developer.android.com/about/versions/12/behavior-changes-12#exact-alarm-permission Haven't checked if other packages would need the same though

We should migrate and check every package individually. That is why this PR is only about package_info_plus.

@vbuberen
Copy link
Copy Markdown
Collaborator

vbuberen commented Oct 5, 2021

We should migrate and check every package individually

Yes, agree here. My message was mostly to @nohli since he has one big PR with changes to multiple packages, so I wanted to bring attention to that moment about Android 12.

Copy link
Copy Markdown
Member

@miquelbeltran miquelbeltran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@miquelbeltran miquelbeltran merged commit 70ca955 into fluttercommunity:main Oct 6, 2021
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Hacktoberfest Issues taking part in Hacktoberfest hacktoberfest-accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Production app bundle build warning uses or overrides a deprecated API.

5 participants