You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: