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 ability to define importMeta on hybrid elements. Fixes #5163 #5180

Merged
merged 4 commits into from
Apr 6, 2018

Conversation

kevinpschaaf
Copy link
Member

After this change, hybrid elements defined in ES modules using legacy API can ensure a correct importPath as follows:

Polymer({
  ...
  importMeta: import.meta
});

This change also removes the default static get importMeta() implementation, for better compatibility with defining element metadata using (compiled) static class fields.

Reference Issue

Fixes #5163

Copy link
Member

@dfreedm dfreedm left a comment

Choose a reason for hiding this comment

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

LGTM with nit

* passed to `Polymer({...})`) to the static API.
*
* @return {!Object} The `import.meta` object set on the prototype
* @suppress {missingProperties}
Copy link
Member

Choose a reason for hiding this comment

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

Please add reasoning.

`this` is always in the instance in closure for some reason.

@kevinpschaaf
Copy link
Member Author

cc @aomarks @justinfagnani Support for import.meta injection in legacy API

@kevinpschaaf kevinpschaaf merged commit 0d8b34e into master Apr 6, 2018
@TimvdLippe TimvdLippe deleted the 5163-kschaaf-importMeta-legacy branch April 9, 2018 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants