Dev & Tell | Dhaiwat - web3-ui

Developer DAO · 17 Dec 2021 · 26:12

Dhaiwat, a Developer DAO member, presents web3-ui, an open source React library for Ethereum applications inspired by scaffold-eth and useDapp. The project is split into UI components, hooks and a core package that connects a wallet in a couple of lines. The demo walks through its Storybook, with ENS-aware address display and input, NFT and NFT gallery components, and a contract hook, all built on Chakra UI. Dhaiwat is candid that the library is still unstable, explains how contributors can join, and answers questions about chain support.

Topics

From Developer DAO; community: Developer DAO.

Transcript

welcome one and all to another fantastic installment of devontel uh so for those of you who don't know what devontel is devontel is basically an initiative to allow people of the doubt to have a platform to be able to sorry oh sorry everyone if you don't mind could you uh mute yeah thank you thank you thank you uh yes so as i was saying um devontel is a platform for for people of the dow to be able to present all the cool projects or or topics they're passionate

about uh in a 30 minute window allowing people to have a glimpse into all the cool stuff you're working on as well as to ask questions so uh very pleased to hand off the mic to our very own daiwa take it away thanks now uh hey everyone uh first of all thanks for being here i really appreciate i really appreciate all of you being here so uh i would say a few weeks ago uh i created this rfc about a web3 specific ui library which would basically uh handle uh

web to use specific use cases uh uh i got the inspiration for this uh project for uh from scaffolding um scaffolding is i'm not sure uh if you have watched that stream that needed it with austin griffith uh scaffolding is basically a template that lets you get an up and running with uh an ethereum project with a dev environment for smart contracts and and it also has a ui which basically generates itself once you provided the contract so i really i really like uh

scaffolding but unfortunately it also it is also like uh extremely extremely bloated and the ui components aren't typed they are written in javascript and the documentation around it isn't that great and it's not yeah it's it's basically a hassle to use so that's that's that's the basically the biggest reason why i thought of creating something from scratch even though it's not really from scratch it it takes inspiration from scaffolding used app and so many other

projects like that we don't want to reinvent the wheel but yeah we we are starting in from scratch in terms of code but we are taking a lot of inspiration from these projects so i'm just gonna share my screen now uh basically show you around the current state of the project and first of all the rfc so initially that the ui was basically just meant to be a set of ui components which are which helped you get started with any ethereum application with react later on we had some discussions and

eventually we decided to create three packages one containing the ui components uh one containing some hooks which we thought would be useful and a third package called core which would be like a combination of these two which would just work out of the box and um yeah this is the storybook of the project we have a single storybook for the entire project so before before i uh get into uh showing you around the current state of the project uh

i would say uh that we we have like taken um a lot of inspiration from maybe i'm repeating myself but we have taken a lot of inspiration from already existing projects and we are trying to take all the good paths that we find and trying to combine it into one good thing so yeah it this is certainly extremely ambitious but i i see this as like an excellent learning exercise if anything and in the best case we would have something extremely useful on our hands uh so yeah let's let's have a look at

the current state of the project so this is this is the storybook uh that we have right now uh we don't have a lot of components at the moment but uh we have or like five to ten working working parts right now and we have a lot of things planned for the future so the first thing we created was having something that just literally displays an e an ethereum address so if you like pass in an ethereum address to this component it will try to resolve the ens you like it to that

address if it finds an ens it will just show that ens otherwise it will like show a shortened version of that address then we have an address input component which is an extremely uh common component used in ethereum applications you will basically just uh so so a drawback we have right now is you have to be connected to the mainnet to for this to work but we have an issue open for that and someone is already working on it so if i refresh this

i should see my address down below yeah so this is basically what you'll get uh as a value and then you can use it for calling and transaction etc etc we have a component that displays an nft so you just provide it with a contract address and the token id and it will just render the nft for you it supports gifs it supports videos it supports audio and we also have this uh nft gallery component which shows someone's all the nft is owned by someone so that's that's really neat this is uh basically all we have

in the component section right now we have like seven prs open uh for different all sorts of components um and yeah we are really taking our time with reviewing the vr prs properly so yeah i'm pretty sure by the end of next month we have we'll have quite a few more components in this in this group of components then we have uh some hooks uh these hooks are really similar to what you will see in used app but we have like just tweaked them a little we have even like more a lot of the code

