-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[META] Plan for publishing null-safe core packages #41398
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
Comments
FYI: Dartdoc needs to know about the planned allow-list of null-safe core packages for the tech preview to make sure they are documented correctly. See dart-lang/dartdoc#2211 |
See go/dart-null-safety-1st-party-package-publish-plan |
@kevmoo can we close this? I believe we have a plan, right? |
I don't think we have a settled plan for all packages. We have a plan for packages pinned by flutter. For the rest there is still open questions around whether we'll do breaking version bumps by default. Last we spoke I think @leafpetersen still wanted to push for non-breaking releases and I'm strongly in favor of breaking releases. |
This comment details how to handle packages migrated to null safety prior to launch. The term 'trial-migrated' is used to refer to a package that has been migrated during this stage. These migrations are 'trial' by definition, as the null safety isn't guaranteed to be API stable until we reach stable (although the actual API churn is expected to slow down as we approach launch). Problem statementWe need a solution where:
Proposed solution for package versioningPublishing prior to null safety betaPrior to beta, publishing to pub.dev is strongly discouraged. Doing so, even as a pre-release version, can in some cases lead to pub resolving to the null safety version for a consumer that is not yet using null safety. If that happens, they will be broken. Thus, prior to beta, we recommend that any trial migrated packages are consumed via git dependencies to the package source code, and that this code is in a branch called The only exception to this role is for a small selection of core packages owned by the core Dart team. Backwards compatible versions of these can be published with extreme care, and only after being added to an allow-list that ensures they work when consumed even without the experiment flag. Publishing after null safety betaOnce null safety is no longer behind an experimental flag, but prior to the stable launch of the feature, publishing to pub.dev can happen. The below listed steps for versioning must be followed to ensure the null safety version only reaches developers who are ready for it. Versioning
Proposed Dart platform supportThe above package versioning guidance is supplemented by:
|
The more I think about this the less comfortable I am with it. There could be any number of unforeseen circumstances which end up with users picking up a null safety release without intending to. If we don't want or aren't able to put the time into some solution that actually prevents users from getting these packages at all, then I would prefer to just use git overrides. |
How are we determining this? We know that it is cumbersome, but I don't know the criteria we are using to determine how cumbersome it can or should be. If it's because we think it will dissuade users from trying it and we'll have too little feedback my gut instinct goes against that and I wonder if we can find out whether that is true (or delay an implementation of something different until we find it is true). |
I suppose that if we suggest people use git-dependencies on a |
@jakemac53 Can you exemplify this concern? I simply don't see how it could happen without the user opting-in by updating their |
It's a qualified guess. If trial migration is hard, we'll get fewer doing it, and thus less feature validation. This is a significant risk (to both feature quality and timelines), so we need to weigh that risk against the risk of the proposal I summarized. |
A big part of the concern is the unforseen part. I cannot say with any confidence that no significant number of users will be affected by this. Because these are considered valid packages by pub my assumption is the opposite - that people almost certainly will end up with them one way or the other. Some theoretical examples could include:
Another part of the concern is, if this becomes a problem, what course of action to we have to remedy it? We are really left with very few options once these packages are published. Ultimately, the potential for headache here is a lot larger than the win we are getting from it, because it could potentially negatively affect all users, instead of just being a pain to use for those who do choose to. |
@jakemac53 is your main concern with the kinds of potential failures you describe during the phase of null safety development where the feature is behind an experimental flag? In other words, would you feel comfortable with the guidance I described above once we get to beta and the feature is no longer behind a flag? |
@mit-mit Yes I would feel perfectly comfortable at that point - the packages at least at the time of their publishing should be perfectly valid, and even if the feature did have a breaking change you do have some recourse which is to publish a new version of your null safe package that fixes any breakage (and it would be one that anybody should be able to get on |
Unlikely. Since the package has a pre-release version, pub will try to prefer any stable release of that package before it considers the null safety one. I think I'm with @natebosch, though. Using Git dependencies and dependency overrides is completely safe with respect to the package ecosystem. The only concerns are that it may be annoying for the relatively small number of people that are trying out null safety. But I would rather inconvenience them than potentially harm random Dart users who don't care about null safety yet. How about we put a Gist somewhere like: dependency_overrides:
args:
git:
url: [email protected]/args.git
ref: null_safety
path:
git:
url: [email protected]/path.git
ref: null_safety
# Every other package we've trial-migrated... And just tell users, "If you want to try out null safety, copy/paste that into your pubspec and you're good." Is that enough to make this usable? |
I think we would want a shared repo somewhere so people could submit their own git branches to it - that is essentially what @leafpetersen suggested in the meeting this week. The downside is that could accumulate a lot of overrides and pull down more packages than people need. Note that for the really core packages (those required for |
@munificent what if instead of using Packages migrated before beta should:
Then use of If someone starts using another repository than the original repository, or a branch name different than |
I think this can fall down if you also want to mix in some transitive published deps, which we'll want to do for the packages the Dart team has published. |
Yes, everybody has to agree to use it from git or from |
The regular dependency strategy requires all of your transitive deps to have migrated effectively - at least any that share any deps with a migrated package (even non-runtime deps). It is possible it might be sufficient, but ultimately I think a lot of people would end up using overrides to work around this anyways. |
@jonasfj @jakemac53 @natebosch @leafpetersen @munificent I updated the proposed solution after our discussion. Please review, and update thumbs up/down votes. |
Your proposed solution looks good to me. Here:
I would add:
Also, I'd remove "publish" from that sentence. |
Both done! |
Closing this issue as resolved. |
I have a unique situation and I was hoping someone could help me unwind my options.
As I understand it, we are being asked to burn the 2.0 major release number to release our null safe version of the package. This is a high cost option for us because we have built up an expectation that fluro 2.0 will be using navigator 2.0.
|
Hey Luke,
It's pretty complex, unfortunately. Basically, most migrations of packages
to support null safety will introduce subtle breaks – even if it doesn't
seem like it. This involves folks publishing packages that depend on your
package, and the order in which they migrate to null safety.
I'd suggest you publish your null safety release as v2 and do the major
rewrite as v3.
Is that doable?
…On Sun, Jan 31, 2021 at 3:05 PM Luke Pighetti ***@***.***> wrote:
I have a unique situation and I was hoping someone could help me unwind my
options.
- Package is fluro
- Current version is 1.7.8
- We have been reserving the major version 2.0.0 for a major rewrite
to Navigator 2.0
- We have ported 1.7.8 to null safety and would like to make this
available before we start work on fluro 2.0
As I understand it, we are being asked to burn the 2.0 major release
number to release our null safe version of the package.
1. Can we distribute this as a git dependency?
2. What happens if we distribute this as 1.8.0-nullsafety.0?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41398 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEFCRHRMDRBLON2BLDARTS4XO5BANCNFSM4MEB7L4A>
.
|
If that's the only option we will be waiting for our rewrite of fluro to nav 2.0 for nnbd, that may be a few months. I have made the null-safe version of 1.x available as a git dependency until then. Thanks for the quick reply! |
Why are you against using v3?
…On Mon, Feb 1, 2021 at 5:34 AM Luke Pighetti ***@***.***> wrote:
If that's the only option we will be waiting for our rewrite of fluro to
nav 2.0 for nnbd, that may be a few months.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41398 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEFCXJOS5CVWGABZ5CSBDS42UU3ANCNFSM4MEB7L4A>
.
|
Fluro 1.0 uses Navigator 1.0 If I burn a 2.0 release on Fluro 1.0 NNBD I am anticipating that it will confuse people. We've been tying the future Fluro 2.0 release to a Navigator 2.0 migration for many months now publicly. The good news is we have precious few dependent packages and none of them appear to be in common use, so a git dependency shouldn't be outlandish. |
Is there a target date for major packages to be null-safe on pub? |
Hi @lukepighetti we hope to share more information about this next week, stay tuned! |
As of our post from February 17th (https://medium.com/dartlang/preparing-the-dart-and-flutter-ecosystem-for-null-safety-e550ce72c010), we've declared null safety API stable, and will not be changing semantics. With that the previously guidance that you have to publish pre-release versions (e.g. Wrt. minor or major version bump, @natebosch @jakemac53 can you comment if minor is an option now (assuming there are no other API breaks, and all deps have been migrated to stable, null safe versions)? |
Looking forward to clarification on minor version bumps. One more thing, is there any way to tell on pub.dev if a package is null safe? I thought all the tooling was using the preview tag to determine. Of interest was Edit: I see this now, but it's not visible until you click on the |
Major version bumps are the recommendation. There is no mechanical enforcement of this best practice, and AFAIK it won't impact the way your package shows up as "Null Safety" on the pub site. There are two main reasons we recommend a major version bump.
For a few packages owned by the Dart team we were careful with 1 and validated the code carefully against a large corpus of unmigrated downstream code, and for |
+1 for major version bumps still, while mostly safe there are enough edge cases that I would avoid doing a minor release. You can potentially break the whole world that depends on you without realizing it. |
Tracking issue for the plan to publish null-safe core packages.
WIP with @natebosch and @jakemac53
The text was updated successfully, but these errors were encountered: