pancake-frontend icon indicating copy to clipboard operation
pancake-frontend copied to clipboard

refactor: Remove persist gate and redux-persist

Open memoyil opened this issue 1 year ago • 3 comments


PR-Codex overview

This PR improves client-side checks and updates dependencies across multiple files.

Detailed summary

  • Added client-side checks for window presence
  • Updated dependencies for useIsomorphicEffect
  • Refactored state management to use useTransactionState
  • Replaced useLayoutEffect with useIsomorphicEffect for consistency

The following files were skipped due to too many changes: apps/web/src/views/Home/components/Hero.tsx, apps/web/src/state/transactions/updater.tsx, apps/web/src/hooks/useStorageDispatches.ts, apps/web/src/state/transactions/reducer.ts, apps/web/src/views/Pottery/index.tsx, apps/web/src/state/user/hooks/useUserAddedTokens.ts, apps/web/src/pages/_app.tsx, apps/web/src/views/Home/hooks/useIsIOS.ts, apps/web/src/views/Migration/components/v3/UnstakeButton.tsx, apps/web/src/components/Menu/UserMenu/TransactionRow.tsx, apps/web/src/state/user/reducer.ts, apps/web/src/hooks/useAuth.tsx, apps/web/src/views/Home/components/CakeSection/CakeSectionTag.tsx, apps/web/src/views/Notifications/components/NotificationDropdown/NotificationMenu.tsx, apps/web/src/views/Home/components/CakeSection/index.tsx, apps/web/src/views/Notifications/containers/NotificationView.tsx, apps/web/src/utils/clearUserStates.ts, apps/web/src/hooks/useAccountEventListener.ts, apps/web/src/views/Farms/components/FarmTable/Actions/StakedAction.tsx, apps/web/src/state/transactions/hooks.tsx, apps/web/src/state/index.ts, apps/web/src/views/Home/components/Banners/MultipleBanner.tsx, apps/web/src/views/Farms/components/FarmCard/StakeAction.tsx, apps/web/src/state/notifications/hooks.ts, apps/web/src/state/user/hooks/index.tsx

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

memoyil avatar Jan 10 '24 15:01 memoyil

⚠️ No Changeset found

Latest commit: 0a0274d3dd87b9ada11925587461f6006fcce8eb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Jan 10 '24 15:01 changeset-bot[bot]

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

Name Status Preview Comments Updated (UTC)
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 29, 2024 8:53am
5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
aptos-web ⬜️ Ignored (Inspect) Visit Preview Feb 29, 2024 8:53am
blog ⬜️ Ignored (Inspect) Visit Preview Feb 29, 2024 8:53am
bridge ⬜️ Ignored (Inspect) Visit Preview Feb 29, 2024 8:53am
games ⬜️ Ignored (Inspect) Visit Preview Feb 29, 2024 8:53am
uikit ⬜️ Ignored (Inspect) Visit Preview Feb 29, 2024 8:53am

vercel[bot] avatar Jan 10 '24 15:01 vercel[bot]

Typescript errors check

Yeah, you have removed 2 errors with this PR 👏

986 ts errors detected in all the codebase 😟.

25 ts errors detected in the modified files.

Details
Filename Location Message
apps/web/src/state/transactions/reducer.ts 62, 11 Type '{ text: string; data?: Record<string, string | number | undefined> | undefined; } | undefined' is not assignable to type 'WritableDraft<{ text: string; data?: Record<string, string | number> | undefined; }> | undefined'.
apps/web/src/state/user/hooks/useUserAddedTokens.ts 11, 42 Type 'undefined' cannot be used as an index type.
apps/web/src/state/user/hooks/useUserAddedTokens.ts 11, 62 Argument of type '(serializedToken: SerializedWrappedToken) => Token' is not assignable to parameter of type '(value: unknown, index: number, array: unknown[]) => Token'.
apps/web/src/utils/clearUserStates.ts 21, 80 Type 'number | undefined' is not assignable to type 'ChainId'.
apps/web/src/views/Farms/components/FarmCard/StakeAction.tsx 82, 11 Property 'lpTokenStakedAmount' does not exist on type 'DeserializedFarm | undefined'.
apps/web/src/views/Farms/components/FarmTable/Actions/StakedAction.tsx 147, 11 Property 'lpTokenStakedAmount' does not exist on type 'DeserializedFarm | undefined'.
apps/web/src/views/Migration/components/v3/UnstakeButton.tsx 35, 11 Property 'lpAddress' does not exist on type 'DeserializedFarm | undefined'.
apps/web/src/views/Migration/components/v3/UnstakeButton.tsx 84, 19 Type 'number | undefined' is not assignable to type 'number'.
apps/web/src/views/Migration/components/v3/UnstakeButton.tsx 96, 19 Type 'number | undefined' is not assignable to type 'number'.
apps/web/src/views/Migration/components/v3/UnstakeButton.tsx 104, 73 Type 'number | undefined' is not assignable to type 'ChainId'.
apps/web/src/views/Migration/components/v3/UnstakeButton.tsx 109, 15 'receipt' is possibly 'null'.
apps/web/src/views/Migration/components/v3/UnstakeButton.tsx 126, 43 Type '0x${string} | undefined' is not assignable to type '0x${string}'.
apps/web/src/views/Migration/components/v3/UnstakeButton.tsx 126, 79 Type 'number | undefined' is not assignable to type 'number'.
apps/web/src/views/Migration/components/v3/UnstakeButton.tsx 131, 49 Argument of type 'BigNumber | undefined' is not assignable to parameter of type 'BigNumber'.
apps/web/src/views/Migration/components/v3/UnstakeButton.tsx 148, 43 Type '0x${string} | undefined' is not assignable to type '0x${string}'.
apps/web/src/views/Migration/components/v3/UnstakeButton.tsx 148, 79 Type 'number | undefined' is not assignable to type 'number'.
apps/web/src/views/TradingCompetition/components/TeamRanks/Podium/PodiumWithParticipants.tsx 40, 59 'firstTeam.teamId' is possibly 'undefined'.
apps/web/src/views/TradingCompetition/components/TeamRanks/Podium/PodiumWithParticipants.tsx 41, 61 'secondTeam.teamId' is possibly 'undefined'.
apps/web/src/views/TradingCompetition/components/TeamRanks/Podium/PodiumWithParticipants.tsx 42, 59 'thirdTeam.teamId' is possibly 'undefined'.
apps/web/src/views/TradingCompetition/components/TeamRanks/Podium/PodiumWithParticipants.tsx 62, 62 'secondTeam.leaderboardData' is possibly 'undefined'.
apps/web/src/views/TradingCompetition/components/TeamRanks/Podium/PodiumWithParticipants.tsx 62, 62 Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
apps/web/src/views/TradingCompetition/components/TeamRanks/Podium/PodiumWithParticipants.tsx 73, 62 'firstTeam.leaderboardData' is possibly 'undefined'.
apps/web/src/views/TradingCompetition/components/TeamRanks/Podium/PodiumWithParticipants.tsx 73, 62 Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
apps/web/src/views/TradingCompetition/components/TeamRanks/Podium/PodiumWithParticipants.tsx 84, 62 'thirdTeam.leaderboardData' is possibly 'undefined'.
apps/web/src/views/TradingCompetition/components/TeamRanks/Podium/PodiumWithParticipants.tsx 84, 62 Argument of type 'number | undefined' is not assignable to parameter of type 'number'.

4 new errors added Note : in some rare cases, new errors can be existing errors but with different locations

chefjackson/action-check-typescript

github-actions[bot] avatar Jan 10 '24 15:01 github-actions[bot]