Refactor native lifecycle to make it better reflect reality, by making it all-or-nothing rather than API versioned.
We attempted to ship native lifecycle via API versioning in 250, but we ended up having to revert it due to various breakages, including issues when components of different API versions (and thus lifecycle modes) are composed together: #4248.
The reality is this:
Native lifecycle is globally disabled on the Lightning Platform
Elsewhere, native lifecycle is the default unless you flip lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE to true – then it's globally disabled
This PR makes our code better reflect this reality by detaching native lifecycle from the API versioning code, and making the DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE flag all-or-nothing.
Does this pull request introduce a breaking change?
😮💨 No, it does not introduce a breaking change.
Technically yes, but only if an OSS consumer is using the apiVersion option in the compiler to pin to an older version, which nobody should be doing. The apiVersion option is intended to be used only on the Lightning Platform.
Does this pull request introduce an observable change?
Details
Refactor native lifecycle to make it better reflect reality, by making it all-or-nothing rather than API versioned.
We attempted to ship native lifecycle via API versioning in 250, but we ended up having to revert it due to various breakages, including issues when components of different API versions (and thus lifecycle modes) are composed together: #4248.
The reality is this:
lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE
to true – then it's globally disabledThis PR makes our code better reflect this reality by detaching native lifecycle from the API versioning code, and making the
DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE
flag all-or-nothing.Does this pull request introduce a breaking change?
Technically yes, but only if an OSS consumer is using the
apiVersion
option in the compiler to pin to an older version, which nobody should be doing. TheapiVersion
option is intended to be used only on the Lightning Platform.Does this pull request introduce an observable change?