-
Notifications
You must be signed in to change notification settings - Fork 322
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
Migrate from mobx-react to mobx-react-lite / Removed mobx-utils Dependency #17759
Merged
nijil-deriv
merged 8 commits into
deriv-com:master
from
heorhi-deriv:mobx-multiple-instances-fix
Dec 30, 2024
Merged
Migrate from mobx-react to mobx-react-lite / Removed mobx-utils Dependency #17759
nijil-deriv
merged 8 commits into
deriv-com:master
from
heorhi-deriv:mobx-multiple-instances-fix
Dec 30, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Pull Request Test Coverage Report for Build 12542715304Details
💛 - Coveralls |
A production App ID was automatically generated for this PR. (log)
Click here to copy & paste above information.
|
🚨 Lighthouse report for the changes in this PR:
Lighthouse ran with https://deriv-app-git-fork-heorhi-deriv-mobx-multiple-instances-fix.binary.sx/ |
b2e4b51
to
4ebc282
Compare
shafin-deriv
previously approved these changes
Dec 10, 2024
farabi-deriv
previously approved these changes
Dec 10, 2024
henry-deriv
approved these changes
Dec 11, 2024
nijil-deriv
previously approved these changes
Dec 11, 2024
cd73eb6
nijil-deriv
approved these changes
Dec 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Migrate to
mobx-react-lite
This pull request updates our project to use
mobx-react-lite
instead ofmobx-react
. The primary motivation for this change is to leverage the lightweight nature ofmobx-react-lite
, which is optimized for functional components. This change helps in reducing the bundle size and improving performance.Key Changes
observer
frommobx-react-lite
.observer
are functional components, asmobx-react-lite
does not support class components.Benefits
mobx-react-lite
.Bundle size after migration
Refactor: Removed
mobx-utils
DependencyThis pull request removes the dependency on the
mobx-utils
library by replacing the usage ofcomputedFn
with a manual caching solution using MobX's core features.Key Changes
computedFn
with a custom implementation usingobservable.map
from MobX.observable.map
(getPositionByIdCache
) to act as a reactive cache for thegetPositionById
method.getPositionByIdCache
) wheneverpositions
is updated to ensure no stale data is returned.computedFn
with behavior parity, including:id
).positions
array changes.Benefits
mobx-utils
, reducing the dependency footprint.observable.map
) for reactive caching, ensuring consistency and easier maintenance.By removing
mobx-utils
and leveraging MobX's built-in features, we reduce external dependencies while maintaining reactivity and performance.