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

Incorrect Dart support policy #968

Open
4 tasks done
mtrezza opened this issue Sep 26, 2023 · 33 comments · Fixed by #969 or #971
Open
4 tasks done

Incorrect Dart support policy #968

mtrezza opened this issue Sep 26, 2023 · 33 comments · Fixed by #969 or #971
Labels
type:meta Non-code issue

Comments

@mtrezza
Copy link
Member

mtrezza commented Sep 26, 2023

New Issue Checklist

Issue Description

It seems we have an mistake in our support policy, which says:

To give developers time to upgrade their app to the newest Dart framework, previous Dart framework releases are supported for at least 1 year after their release date.

The end-of-support date needs to depend on how long a newer significant (=minor) release is available to give developers time to upgrade. Dart 3 has been released in May 2023. So we'd support Dart 2.19 until May 2024. That gives developers 12 months to upgrade.

@parse-github-assistant
Copy link

parse-github-assistant bot commented Sep 26, 2023

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza mtrezza added the type:meta Non-code issue label Sep 26, 2023
@mbfakourii
Copy link
Member

In my opinion, one year is too much time. If the developers are not interested in updating and using the new version, they can still use the old version of the package.

In my opinion, this policy also annoys the developers, it makes us unable to use new features for up to 1 year! And this actually slows down the development of the package.

@mtrezza
Copy link
Member Author

mtrezza commented Sep 26, 2023

it makes us unable to use new features for up to 1 year

Can you give an example of a new feature that is not available because we still support Dart 2.19?

@mbfakourii
Copy link
Member

Can you give an example of a new feature that is not available because we still support Dart 2.19?

One of the new features of Dart 3 is Multiple returns, which allows us to have multiple output values in the function

Another point is that Flutter and Dart do not have a long lifespan and are developing and growing, I think they offer a new version almost every two weeks.

@mtrezza
Copy link
Member Author

mtrezza commented Sep 26, 2023

One of the new features of Dart 3 is Multiple returns, which allows us to have multiple output values in the function

The question is whether that impedes Parse SDK development, or it's just less convenient because it doesn't allow us to use the latest greatest Dart features when developing the SDK. For a developer who is using the Parse SDK this should be irrelevant as long as it's not affecting their own development. For Parse SDK maintainers that should be acceptable as long as it doesn't significantly increase maintenance effort.

I think they offer a new version almost every two weeks.

We only care for breaking releases (minor releases in the Dart world), which currently seem to happen about every 4-5 months. We could think about reducing the support time from 12 to 6 months, if we can find real examples that show a significant increase in maintenance effort because of the 12 months support. Also, if you could find Dart adoption statistics of apps somewhere, and we see for example that in the Dart world, 80% of developers upgrade their app to the latest significant Dart release within n months, we can adapt our support policy.

@mbfakourii
Copy link
Member

The question is whether that impedes Parse SDK development, or it's just less convenient because it doesn't allow us to use the latest greatest Dart features when developing the SDK. For a developer who is using the Parse SDK this should be irrelevant as long as it's not affecting their own development. For Parse SDK maintainers that should be acceptable as long as it doesn't significantly increase maintenance effort.

In addition, it impedes development, it also prevents developers from using other packages that do not support versions below 3 !

For example, a package that does not support the version below Dart 3 cannot be in the same project as our package!

We only care for breaking releases (minor releases in the Dart world), which currently seem to happen about every 4-5 months. We could think about reducing the support time from 12 to 6 months, if we can find real examples that show a significant increase in maintenance effort because of the 12 months support. Also, if you could find Dart adoption statistics of apps somewhere, and we see for example that in the Dart world, 80% of developers upgrade their app to the latest significant Dart release within n months, we can adapt our support policy.

It is better to ask the question in the Dart repository.

Another thing is that all the packages that are currently available in Flutter packages, none of them support below 3! [1]

@mtrezza
Copy link
Member Author

mtrezza commented Sep 27, 2023

it also prevents developers from using other packages that do not support versions below 3 !

Are you talking about app developers, and if yes, why would that be? If someone wants to use Dart 3, they can do it as the Parse SDK supports it.

@mbfakourii
Copy link
Member

Are you talking about app developers, and if yes, why would that be? If someone wants to use Dart 3, they can do it as the Parse SDK supports it.

I think I explained it wrong. For example, when a developer uses version 2.8 of Dart, in order to use a package that supports version 3 and above, he must update himself, which is not a problem on the developers' side.

But when we want to use a package in our package that supports version 3 and above, we encounter a problem in CI because it is not possible to use it in version 2.8 or 2.9.

If we skip from our CI and CI no longer checks the old versions below 3. When the developer adds our new version, he encounters a message that he should upgrade to the new version of Dart.

If the developer has secrets about using the old version of Dart, he can use the old version of our package!

And currently, most of the famous packages no longer support versions below 3. If you check the pub.dev site, you will understand this!

@mtrezza
Copy link
Member Author

mtrezza commented Sep 30, 2023

And currently, most of the famous packages no longer support versions below 3. If you check the pub.dev site, you will understand this!

Let's do a quick analysis.

There are two different aspects: "compatibility with Dart 3" vs. "required min Dart SKD version 3".

Looking at the packages listed on the overview page you linked we can see these min Dart SDK versions:

Group Min Dart SDK
Flutter Favorites 2.12, 2.17, 2.14, 2.12
Most popular packages 2.18, 3.0, 3.0, 2.12, 2.18, 2.12
Top Flutter packages 2.18, 2.15, 2.12, 2.16, 2.17, 2.19
Top Dart packages 2.12, 2.12, 2.19, 2.12, 2.12, 2.12
  • All of these packages are "Dart 3 compatible".
  • Only 3 packages require a min Dart SDK version of 3, that's only 9%.

Let's take a look at the min SDK distribution:

Min Dart SDK Count
3.0 2
2.19 2
2.18 3
2.17 2
2.16 1
2.15 1
2.14 1
2.12 10

This is a bimodal distribution. The first peak (2.18) are the "moderate speed adopters" which take about a year (Dart 2.19 was released in Jan 2023) to upgrade. The second peak (2.12) is most likely a deliberate choice to support older Dart versions, because all of these packages are well maintained. An interpretation of this could be that 45% of the most popular Dart and Flutter packages still support Dart 2.12 to reach a broader developer audience and to make life easier for developers.

Looking at the firebase_core package as an example: the min SDK was raised to 2.18 in March 2023, but Dart 2.18 was released in August 2022. Developers had 9 month to upgrade their app, meanwhile they were able to upgrade the package with bug fixes and new features.

The fundamental problem with increasing the min Dart SDK version fast is that the time a package maintainer takes to make their package "Dart 3 compatible" varies. If an app has 10 packages and only 1 package requires a min Dart SDK version of 3, then all other 9 packages must be Dart 3 compatible in order to upgrade to Dart 3. Otherwise the developer must look for alternative packages that already support Dart 3 (higher development effort), or cannot upgrade to use the latest release of that one package that requires Dart 3, which can be especially challenging if a release contains a critical bug fix.

The developer is between the front lines of package maintainers. The more rapidly we increase the min Dart SDK version, the more difficult we make life for developers who use the Parse Platform SDK. We need to strike a balance, and I would say from the data above that balance is somewhere between Dart 2.18 and 2.12.

@mbfakourii
Copy link
Member

Great analysis, I'm convinced, but what do you suggest? Is the support period the same as one year?

@mtrezza
Copy link
Member Author

mtrezza commented Oct 1, 2023

In time terms:

  • Dart 2.18, released Aug 2022 -> time passed since release: 1 year + 1 month
  • Dart 2.12, released Mar 2021 -> time passed since release: 2 years + 6 months months

That means that the Parse SDK's support policy of 1 year is already on the lower end of the range. Unless there is a critical reason - which we would evaluate on a per-case basis - I would keep it at 1 year.

