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

Add back check for invalid core library imports #2783

Merged
merged 4 commits into from
Jan 10, 2024

Conversation

parlough
Copy link
Member

@parlough parlough commented Jan 4, 2024

93dc547 simplified import handling but no longer reported invalid Dart core library imports. Since then I've seen a few cases of people posting DartPad screenshots trying to use VM-only libraries.

To prevent any confusion, this PR reintroduces checks and reports warnings if a user tries to import a core library that won't work.

It also introduces support for indicating a core web library as deprecated. For now this only includes dart:js, but likely will expand to dart:html and dart:js_util in the future. It doesn't include the other web libraries like dart:web_gl, dart:web_audio, etc since they are already resulting in errors in the DartPad frontend.

@parlough parlough requested a review from devoncarew January 5, 2024 17:35
Copy link
Member

@devoncarew devoncarew left a comment

Choose a reason for hiding this comment

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

Thanks! I didn't realize we'd regressed the behavior wrt dart:io imports.

@parlough parlough merged commit 982b94f into main Jan 10, 2024
6 checks passed
@parlough parlough deleted the fix/core-library-usage-warnings branch January 10, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants