-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve DependencyDescriptor
to combine import_assertions
with dynamic_import_assertions
#3137
Comments
In addition I had second thoughts about letting individual keys be unknown, instead of just requiring that the whole object is a simple literal or set as unknown. That would make it much less annoying to unwrap We could just use an struct DependencyDescriptor {
/// Import assertions. Set as `None` for dynamic imports whose assertions are not statically analyzable.
pub import_assertions: Option<HashMap<String, String>>,
} |
@nayeemrmn I think it might be useful to still have all the detail, but to make it easy to use the API for common cases perhaps we could add helper methods instead? So maybe something like: impl ImportAssertions {
pub fn get(&self, key: &str) -> Option<&String> {
// ...
}
} ...then we can just make it |
By the way, @nayeemrmn would you be willing to make this change? If not, I will get to it within a few days. |
I'm starting work on this. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Describe the feature
The type of
DependencyDescriptor
is error prone because it does not force you to check the correct value:Instead it would be better to do something along the lines of:
Babel plugin or link to the feature description
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: