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

fix(engine-dom): use native lifecycle callbacks #3904

Merged
merged 10 commits into from Jan 17, 2024

Conversation

nolanlawson
Copy link
Contributor

@nolanlawson nolanlawson commented Dec 13, 2023

Details

BREAKING CHANGE: Use native custom element lifecycle for API version >=61.

Fixes #3198. New version of #3662. The umpteenth attempt to land this thing.

Does this pull request introduce a breaking change?

  • 🚨 Yes, it does introduce a breaking change.

All details are catalogued in #3662. The only difference this time is that this is for API version 61 rather than 60.

Does this pull request introduce an observable change?

  • ⚠️ Yes, it does include an observable change.

See above.

@nolanlawson nolanlawson requested a review from a team as a code owner December 13, 2023 00:44
@nolanlawson nolanlawson added this to the 6.0.0 milestone Dec 13, 2023
packages/@lwc/engine-core/src/framework/rendering.ts Outdated Show resolved Hide resolved
packages/@lwc/engine-core/src/framework/vm.ts Show resolved Hide resolved
Comment on lines +46 to +49
// When in native lifecycle mode, we need to keep track of instances that were created outside LWC
// (i.e. not created by `lwc.createElement()`). If the element uses synthetic lifecycle, then we don't
// need to track this.
nativeLifecycleElementsToUpgradedByLWC.set(this, elementBeingUpgradedByLWC);
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was pleased that I was able to do this with just one Map!

Co-authored-by: James Tu <jmsjtu@gmail.com>
@jmsjtu jmsjtu merged commit 3235744 into master Jan 17, 2024
9 checks passed
@jmsjtu jmsjtu deleted the nolan/native-lifecycle-for-real-this-time branch January 17, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use native connectedCallback/disconnectedCallback lifecycle hooks
2 participants