Uniswap / web3-react

A simple, maximally extensible, dependency minimized framework for building modern Ethereum dApps
https://web3-react-mu.vercel.app/
GNU General Public License v3.0
5.56k stars 1.52k forks source link

V8 compatibility with Web3js? #536

Open williamkmlau opened 2 years ago

williamkmlau commented 2 years ago

In V6, if we wanted to use Web3js, one could simply use new Web3(provider) instead of Web3Provider(provider) inside the getLibrary(provider: any) function to use our convenience library of choice.

In V8, with the library creation function removed, it seems to assume we will be using Ethers project since the returned provider is an Ethers project Web3Provider.

I am unsure how to use Web3js library instead.

talentlessguy commented 2 years ago

since web3-react is based on ethers, it's not recommended to mix it together with web3.js. Use ethers instead

Lucienest commented 2 years ago

It seems like V8 is a downgrade since V6 had more flexibility now breaking things. I prefer web3 as well.

ThisIsRuddy commented 2 years ago

Just spent 2 hours going round in circles with this same issue. ๐Ÿ˜ข

talentlessguy commented 2 years ago

@ThisIsRuddy just use ethers Web3Provider instead of web3js

0xZXDX commented 2 years ago

It would be better if it could support web3js๐ŸŒน๐ŸŒน

Lucienest commented 2 years ago

@ThisIsRuddy just use ethers Web3Provider instead of web3js

V6 supports web3js, and now it doesn't. many prefer web3, not ethers.

All we want is web3js support on V8, as V6.

ThisIsRuddy commented 2 years ago

Downgraded to v6 back to working now ๐Ÿ‘Œand kept a v8 branch stashed incase Web3 support in v8 happens... ๐Ÿ˜…

williamkmlau commented 2 years ago

@talentlessguy I think regardless of whether or not V8 will support web3js in the future, the fact that this is currently a breaking change from V6 should be explained in the readme in the section about upgrading from V6. I jumped into the upgrading process from V6 to V8 expecting to continue using web3js, without knowing that it is no longer supported.

bbminhtri commented 2 years ago

My project is at a stage where it is very time-consuming to migrate to EtherJS, but we still need support to keep our current implementation of web3-react working against Metamask updates.

Is there any plan to add support for Web3.js in the future?