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

Migrate composables to a provider pattern, so watchers and composables register once. #537

Closed
wants to merge 3 commits into from

Conversation

arb000r
Copy link
Collaborator

@arb000r arb000r commented Jul 8, 2021

Description

The current issue with a lot of token list lag was the fact that our composables were called many times. Given the fact that these composable instances are isolated, they would register their own watchers and computed properties multiple times as well.
Some of of these watchers and composables are quite hefty in the compute they perform, so it would essentially become a very expensive render every tim.
This PR aims to refactor that logic and move the more used composable contents to a provider pattern, so they are provided once (watchers and computables) registered once and a much needed speed improvement is introduced.

Fixes #TokenListsLagging

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

How should this be tested?

Entire app, make sure invest works, withdraw works (balances update when so). Trading works (balances update)

Checklist:

  • [ WIP] I have performed a self-review of my own code
  • [X ] I have commented my code where relevant, particularly in hard-to-understand areas
  • [ X] My changes generate no new console warnings
  • The base of this PR is master if hotfix, develop if not

@vercel
Copy link

vercel bot commented Jul 8, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

kovan-app – ./

🔍 Inspect: https://vercel.com/balancer/kovan-app/AUKZau2NTCNtoMgr4jvQWV8xQtDy
✅ Preview: Canceled

app – ./

🔍 Inspect: https://vercel.com/balancer/app/3ZLJaZhtaYwsonGBxHjGmtU8sCLc
✅ Preview: Canceled

staging-app – ./

🔍 Inspect: https://vercel.com/balancer/staging-app/AsLSY2gs2SVBiEguiGcwPBMuVfgj
✅ Preview: https://staging-app-git-fix-tokenlist-lag-balancer.vercel.app

staging-kovan-app – ./

🔍 Inspect: https://vercel.com/balancer/staging-kovan-app/5AaKH6qX8rTy4q2KWSc1auyHVniX
✅ Preview: https://staging-kovan-app-git-fix-tokenlist-lag-balancer.vercel.app

gnosis – ./

🔍 Inspect: https://vercel.com/balancer/gnosis/7nu3r5SEuRfD4kdM4bix1YC15mhg
✅ Preview: https://gnosis-git-fix-tokenlist-lag-balancer.vercel.app

polygon – ./

🔍 Inspect: https://vercel.com/balancer/polygon/Emjh3XPBarqxcf5UxSvvg7sMt9fm
✅ Preview: https://polygon-git-fix-tokenlist-lag-balancer.vercel.app

@arb000r arb000r requested a review from garethfuller July 8, 2021 10:01
Comment on lines +4 to +8
import Provider from '@/plugins/providers/Provider.vue';
import provideTokenStore from '@/plugins/providers/tokenstore.provider';
import provideTokens from '@/plugins/providers/tokens.provider';
import provideAccountBalances from '@/plugins/providers/balances.provider';
import provideAccountAllowances from '@/plugins/providers/allowances.provider';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These probably will move to a better home that isn't inside plugins

@garethfuller garethfuller marked this pull request as draft July 13, 2021 09:44
@arb000r arb000r closed this Aug 4, 2021
@garethfuller garethfuller deleted the fix/TokenList-Lag branch May 17, 2022 10:10
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.

1 participant