has been like inspired from used app uh but we have just the reason why we created this hooks packages because we want a specific api if that makes sense the the api provided by usdap wasn't uh wasn't really i wouldn't say nice but wasn't exactly perfect and yeah we are just trying to experiment with this uh and see see where we go uh so we have this used contract hook which basically lets you interact with the contract uh

if i open up the code for it so yeah it's it's like an extremely basic hook it you just pass in an address you pass in an api and it just lets you interact with the contract now the the i would say the usp of this of this project is the the core package because that's that's really what's vastly different than uh most projects available already so if i open up the story for

this you'll see that all you need to basically lock someone in you are using their wallet is basically like two lines of code you just specify the network that you want this is the chain id for link b and you place this connect fault component here and that's it that's all you need so under the hood this is this is using our hooks package and the great thing about this is that once you once you do this when someone clicks on this

you can get in you can get info about the connection from anywhere inside your app using this hook this and you can also use other hooks like i use contract we are working on the hook for contract functions used app also has one for that so so that you can easily handle uh transactions basically error states loading states all of that will play extremely nicely uh with the the entire setup really so this is this is like the source code

but this is what you'll actually write this in my opinion is like so much easier than writing like hundreds of lines of code just to get someone to sign and using metamask and this is really the reason why i i wanted to create this project and i i think that's that's the reason why the the team are working on this project has been uh you know coming up with ideas and have been working with working so well uh most of us aren't in the same time zone so we have been working async and some of the pr's that have been reviewed are like amazing i

i really didn't expect that so if you are new to open source there are some really great conversations in those fields so yeah that's that's basically a quick overview of what what the project is right now i think i'm almost going too fast but yeah that's that's the state of it right now if you if you want to have a look at a an example use case of the hooks i just i was just experimenting we just released a version and i was just experimenting with it recently this

is an example that you can check out and yeah this is this is super early days in this project and almost 20 people have been working on this and i'm super excited for the future of it and yeah i i i'm grateful to you know i'm grateful to be working on this project yeah this is fantastic just being able to uh have all that uh all that boiler plate abstracted away and only have 10 10 lines of code enable you to connect to a blockchain is is awesome uh one one question i have for you is uh is it only limited to

ethereum like being able to connect to an ethereum wallet or are there plans to extend this to say like connecting to a solana wallet or whatnot great question okay so uh i would love to make this a chain agnostic but for now i guess it's a it's a good idea to validate this idea by creating this first specifically ethereum and yeah so that we can see if this is actually useful because like i said this is an extremely ambitious experiment and if people find this useful i'm sure

i'm sure we'll create something for you know solana and any other change perfect and uh for passing in so are are you are are you in the team hosting your own like inferior account or whatnot to be able to connect to the the the mainnet or are you allowing people to pass in their own api keys to be able to do that so yeah we are letting them pass in fewer keys they are optional you don't need an if your key for everything but just in case you in places where you need it

we can yeah we are accepting it in the the provider component that we are using and while we're at it uh i forgot to mention that the the ui library that we have the components that we have all of them are based off of chakra so and you so you can basically pass any props that you can pass through a chakra component so you can basically apply your existing chakra themes you can pass in any props that you you can pass to and chakra input to our address input and yeah it just plays along nicely it literally is chucked our ui under the hood

awesome awesome that's great stuff does anybody else have any questions for darwatin team hey this is not much of a question but um i just wanted to say great work on this daiwat and everyone who's been working on it i i've used uh scaffolding a bunch in the past and i totally agree it's really bloated and so i think that's a great goal to kind of make this a lightweight library but yeah just uh congrats on everything and good work i have no clue what's happened thanks jake uh

and yeah i the entire team i would like i would like to congratulate all of them because we have been surprisingly working extremely efficiently even though none of us are in the same time zone so yeah i'm not i'm not sure how many of you are here if any of you are here just feel free to you know speak up and share anything that you want um i want to ask you if someone uh wants to contribute and help you build the

web ui where where can we start um i would say you can you can start by dropping the message in the web3 web3ui channel it's in the dev guild and then you have you can have a look at the open issues on the repo there are usually quite a few issues open and if no one has been already assigned to an issue it's basically up for grabs so you you just go on and comment on it and please let us know if you encounter any issues while trying to contribute because we are we are just upgrading our documentation as we go

uh jose has been has been working on the documentation i think he has done a great job up till now but yeah i'm sure there are edge cases thank you thank you i guess another question what's been something you found surprising or challenging about this project uh

yeah that's that's a great question and that that's something i was all planning on sharing with i think i completely forgot about it so i would say the biggest challenge is having a concrete road map ahead of us while we are trying to discover what we are actually trying to build because i would say that this space first of all the space is so early here and there's not a lot of um hey can you hear me okay uh so first of all there's

the space is so early there's not a lot of you know well-maintained packages that you can refer to unlike in web 2 where their libraries like chakra ui you know chakra ui material ui you know widely adopted and you basically know what's a good practice and what's not while in the web 3 space we are everyone's still basically trying to figure things out we are fortunate that we have some projects to look up to like scaffold need use tab 3 by the way we are using all of these

projects uh in our in our library so yeah we are just discovering new information as we go so the road map is constantly changing so that's getting a bit hard to keep up so often i'm finding myself like thinking about what we actually want to build with some component or some functionality when i'm reviewing a pr or putting in a pr myself so yeah that's been a challenge for i i would say everyone almost everyone in the team yeah it's always a challenge trying to

navigate such an ambitious project but uh you guys are doing a fantastic job so far uh one question for me is uh is the library ready for consumption now yeah yeah no worries no worries yeah the the question was uh is the library available for consumption now like can can i go and and grab the the connect wallet component and start using it or would you say it's still under development it's two cups per one you show up as on the screen

but maybe darwat is having uh mic problems at the moment um is idle right now that's weird maybe computer issues well that's that's a shame uh while we wait for daiwa to come back uh i guess i can use this opportunity uh to say that there for the next dev and tell uh it won't uh the next schedule devontel will be for january 6th um there won't be uh yeah oh my my internet just went all in a second yeah we suspected as much yeah all good

i think i i think i caught your question yeah i want me to answer that yeah yeah for sure so uh i would say the in its current state it's extremely unstable because things are working so you definitely can use the hooks but and also the also the components but you you you should expect to see some weird errors because for example we haven't added support for ens on test nets so you just basically get through in an error if you try to use an address input on ring p and you pass in an ens things like that

so yeah if you're planning to use it you did it on anything serious uh i would say you wait for v1 gotcha that's it awesome but if anyone wants to experiment and you know play around with it i would more than welcome any feedback because that would be so crucial right now yes for sure for sure uh we're coming up on time about six minutes left are there any other questions for dayawad and team um

if there are any questions uh middle has prepared for apps for everyone uh this is the first time um i've created four apps so this is a link to the spreadsheets uh try claiming one everyone and just delete the link if you successfully claim it and again shout out to needle for the great design yes yeah big shout out to maro for that awesome design and hopefully we can make these po-ops a regular thing for future dev and tells going forward yeah oh yeah all right

uh if there are no further questions uh you can always reach out to um daiwad and team in the web3 ui developers guild channel or or on the github repository itself and some final closing words for me so as i was saying before uh the next two fridays in december uh we won't be having any official dev and tells just because it's they fall on uh the 24th and 31st respectively uh so the next schedule dev and tell will be on january 6th and so far uh all the the friday slots in january are open so if you have uh

something cool you want to share a project or or just something you're passionate about please go ahead and and sign up you the instructions to sign up can be found on the notion wiki that's pinned in the devintel channel if you don't have access to the dev dev and tell channel i will also post that link in the developers voice text shortly after this call is concluded and yeah i just wanted to say a very happy holidays and happy new years to everybody and hope you get some time to actually recharge these last two weeks of december and uh come back extra strong for the 2022 push

so uh with that happy holidays everyone yes uh and thanks for hosting this nab yeah this is like a great initiative i've been loving every single session even though i was even i wasn't able to make the last two uh i i think i catch all of them on youtube yes so thanks for recording them as well yes yes for sure for sure i'm enjoying them as well i'm sure everybody else is is too i think today's attendance is the highest we've ever had in our short existence so very promising very promising yeah uh all right with that i will stop the recording now

Related talks