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

Remove Next.js, Yarn, Jest #134

Merged
merged 17 commits into from
Jun 20, 2024
Merged

Remove Next.js, Yarn, Jest #134

merged 17 commits into from
Jun 20, 2024

Conversation

johnthecat
Copy link
Contributor

@johnthecat johnthecat commented Jun 14, 2024

Changes

Moved from yarn to npm
yarn v1 is deprecated. We decided to move along with npm. For now it looks more stable and reliable.

Removed Next.js
Replaced Next.js with Vite + Remix. Main reason is to simplify app infrastructure and remove friction between app and third-party libs. Also, after Remix announced merging with react-router, next major release will remove any custom compilers and bring file-based routing as just another build feature in Vite config.

Moved tests from Jest to Vitest
Vitest have pretty much the same functionality as Jest, but removes additional configuration for test running.

Eslint
I've refactored Eslint config to make it more readable and speedup lint execution. Also, added some rules related to import ordering.

App refactoring
After working with Remix and build-in React.StrictMode, i've found some nasty useEffects. They was rewritten.

Precommit hooks
Added precommit hooks with typechecking, linting, and test running.

Serving
Added precompiled gzip and brotli assets for better user experience.

Release preparation

  • Create new repository secrets - rename existing NEXT_PUBLIC_* to PUBLIC_
  • Test telenova on stage - check all integrations, redirects and data fetching logic

Aftermath

After these changes, we can start to rebuild Telenova as stable and easy-to-support app. Next steps most likely will be:

Copy link

