Skip to content

[Custom Elements] Add a lazyDefine feature to explore a future spec proposal. #116

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

Closed
sorvell opened this issue May 30, 2019 · 2 comments
Closed
Assignees
Labels

Comments

@sorvell
Copy link
Collaborator

sorvell commented May 30, 2019

Add a feature that allows defining custom elements via a function that is only run when the first element is found to be customized. This potentially allows the code needed to upgrade the element to be fetched on demand.

Something like customElements.polyfillDefineLazy(name, classGenerator) where classGenerator is a function that returns a promise that resolves to a custom elements constructor function.

@sorvell sorvell self-assigned this May 30, 2019
sorvell referenced this issue in webcomponents/custom-elements May 31, 2019
Fixes #200 by adding customElements.polyfillDefineLazy(name, constructorGenerator) and adds a preferPerformance option.

The customElements.polyfillDefineLazy is an approximation of a potential spec feature to allow definitions to be processed lazily when the first element to customize is found. The constructorGenerator is a function that's invoked only the first time and element to customize is found. It can return an element constructor function or a promise that resolves to an element constructor function.
@dfreedm dfreedm transferred this issue from webcomponents/custom-elements Jun 7, 2019
@dfreedm dfreedm changed the title Add a lazyDefine feature to explore a future spec proposal. [Custom Elements] Add a lazyDefine feature to explore a future spec proposal. Jun 12, 2019
@dfreedm dfreedm added Severity: High Type: Feature New feature or request labels Jun 13, 2019
@stale
Copy link

stale bot commented Mar 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 11, 2021
@stale
Copy link

stale bot commented Mar 18, 2023

This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen!

@stale stale bot closed this as completed Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants