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

Wagmi and Viem Experiment #624

Closed
Tracked by #669
alcercu opened this issue Mar 8, 2023 · 3 comments · Fixed by #670
Closed
Tracked by #669

Wagmi and Viem Experiment #624

alcercu opened this issue Mar 8, 2023 · 3 comments · Fixed by #670
Assignees
Labels
Package: Web Court web frontend Type: Enhancement ✨ Type: Toolchain ⚒️ Build tools configuration, CI/CD
Milestone

Comments

@alcercu
Copy link
Contributor

alcercu commented Mar 8, 2023

Determine if we are using packages in the front-end that are too low level and are forcing us to replicate boilerplate code among projects. The aim of this issue is to do a time-boxed exploration of different libraries, and try to asses if we should migrate from ethersjs to a more abstracted library like wagmi, useDapp, etc. , to another low level like viem, or if there is no migration needed at all.

@greenlucid
Copy link

I think wagmi and viem are for different things. wagmi is react hooks, viem is low-level, minimalistic ethers.
so far, I'm loving viem, it's insane quality:

  • magic typescript autocomplete, without parsing or codegen
  • small bundle size
  • less non-sense types (such as, BigNumber is just bigint instead)

Wagmi, in the future, will be refactored to support viem.
Then there's rainbow wallet, which we should look into since most frontends are using it lately and it uses wagmi under the hood.

@AndreiMVP
Copy link
Contributor

Viem is what.. 1 month old? I would give it some time before starting to use it in our apps. Wagmi adapting it would be cool (since they say it would help with some of the difficulties they faced). For the moment I think ethers w/ typechain is fine. The boilerplate you have also dictates how you use it around the codebase, which can lead to better or worse code.

A tool like typechain but for generating React specific hooks/components for the smart contract functions/data used (and more minimalistic) would be cool imo.

@jxom
Copy link

jxom commented Mar 15, 2023

Hi! wagmi & viem author here! Just lurking GitHub.

@AndreiMVP@wagmi/cli can generate React Hooks from an ABI definition. :)
React Plugin: https://wagmi.sh/cli/plugins/react

wagmi also infers types from an ABI at compile time, which removes the need for a build step altogether to generate types (no need for TypeChain). We use abitype (our other library) to achieve this. You can see the comparison here.

Would be awesome if ya’ll considered wagmi — let me know if you have any questions.

@jaybuidl jaybuidl changed the title viem and wagmi, etc. exploration Wagmi and Viem Experiment Apr 5, 2023
@jaybuidl jaybuidl linked a pull request Apr 10, 2023 that will close this issue
@jaybuidl jaybuidl added this to the alpha-1 milestone Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: Web Court web frontend Type: Enhancement ✨ Type: Toolchain ⚒️ Build tools configuration, CI/CD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants