Skip to content

lazy DCE load facade #81

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

Open
sashafirsov opened this issue Mar 18, 2025 · 0 comments
Open

lazy DCE load facade #81

sashafirsov opened this issue Mar 18, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@sashafirsov
Copy link
Member

idea from: WICG/webcomponents#782
The DCE would be initialized only on actual tag use.

load-on attribute

accept values:

  • declare or default value would load during declaration, disregarding of use
  • use would create a facade which would load DCE when it is actually used. Of course only once.

facade pattern

would:

  • register the tag, DCE source, fallback DOM as a payload.
  • on tag appearance, render the fallback content
  • initiate the DCE loading
  • once loaded, replace the content

Advanced phases:

  • payload would have multiple slots.
  • default slot is shown immediately
  • progress is shown when DCE is started to load but does not have a rendered content yet
  • error - for whatever error reason
  • load-error when DCE sources are not available
<custom-element scr="mod" tag="my-tag" load-on="use">
    <template>
        <slot> Wait my-tag to be loaded ... </slot>
        <slot name="error"> my-tag load error </slot>
    </template>
</custom-element>
@sashafirsov sashafirsov added the enhancement New feature or request label Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant