Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to Yarn workspaces #54

Open
prastut opened this issue Jul 25, 2018 · 0 comments
Open

Move to Yarn workspaces #54

prastut opened this issue Jul 25, 2018 · 0 comments
Assignees

Comments

@prastut
Copy link
Owner

prastut commented Jul 25, 2018

Task:

Port our codebase to yarn workspaces so that there is a common node_modules folder and we don't repeat package installation.

Reference:

https://medium.com/@kohlandpen/yarn-workspaces-cra-now-fullstack-react-%EF%B8%8F-35bcb9229f79

More info:

Currently, our client and server are entirely decoupled into different folders but housed under one repository for easier code management.

Most apps are moving towards a monolithic structure where codebase lives in one repo, but each folder can serve as a microservice. Essentially it's not mandatory to have different repos for decoupled structures when we can simply have one single repo. I was against the microservice folder structure from the start of the trend, I liked the concept in terms of abstraction but a concept shouldn't hamper developer productivity. Afterall tools are made for us, not the other way round.

Coming back to our architecture, we have client which is bootstrapped with create-react-app package and server which is bootstrapped with node/express combination. As you can see both folders have node_modules. What I would like is a central node_modules folder. Why? Because most of the libraries are shared between client and server for eg: I want to use moment both on the client as well as the server side. Currently, in our architecture, I have to install it twice.

We need to lift the node_modules to the parent folder and then symlink packages inside these folders. Yarn workspaces enables this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants