sgcodigo / frontend-boilerplate

A monorepo boilerplate for both web and cms.
1 stars 0 forks source link

Utilites sharing, maintenance, implementation & more #11

Open yethiha-codigo opened 4 months ago

yethiha-codigo commented 4 months ago

In Codigo we write utilites which can later be used in the on going or new projects of Codigo.

Example of utils codes are Form Components, Image Components, useQuery( which consists of query funcs ).

Currently, whenever we create a new project we copy the utilies from old project.

For example utilites from Trifecta are copied from Renonation.

This ☝️ approach work but it has own limitation. What happen when update the utils from Trifecta and continue the development while leaving Renonation behind. And later when Renonation need the utils which already developed in Trifecta, What should we do ?. Copy utils form Trifecta to Renonation or should we developed the new utils in Renonation? As we can see there is counter productive in this process. And the issue become much bigger when there is more projects which uses the same utils.

So which approach can we used to matain, sync, share this utils codes which will be used across through out the codigo projects.

My recommend is using Share Repo aka Github sub_modules When we used GitHub sub_modules we get advantages such as

kyawzayarwin-codigo commented 4 months ago

I would like to understand more about shared repo. Can you please kindly demonstrate in the next meeting by using another github repo or something? I have seen proof of concepts in current github repo for mono repo but I haven't seen the details how shared repo will be look like when we're going to implement it.

So I can't decide yet and give voting for it.

@yethiha-codigo

yethiha-codigo commented 4 months ago

@kyawzayarwin-codigo Sure bro, next meeting is going to be "Comparing Shared Repo with Monorepo". In the mean time plz explore the shared_repo when u got the time

yethiha-codigo commented 3 months ago

after doing the meeting on Jun 5 2024

We explored the difference between shared business logic and shared utilities

Business logic example "Checkout" func share between 7E CMS & 7E Website can be consider as share business logic.

Share utiilies example useFetchQuery hook share between all the app of codigo can be consider as shared utilies