-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Dart experiment to remove (or hide) dart:html
and friends from included libraries
#54347
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
dart:html
and friends from included librariesdart:html
and friends from included libraries
For what it's worth, we have a dart2js flag I'll start the triage here first by asking a few questions: For the @dart-lang/language-team: is it possible to use experiment flags and language versioning to hide a library? For the analyzer team: if not, are there mechanisms to enable/disable an SDK library from being available in the analysis server? |
I didn't think about The big win I see for developers is mostly in analysis errors and especially less noisy completion suggestions :) |
You can also use the import_path package to check for imports to any library (such as
|
/cc @bwilkerson , @scheglov |
It might be nice to make it more general than this - why can't I pick which specific I've previously also wondered whether the Dart SDK could include
That could allow things to be shipped in the Dart SDK without being automatically available to projects (for example allowing other packages to use the same names without completion lists being full of duplicates). For example IIRC in flutter_tools it's forbidden to use |
Closing in favor of #54610 which implemented not surfacing For determining outdated usages during compile, you can use Thanks all. |
It would be super cool to have an experiment (that can be used with
--enable-experiment
) or some other mode/common flag that removes (or hides)dart:html
,dart:svg
,dart:js
,dart:js_util
, etc. from the supported/surfaced SDK libraries. So I suppose it would load a different SDK overview file?This would allow the analyzer and compilers to catch usages of the old libraries in your package and dependencies (sure, can be partially done by compiling with
dart2wasm
).Perhaps more importantly though, the analyzer could avoid surfacing those libraries in completion suggestions, greatly improving the developer experience of those using modern interop functionality.
It would be a useful step towards migration that could be enabled relatively soon due to the lack of guarantees around experiments.
The text was updated successfully, but these errors were encountered: