3 ms·
creating or updating a component is usually cross-concern, so if you want to change some functionality in a component you'll have to update it's controller,view
by Illniyar 9y ago
creating or updating a component is usually cross-concern, so if you want to change some functionality in a component you'll have to update it's controller,view,model etc...
If they are in the same folder, it makes moving between the relevant files for a feature easier (especially if you have a lot of components and finding the right file in your "controllers" folder means searching through a few dozen files).
It also makes reasoning about a certain feature easier - since all the relevant files are grouped next to eachother you can easily move between a feature's controller and it's view.
It also makes moving a feature easier- instead of renaming each file separately you can simply move the folder to anywhere else in the structure (for instance if you move a feature from a specific page to something more generic/shared)
- maaaats 9y agoWe always try to think that one folder ideally should be able to be copied to its own project and live on as its own npm module.