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

Tighten/simplify implementation of HoistModel.componentProps #3883

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

lbwexler
Copy link
Member

@lbwexler lbwexler commented Dec 31, 2024

  • Fix difficult bug with re-render loops.
  • Avoid mobx object/proxy object creation for models that don't use this property
  • Avoid extra prop processing for linked models that don't use this property

Hoist P/R Checklist

Pull request authors: Review and check off the below. Items that do not apply can also be
checked off to indicate they have been considered. If unclear if a step is relevant, please leave
unchecked and note in comments.

  • Caught up with develop branch as of last change.
  • Added CHANGELOG entry, or determined not required.
  • Reviewed for breaking changes, added breaking-change label + CHANGELOG if so.
  • Updated doc comments / prop-types, or determined not required.
  • Reviewed and tested on Mobile, or determined not required.
  • Created Toolbox branch / PR, or determined not required.

If your change is still a WIP, please use the "Create draft pull request" option in the split
button below to indicate it is not ready yet for a final review.

Pull request reviewers: when merging this P/R, please consider using a squash commit to
collapse multiple intermediate commits into a single commit representing the overall feature
change. This helps keep the commit log clean and easy to scan across releases. PRs containing a
single commit should be rebased when possible.

- Fix difficult bug with re-render loops.
- Avoid mobx object/proxy object creation for models that don't use this property
- Avoid extra prop processing for linked models that don't use this property
@lbwexler lbwexler requested a review from ghsolomon December 31, 2024 19:11
@lbwexler lbwexler linked an issue Dec 31, 2024 that may be closed by this pull request
@ghsolomon
Copy link
Contributor

Nice cleanup!

@lbwexler lbwexler merged commit 9ebd5a4 into develop Dec 31, 2024
2 checks passed
@lbwexler lbwexler deleted the tightenComponentProps branch December 31, 2024 19:19
@amcclain
Copy link
Member

amcclain commented Jan 2, 2025

I am sure this is a great cleanup, but admit I don't really understand it.

Were we previously doing the apply and delete checks on the singular _componentProps object to trigger reactions to the proxied observable?

To put it another way, we had/still have the comment on the getter:

Observability is based on a shallow computation for each prop (i.e. a reference change in any particular prop will trigger observers to be notified).

Is it correct to say that the @computed({equals: comparer.shallow}) annotation is now making that the case? Was that the "extra processing" referenced by:

Avoid extra prop processing for linked models that don't use this property

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.

Component prop marked as observable.ref can cause performance issues
3 participants