github-actions bot commented Jun 14, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 2.67% 183 / 6833
🔵 Statements 2.67% 183 / 6833
🔵 Functions 3.03% 5 / 165
🔵 Branches 3.28% 5 / 152
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
postcss.config.js 0% 0% 0% 0% 1-9
tailwind.config.ts 0% 0% 0% 0% 1-34
src/app/root.tsx 0% 0% 0% 0% 1-111
src/app/routes/dashboard.tsx 0% 0% 0% 0% 1-9
src/app/routes/exchange._index.tsx 0% 0% 0% 0% 1-9
src/app/routes/exchange.select.tsx 0% 0% 0% 0% 1-9
src/app/routes/exchange.widget.tsx 0% 0% 0% 0% 1-9
src/app/routes/gifts._index.tsx 0% 0% 0% 0% 1-9
src/app/routes/gifts.details.tsx 0% 0% 0% 0% 1-9
src/app/routes/onboarding._index.tsx 0% 0% 0% 0% 1-9
src/app/routes/onboarding.create-wallet.tsx 0% 0% 0% 0% 1-9
src/app/routes/onboarding.password.tsx 0% 0% 0% 0% 1-9
src/app/routes/onboarding.start.tsx 0% 0% 0% 0% 1-9
src/app/routes/receive._index.tsx 0% 0% 0% 0% 1-9
src/app/routes/receive.select-token.tsx 0% 0% 0% 0% 1-9
src/app/routes/settings._index.tsx 0% 0% 0% 0% 1-9
src/app/routes/settings.backup.tsx 0% 0% 0% 0% 1-9
src/app/routes/settings.change-password.tsx 0% 0% 0% 0% 1-9
src/app/routes/settings.new-password.tsx 0% 0% 0% 0% 1-9
src/app/routes/settings.password-confirmation.tsx 0% 0% 0% 0% 1-9
src/app/routes/settings.recovery.tsx 0% 0% 0% 0% 1-9
src/app/routes/transfer._index.tsx 0% 0% 0% 0% 1-9
src/app/routes/transfer.address.tsx 0% 0% 0% 0% 1-9
src/app/routes/transfer.amount-gift.tsx 0% 0% 0% 0% 1-9
src/app/routes/transfer.amount.tsx 0% 0% 0% 0% 1-9
src/app/routes/transfer.confirmation.tsx 0% 0% 0% 0% 1-9
src/app/routes/transfer.create-gift.tsx 0% 0% 0% 0% 1-9
src/app/routes/transfer.result.tsx 0% 0% 0% 0% 1-9
src/app/routes/transfer.select-token.tsx 0% 0% 0% 0% 1-9
src/common/balances/BalanceProvider.tsx 0% 0% 0% 0% 1-170
src/common/balances/BalanceService.ts 0% 0% 0% 0% 1-78
src/common/chainRegistry/CachedMetadataConnection.ts 0% 0% 0% 0% 1-29
src/common/chainRegistry/ChainProvider.ts 0% 0% 0% 0% 1-53
src/common/chainRegistry/ChainRegistry.tsx 0% 0% 0% 0% 1-112
src/common/chainRegistry/ConnectionProvider.ts 0% 0% 0% 0% 1-230
src/common/chainRegistry/RuntimeProvider.ts 0% 0% 0% 0% 1-55
src/common/chainRegistry/knownChains.ts 0% 0% 0% 0% 1-193
src/common/chainRegistry/types/index.ts 0% 0% 0% 0% 1-80
src/common/extrinsicService/ExtrinsicBuilder.ts 0% 0% 0% 0% 1-70
src/common/extrinsicService/ExtrinsicProvider.tsx 0% 0% 0% 0% 1-61
src/common/extrinsicService/ExtrinsicService.ts 0% 0% 0% 0% 1-57
src/common/extrinsicService/useExtrinsic.tsx 0% 0% 0% 0% 1-124
src/common/extrinsicService/types/index.ts 0% 0% 0% 0% 1-64
src/common/providers/contextProvider.tsx 0% 0% 0% 0% 1-54
src/common/providers/telegramProvider.tsx 0% 0% 0% 0% 1-42
src/common/queryService/QueryService.ts 0% 0% 0% 0% 1-80
src/common/repository/Repository.ts 0% 0% 0% 0% 1-27
src/common/telegram/bot-api.ts 0% 0% 0% 0% 1-44
src/common/telegram/index.ts 0% 0% 0% 0% 1-46
src/common/telegram/message-factory.ts 0% 0% 0% 0% 1-25
src/common/telegram/useMainButton.ts 0% 0% 0% 0% 1-43
src/common/types/index.ts 0% 0% 0% 0% 1-69
src/common/utils/address.ts 0% 0% 0% 0% 1-58
src/common/utils/assets.ts 0% 0% 0% 0% 1-53
src/common/utils/balance.ts 0% 0% 0% 0% 1-133
src/common/utils/coingecko.ts 0% 0% 0% 0% 1-46
src/common/utils/constants.ts 100% 100% 100% 100%
src/common/utils/exchange.ts 0% 0% 0% 0% 1-31
src/common/utils/gift.ts 0% 0% 0% 0% 1-52
src/common/utils/twMerge.ts 100% 100% 100% 100%
src/common/utils/hooks/useAssetHub.ts 0% 0% 0% 0% 1-83
src/common/utils/hooks/useGifts.ts 0% 0% 0% 0% 1-64
src/common/wallet/store.ts 47.47% 75% 17.64% 47.47% 28-37, 39-41, 51-53, 84-97, 100-110, 113-114, 117-128, 131-136, 139-140, 148-161, 164-165, 168-173, 176-187, 190-191, 194-198
src/components/index.ts 0% 0% 0% 0% 1-67
src/components/Address/TruncateAddress.tsx 0% 0% 0% 0% 1-22
src/components/Assets/AssetBalance.tsx 0% 0% 0% 0% 1-35
src/components/Assets/AssetsList.tsx 0% 0% 0% 0% 1-25
src/components/Assets/Balance.tsx 0% 0% 0% 0% 1-39
src/components/Countdown/Countdown.tsx 0% 0% 0% 0% 1-27
src/components/GiftDetails/GiftDetails.tsx 0% 0% 0% 0% 1-29
src/components/Icon/Icon.tsx 0% 0% 0% 0% 1-24
src/components/Icon/IconButton.tsx 0% 0% 0% 0% 1-30
src/components/Icon/types.ts 0% 0% 0% 0% 1-83
src/components/Identicon/Identicon.tsx 0% 0% 0% 0% 1-31
src/components/Input/Input.tsx 0% 0% 0% 0% 1-20
src/components/LinkCard/LinkCard.tsx 0% 0% 0% 0% 1-54
src/components/LoadingScreen/LoadingScreen.tsx 0% 0% 0% 0% 1-14
src/components/LottiePlayer/LottiePlayer.tsx 0% 0% 0% 0% 1-22
src/components/Modals/GiftModal.tsx 0% 0% 0% 0% 1-222
src/components/Modals/ResetModal/BackupDeleted.tsx 0% 0% 0% 0% 1-26
src/components/Modals/ResetModal/ResetPassword.tsx 0% 0% 0% 0% 1-60
src/components/Modals/ResetModal/ResetPasswordModal.tsx 0% 0% 0% 0% 1-61
src/components/PasswordForm/PasswordForm.tsx 0% 0% 0% 0% 1-101
src/components/Plate/CreatedGiftPlate.tsx 0% 0% 0% 0% 1-54
src/components/Plate/GiftPlate.tsx 0% 0% 0% 0% 1-33
src/components/Plate/Plate.tsx 100% 100% 100% 100%
src/components/Plate/index.ts 0% 0% 0% 0% 1-5
src/components/Price/Price.tsx 0% 0% 0% 0% 1-27
src/components/Price/TokenPrice.tsx 0% 0% 0% 0% 1-45
src/components/RecoveryPhrase/RecoveryModal.tsx 0% 0% 0% 0% 1-96
src/components/RecoveryPhrase/RecoveryPhrase.tsx 0% 0% 0% 0% 1-51
src/components/Shimmering/Shimmering.tsx 0% 0% 0% 0% 1-20
src/components/Typography/index.ts 0% 0% 0% 0% 1-11
src/components/Typography/common/TextBase.ts 0% 0% 0% 0% 1-27
src/components/Typography/components/BigTitle.tsx 0% 0% 0% 0% 1-8
src/components/Typography/components/BodyText.tsx 0% 0% 0% 0% 1-8
src/components/Typography/components/HeadlineText.tsx 0% 0% 0% 0% 1-8
src/components/Typography/components/HelpText.tsx 0% 0% 0% 0% 1-8
src/components/Typography/components/LabelText.tsx 0% 0% 0% 0% 1-8
src/components/Typography/components/LargeTitleText.tsx 0% 0% 0% 0% 1-8
src/components/Typography/components/MediumTitle.tsx 0% 0% 0% 0% 1-8
src/components/Typography/components/TitleText.tsx 0% 0% 0% 0% 1-8
src/screens/dashboard/DashboardMain.tsx 0% 0% 0% 0% 1-161
src/screens/exchange/ExchangePage.tsx 0% 0% 0% 0% 1-54
src/screens/exchange/MercuryoWidgetPage.tsx 0% 0% 0% 0% 1-69
src/screens/exchange/SelectTokenExchangePage.tsx 0% 0% 0% 0% 1-52
src/screens/exchange/index.ts 0% 0% 0% 0% 1-5
src/screens/gifts/GiftDetailsPage.tsx 0% 0% 0% 0% 1-49
src/screens/gifts/GiftPage.tsx 0% 0% 0% 0% 1-93
src/screens/onboarding/CreateWallet.tsx 0% 0% 0% 0% 1-93
src/screens/onboarding/Onboarding.tsx 0% 0% 0% 0% 1-35
src/screens/onboarding/OnboardingStartPage.tsx 0% 0% 0% 0% 1-76
src/screens/onboarding/Password.tsx 0% 0% 0% 0% 1-63
src/screens/onboarding/RestoreWallet.tsx 0% 0% 0% 0% 1-110
src/screens/onboarding/index.ts 0% 0% 0% 0% 1-8
src/screens/receive/ReceivePage.tsx 0% 0% 0% 0% 1-89
src/screens/receive/ReceiveTokenPage.tsx 0% 0% 0% 0% 1-45
src/screens/settings/BackupPage.tsx 0% 0% 0% 0% 1-58
src/screens/settings/RecoveryPage.tsx 0% 0% 0% 0% 1-35
src/screens/settings/SettingsPage.tsx 0% 0% 0% 0% 1-137
src/screens/settings/index.ts 0% 0% 0% 0% 1-15
src/screens/settings/password/ChangePassword.tsx 0% 0% 0% 0% 1-79
src/screens/settings/password/NewPassword.tsx 0% 0% 0% 0% 1-48
src/screens/settings/password/PasswordConfirmation.tsx 0% 0% 0% 0% 1-35
src/screens/transfer/AddressPage.tsx 0% 0% 0% 0% 1-93
src/screens/transfer/ConfirmationPage.tsx 0% 0% 0% 0% 1-116
src/screens/transfer/CreateGiftPage.tsx 0% 0% 0% 0% 1-88
src/screens/transfer/ResultPage.tsx 0% 0% 0% 0% 1-45
src/screens/transfer/SelectTokenPage.tsx 0% 0% 0% 0% 1-48
src/screens/transfer/TrasferPage.tsx 0% 0% 0% 0% 1-54
src/screens/transfer/index.ts 0% 0% 0% 0% 1-19
src/screens/transfer/amount/AmountDetails.tsx 0% 0% 0% 0% 1-79
src/screens/transfer/amount/AmountGiftPage.tsx 0% 0% 0% 0% 1-73
src/screens/transfer/amount/AmountPage.tsx 0% 0% 0% 0% 1-58
src/screens/transfer/amount/useAmountLogic.tsx 0% 0% 0% 0% 1-176
tw-config-consts/font-sizes.ts 100% 100% 100% 100%
Generated in workflow #111

@johnthecat johnthecat assigned johnthecat and unassigned johnthecat Jun 17, 2024
@johnthecat johnthecat marked this pull request as ready for review June 17, 2024 09:14
Copy link
Contributor

@sokolova-an sokolova-an left a comment

Choose a reason for hiding this comment

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

  1. What about dividing the routes into folders? This will make it easier to navigate when we have more screens
  2. Seams like in a web version var(--tg-theme-button-color) doesn't apply so we have a bad color scheme (but it looks fine in the app)
  3. All modals moved down, the tailwind style --slide-exit: 80px; affected them
  4. The loading screen now takes longer time and sometimes has glitches (see attachment)
  5. Looks like we're making too many requests to coingecko (without cashing), so it's easy to get 429 error - Too many requests
Screen.Recording.2024-06-17.at.19.04.49.mov

src/app/root.tsx Show resolved Hide resolved
src/components/ErrorScreen/ErrorScreen.tsx Outdated Show resolved Hide resolved
src/app/root.tsx Outdated Show resolved Hide resolved
@johnthecat johnthecat merged commit fa21247 into dev Jun 20, 2024
3 checks passed
@johnthecat johnthecat deleted the tech/refactor branch June 20, 2024 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants