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

feat(runtime): support already-existing shadow roots #5787

Closed
wants to merge 3 commits into from

Commits on May 28, 2024

  1. feat(runtime): support already-existing shadow roots

    This adds some checks when a Stencil component is booting up that will
    re-use a shadow root if the host element already has one, instead of
    just calling `this.attachShadow` in all cases.
    
    Additionally, Stencil's virtual DOM will now cleanly take over any
    elements which are already present in its root element when it first
    runs. This will allow it to re-use elements that were already created in
    the shadow root, as well as clean up any stray elements that shouldn't
    be there.
    
    Together these changes will allow the Stencil runtime to smoothly take
    over a shadow root which was created via a `<template>` tag in the
    page's HTML, i.e. via declarative shadow DOM (DSD).
    
    **NOTE** this _only_ enables the Stencil runtime to re-use a shadow root
    created via DSD, it does not add any support to Stencil for rendering
    a suitable `<template>...` HTML string.
    
    STENCIL-1316
    alicewriteswrongs committed May 28, 2024
    Configuration menu
    Copy the full SHA
    519a40f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    302f66f View commit details
    Browse the repository at this point in the history
  3. ok

    alicewriteswrongs committed May 28, 2024
    Configuration menu
    Copy the full SHA
    65b5fb8 View commit details
    Browse the repository at this point in the history