-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[breaking change] Make dart:io
Platform
abstract
#52444
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
SGTM – although deferring to @mit-mit |
I'm a bit confused about the timeline as the Mitigation section mentions both 3.1 and 3.2. Can you clarify @brianquinlan ? |
As far as I can tell this doesn't impact ACX or our customers. Can we run a global presubmit to validate? |
I was hoping to deprecate the But @timsneath suggested that Dart 3.2 is too aggressive so we can push that out to... when? I don't know what our policy is here. |
I suggest a few more releases in between deprecation and the following change. |
lgtm - let's go forward with marking deprecated If we're conservative, we'd give a year. We can decide whether we want to pull that forward. |
We generally seem to use |
@brianquinlan I would like to mark this as approved, could you respond the question by @grouma above so we can clear this up? |
I'm fine waiting a year to actually do the removal. We did the deprecation in Dart 3.1.0 (released August 16, 2024) so I'll make a note to remove this around August 2024
We can consider that in a year - but hopefully by then people will have reacted to the deprecation ;-) |
Bug:#52444 Change-Id: Ia4f98162f2b60d23c27ed9d8f78f70d308785650 CoreLibraryReviewExempt: landing previously-approved change Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379740 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Brian Quinlan <bquinlan@google.com>
Change Intent
Add the
abstract
class modifier to thedart:io
Platform
class.Justification
Platform
only hasstatic
properties so there is no reason to make instances of it.Impact
All code that constructs
Platform
(i.e.Platform()
) will break. There is one known pattern where this is done:package:dcli
implements a non-static extension onPlatform
to allow users to get the line ending for the platform i.e.Platform().eol;
Mitigation
In Dart 3.1:
Platform
is deprecated.Platform
contains alineTerminator
property that obviates the need for the extension inpackage:dcli
.Before we mark
Platform
asabstract
, I will remove theextension
frompackage:dcli
and give users some time to update their dependencies. Making the change in Dart 3.2 would give users an approximately 6 week period to update their dependencies and code.The text was updated successfully, but these errors were encountered: