Provider: Migrate provider to null-safety

Created on 18 Nov 2020  路  14Comments  路  Source: rrousselGit/provider

This is a tracker issue for migrating package:provider to null-safety. More details coming soon.

enhancement needs triage

Most helpful comment

I will fully migrate provider by the end of the week.

All 14 comments

We first need to migrate package:nested which is a dependency of provider.

@rrousselGit FYI null-safety is still in beta. Why are we migrating some packages now? package:provider is a critical package to Flutter ecosystem. As such, it is being used in other critical packages/apps that we would like to migrate.

We have several options w.r.t. to this migration before null-safety hits stable in Dart:

  • Keep separate a separate null-safety branch and keep it in sync with master. This is useful if you want to be able to develop/submit fixes to non-null-safe version of the code and publish it on pub. However, it is quite an overhead.

  • Declare master to be null-safe and change pubspec accordingly. The downside for this is that you have effectively frozen your normal releases until null-safety hits stable. If users want to use the null-safe version, they would need to upgrade their Flutter/Dart version to something that supports null-safety. This is what we recommend. It gives you a clean null-safe master repo to work on.

  • Don't do anything. We can fork this package within Google and migrate it. We can then send you a PR that sits there unmerged until you feel like merging it. This is also not the best option since the PR will atrophy.

Hello!

I'm fine with either of these solutions.
Honestly, I would do the migration myself. But I am in the middle of a burnout at the moment.

Hopefully I will be able to resume working after a little bit of time

Take care! Added a PR for nested https://github.com/rrousselGit/nested/pull/10

It looks like all deps of provider have migrated now:

Yes, we have a draft PR that aims to migrate provider but migrating the tests are challenging as they heavily use mockito.

I will fully migrate provider by the end of the week.

Thanks Remi. Take care of yourself first. As I mentioned, it is not a big deal if we cannot push all the _right_ changes in the first cut. Just making it null-safe compatible would suffice to unblock further migration up the chain.

In case some people missed it:

A null-safety version is available on pub: 5.0.0-nullsafety.1

Remi, do you intend to merge this to master so that any subsequent changes to code is null-safe?

Not for now

Since NNBD isn't available on stable as far as I know, that would prevent updates for people using the stable channel

OK. Originally, stopping the updates to stable is what I have recommended in https://github.com/rrousselGit/provider/issues/573#issuecomment-730070224.

So, instead, you prefer accepting more PRs in master, rebasing and fixing the null-safety PR and merging when nnbd hits stable, right?

That's fine by me as well. We need to move to null-safe version in Google but I can stop updating it for now and resume when you merge null-safety PR to master.

Provider is unlikely to have a lot of changes in the short term

I just think keeping NNBD in a separate branch for now is the best bet, as I have no idea when would be the stable release of non-nullable types.

Since I'm working on a tab in Flutter's devtool to inspect the state of providers at the moment, it would be a shame if stable users couldn't benefit from it until NNBD is released officially

Looking forward to it. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rrousselGit picture rrousselGit  路  3Comments

mhd-barikhan picture mhd-barikhan  路  5Comments

stocksp picture stocksp  路  5Comments

sanekyy picture sanekyy  路  5Comments

Alfie-AD picture Alfie-AD  路  4Comments