Web3.js update - Frankie Pangilinan - [Toronto Ethereum Developers Meetup]

ETH Toronto Talks · 31 Mar 2021 · 7:14

ChainSafe web3.js developer Frankie Pangilinan gives the Toronto Ethereum Developers Meetup an update on web3.js, the JavaScript library used to connect applications to Ethereum nodes. The short talk covers recent changes to the library and was given on a community call in March 2021.

Speakers

Topics

From ETH Toronto Talks, hosted by ETH Toronto.

Transcript

excellent so hi i'm frankie i don't have any slides i will be very brief um i work on web3.js and we've been working on it for a couple months now um so we have a couple pretty big announcements that we'd like to make here at this meetup and one of them is that you can expect in the next week a major version bump um that is pretty mellow in siri if you guys are using web3 it will be removing and deprecating the packages vzz and should um and then the next thing uh that i would like to talk about is that wyatt and i have been working on

rewriting the library and updating it to modern javascript it's been very fascinating and an interesting experience coming onto a library that is sorry that is a little bit legacy and maybe a little more than legacy and so we're just trying to bring it up to speed along with hopefully if we can get it there a new feature that we're calling dot use if you guys want to track the progress i'm gonna i have like an aggregate issue on the project that i can drop here in the link the idea would be to get to like not be as responsible for maintaining a lot of

packages because it's not for an open source library it's not very sustainable to maintain a bunch of packages you don't necessarily have your feet in the door with so then they there we go in the case of the dot used it would be it would make the core web3 library much smaller and much lighter weight and allow very just like easy code nothing super complicated i want to make it more like express where you just like import in libraries that you want to use that can be that need a provider and then webstreet will primarily be used to have to like maintain shared providers that being said i'm not getting rid of

like the way it stands now except for buzz and sha um the web 3 that you would normally import will still be the same it will still have.ethan.net and all of those things minus bzz and shi it'll just be that you'll be able to also import something on your own called web3 core which will be a very very lightweight module that you can then import separately all of the packages and he didn't talk about it much but why it did actually create an eth2 package that works with the e2 client beacon chain and so if maybe for example you want it you wanted to write your own packages as well and

have that available for the community because it's important to push community effort um then you can write a package that just like follows this really simple set like have a name things like that and then you should be able to get your provider from the what from one to core cool any questions anyone did it was i heard yeah i think we we did hear you um if anyone has any questions um yeah feel free to make sure to update your major versions that's all next one's version three look for it on

a github near you i've got a question yeah go oh so what what does this mean for like the upgrade path for people using web3 um in what sense like going from version one to version three or four yeah just trying to get like this going from now go ahead just trying to get a sense of like you know how extreme of a difference it would be ideally for actual api usage there's not a huge

change that being said i do want to see like the typescript updated um so that it's not buggy but the one major thing to look out for i guess would be going from all these like number strings to like actual either bn or the native big number that is provided now in javascript that's like the major one other than that there shouldn't be too much of a difference but that's a pretty big difference so but mainly it was just we were left with um you know i actually we're currently working on i am not quiet of a great guy currently working on trying to fix

this uh like one of the gas limits sometimes the gas limit is too big and it comes out as an integer and it breaks on a really you know basic thing which is like the introduce two bigs um but we inherited a lot of these problems and we're going to try and fix them by doing the right thing which is using either hex strings or big numbers so more things like that than things like the actual like like you'll see new like it's very unlikely you'll see new methods for like e or that the like the the order in which the arguments are in is is totally different there will be little things that will change that'll

probably not affect um the average user and so that's like more about how the the current base class works um since there isn't a concept of like inheritance or class in web3 js right now um trying to write that in has been really entertaining because uh one thing that i've learned which i was not stoked to learn about was that every method has its own this context for those of you who don't understand that i know that this might be a little weird to hear every method is its own class in a way and so trying to sort that out has

needed to make has has forced me to make major changes throughout the code but it doesn't necessarily change the api per se for like send transactions like that'll be the same as it was or as it has to be because i guess that there's also an update in the eip for that but you know does that answer your question hopefully not much unless you use dz or show in which case you're yeah it answers my question right uh you might get to delete some lines of code like all those changing like you know

numbers and hexes around that could be fun i like deleting lines of code who doesn't