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

rfc: mixed shadow mode #49

Merged
merged 16 commits into from
Aug 30, 2021
Merged

rfc: mixed shadow mode #49

merged 16 commits into from
Aug 30, 2021

Conversation

ekashida
Copy link
Member

No description provided.

text/0000-mixed-shadow-mode.md Outdated Show resolved Hide resolved
text/0000-mixed-shadow-mode.md Outdated Show resolved Hide resolved
text/0000-mixed-shadow-mode.md Outdated Show resolved Hide resolved
text/0000-mixed-shadow-mode.md Outdated Show resolved Hide resolved
text/0000-mixed-shadow-mode.md Show resolved Hide resolved
text/0000-mixed-shadow-mode.md Outdated Show resolved Hide resolved
text/0000-mixed-shadow-mode.md Outdated Show resolved Hide resolved
@ekashida ekashida force-pushed the ekashida/mixed-shadow-mode branch from 84e22eb to 7b83394 Compare June 3, 2021 04:20
Copy link
Contributor

@caridy caridy left a comment

Choose a reason for hiding this comment

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

LGTM, but the question around inspection time vs creation time is still a big one for me, let's resolve that before we merge this.

@nolanlawson
Copy link
Contributor

nolanlawson commented Jun 16, 2021

A question that came up today is what to do about lwc:dom="manual" restrictions (e.g. cannot call div.appendChild() unless the div is in manual mode). It seems to me that mixed mode should continue enforcing these, even for components that are running in native mode, because we don't want component authors to deliberately break compat with synthetic shadow.

If @lwc/synthetic-shadow is never loaded though (100% native), then these restrictions don't need to be enforced IMO.

@pmdartus
Copy link
Member

If @lwc/synthetic-shadow is never loaded though (100% native), then these restrictions don't need to be enforced IMO.

There is currently no guarantee that @lwc/synthetic-shadow will never be loaded. I think once we are further down the process of deprecating synthetic shadow DOM we should start removing those restrictions. Existing components will keep working but we won't surface the error when lwc:dom="manual" isn't set.

@ekashida ekashida changed the title feat: rfc for mixed shadow mode rfc: mixed shadow mode Jun 22, 2021
text/0000-mixed-shadow-mode.md Show resolved Hide resolved
text/0000-mixed-shadow-mode.md Outdated Show resolved Hide resolved
Copy link
Contributor

@caridy caridy left a comment

Choose a reason for hiding this comment

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

I think this RFC is very complete, solid piece. I still disagree with the approach of forcing leaf components to opt-in in order for higher level components to be able to opt-in, but I will not block this on the basis that this can be changed later on.

@nolanlawson
Copy link
Contributor

@caridy

I still disagree with the approach of forcing leaf components to opt-in in order for higher level components to be able to opt-in

I think there may be some confusion; I'm pretty sure @ekashida and I agreed that they don't need to opt-in. Just that forcing children and grandchildren into native shadow may cause breakages if there are incompatibilities.

@caridy
Copy link
Contributor

caridy commented Aug 26, 2021

@nolanlawson I was referencing to what I read in the last paragraph of adoption strategy:

When setting shadowSupportMode to any, it will be the responsibility of the component author to ensure that all components in the subtree are compatible with native Shadow DOM. Due to the nature of this feature, it is expected that initial usage will start at the leaf components and work its way up the component tree. If a component in the subtree does not support native Shadow DOM, the component author should work with the other component author to make the appropriate updates.

Maybe the word "ensure" is the problem there, it is not clear that it means they must use "any", or just to "test" them to be "confident" that they indeed work. I was surprise that it wasn't mentioned anywhere in the doc, so it might very well be what you said, and that there is no problem at all.

@nolanlawson
Copy link
Contributor

@caridy Yeah, you're right, it's ambiguous. Also arguably if you're going to the trouble of working with those leaf-component teams to make them work properly in native shadow, then they might as well switch from default to any. (Native-within-synthetic is allowed, so they might as well opt for the faster native mode.)

I guess the subtlety here is that "transitivity" is not going to wait around for an explicit signal from leaf nodes. I don't think this needs to be solved in this RFC, but we'll probably have to figure out how to message this properly.

@ekashida ekashida merged commit a9059ef into master Aug 30, 2021
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.

5 participants