Hey everybody What s a…
Hey, everybody! What’s a general recommendation on how to deal with what used to be “SharedModule” in NX enterprise workspace scheme? The one that reexports other shared libs modules
Responses:
in my apps that’s either a single shared
library or when the app is larger I have shared libs for each project feature: course-shared
, store-shared
, etc.
We avoid using one monolithic shared module and instead import each module that is needed.
How about UI things ? Also just import them individually throughout the app?
Hi, I have a related question: Where do you put interfaces that are shared between ui
and data-access
libraries? Do you have a models
library that is included by ui
and data-access
?
I’ve decided to have shared/models library + /models lib for every feature module. In /shared/models you put only something that can’t semantically be tied to any particular feature module. So, if in your feature module you need to access model from another feature module, but it doesn’t make sense to make it shared - you just reference /feature/models lib without any connection to feature lib itself.