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

Gas optimizations #5779

Merged
merged 7 commits into from
May 29, 2024
Merged

Gas optimizations #5779

merged 7 commits into from
May 29, 2024

Conversation

greg-schrammel
Copy link
Contributor

Fixes APP-####

What changed (plus any additional context for devs)

Screen recordings / screenshots

What to test

speed,
select,
enabled: !!state,
notifyOnChangeProps: !!state && speed !== 'custom' ? ['data'] : [],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

won't trigger a rerender if the speed is custom or the user is editing the gas panel

cacheTime: 60 * 1000, // 1min
notifyOnChangeProps: ['data', 'isFetching'],
keepPreviousData: true,
placeholderData: gasUnits.basic_swap[chainId],
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@greg-schrammel greg-schrammel merged commit 56aecb3 into develop May 29, 2024
6 checks passed
@greg-schrammel greg-schrammel deleted the gas-optimizations branch May 29, 2024 18:33
greg-schrammel added a commit that referenced this pull request May 29, 2024
* perf

* ✨

* useWhyDidYouUpdate

* EstimatedSwapGasFee

* keepPreviousData

* AnimatedText

* isSameAddress
greg-schrammel added a commit that referenced this pull request Jun 14, 2024
* wip

* fix gesture button states

* Safemath pt 2 (#5778)

* add more fns

* accept string or number

* update errors

* fix dynamic island overlap on recieve modal (#5672)

* .

* oop

* oop

* okay ty ben

* change background opacity to 1

* .

* oop

* .

* Gas optimizations (#5779)

* perf

* ✨

* useWhyDidYouUpdate

* EstimatedSwapGasFee

* keepPreviousData

* AnimatedText

* isSameAddress

* fix other networks section (#5784)

* Swaps: fix favorite button press (#5782)

* fix

* android fix

* todo

* remove console logs

* Insufficient Funds

* remove todo

* move cache getter closer to fetcher implentation

* fix

* :)

* 🍕

* or equal 🤌

* remove unused isSameAddress util

* just reordering declarations

* error i18n

* useGasSharedValues

* remove estimating

* fix label flickering

* fix review panel not prompting

* Revert "Lint on pre-commit (#5836)"

This reverts commit d56ed46.

* fix a bunch of shit

---------

Co-authored-by: Matthew Wall <matthew.wallt@gmail.com>
Co-authored-by: Bruno Barbieri <1247834+brunobar79@users.noreply.github.com>
Co-authored-by: brdy <41711440+BrodyHughes@users.noreply.github.com>
Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
brunobar79 added a commit that referenced this pull request Jun 21, 2024
* wip

* fix gesture button states

* Safemath pt 2 (#5778)

* add more fns

* accept string or number

* update errors

* fix dynamic island overlap on recieve modal (#5672)

* .

* oop

* oop

* okay ty ben

* change background opacity to 1

* .

* oop

* .

* Gas optimizations (#5779)

* perf

* ✨

* useWhyDidYouUpdate

* EstimatedSwapGasFee

* keepPreviousData

* AnimatedText

* isSameAddress

* fix other networks section (#5784)

* Swaps: fix favorite button press (#5782)

* fix

* android fix

* todo

* remove console logs

* Insufficient Funds

* remove todo

* move cache getter closer to fetcher implentation

* fix

* :)

* 🍕

* or equal 🤌

* remove unused isSameAddress util

* just reordering declarations

* error i18n

* useGasSharedValues

* remove estimating

* fix label flickering

* fix review panel not prompting

* Revert "Lint on pre-commit (#5836)"

This reverts commit d56ed46.

* fix a bunch of shit

* fix?

* opacity

* on review panel we should show fetching status and quote errors too

* remove error

* useUserNativeNetworkAsset

* less or equal

* Fixes for review button states (#5873)

* Fixes APP-1601: adds missing useThreshold for gas fee showing $0.00

* Tweak confirm button prop labels logic and ordering

* Prep work: remove reliance of asset balance display in valueBasedDecimalFormatter

* niceIncrementerFormatter returns asset balance if max swap

* Update formattedInputValue

Instead of using the niceIncrementFormatter for formatting slider-based
values:
for max: use the valueBasedDecimalFormatter on the input value which has
already been set to maxSwappableAmount
for everything else: add commas to the input value as it has already been
formatted using the niceIncrementFormatter

* Fixup: missed spot for previous hasEnoughFundsForGas revert

* fix formatting

---------

Co-authored-by: gregs <ukfaeku@gmail.com>
Co-authored-by: Bruno Barbieri <1247834+brunobar79@users.noreply.github.com>
Co-authored-by: brdy <41711440+BrodyHughes@users.noreply.github.com>
Co-authored-by: Ben Goldberg <bengoldberg@rainbow.me>
Co-authored-by: Jin <jin.chung17@gmail.com>
Co-authored-by: Bruno Barbieri <brunobar79@gmail.com>
jinchung added a commit that referenced this pull request Jun 22, 2024
#5881)

* wip

* fix gesture button states

* Safemath pt 2 (#5778)

* add more fns

* accept string or number

* update errors

* fix dynamic island overlap on recieve modal (#5672)

* .

* oop

* oop

* okay ty ben

* change background opacity to 1

* .

* oop

* .

* Gas optimizations (#5779)

* perf

* ✨

* useWhyDidYouUpdate

* EstimatedSwapGasFee

* keepPreviousData

* AnimatedText

* isSameAddress

* fix other networks section (#5784)

* Swaps: fix favorite button press (#5782)

* fix

* android fix

* todo

* remove console logs

* Insufficient Funds

* remove todo

* move cache getter closer to fetcher implentation

* fix

* :)

* 🍕

* or equal 🤌

* remove unused isSameAddress util

* just reordering declarations

* error i18n

* useGasSharedValues

* remove estimating

* fix label flickering

* fix review panel not prompting

* Revert "Lint on pre-commit (#5836)"

This reverts commit d56ed46.

* fix a bunch of shit

* fix?

* opacity

* on review panel we should show fetching status and quote errors too

* remove error

* useUserNativeNetworkAsset

* less or equal

* gas fee range

* fixes

* Fixes for review button states (#5873)

* Fixes APP-1601: adds missing useThreshold for gas fee showing $0.00

* Tweak confirm button prop labels logic and ordering

* Prep work: remove reliance of asset balance display in valueBasedDecimalFormatter

* niceIncrementerFormatter returns asset balance if max swap

* Update formattedInputValue

Instead of using the niceIncrementFormatter for formatting slider-based
values:
for max: use the valueBasedDecimalFormatter on the input value which has
already been set to maxSwappableAmount
for everything else: add commas to the input value as it has already been
formatted using the niceIncrementFormatter

* merge

* weird issues

* fixes

* fix out of sync issue

* update input amount + quote when maxSwappableAmount changes

* fix input formatting logic

* fix wei conversion

---------

Co-authored-by: gregs <ukfaeku@gmail.com>
Co-authored-by: Matthew Wall <matthew.wallt@gmail.com>
Co-authored-by: Bruno Barbieri <1247834+brunobar79@users.noreply.github.com>
Co-authored-by: brdy <41711440+BrodyHughes@users.noreply.github.com>
Co-authored-by: Jin <jin.chung17@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants