Skip to content

Conversation

@DanTup
Copy link
Member

@DanTup DanTup commented Sep 10, 2024

This adds two new fields to DartCapabilities for isUnsupportedNow and isUnsupportedSoon to determine whether to warn the user about unsupported SDKs. This is a necessary step before we can remove any legacy code (such as the legacy analysis server integration, or activating DevTools from pub!).

We always do the SDK check against the Dart SDK version, but if the current Dart SDK comes from Flutter, we will reference "Flutter" and its SDK version in the user-facing messages.

"Unsupported now" messages will always be shown as the intention is that the user will either upgrade their SDK or switch to an older extension.. this may seem annoying, but the extension will be broken in many ways when using an SDK that triggers this, so ignoring it is not an option - you must upgrade SDK or switch to an older extension.

"Unsupported soon" messages will be shown only until dismissed the first time (clicking "More Info" counts as dismissing), but this is tracked by major+minor versions, so dismissing for Dart 2.0 would not prevent seeing the message again in future for 3.0.

Currently looks like this (version number is just the SDK I was testing with, ofc):

Screenshot 2024-09-10 175404

Screenshot 2024-09-10 175318

Where it says "Flutter SDK" and shows a Flutter SDK version number will be "Dart SDK" if the selected SDK is a standalone Dart SDK.

TODO Before Merging

@jwren @helin24 @itsjustkevin

@helin24
Copy link
Contributor

helin24 commented Sep 10, 2024

The text LGTM.

I'm curious what the matrix of supported extension and SDK versions will look like. What is reasonable to say for extensions prior to the one where we will discontinue support for v3.25 and earlier? "All SDK versions?"

@DanTup
Copy link
Member Author

DanTup commented Sep 10, 2024

I'm curious what the matrix of supported extension and SDK versions will look like. What is reasonable to say for extensions prior to the one where we will discontinue support for v3.25 and earlier? "All SDK versions?"

