BIT.DEV — Can It Replace Conventional Component Packages?

in #bit6 years ago

BIT is a new concept in the market where you can manage your components among multiple/several projects and manage them with full scalability. The principle behind developing a platform like BIT.DEV is to have the source code of the external components to be a part of your local code and the best part is you can make changes according to your need and tag it with a different version and publish it. It just makes so much sense to have the isolated components code inside your source and make the changes on the go.



Bit In a Team

Bit is open-source and lets you isolate your components and converts them into sharable modular components that can be used among multiple projects and can be made public for the other users to use. This is one of the fascinating thing that I found about it. It doesn’t only let you publicly publish your packages but also, you can manage your own private space that only you can use. e.g If you are working on multiple projects and you want your components to be reused instead of copying and pasting or publishing your npm package (becomes very intensive) then it really takes the lead. You team members would also be able to make use of your code efficiently and your project manager would be happy to see all the component’s progress at one place. Ultimately, the code would be more consistent and development would be a lot faster.


Is Developer Experience Improved? 

Definitely! Let me show you an example and why I feel that way. Bit.dev allows you to host your components but you can also host it on your private/dedicated server. You can go to https://bit.dev/ and check out public components yourself. You would be amazed to see the progress of the platform in such a short period of time. It lets you log in with GitHub and in order to use the packages in your project, you would need to install its CLI using npm as


npm install bit-bin -g


or yarn as


yarn global add bit-bin


Before you are able to use a component in your project, you would first need to initialize your project with 


blt init // In order to initialze your project with bit


In addition, you would need ssh keys setup or do a bit login in the terminal which would open up a link in your default browser


bit login


Once you are authenticated, choose a package of your choice from bit.dev and import it using 


bit import package-name


It would import your package into a default repository as PROJECT_ROOT_DIRECTORY/componentsif you want to specify a path to import then you can do it using — path as


bit import package-name --path src/components


Now the component would become available in your local path which you can import in your code like your own code. The sad part is I tried a lot of components but only a few worked out of the box. It was like 4 out of 11 worked for me with no effort. But the same things happen with npm/yarn component packages. So why would a developer go for BIT? It’s a very reasonable question and that’s why I think bit.dev is still maturing but it will truly make a good impact on how we do things with isolated components and packages.


EXPORT

In terms of exporting a component that a user think can be reused is pretty easy too. First, add the components that you want to export as 


bit add src/myComponents/*


Second, do the export as


bit export user.my-collection


where user.my-collection is the scope that you want your components to be exported too.

Summary

Overall, I would say Bit is a great way to manage and isolate your components and use it with multiple projects. It doesn’t only let you import/export but also lets you define your own versioning and let you change the actual library code on local, on the go. This is a hot technology that I would want to keep my eyes on and really looking forward to what the future holds for BIT.

This blog has also been published on Medium. Link —https://medium.com/@chandna.vishal1234/bit-dev-can-it-replace-conventional-component-packages-2e3a989920e2

 If you found any value in reading this, give it a thumbs up. 

Thanks.

Coin Marketplace

STEEM 0.09
TRX 0.30
JST 0.034
BTC 115067.22
ETH 4145.27
USDT 1.00
SBD 0.61