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-dom): support mount app on ShadowRoot #2447

Merged
merged 2 commits into from
Dec 4, 2020

Conversation

unbyte
Copy link
Contributor

@unbyte unbyte commented Oct 20, 2020

close #2399

packages/runtime-dom/src/index.ts Outdated Show resolved Hide resolved
if (isString(container)) {
const res = document.querySelector(container)
if (__DEV__ && !res) {
warn(`Failed to mount app: mount target selector returned null.`)
}
return res
}
if (container instanceof ShadowRoot) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mode: 'closed' doesn't actually prevent Vue from mounting to it (see https://blog.revillweb.com/open-vs-closed-shadow-dom-9f3d7427d1af) so this whole check is unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no in-depth study yet, but at least input can't work
https://codepen.io/unbyte/pen/XWKjaVO?editors=1010

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know why now. It's a regression of Vimium, an extension that I enabled in my browsers. philc/vimium#853

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I wonder if warnings should be retained so that developers can be aware that some of the problems may be caused by the closed shadow root, for what the user side is using is beyond developers' control

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.

Allow mounting an app to a ShadowRoot
2 participants