What we could do now is to open a PR that removes Dart 18 support (it's already >1 year old) and fix the wording in the support policy, which is the original issue opened.

@mbfakourii
Copy link
Member

In time terms:

  • Dart 2.18, released Aug 2022 -> time passed since release: 1 year + 1 month
  • Dart 2.12, released Mar 2021 -> time passed since release: 2 years + 6 months months

That means that the Parse SDK's support policy of 1 year is already on the lower end of the range. Unless there is a critical reason - which we would evaluate on a per-case basis - I would keep it at 1 year.

What we could do now is to open a PR that removes Dart 18 support (it's already >1 year old) and fix the wording in the support policy, which is the original issue opened.

Yes, it is a good suggestion

@mtrezza
Copy link
Member Author

mtrezza commented Oct 1, 2023

Would you want to do the honors? 🙂

@mbfakourii
Copy link
Member

mbfakourii commented Oct 2, 2023

Would you want to do the honors? 🙂

Sure 😃

I think I should change ci too

@mtrezza
Copy link
Member Author

mtrezza commented Oct 2, 2023

Yes, from the CI you'd remove Dart 2.18. And we should add Dart 3.1 compatibility. You could do this in 1 PR. The PR would be a feat PR because of the added Dart 3.1 compatibility, with a breaking change label because of the removal of Dart 2.18 compatibility.

@chadpav
Copy link

chadpav commented Oct 17, 2024

Great discussion!

It's interesting that I had a similar versioning issue with a different, but popular, package #1002 about 1 year later. All I'm saying is that there may be something to the Flutter community being new and evolving quickly that makes this discussion more interesting.

This issue resulted in me forking the Flutter SDK and fixing it locally. Later, I ended up realizing that I didn't need the functionality in the Flutter SDK and that the Dart SDK didn't have that dependency. So I switched packages. I even took the time to update the Flutter SDK package and submit a PR but was blocked due to the backward compatibility policy. It was the right call because we should respect the policies that we have in place. But in the end, I was frustrated and felt like I wasted several days on it.

Taking the other side I want to make a hypothetical argument. What would happen if we were to bump major versions of our SDK when backward compatibility breaks and keep up with the latest dependencies? If there were a critical bug on an older version of this SDK and a developer were stuck in maintenance mode they would be forced to patch an old release of the SDK or figure out a path forward through breaking changes?

We've seen at least two examples of the former. Would it be less pain to deal with the latter on an exceptional basis?

@mtrezza
Copy link
Member Author

mtrezza commented Oct 17, 2024

What would happen if we were to bump major versions of our SDK when backward compatibility breaks and keep up with the latest dependencies?

How would such a policy be clearly defined in practice, so that there are no discussions required in order to follow the policy? This is one important criteria, for efficiency and predictability. Currently it's clear; there is a simple time constraint on how long we support older Dart / Flutter SDKs.

If there were a critical bug on an older version of this SDK and a developer were stuck in maintenance mode they would be forced to patch an old release of the SDK or figure out a path forward through breaking changes?

We currently do not support LTS versions, so whatever issues occur in older versions are not considered. I don't see it viable for the Parse Flutter SDK in its current circumstances to introduce a LTS policy. Hats off to @mbfakourii for putting a lot of effort into contributing to the maintenance of this SDK. Adding LTS will significantly increase the required effort.

Great comment @chadpav, happy to revive this discussion.

@mtrezza mtrezza reopened this Nov 16, 2024
@mtrezza mtrezza pinned this issue Nov 16, 2024
@mtrezza
Copy link
Member Author

mtrezza commented Nov 16, 2024

@mbfakourii I've re-opened the issue and pinned it. Reason being that I'd like to review the policy since we've introduced it about a year ago.

We keep getting issue reports regarding dependency upgrades, and we sometimes have to reject them due to the support policy. For example:

Is the policy working and sensible as it is; should we improve anything?

@mbfakourii
Copy link
Member

Is the policy working and sensible as it is; should we improve anything?

I think considering the many issues, it is better to change the time from 1 year to 6 months.

Another point is that I did not see support policy in many packages in Dart and Flutter

Is support policy really needed for Dart and Flutter packages?

@mtrezza
Copy link
Member Author

mtrezza commented Nov 19, 2024

A support policy is simply making sure we have a consistent approach and don't need to initiate a discussion every time we need to make a choice. We can define the support policy as we see fit. If the philosophy of Dart and Flutter is that we always strive to support only the latest version of Dart and Flutter and its dependencies, and drop support for older versions at any time, we could define that as well (although that's not what I have found in my analysis). We just can't have a discussion then to suddenly keep supporting an older version for some arbitrary reason, instead we'd follow that policy.

@2shrestha22
Copy link

2shrestha22 commented Dec 20, 2024

I want to add my struggle with current policy. Previously it was with http package. Major package was already updated to latest http package but Parse SDK wasn't which was causing dependency issues. You may be asking why I need to upgrade. It's because I like to keep my app up-to-date and I have maintenance at the end of the month. I do upgrade, test and deploy each month so I don't have to deal with huge amount of changes Flutter ecosystem introduces later on.

Another issue I recently got when compiling my app for iOS 18 when using Firebase. There is an issue with iOS 18 and older Firebase plugin version. It just won't compile. Fix is to update the firebase plugin to latest version. But release cycle don't let me update it because of dependency of Parse SDK with lower version of dependencies.

There will be huge changes in 6 months of time span. Policies are made to make things in order but if it's breaking the system we should change the policy. Instead of sticking to policy we should be prioritizing developer issues.

@mtrezza
Copy link
Member Author

mtrezza commented Dec 20, 2024

What is your policy suggestion in context of the arguments made previously in this thread?

@2shrestha22
Copy link

2shrestha22 commented Dec 20, 2024

What is your policy suggestion in context of the arguments made previously in this thread?

I would say decrease the update time from 6 months to 3 where we do upgrade regularly every 3 months. Then we also take new issues into consideration. If someone reports a issue about dependency then we fix it immediately instead of waiting another 3 months.

@mtrezza
Copy link
Member Author

mtrezza commented Dec 20, 2024

If someone reports a issue about dependency then we fix it immediately instead of waiting another 3 months.

That sounds like a contradiction. Why wait 3 months, if we wait 0 when someone requests a dependency upgrade? The policy would then basically be, "upgrade every dependency as soon as possible". The reason why we didn't go with that is explained in #968 (comment). Please feel free to counter the argument made there.

@2shrestha22
Copy link

2shrestha22 commented Dec 20, 2024

No it's not a contradiction.

  1. Not everyone complain about dependency unless it's unsolvable or causing severe issue.
  2. After getting dependency upgrade issue we still can analyze the necessity.
  3. Why 3 months? If no one complains about dependency issue that doesn't mean we should not upgrade it regularly.

Doing so, we get both regular update every 3 months and still fix developer issues.

@mtrezza
Copy link
Member Author

mtrezza commented Dec 20, 2024

That sounds too arbitrary, why 3 months, why not 2 or 4? A complaint is not a technical basis for making a decision, it's just an unconditional action. That's the contradiction to the 3 months condition. It's also unclear how you define a complaint. What if someone opens an upgrade PR without technical necessity, or if an automated process open a PR as soon as a new version becomes available? Your suggestion is not addressing the arguments made previously, which give a reason for why the policy is currently as it is, based on an analysis of how other popular libraries support historic dart versions.

@2shrestha22
Copy link

2shrestha22 commented Dec 20, 2024

That sounds too arbitrary, why 3 months, why not 2 or 4? And complaint is not a technical basis for making a decision. Your suggestion is not addressing the arguments made previously, which give a reason for why the policy is currently as it is.

I think you are misunderstanding package dependency version with flutter SDK version. The comment in #968 (comment) is about SDK version. I am not complaining about it. It is the package dependency we need to resolve.

And why are you arguing on months 2 or 4? We should pick whatever considering both maintainer and Parse SDK user.

@mtrezza
Copy link
Member Author

mtrezza commented Dec 20, 2024

I think you are misunderstanding package dependency version with flutter SDK version.

As I understand it, these two are related to each other. The reason why we cannot upgrade some dependencies is because they increase the required min dart / flutter version which is higher than the dart / flutter version the Parse SDK is required to support according to its current support policy. See for example this comment. If a dependency can be upgraded without requiring to modify the SDK's dart / flutter version, then we can always do that. In fact, such dependencies should be upgraded as soon as possible for bug fixes and security. Our support policy currently doesn't define a hold-off time for that.

We should pick whatever considering both maintainer and Parse SDK user.

Whatever number we pick, it should have a factual basis on data. Otherwise 3 months is as good as 6 months. But again, to be clear, this issue here is not about "how long we wait until we upgrade a dependency", it's about "how long should the SDK support a dart / flutter version", which then defines - for some dependencies - the earliest date we can upgrade them.

@2shrestha22
Copy link

2shrestha22 commented Dec 20, 2024

You can not relate Dart/Flutter SDK with package dependency since every package depends on Dart SDK. Package maintainers do not need to change dart SDK constraints frequently since the constraint we get when creating a project is already enough. If I create a dart package now I will get SDK constraints >=3.4.3 <4.0.0 and the package is compatible with all dart version from 3.4.3 up to dart 4. However maintainer do update minimum dart version to make package compatible with latest changes in Dart or Flutter SDK. Before that they make sure new feature is stable and can be used in their package. And 1-2 months is more than enough for stability but we still waiting for 6 months.

Updating http, device_info_plus and web_socket_channels may not require any SDK constraints updates and does not break anything. I already have my app in production with latest packages. http package upgrade took months before it was merged. Developer are forced into trouble just for sake of policy even though it can be easily solved with regular updates.

@pastordee
Copy link
Contributor

I think as long as there's no breaking changes, we should be able to update the SDK, I think someone mentioned earlier, most update as long as it does not have any new future is for bugs and security update so as a developer it is good to keep up with these updates

@mtrezza
Copy link
Member Author

mtrezza commented Dec 20, 2024

If I create a dart package now I will get SDK constraints >=3.4.3 <4.0.0 and the package is compatible with all dart version from 3.4.3 up to dart 4.

How is that possible if dart 3.5.0, 3.6.0 and 3.7.0 each already contain breaking changes? In my understanding, the dart and flutter SDKs don't follow semver and breaking changes are introduced at a feature version level. That's why in our compatibility table we distinguish by feature version, and our CI tests the SDK for each version. In fact, I seem to remember that we had to make code adjustments in the past for the CI to pass for all these feature versions.

To recap the earlier comments in this thread and outline the chain of events:

  1. A developer "A" requires a dependency upgrade with an increased min. dart SDK version (not major version but feature version, e.g. 3.5.0 to 3.6.0),
  2. then the Parse SDK is required to increase its min. dart SDK version,
  3. then another developer "B" is required to increase the project dart SDK version if they want to upgrade to a newer Parse SDK version,
  4. then developer "B" is required to upgrade other dependencies where there are conflicts with transient dependencies,
  5. then developer "B" becomes developer "A" and the cycle repeats with (1).

Important that (3) and (4) apply to every developer who uses the Parse SDK, not just the developer who requests the dependency upgrade in (1). I believe I understand what the designers of the dart ecosystems intended, which seems to be to force developers and library maintainers into a continuous upgrade cycle. However, this creates the challenges we're faced with here. My interpretation of this is a fundamental flaw in the frequency in which dart introduces breaking changes (only ~2-3 months between releases) and the transient dependency management (only 1 single version of a dependency in a project). We can only try to mitigate that, and as we do, we're trying to balance the need of the developer in (1) vs. the effect on the developer in (3) and (4).

@2shrestha22
Copy link

  1. Developer requires dependency update when ParseSDK is already behind other packages.
  2. When we upgrade the dependency it will not create an issue but solves the issue.

All of this points to dependency issue. The only question is how we are trying to fix the dependency issue. Holding back upgrades is not helping at all.

@2shrestha22
Copy link

2shrestha22 commented Dec 20, 2024

At least we can try making ParseSDK compatible with other major packages and latest Flutter version. I never suggested to upgrade the package as soon as there is new version if you think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:meta Non-code issue
Projects
None yet
5 participants