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

refactor: simplify UpgradableConstructor use of native lifecycle callbacks #3862

Merged
merged 2 commits into from
Nov 17, 2023

Conversation

jmsjtu
Copy link
Member

@jmsjtu jmsjtu commented Nov 16, 2023

Details

Fixes #3818.

This PR removes the WeakMap that stores the lifecycle methods for formAssociated lifecycle methods which improves performance by ~18%.

Does this pull request introduce a breaking change?

  • ✅ No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • ✅ No, it does not introduce an observable change.

@jmsjtu jmsjtu requested a review from a team as a code owner November 16, 2023 19:09
formStateRestoreCallback = (elm: HTMLElement) => {
runFormStateRestoreCallback(elm);
};
setLifecycleCallbacks({
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is a global setting, can we do this one time only instead of in each createElement invocation.

@jmsjtu jmsjtu requested a review from a team November 16, 2023 23:54
@jmsjtu jmsjtu changed the title perf: use setter for lifecycle callbacks in UpgradeableConstructor refactor: simplify UpgradableConstructor use of native lifecycle callbacks Nov 16, 2023
@jmsjtu jmsjtu merged commit 647275a into master Nov 17, 2023
9 checks passed
@jmsjtu jmsjtu deleted the jtu/face-fix branch November 17, 2023 18:31
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.

Simplify UpgradableConstructor use of native lifecycle callbacks
3 participants