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

Remove dart:io's Platform.packageRoot and dart:isolate's Isolate.packageRoot APIs #47769

Closed
mit-mit opened this issue Nov 25, 2021 · 7 comments
Closed
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. breaking-change-request This tracks requests for feedback on breaking changes library-io library-isolate

Comments

@mit-mit
Copy link
Member

mit-mit commented Nov 25, 2021

The dart:io library contains a packageRoot API:

/// This returns `null`, as `packages/` directories are no longer supported.
///
@Deprecated('packages/ directory resolution is not supported in Dart 2')
static String? get packageRoot => null; // TODO(mfairhurst): remove this

Similarily in the isolate API:

/// The package root of the current isolate, if any.
///
/// This getter returns `null`, as the `packages/` directory is not supported
/// in Dart 2.
@Deprecated('packages/ directory resolution is not supported in Dart 2.')
external static Future<Uri?> get packageRoot;

As the deprecation comments state, this is not only deprecated but non-functional in Dart 2, and is hardcoded to return null. We should go ahead and remove it.

@mit-mit
Copy link
Member Author

mit-mit commented Nov 26, 2021

While the API doesn't currently work, removing the API is technically a breaking change, so tagging.

cc @devoncarew

@mit-mit mit-mit added the breaking-change-request This tracks requests for feedback on breaking changes label Nov 26, 2021
@mit-mit mit-mit changed the title dart:io Remove packageRoot API dart:io Remove Platform.packageRoot and Isolate.packageRoot APIs Nov 26, 2021
@mit-mit mit-mit changed the title dart:io Remove Platform.packageRoot and Isolate.packageRoot APIs Remove dart:io's Platform.packageRoot and dart:isolate's Isolate.packageRoot APIs Nov 26, 2021
@lrhn lrhn added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io library-isolate labels Nov 29, 2021
@mit-mit
Copy link
Member Author

mit-mit commented Nov 29, 2021

@devoncarew
Copy link
Member

@bwilkerson - would dart fix help at all here? Is there any useful guidance we can have for deleted APIs - does flutter have any similar situations?

@mit-mit
Copy link
Member Author

mit-mit commented Dec 1, 2021

I don't think we need to spend any more time here -- I'm fairly sure there is a very minimal risk. Even pub has supported package directories for more than two years: dart-lang/pub#1960

copybara-service bot pushed a commit that referenced this issue Dec 7, 2021
Bug: #47769
Change-Id: I1cbd7761e7119c07f2697d7624bec703ba4c4641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221340
Reviewed-by: Lasse Nielsen <[email protected]>
Commit-Queue: Michael Thomsen <[email protected]>
@mit-mit
Copy link
Member Author

mit-mit commented Dec 7, 2021

Fixed in 71e3dac

@mit-mit mit-mit closed this as completed Dec 7, 2021
@zanderso
Copy link
Member

zanderso commented Dec 9, 2021

This change is breaking the Dart roll into Flutter. See flutter/engine#30231.

@mit-mit
Copy link
Member Author

mit-mit commented Dec 9, 2021

Sorry about that; PR to roll Engine is flutter/engine#30236. Framework was already prepared in flutter/flutter#94603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. breaking-change-request This tracks requests for feedback on breaking changes library-io library-isolate
Projects
None yet
Development

No branches or pull requests

4 participants