Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: Native lifecycle mixed mode #89
base: master
Are you sure you want to change the base?
RFC: Native lifecycle mixed mode #89
Changes from all commits
17e7327
33f79f7
55baff6
fe8ed69
127ceac
4b372a5
510956e
893a512
6b9df08
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we consider moving synthetic lifecycle into
@lwc/synthetic-shadow
? Seems like a reasonable fit that wouldn't cause disruption.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered conflating the two, but I thought it might be best to keep them separate so we can test them separately. Same deal with
@lwc/aria-reflection
(yet another polyfill, loaded by default in LEX).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to test them separately? Conflating the two would preclude an app from using
@lwc/synthetic-shadow
with default native lifecycle, but I wonder what the demand for such a configuration is.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I'm thinking that component authors may have more trouble with one than the other. In particular, it feels intuitively like it should be "easier" to move to native lifecycle than to native shadow. That said, we ideally want to move the needle on both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this – I'm not sure we can conflate the two together, because that would be potentially a breaking change for existing components that have
shadowSupportMode = 'native'
. Their timing would certainly change in native lifecycle.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the part that really makes me hesitate, but I don't see a way around it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nolanlawson Would it make sense to allow the customer to toggle the
lifecycleSupportMode
for an internal component?I'm thinking of something like base components that have high external customer usage.
Something like this:
This would allow internal components to move to native lifecycle but give customer an escape hatch in case of any incompatibilities.
The main drawback I can see is that the internal components would have to design for both synthetic and native lifecycles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I am thinking of it more like this:
This is almost exactly the same situation we have with
shadowSupportMode
BTW.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with this feature. Does it force the component to use native shadow regardless of its
shadowSupportMode
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it causes
@lwc/synthetic-shadow
to not be loaded at all.Our Jest plugin is kind of odd in that it assumes synthetic shadow by default, but allows you to opt-in to native shadow. That's not how
@lwc/engine-dom
works by default in most OSS cases.