Vasyl Stokolosa

@shystruk

Moving project’s components/services into packages (the separation of concerns)

In this day’s Component-Based Architecture is highly popular, each modern UI framework provides component structure approach. Check out this article for pros and cons. What I like the most in CBA is the separation of concerns😎

Whether starting a small project or having a huge one the separation of concerns is going to be a key point for easy maintenance, testability, reusability. If you are UI engineer you should have probably heard about npm package manager. This is a good way to move your reusable components, services there.

Why should I do that? ☝️
1. easy to share between teams
2. integration in one line - import package from ‘package’
3. maintenance 
4. testing
5. semantic versioning
6. private or public (community may help to improve)

If you want to have a private packages it is also possible.

As an example you may check this project.

In Dependencies list it has 4 public packages which were checked by open source community and improved 👌 (no-internet, publish-subscribe-js, set-interval, famulus).

How to create npm package?

Check out official doc. Rollup (module bundler for JavaScript) may help you to create a new standardized format for code modules included in the ES6 revision of JavaScript.

In addition, to the separation of concerns, I would like to mention “Pattern library” as a way to collect user interface design elements. Check out this article for more understanding 💪

Some thoughts are here and there:

👏 Thank you for reading. Suggestions, comments, thoughts are welcome 👍

If you like this, clap, follow me on medium, twitter, github share with your friends 😎

More by Vasyl Stokolosa

Topics of interest

More Related Stories