Closed jessepinho closed 1 week ago
Latest commit: 8601886edcce858931e92d05830659e7b910b6e0
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
good to merge barring the resolution of conflicts ~
@jessepinho I still had a few questions I left as comments I was hoping you could answer, selfishly for my own benefit?
This PR goes through a bunch of routes where we're using react-router loaders, and replaces loader functionality with ZQuery. Note that this means some assumptions have changed about when data is available. react-router loaders wait to render their route components until data has loaded, which means your component can assume the data is already present. Since we're now effectively loading data from
useEffect()
(by way of ZQuery), we can't assume that data is present just because a component is rendered. So you'll see some instances of code that accounts forundefined
where we didn't previously have to.One of the benefits of this change is that route changes are instant. There's no lag time between when you click on a link to a route, and when the route changes, like there was before when route changes were blocked by loaders.
Before (note the delayed route changes after I click)
https://github.com/penumbra-zone/web/assets/1121544/7fbb50a0-4acf-4789-b0d2-51d99c49fcef
After (note the instant route changes after I click)
https://github.com/penumbra-zone/web/assets/1121544/22a7dba1-3ae8-4fef-a753-5e3f8479669e
In this PR
balances
slice with abalancesByAccount
ZQuery object.transferableBalancesResponses
ZQuery object in the send state.shared
Zustand slice and added astakingTokenMetadata
ZQuery object to it, to be used by the send form and the IBC UIs.state.shared.stakingTokenMetadata
, and combine theaccountSwitcherFilter
andunstakedTokensByAccount
into a single ZQuery object, since they both depend on the same data.Future PRs
SwapLoader
andIbcLoader
to ZQuery. Those look a bit involved and this PR is already touching a lot of files, so I haven't done those yet.Relates to #1243