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

Chore: replace @walletconnect packages with @reown/walletkit #4548

Merged
merged 3 commits into from
Nov 22, 2024
Merged

Conversation

katspaugh
Copy link
Member

What it solves

WalletConnect packages are now under a new namespace on npm. See https://docs.reown.com/walletkit/upgrade/from-web3wallet-web

@katspaugh katspaugh requested a review from compojoom November 22, 2024 07:27
Copy link

github-actions bot commented Nov 22, 2024

Copy link

github-actions bot commented Nov 22, 2024

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 1 MB (-25 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Copy link

github-actions bot commented Nov 22, 2024

Coverage report

Caution

Test run failed

St.
Category Percentage Covered / Total
🟡 Statements
74.28% (-0.09% 🔻)
13988/18831
🔴 Branches
52.6% (-0.12% 🔻)
3473/6603
🔴 Functions
58.05% (-0.16% 🔻)
2047/3526
🟡 Lines
75.91% (-0.08% 🔻)
12704/16735
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / mobileAppPromotion.ts
100% 100% 100% 100%
🟡
... / index.tsx
60% 50% 33.33% 66.67%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🔴
... / index.tsx
44.44% (-11.11% 🔻)
100% 0% 57.14%

Test suite run failed

Failed tests: 0/1610. Failed suites: 1/217.
  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /home/runner/work/safe-wallet-web/safe-wallet-web/node_modules/@reown/walletkit/node_modules/uint8arrays/esm/src/index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { compare } from './compare.js';
                                                                                      ^^^^^^

    SyntaxError: Cannot use import statement outside a module

    

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1505:14)
      at Object.<anonymous> (node_modules/@reown/walletkit/node_modules/@walletconnect/utils/dist/index.cjs.js:1:596)
      at Object.<anonymous> (node_modules/@reown/walletkit/node_modules/@walletconnect/core/dist/index.cjs.js:1:461)
      at Object.<anonymous> (node_modules/@reown/walletkit/dist/index.cjs.js:1:217)
      at Object.<anonymous> (src/features/walletconnect/services/WalletConnectWallet.ts:2155:26)
      at Object.<anonymous> (src/features/walletconnect/__tests__/WalletConnectContext.test.tsx:13:69)

Report generated by 🧪jest coverage report action from c8355f1

@katspaugh katspaugh requested review from usame-algan and removed request for compojoom November 22, 2024 07:48
@katspaugh katspaugh marked this pull request as draft November 22, 2024 07:56
@katspaugh katspaugh marked this pull request as ready for review November 22, 2024 08:37
@@ -66,7 +66,6 @@
"@sentry/react": "^7.91.0",
"@spindl-xyz/attribution-lite": "^1.4.0",
"@walletconnect/utils": "^2.17.2",
Copy link
Collaborator

Choose a reason for hiding this comment

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

could this be also taken from reown?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've asked them about this.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like they still recommend this package according to their docs: https://docs.reown.com/walletkit/web/installation

Copy link
Member

Choose a reason for hiding this comment

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

Although I would suggest to add an explicit dependency to @walletconnect/core since we are using it as well.

Copy link
Member

@usame-algan usame-algan left a comment

Choose a reason for hiding this comment

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

👍

@katspaugh
Copy link
Member Author

I've tested that WalletConnect still works. ✅

Screenshot 2024-11-22 at 11 42 43

@katspaugh katspaugh merged commit cf98da0 into dev Nov 22, 2024
13 of 15 checks passed
@katspaugh katspaugh deleted the reown branch November 22, 2024 10:51
@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants