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

Update docs with Wagmi v2 changes #61

Merged
merged 24 commits into from
Apr 15, 2024
Merged

Update docs with Wagmi v2 changes #61

merged 24 commits into from
Apr 15, 2024

Conversation

Pabl0cks
Copy link
Collaborator

@Pabl0cks Pabl0cks commented Apr 4, 2024

Creating this draft to start working on #60 to adapt docs to all changes involved with SE2 Wagmi v2 migration

  • Update wagmi docs links to v2
  • Update viem docs links to v2
  • Update custom hooks names, params and examples to wagmi v2
  • Update recipes

Closes #60

Copy link

vercel bot commented Apr 4, 2024

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

Name Status Preview Comments Updated (UTC)
scaffold-eth-2-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2024 5:27pm

@Pabl0cks
Copy link
Collaborator Author

Pabl0cks commented Apr 8, 2024

Maybe add a small section about upgrading a Wagmi v1 SE-2 project to a Wagmi v2 SE-2 project?

I think Damu's idea in #60 can be helpful for people wanting to migrate to latest SE-2 version, without having to check all details of wagmi v2 migration.
Let me know if you think it's interesting and I'll prepare a draft version for that guide 🙌, we could add it at the end of hooks menu.

Some doubts I had when I was documenting the changes:

  • In useScaffoldWriteContract doc I'm instanciating writeContractAsync into writeYourContractAsync, not sure if it's the right practice for the docs.
  • In recipes (WagmiContractWriteWithFeedback and WriteToContractWriteAsyncButton) I was not sure about putting the writeContractAsyncWithParams into the event handler or not. Did not put it for simplicity of the example, but don't know if it's a good practice for a "real world" example

Hope I haven't missed any changes, and that my explanations are not terrible 😅

Copy link
Collaborator

@technophile-04 technophile-04 left a comment

Choose a reason for hiding this comment

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

TYSM @Pabl0cks !! This is really great !!!

Just pushed a few commits tried keeping them atomic so its easy to read, mainly revolving around :

  1. Distinguishing that contract interaction args are now passed to writeContractAsync instead of useSWC eg: 38d8085, d0c172a
  2. Wrapping writeContractAsync inside try/catch its important we mention this, earlier it not imp but after Fix useScaffoldContractWrite so it properly throws errors scaffold-eth-2#758 you should do it.

I think this is nicely ready to merge along with scaffold-eth/scaffold-eth-2#700 🙌

@Pabl0cks
Copy link
Collaborator Author

Thanks for the awesome review @technophile-04!!

Love all the improvements and learnt from the fixes 🙌

@technophile-04
Copy link
Collaborator

Merging this, we already merged scaffold-eth/scaffold-eth-2#700

Tysm @Pabl0cks again !!

@technophile-04 technophile-04 merged commit b9d7f82 into main Apr 15, 2024
3 checks passed
@technophile-04 technophile-04 deleted the wagmi-v2 branch April 15, 2024 17:38
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.

Wagmi V2 docs update
2 participants