I am almost exclusively working with Next 14 for 5 months now, I till today get confused while working and sometimes import wrong components. I am looking for a good convention so I can separate the files (Not folders).
Ideal solution should allow me to reach following
- I need separation of concerns as features, not files. so client and server files can exist in the same folder
- give me an indication while importing them so I or any of other team member don’t import a server file into client and accidentally make the whole tree client.
- need something that scale with size of project
I was just thinking to add a name, like this
mycomponent.ts
for server ones and mycomponent.client.ts
from client components, and choosing this because I want to try my best to make sure most of the app stays in server unless required.