Skip to content

feat(): add forceShadowDom config option - this will disable scoped fallback in IE - #2031

Closed
schadenn wants to merge 1 commit into
stenciljs:mainfrom
schadenn:master
Closed

schadenn wants to merge 1 commit into
stenciljs:mainfrom
schadenn:master

Conversation

@schadenn

Copy link
Copy Markdown

Hi all,

this might not be the cleanest solution as I guess there's a lot of code being shipped for the scoped fallback even though you disable using it, but it's a quick fix and works together with @webcomponents/webcomponentsjs.

Related to #2012 and various other IE issues that exist using the scoped fallback.

@arielsalminen

Copy link
Copy Markdown
Contributor

Yes, please! Do you need any help so that we could get this merged in?

@schadenn

Copy link
Copy Markdown
Author

Actually I'm not sure if this PR has a real value as you could just "dirty hack" Stencil into ShadowDom mode by doing this before your component bundle loads:

if (!document.documentElement.attachShadow) {
  document.documentElement.attachShadow = true;
} 

That way the Stencil ShadowDom check will pass and you'll be able to try the webcomponent polyfills for shadow: true components.

To make this an actual feature of Stencil it would be cleaner to actually remove the "scoped fallback code" (I'm not sure what exactly this includes) from the bundle if forceShadowDom: true.

@schadenn
schadenn requested a review from a team October 6, 2021 16:35
@rwaskiewicz

Copy link
Copy Markdown
Member

I apologize that someone on the team never responded to this PR. Since its original creation, Stencil has dropped support for IE (as of Stencil v4). As a result, we no longer support browsers that do not support shadow DOM. I'm going to close this out, but wanted to thank you for putting for the effort here and again apologize for the lack of response here. If you have any questions, please feel free to reach out.

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