-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Why createMetaResolver ignores object for instance polyfills #193
Comments
@nicolo-ribaudo could I ping you for an opinion here? Just wondering if my logic is wrong before I go implementing it with the assumption in my OP. |
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using
@babel/helper-define-polyfill-provider
with a simple custom plugin to inject various polyfills for an application. In the documentation forcreateMetaResolver
, it's noted:I understand that, but I'm wondering if completely ignoring it is the best approach considering it's not always impossible to determine the object. And in those cases, it seems the resolver should not return a polyfill if the object does not match the desired prototype, which would save some unnecessary injections.
By ignoring it, a provider has to manually do this for example, by adding the desired object to the resolve data and then something like:
Or is that a bad idea? Although it seems like the Core JS providers already do something like this in a more roundabout way?
If I'm way off base here, please explain and feel free to close this. Otherwise I guess consider it a feature request for an API improvement.
The text was updated successfully, but these errors were encountered: