Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

2440/uni merge #2536

Closed
wants to merge 382 commits into from
Closed

2440/uni merge #2536

wants to merge 382 commits into from

Conversation

alfetopito
Copy link
Contributor

@alfetopito alfetopito commented Mar 10, 2022

Summary

(recreating from #2529)

Closes #2440

Merge with latest from original UNI code

PR deployment URL https://pr2536--gpswapui.review.gnosisdev.com/

TO DOs

List of things that I know we should look at. There might be more...

  • Identicon looking weird, need to be revisited
  • Network switcher: Styles
  • Network switcher: On hover effect
  • Network switcher: No longer disabled for unsupported wallets
  • Widget command not starting - probably need to adjust the paths in the /lib/ files
  • connectors file might need to be updated
  • useCurrency file might need to be updated
  • ErrorBoundary HTML changes we might want to apply
  • AdvancedSwapDropdow file has been removed from original but we still have the mod
  • ListUpdatePopup file has been removed from original but we still have the mod
  • UrlWarning file has been removed from original but we still have the mod -- we do want to keep it. Older merge
  • Native currency on activity details has no icon because it's not tagged as native currency (eeee... address)
  • Probably will need to fix integration tests...
  • Locale/plurals are all screwed
  • Added app Suspense Loader from Uni. We might want to customize it
  • There's a component unreacheable on SwapMod
  • There's a new component that could be used: AccountDetails/index:StatusIcon
  • Need to re-do useChangeNetworks based on changes from NetworkSelectorMod
  • Need to understand and fix whatever rules-of-hooks is broken on SwapMod. Temporarily disabled the rule
  • WETH/wxDAI -> USDC pair is pre-selected, but:
    • Price for USDC is not loaded
    • USDC is not selected on gchain
  • ESlist on CI
  • Loading balances via Wallet Connect is broken for some mobile wallets (MM, imToken, Token Pocket, Pillar, Argent). Worked flawlessly with Coinbase mobile wallet though
  • Wallet connect wallet images no longer shown

To Test

  1. TEST EVERYTHING!!

crowdin-bot and others added 30 commits January 11, 2022 21:06
* Revert "chore: import from ethers"

This reverts commit 6d9c0855d261679c316307ea3f668869c90e63a2.

* Revert "fix: use provider JsonRpcProvider"

This reverts commit dcbbab5e4d6458a11c38582388a7cb5b12691188.

* chore: depend on @ethersprojects directly
…ssing provider error (#3107)" (#3109)

This reverts commit ac2642f.
* feat: mv block number to atom

* fix: add block updater

* fix: fast forward dep
* feat: mv block number to atom

* fix: add block updater

* fix: fast forward dep

* refactor: mv multicall to lib

* feat: add multicall to widget

* chore: update widget deps

* nit: pluralize updaters

* chore: minimize deps
* refactor: mv token list utils to lib

* refactor: mv balance hooks to lib

* feat: interactive token select
* refactor: mv gas estimate chains out of component

* chore: replace microbundle with rollup

* chore: use ts rollup config

* chore: rename lib to widgets

* chore: add rollup doc comment

* feat: rollup typings

* fix: retain tsconfig decl dir
* add survey popup for survey monkey

* update useEffect and add 24 hour window

* upate % logic

* update logic to show after duration

* update timestamp conditional

* small changes
* refactor: mv useNativeCurrency to lib/hooks

* refactor: mv useCurrency logic to lib/hooks
* fix: token image for chains / natives

* feat: include native currency in select

- Updates widgets swap state to use Currency (and deals with downstream updates)
- Refactors logoURI code to a new lib/hooks/useCurrencyLogoURIs
- Adds native currency to useQueryTokenList

NB: This does not build because tests must be updated to use Currency (they currently use mock tokens)

* test: update fixtures to use real currency

* fix: data uri color extraction

* fix: token img state

* fix: use new array
* fix: memoize derived swap info

* fix: memoize current block timestamp

* fix: memoize price impact

* fix: memoize debounced value updates

* fix: nits
… and Missing provider error (#3110)

* add error reporting component, INTEGRATION ERROR type, and Missing provider error

* rename reporter to generator

* pr feedback

* refactor provider check

* add chainId, convenienceFee, and width errors

* pr feedback and convenienceFeeRecipient address enforcement

* fix imports for utils
* refactor: mv settings state to own file

* chore: add default exports

* refactor: update swap state to match biz logic

* feat: copy biz logic to widgets

* Hook up UI to updated swap state

* fix: decimal inputs

* fix max slippage

* fix error in settings

* fix: typing errors

* revert: useBestTrade changes

* fix: use client side trade for widgets

* fix: exhaustive deps

* chore: add router-sdk

* fix: gate old web3 on widget env

* fix building errors

* update trade imports

* update hook naming for swap amount and currencies

* small changes

Co-authored-by: Zach Pomerantz <[email protected]>
* feat: filter selected currency from select

* test: use infura urls

* fix: load native with chain

* fix: use currencyId for key

* feat: switch currencies when selecting other

* fix: resolve merge conflict name
@@ -72,3 +72,6 @@ REACT_APP_PATH_REGEX_ENS="/ipfs"

# Enables mock mode (default = true)
REACT_APP_MOCK=true

# Locales
REACT_APP_LOCALES="locales"
Copy link
Contributor

Choose a reason for hiding this comment

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

this is already concerning, why is .env no longer ignored?

"rules": {
"unused-imports/no-unused-imports": "error",
// "simple-import-sort/imports": "error",
Copy link
Contributor

Choose a reason for hiding this comment

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

they removed this or we did? tbh i always liked this rule but it can get noisy

prettier: true

- name: Run eslint
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }}
Copy link
Contributor

Choose a reason for hiding this comment

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

weird rule, don't run eslint if the owner is opening a PR?

"configPath": "react-scripts/config/webpack.config",
"overridePath": "cosmos.override.js"
},
"port": 5001
Copy link
Contributor

Choose a reason for hiding this comment

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

so cosmos stuff willa lso be run on yarn start? seems bulkier. but ill give it a go later. just a note

@@ -1,4 +1,4 @@
/// <reference types="cypress" />
/// <reference types="Cypress" />
Copy link
Contributor

Choose a reason for hiding this comment

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

?? 🤔

"web3-providers-ws": "^1.7.0",
"typescript": "^4.4.3",
"web3-react-abstract-connector": "npm:@web3-react/abstract-connector@^6.0.7",
"web3-react-core": "npm:@web3-react/core@^6.0.9",
Copy link
Contributor

Choose a reason for hiding this comment

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

whta's this npm prepending going on?

"web3-react-injected-connector": "npm:@web3-react/injected-connector@^6.0.7",
"web3-react-portis-connector": "npm:@web3-react/portis-connector@^6.0.9",
"web3-react-types": "npm:@web3-react/types@^6.0.7",
"web3-react-walletconnect-connector": "npm:@web3-react/walletconnect-connector@^7.0.2-alpha.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

beta connector in use, differs quite alot from v6

"@web3-react/empty": "8.0.7-beta.0",
"@web3-react/fortmatic-connector": "^6.1.6",
"@web3-react/injected-connector": "^6.0.7",
"@web3-react/metamask": "8.0.10-beta.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry made a mistake above, these are all the latest connectors

// eslint-disable-next-line no-restricted-imports
import { t, Trans } from '@lingui/macro'
import { t } from '@lingui/macro'
Copy link
Contributor

Choose a reason for hiding this comment

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

should combine these, is this a mistake?

@elena-zh
Copy link

elena-zh commented Apr 1, 2022

Hey @alfetopito , great job!
I have done a round of PR testing and reported related issues:

Besides these issues, I'd like to leave here some notes:

  1. I have not fully tested Profile page as it should be updated according to the latest changes
  2. I have some doubts in displaying WETH-USDC token pair b default. Seems like the app forces me immediately to trade with these tokens. Besides. when switch to Rinkeby, it shows an incorrect price.. So I'd leave TO field empty as we do currently in Prod. However, I do not insist on it
    incorrect USDC price
  3. I see a lot of errors in the Console. Seems like it is totally red
    failed requests

Thanks!

@stale
Copy link

stale bot commented Jun 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you think it shouldn't be closed, speak now or forever hold your peace.

@stale stale bot added the wontfix Stale issue label Jun 12, 2022
@alfetopito alfetopito closed this Jun 17, 2022
@alfetopito alfetopito deleted the 2440/uni-merge branch June 17, 2022 15:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix Stale issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merge Uniswap