Congrats on reaching 10k subscribers! Thank you for all your hard work, your content hits that perfect balance of being interesting and just the right length to keep viewers engaged without dragging. Keep it up! 🙂Any chance for a video about Module Federation with Nuxt? I'm trying to implement it with Nuxt and Vite and nothing seems to work without issues and be ready for production...
This is one of the reasons I decided to bet on structuring my project as a monorepo(multi-package) where the shared folder is a just a simple package that can be shared on the frontend and backend. Depending on this type of configuration, that is often not easily found, can be very frustrating. Even the workaround before was kind of a nightmare. Great that this particular issue can now be solved like in the video, thanks for sharing.
10K Yay!, Congrats, for future videos maybe if there is a way to share a Nuxt composable that use useState, can we share the state between Nuxt and Nitro?
Awesome. Love it. Question: Is there a need for the types and utils folders under shared, or can we put things directly in the shared folder, or group things by domain rather than file type?
I've modeled it based on how it is implemented in the PR (and will likely land in core). You are free to add different folders for auto imports or do as you like 👌
I wonder if a data fetch from CMS might also go there? I handle that on the server with caching, however… I then find I need to pull into multiple components (using useState). Eg. Index, then each blog article for a small (20 article blog). From you videos, I know how to get the data, but I’m not so sure best practice on the client side. (Also congrats… sooo great!!)
i actually do exactly that in my project, absolutely usefull. the only downside i have noticed is no clear way to recursively import and also cross importing in the shared folder does not work for me without manual import declaration. Could you precise the pattern to recursively import all subdirectories and files ? I have that now imports: { // Auto-import recursively for utils dirs: ['shared/**/**'] }
It was amazing, also interesting to listen about budledStorage what is that in nitro configs,, and solution to build projecwiwith storage base, based on server environment, not on build environment. Thank you.
We are working on a way to think about projects like mobile phones and tablets. What we mean by that is how to create apps and themes that get installed in the site project akin to how we pull an app from an app store. Yes, the difference is it would be for development. We have a working concept with some tradeoffs. Seems tradeoffs are expected, but we would like to reduce the tradeoffs even farther. We would love to know what would make our work valuable for others. We don't believe this is a feature coming in Nuxt 4. LOL, perhaps for Nuxt 5.
This is great solves a headache for sure, I’m still not sold on using complete auto imports, I like it with the built ins but not so much with my own functions. Speaking of good intentions clearNuxtState is a horrible implementation and I bet is the cause of so many bugs that are hard to pinpoint. This is because if you clear the state and you’re using a module that also relies on the useState built-in it clears the state in the module as well. This is particularly bad for modules that use auth as the credentials can intermittently get cleared and you have no idea what is going on.
Man, auto-imports really suck. Glad we have the option to disable it (thank you). It's so unreadable. Easy to work with when youre alone, but a horror when the projects gets bigger and you work in a team. Im wondering why Nuxt went with the idea of magically importing stuff in the first place
Agree, I have seen some comments from the devs indicating they might be considering being less dependent on those auto-imports in future versions. There is a Eslint solution that adds the explicit imports, but I is just another unnecessary dependency to a problem that I wished wasn't there in the first place.
@pogospoofer69420 Even w/o auto imports a clear separation would be helpful IMO. Auto imports are a polarizing topic but IMO they can nicely improve the signal noise ratio
It's clearly a plus imo, the fact that we need dev tools to collapse imports in our IDEs clearly explains why it's important. The fact that we rely on dev tools to collapse imports in our IDEs shows just how important this is. The Nuxt team just needs to ensure that it doesn’t lead to performance bottlenecks.
It's incredible that developers deal with things that could be workarounded in a single line of code, yet there's still no smart caching for nuxi generate. Whenever you want to generate a static site, even after changing just a single line of text, you have to regenerate everything from scratch. Nuxt Content also isn’t fully resistant to deployment and hash changes, 820 opened issues, even more including modules, nuxt 4 was supposed to be out ~six months ago
Not sure I understand. What exactly is a workaround in a single line of code? Generate has caching if only the data changes - see ua-cam.com/video/Qgsd6-Hsbz4/v-deo.html (which lives mostly in core as experimental flag now!). Caching when code changes is a bit trickier. When you change code, you need to regenerate quite some files. 820 issues include non-issues, feature requests, upstream problems and more. This plain number doesn't tell much about the stability of a framework. It is more interesting how many issues are triaged, closed etc. etc. Yes, Nuxt 4 should've been out earlier indeed.
UPDATE: Nuxt 3.14 with the `shared` folder to use is out now! Simply opt into Nuxt 4 breaking changes and it'll work without any additional setup 🤩
Congrats to 10k! As a heavy Nuxt fan & user, I love your content 💪 It's really great for the community
Congrats on 10k! Will be 100k in no time!
Thank you so much!
I wish ✨🙏
Congratulations on 10 thousands subs. I am here from the start
Oh yes share Zod definitions ❤
Congrats on reaching 10k subscribers! Thank you for all your hard work, your content hits that perfect balance of being interesting and just the right length to keep viewers engaged without dragging. Keep it up! 🙂Any chance for a video about Module Federation with Nuxt? I'm trying to implement it with Nuxt and Vite and nothing seems to work without issues and be ready for production...
This is one of the reasons I decided to bet on structuring my project as a monorepo(multi-package) where the shared folder is a just a simple package that can be shared on the frontend and backend. Depending on this type of configuration, that is often not easily found, can be very frustrating. Even the workaround before was kind of a nightmare. Great that this particular issue can now be solved like in the video, thanks for sharing.
congratulations on 10k !!
Congrats Alex 🎉
Thank you Roman! 🙏
I really wanted to see how this will work with layers
Congrats on 10k
Thank you! ✨
@@TheAlexLichter I love your content, it’s awesome. You deserve 10k and more 🥳
I use the same validation schema between client and server most of the time. This would be useful. Thanks!
Yes, good use case for the shared folder 🙌
This is great! It will be perfect for validation schemas :)
Congrats!
Thank you 🙏🏻
CONGRATULATIONS !!
I needed this today. Loads of code duplication at the moment.
Happy Milestone!
Thanks 🙏
10K Yay!, Congrats, for future videos maybe if there is a way to share a Nuxt composable that use useState, can we share the state between Nuxt and Nitro?
Awesome. Love it. Question: Is there a need for the types and utils folders under shared, or can we put things directly in the shared folder, or group things by domain rather than file type?
I've modeled it based on how it is implemented in the PR (and will likely land in core). You are free to add different folders for auto imports or do as you like 👌
Congrats on the 10k+ subs!
Looking forward to 100k 🫡
Thank you 🎉
Haha - me too one day 🙏
I wonder if a data fetch from CMS might also go there? I handle that on the server with caching, however… I then find I need to pull into multiple components (using useState). Eg. Index, then each blog article for a small (20 article blog).
From you videos, I know how to get the data, but I’m not so sure best practice on the client side.
(Also congrats… sooo great!!)
i actually do exactly that in my project, absolutely usefull. the only downside i have noticed is no clear way to recursively import and also cross importing in the shared folder does not work for me without manual import declaration. Could you precise the pattern to recursively import all subdirectories and files ? I have that now
imports: {
// Auto-import recursively for utils
dirs: ['shared/**/**']
}
Just do 'shared/**'. That should be enough in my quick test for files like shared/a/b/c/d.ts
@@TheAlexLichter Perfect it works fine. Thank you.
It was amazing, also interesting to listen about budledStorage what is that in nitro configs,, and solution to build projecwiwith storage base, based on server environment, not on build environment. Thank you.
We are working on a way to think about projects like mobile phones and tablets. What we mean by that is how to create apps and themes that get installed in the site project akin to how we pull an app from an app store. Yes, the difference is it would be for development. We have a working concept with some tradeoffs. Seems tradeoffs are expected, but we would like to reduce the tradeoffs even farther. We would love to know what would make our work valuable for others. We don't believe this is a feature coming in Nuxt 4. LOL, perhaps for Nuxt 5.
Is there a WIP docs website for Nuxt 4?
There is a Nuxt migration guide in the docs. No own v4 website planned
Мои поздравления друг!
This is great solves a headache for sure, I’m still not sold on using complete auto imports, I like it with the built ins but not so much with my own functions.
Speaking of good intentions clearNuxtState is a horrible implementation and I bet is the cause of so many bugs that are hard to pinpoint. This is because if you clear the state and you’re using a module that also relies on the useState built-in it clears the state in the module as well. This is particularly bad for modules that use auth as the credentials can intermittently get cleared and you have no idea what is going on.
Man, auto-imports really suck. Glad we have the option to disable it (thank you). It's so unreadable. Easy to work with when youre alone, but a horror when the projects gets bigger and you work in a team. Im wondering why Nuxt went with the idea of magically importing stuff in the first place
Agree, I have seen some comments from the devs indicating they might be considering being less dependent on those auto-imports in future versions. There is a Eslint solution that adds the explicit imports, but I is just another unnecessary dependency to a problem that I wished wasn't there in the first place.
Nah it's hell in vanilla vue when you have to import 100 things into every component.
At least having the components auto-import is great imo
@Ss-zg3yj Because?
@pogospoofer69420
Even w/o auto imports a clear separation would be helpful IMO.
Auto imports are a polarizing topic but IMO they can nicely improve the signal noise ratio
It's clearly a plus imo, the fact that we need dev tools to collapse imports in our IDEs clearly explains why it's important. The fact that we rely on dev tools to collapse imports in our IDEs shows just how important this is. The Nuxt team just needs to ensure that it doesn’t lead to performance bottlenecks.
Благодарю
You are welcome! 😊
oh wow. always thinked you have millions of subscribers with the quality of your videos. Not 10k. I am in shock
Well, hope we can change that through the course of time 😛
It's incredible that developers deal with things that could be workarounded in a single line of code, yet there's still no smart caching for nuxi generate. Whenever you want to generate a static site, even after changing just a single line of text, you have to regenerate everything from scratch. Nuxt Content also isn’t fully resistant to deployment and hash changes, 820 opened issues, even more including modules, nuxt 4 was supposed to be out ~six months ago
Not sure I understand. What exactly is a workaround in a single line of code?
Generate has caching if only the data changes - see ua-cam.com/video/Qgsd6-Hsbz4/v-deo.html (which lives mostly in core as experimental flag now!). Caching when code changes is a bit trickier. When you change code, you need to regenerate quite some files.
820 issues include non-issues, feature requests, upstream problems and more. This plain number doesn't tell much about the stability of a framework. It is more interesting how many issues are triaged, closed etc. etc.
Yes, Nuxt 4 should've been out earlier indeed.