(note: 3.25 was just the current Flutter SDK version I was testing with and isn't due to become unsupported, it's only currently on master 😄 specific versions haven't been published yet)

But it's a good question that I've been wondering myself. I feel like the goal of this information is that a user knows they are on SDK version x and they basically want to know "what version of the extension must I downgrade to for this SDK to fully work?". I don't think we need to track complete version ranges for each (I don't think there's much value in knowing the oldest version of an extension that supports a given SDK, only the newest), so we could just record the final extension version before we consciously remove something that prevents an older SDK from working.

So maybe some table like this (version numbers are just made up here, notes in italic just for explanation):

Dart SDK Flutter SDK Dart Extension
v0.1 - v0.9 Supported until Dart extension 1.10 (1.11 removed X which SDK <= v0.9 needs)
v1.0 - v1.11 v1.0 - v1.8 Supported until Dart extension 2.3 (2.4 removed Y Dart SDK <= v1.11 needs)
v1.12 - v2.4 v1.9 - v2.1 Currently supported

The first column is a non-overlapping set of ranges of the Dart SDK, the second column is the matching Flutter SDKs, and the final column is basically "the newest extension you can use and expect it to work correctly with this SDK". So if you're stuck on an old SDK, you find the row that contains that SDK version, then roll back to the noted version of the extension.

I'm interested in opinions/suggestions though :-)

@helin24
Copy link
Contributor

helin24 commented Sep 11, 2024

My main concern is that in the IntelliJ plugin, I'm not aware of us having made any decisions to stop supporting particular features from old SDKs, and at the same time we haven't been running tests to ensure compatibility with old SDKs. So the chart isn't going to be meaningful until after a round of removing support. I suppose our chart could look like:

Flutter SDK Flutter IntelliJ plugin
<v3.0 Supported until 83.0 (whatever version coming in Nov)
3.1+ Continuing support

@DanTup
Copy link
Member Author

DanTup commented Sep 11, 2024

So the chart isn't going to be meaningful until after a round of removing support. I suppose our chart could look like:

Yep, the VS Code one might end up being just as sparse initially (depending on how easily I can get old data). But I think that is still useful, because for someone on < Flutter SDK 3.0 (for your example), they know that 83 is the latest plugin they can use.

The table will grow over time (and the lack of specifics for the oldest SDKs probably matters less), but I think the important thing is (at least for VS Code... I'm not sure using old plugins for IntelliJ is as straight-forward) that if a user gets a "Your SDK is no longer supported" message, they have some easy way to know what plugin version does support their SDK if they're unable to update it.

@helin24
Copy link
Contributor

helin24 commented Sep 11, 2024

Okay, that sounds good. I feel like perhaps there's a better word than "supported" to convey "In theory supported, but older versions of SDK probably fail in unpredictable ways" 😆

@DanTup
Copy link
Member Author

DanTup commented Sep 11, 2024

I feel like perhaps there's a better word than "supported" to convey "In theory supported, but older versions of SDK probably fail in unpredictable ways" 😆

Yeah, maybe we can come up with something better, or just start the table from a slightly more recent SDK (instead of <) that we spend a little time testing against that version of the plugin before we (deliberately) drop support for some versions.

…rted (or will be soon)

This adds two new fields to `DartCapabilities` for `isUnsupportedNow` and `isUnsupportedSoon` to determine whether to warn the user about unsupported SDKs.

We always do the SDK check against the Dart SDK version, but if the current Dart SDK comes from Flutter, we will reference "Flutter" and its SDK version in the user-facing messages.

"Unsupported now" messages will always be shown as the intention is that the user will either upgrade their SDK or switch to an older extension.. this may seem annoying, but the extension will be broken in many ways when using an SDK that triggers this, so ignoring it is not an option - you must upgrade SDK or switch to an older extension.

"Unsupported soon" messages will be shown only until dismissed the first time (clicking "More Info" counts as dismissing), but this is tracked by major+minor versions, so dismissing for Dart 2.0 would not prevent seeing the message again in future for 3.0.
@DanTup DanTup force-pushed the add-unsupported-sdk-support branch from 0a3ea8a to 96dd4df Compare September 24, 2024 09:57
@DanTup
Copy link
Member Author

DanTup commented Sep 24, 2024

Based on the announcement at https://groups.google.com/g/flutter-announce/c/JQHzM3FbBGI:

Starting with the release of Dart 3.6, we will deprecate support for Dart SDK versions older than 3.0

I've updated this to consider Dart SDKs before 3.0 as "unsupported soon" (that is, they will show a warning that only appears until the user interacts with it once, then it won't be shown again) and I will merge this PR once Dart 3.6 releases (so the warning will begin showing up with the next Dart-Code release after then).

I've added a basic page to https://dartcode.org/sdk-version-compatibility/ with a table as noted above, and linked the "More Info" button in the notification to that page (which also contains a link to the flutter-announce post).

The notification (when using a 2.19 Dart SDK) looks like this:

Screenshot 2024-09-24 110530

@jwren @itsjustkevin please let me know if this (including the text here and in the original screenshots at the top, which includes text for when the SDK support is removed - which will happen around the Dart 3.7 release for < 3.0) all looks reasonable to you or if we should change before this merges (which won't be until Dart 3.6 releases).

@DanTup DanTup added this to the On Deck milestone Sep 24, 2024
@itsjustkevin
Copy link

Thanks @DanTup LGTM!

Copy link
Member

@jwren jwren left a comment

Choose a reason for hiding this comment

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

LGTM, we'll coordinate in coming weeks to synchronize IJ and VS Code here.

@DanTup DanTup modified the milestones: On Deck, v3.100.0 Oct 8, 2024
This allows merging the branch and including the code changes in a pre-release in advance of this being enabled.
@DanTup
Copy link
Member Author

DanTup commented Oct 8, 2024

I've removed the version number from here so I can merge this PR now (without the notification showing up to pre-release users if I push a pre-release build), and have opened #5304 for the current milestone to put it back prior to shipping.

That means, with the next release (somewhere around the end of this month / start of next month) we'll begin showing the notification.

@DanTup DanTup merged commit b06851a into master Oct 8, 2024
@DanTup DanTup deleted the add-unsupported-sdk-support branch October 8, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants