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

Fix: whenPolyfillLoaded #851

Merged
merged 1 commit into from
Oct 15, 2019

Conversation

clementlemarc-certua
Copy link
Contributor

Check that polyfill are not already loaded and that we are not waiting on an event that has already been emitted.

Check that polyfill are not already loaded
@CLAassistant
Copy link

CLAassistant commented Oct 15, 2019

CLA assistant check
All committers have signed the CLA.

@pskelin pskelin merged commit d5e19f6 into SAP:master Oct 15, 2019
@pskelin
Copy link
Contributor

pskelin commented Oct 15, 2019

@clementlemarc-certua great find and thanks for the contribution!

@pskelin
Copy link
Contributor

pskelin commented Oct 15, 2019

@clementlemarc-certua I looked a bit deeper in the polyfill loader and this actually shouldn't be an issue.

In the original loader, executing waifFor with a callback as parameter, the callback is executed even if the polyfill is already loaded.
https://github.com/webcomponents/polyfills/blob/2894514944ff8ceff3a45c1f34681b851977dea1/packages/webcomponentsjs/webcomponents-loader.js#L94-L101

Could you describe your use case and why the waitFor callback is not being called? How are you loading the polyfill and which version?

@clementlemarc-certua
Copy link
Contributor Author

A ui5 web component was integrated in a lib (using rollup). The lib was loaded when receiving the WebComponentsReady event. I checked the webcomponents we're getting and it should actually work.

I will dig on my side, I feel like someone did something wrong in our project and messed this up 🙄

Sorry about that and for the not required fix 😞, although it does avoid calling waitFor

@clementlemarc-certua clementlemarc-certua deleted the fix-whenPolyfillLoaded branch October 15, 2019 12:47
@pskelin
Copy link
Contributor

pskelin commented Oct 15, 2019

No worries, we are always glad to see actual use cases that we did not think about. Feel free to get back if you find anything interesting.

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.

3 participants