Why we need modules?
Modules is important concept for me to group related components together so when I look at component declaration I know the business scope and where it is used (instead of searching that component everywhere). It is crucial in big projects. Also modules allow you to lazy load all at once instead of seperate loading of related component( imagine 20 + components seperately). Without modules on initial project we can assume it is easier but as project grows , things get out of control. I looked at your Neftlic clone repo and it consists of few components so you may not feel difference with/without modules. Angular is working to make ngmodules optional but even with that I would prefer to use modules.
Why don't we use our folder structure to manage our components. We can keep one type of components in one folder and we can use import for lazy loading a bunch of components in react too. So I don't see any need for module.
Yeah but that causes another problem importing full modules in Angular. I've seen many times a shared module with all material components imported. Imported at many other places. That just add in wanted is to your modules. That is a problem too. I component creation seems so trivial in react that I don't think you should import more than 4-5 components in one and import them at other places. If you have created your app in the right way. I don't think there is a need of modules. I have read and wrote about Angular Compiler and I think we could have worked around them. It is one of the culprits that creates a bad narrative that angular is hard. In other frameworks the mental model is so easy. Create components and import them use them. We have worked with modules for so long that we have wtarted thinking it as important part of a framework but working in React made me think we could have work without them.
Moreover in services providedIn option have you given a module name it creates circular dependencies. Providing service in a module seems like the right thing but then you have to create an intermediate module import there and pull that module in the module. See already this comment is getting so confusing. I don't think modules are a good pattern and I'm very happy that they are going to be optional
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Why we need modules?
Modules is important concept for me to group related components together so when I look at component declaration I know the business scope and where it is used (instead of searching that component everywhere). It is crucial in big projects. Also modules allow you to lazy load all at once instead of seperate loading of related component( imagine 20 + components seperately). Without modules on initial project we can assume it is easier but as project grows , things get out of control. I looked at your Neftlic clone repo and it consists of few components so you may not feel difference with/without modules. Angular is working to make ngmodules optional but even with that I would prefer to use modules.
Why don't we use our folder structure to manage our components. We can keep one type of components in one folder and we can use import for lazy loading a bunch of components in react too. So I don't see any need for module.
İ am afraid with React.lazy you need to use React.lazy(()>import.... ) on every component which depends on that component. Is not it?
Just create an intermediate component. That is how everyone that use SCAM in angular does it anyway.
also don't forget, that with modules you can avoid the import hell in every component. (e g. importing every used material component every time?)
Yeah but that causes another problem importing full modules in Angular. I've seen many times a shared module with all material components imported. Imported at many other places. That just add in wanted is to your modules. That is a problem too. I component creation seems so trivial in react that I don't think you should import more than 4-5 components in one and import them at other places. If you have created your app in the right way. I don't think there is a need of modules. I have read and wrote about Angular Compiler and I think we could have worked around them. It is one of the culprits that creates a bad narrative that angular is hard. In other frameworks the mental model is so easy. Create components and import them use them. We have worked with modules for so long that we have wtarted thinking it as important part of a framework but working in React made me think we could have work without them.
Moreover in services providedIn option have you given a module name it creates circular dependencies. Providing service in a module seems like the right thing but then you have to create an intermediate module import there and pull that module in the module. See already this comment is getting so confusing. I don't think modules are a good pattern and I'm very happy that they are going to be optional