Please make one more video to explain how this can be useful on a architecture, where multiple projects (deployed on multiple domains) can share a components "layer" with each other. This is a *really* useful feature which other ecosystems dont have to my knowledge and it will surely benefit a lot of people and make Nuxt even more attractive. I subscribed for it, would be amazing
Oh makes sense with the new folder structure. I was trying to create a new project and when I did enable the compatibility version my app broke because didn't have the app folder. Thank you.
Sounds like a very useful feature, that you can have different config files for each layer. Although I have to think about a little bit when in real life I would use that - e.g. one layer uses Pinia, one Vuex? Or one Bootstrap, but another Tailwind? 😊 But in general I like the idea 🙂👍
Layers is more about grouping your app into logical units like "users", "settings", "sales", "blog", "auth" etc. So you can work on your "settings" feature and find all files related to settings in that layer. This is especially useful in larger apps with bigger teams where one team or developer might work on settings feature, another developer can work on users etc. without conflicts. It also gives the app nice, clean structure.
@@QueeeeenZ Yes, I understand the layers concept and agree with you, but my comment was meant more on "each layer can have its own config" - I was wondering how often in real life I would need a different config file for each layer :) But I don't insist that there aren't use cases for that, especially for large apps :)
Oh, I see what you mean. I have created large scale apps with layers and I have never needed to specify a different config for each layer. The only difference between layer configs was to specify where to find imports, components etc. because it's a different directory for each layer.
This is all really interesting.. how could we have a base collection of these global files and then have these layers override those global components? Does one layer's components override a layer higher up in the tree? If we can achieve this with layers then this is really exciting
is it ok to have layers outside the "my-app" folder? Imagine I have 2 apps: app1 and app2. Both share some common functionality. Can I have a structure like /layers/ , /app1/ , /app2/ ? And do I need pnpm to make this work or any package manager would do it? Thanks.
I thought layers in Nuxt meant a different thing. Layers allows you to share components with other installations, we are not talking about the same thing. Correct?
In simple terms, your final app will be all your layers merged together. The end result might be your 'top layer' app using components/utilities provided in some lower layers or like in the video an app where pages and their functionality are separated via layers and merged to create an app with multiple pages.
@@M-lt6kx I understand what you are talking about but I thought layers was something else. I have a ui layer that other Nuxt installations can use. Pnpm monorepo manages all layers. That is how they worked in Nuxt 3. Maybe they are ditching this concept
@nyambe Layers can be used for multiple purposes. Yes, one way is to share them among projects. But they cal also be used to implement a DDD/modular architecture. Take a look at the official docs.
Nuxt also has an upcoming multi-app feature which is for micro frontends. But layers is simply a way to group your monorepo app into logical features and it's completely optional.
just pointless meanderings in the javascript land. they keep changing things for no reason. instead they should selectively ignore things not being changed such as node modules... i dont know why javascript devs lap it up...
Please make one more video to explain how this can be useful on a architecture, where multiple projects (deployed on multiple domains) can share a components "layer" with each other.
This is a *really* useful feature which other ecosystems dont have to my knowledge and it will surely benefit a lot of people and make Nuxt even more attractive.
I subscribed for it, would be amazing
Oh makes sense with the new folder structure. I was trying to create a new project and when I did enable the compatibility version my app broke because didn't have the app folder.
Thank you.
Sounds like a very useful feature, that you can have different config files for each layer. Although I have to think about a little bit when in real life I would use that - e.g. one layer uses Pinia, one Vuex? Or one Bootstrap, but another Tailwind? 😊 But in general I like the idea 🙂👍
Layers is more about grouping your app into logical units like "users", "settings", "sales", "blog", "auth" etc. So you can work on your "settings" feature and find all files related to settings in that layer. This is especially useful in larger apps with bigger teams where one team or developer might work on settings feature, another developer can work on users etc. without conflicts. It also gives the app nice, clean structure.
@@QueeeeenZ Yes, I understand the layers concept and agree with you, but my comment was meant more on "each layer can have its own config" - I was wondering how often in real life I would need a different config file for each layer :) But I don't insist that there aren't use cases for that, especially for large apps :)
Oh, I see what you mean. I have created large scale apps with layers and I have never needed to specify a different config for each layer. The only difference between layer configs was to specify where to find imports, components etc. because it's a different directory for each layer.
This is all really interesting.. how could we have a base collection of these global files and then have these layers override those global components? Does one layer's components override a layer higher up in the tree? If we can achieve this with layers then this is really exciting
If you create a component/composable/page etc with the same name in a higher layer it will override the existing one.
Not sure what you mean by that. The idea of Nuxt layers is to "extend" layers not override them. Can you share your use case?
is it ok to have layers outside the "my-app" folder? Imagine I have 2 apps: app1 and app2. Both share some common functionality. Can I have a structure like /layers/ , /app1/ , /app2/ ? And do I need pnpm to make this work or any package manager would do it? Thanks.
Your layers can be anywhere. In any folder locally, in an npm package or in another git repo. Any of the supported package managers will allow this.
I thought layers in Nuxt meant a different thing. Layers allows you to share components with other installations, we are not talking about the same thing. Correct?
In simple terms, your final app will be all your layers merged together. The end result might be your 'top layer' app using components/utilities provided in some lower layers or like in the video an app where pages and their functionality are separated via layers and merged to create an app with multiple pages.
@@M-lt6kx I understand what you are talking about but I thought layers was something else. I have a ui layer that other Nuxt installations can use. Pnpm monorepo manages all layers. That is how they worked in Nuxt 3. Maybe they are ditching this concept
@nyambe Layers can be used for multiple purposes. Yes, one way is to share them among projects. But they cal also be used to implement a DDD/modular architecture. Take a look at the official docs.
this awfully reminds me of django and the apps concept
Nuxt also has an upcoming multi-app feature which is for micro frontends. But layers is simply a way to group your monorepo app into logical features and it's completely optional.
just pointless meanderings in the javascript land. they keep changing things for no reason. instead they should selectively ignore things not being changed such as node modules... i dont know why javascript devs lap it up...
Why do you care what JavaScript devs do?
@@codingwithmartin3177 i like technology as a whole. dont want my bethrens suffering