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: Remove useArbTokenBridge from store #1479

Conversation

chrstph-dvx
Copy link
Contributor

@chrstph-dvx chrstph-dvx commented Jan 26, 2024

You should read this comment before reviewing it as it will be easier to review

@chrstph-dvx chrstph-dvx requested review from a team, douglance and fionnachan January 26, 2024 19:55
@chrstph-dvx chrstph-dvx linked an issue Jan 26, 2024 that may be closed by this pull request
@cla-bot cla-bot bot added the cla-signed label Jan 26, 2024
Copy link

vercel bot commented Jan 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
arbitrum-token-bridge ✅ Ready (Inspect) Visit Preview Sep 9, 2024 1:10pm

@@ -853,6 +854,7 @@ export function TransferPanelMain({
networks.destinationChain,
isTestnetMode,
setNetworks,
actions.app,
Copy link
Member

Choose a reason for hiding this comment

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

would be better if we just kept this out so we don't introduce unnecessary rerenders

Copy link
Contributor Author

@chrstph-dvx chrstph-dvx Jan 29, 2024

Choose a reason for hiding this comment

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

actions.app is the same reference every time, it doesn't cause rerender

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The diff on this file is actually fairly simple:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can be browsed from commit 7dc7d8c

@@ -100,14 +101,11 @@ export function TransferPanel() {
useState(false)

const {
app: {
connectionState,
Copy link
Member

Choose a reason for hiding this comment

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

i see that connectionState is not used in the whole app, let's nuke it from the code base

Copy link
Member

Choose a reason for hiding this comment

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

useAppState is now an unused import

Copy link
Member

Choose a reason for hiding this comment

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

this doesn't seem related to useArbTokenBridge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This wasn't memoed and it was causing issues

transactions: emptyState,
loading: isLoadingTxsWithoutStatus,
error,
failedChainPairs: emptyState,
Copy link
Member

Choose a reason for hiding this comment

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

i am not entirely sure if emptyState should be reused here

wouldn't both be using the same reference?

i get that we only want to return an empty array for both here and will not change them but this feels very weird?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would, but it should not cause issues as you're not mutating them.

Copy link
Member

Choose a reason for hiding this comment

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

i don't think this file has anything to do with useArbTokenBridge's refactoring either

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here, we needed to add memo

fionnachan
fionnachan previously approved these changes Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use useNetworksRelationship inside useArbTokenBridge
3 participants