Тёмный

You're Probably Using Nuxt Wrong 

LearnVue
Подписаться 44 тыс.
Просмотров 15 тыс.
50% 1

RESOURCES
Source Code - github.com/nuxt/nuxt/blob/fdb...
✅ Join the LearnVue+ Waiting List - learnvue.co
Get early access to videos, exclusive content, interactive code challenges, and more.
follow me on twitter
/ mattmaribojoc
#vuejs #vue #javascript #webdev

Наука

Опубликовано:

 

30 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 67   
@iUmerFarooq
@iUmerFarooq 2 месяца назад
Need more Vuejs and Nuxtjs content 💚
@OGJons
@OGJons 2 месяца назад
WE'RE SO BACK BABY
@LearnVue
@LearnVue 2 месяца назад
back like i never left 🫡
@user-od1mt8qr8y
@user-od1mt8qr8y 2 месяца назад
I'm still confused. I definitely have to watch this video more than once. Thank you.
@LearnVue
@LearnVue 2 месяца назад
yeah it's a pretty dense topic. let me know if you have questions
@mohammedzaid6634
@mohammedzaid6634 2 месяца назад
great video i was confused about this for a while now i understand it THANK YOU! KEEP GOING!
@mohaab
@mohaab 2 месяца назад
Love this, thanks for the explanation!
@LearnVue
@LearnVue 2 месяца назад
glad it was helpful
@RaphaelDDL
@RaphaelDDL 2 месяца назад
Thank you for the explanation. Nuxt2 was easier to understand in that matter, I think. You either used fetch() (and $fetchState.pending etc) for data fetch which doesn't block client navigation (and you have to assign the value to your data via this.datavar = yourfetchvalue) , or asyncData() for navigation blocking (and you directly return the data you want that will be used in the template, without need to assign to a data). As far as I remember, that was it. Now in 3 is confusing by having useFetch, useAsyncData, $fetch.. which in the end is all the same method, but it doesn't block because you can give lazy true.
@khakcsar
@khakcsar Месяц назад
Thanks for explaining it in such an easy way.
@universe_decoded797
@universe_decoded797 2 месяца назад
We should keep it simple, simplicity makes working with a framework nice.
@danialwafiy5978
@danialwafiy5978 2 месяца назад
Hi, on a side note, does using server:false mean it wont get rendered on the server hence no SEO ? because for me what I do now is if I want the content data to NOT BE "SEOABLE", I'll set server:false, else I'll just use default. Not sure if this is the right concept.
@LearnVue
@LearnVue 2 месяца назад
it won't render on the server, but tbh it's still unclear if/how/when Google renders JS client-side. If you want to be sure it won't be indexed, useSeoMeta is probably your best bet
@TheAlexLichter
@TheAlexLichter 2 месяца назад
It is "probably" still indexed by Google *but* SEO would be better when rendering it on the server. Not even starting to talk about OG tags which aren't available otherwise (if they rely on the data)
@wertin200
@wertin200 2 месяца назад
Great video, it explains a lot!
@jaker9007
@jaker9007 2 месяца назад
I have been using $fetch exclusively in cases when fetching is triggered by user actions, inside functions. But can we avoid using $fetch altogether by passing proper options to useFetch?
@shadkamel362
@shadkamel362 2 месяца назад
This explains a lot for me, thank you
@LearnVue
@LearnVue 2 месяца назад
appreciate u fr
@svenst
@svenst 2 месяца назад
Mh .. still not clear to me, do we need to add the await or not?
@s4ndeep1203
@s4ndeep1203 2 месяца назад
thank you for explaining this
@olatunjiolakunle6908
@olatunjiolakunle6908 19 дней назад
Powerful explanation
@Slotherinee
@Slotherinee 23 дня назад
Guys, could anyone tell me which font and theme author uses?
@AksoomHussain7866
@AksoomHussain7866 2 месяца назад
butter smooth explanation 🤩
@LearnVue
@LearnVue 2 месяца назад
glad you think so :)
@St0rMsk
@St0rMsk 3 дня назад
Why is server side navigation / initial request blocked when using useLazyFetch / useLazyAsyncData?
@khaledoghli3400
@khaledoghli3400 14 дней назад
When using nuxt , do i need to use Axios and set global interceptors !?
@pratikrane149
@pratikrane149 2 месяца назад
Timely video! Currently migrating a project from Vue2 to Nuxt3 and I did struggle to know which composable to use where. Thanks for an easy explanation of such a complex topic. Always love this clean demonstrating videos! ✨
@orenmizr
@orenmizr 2 месяца назад
great content! 10x matt .
@user-nr9ti5xp5q
@user-nr9ti5xp5q Месяц назад
Sorry but It's still doesn't clear to me, if its client side fetching then I think await is not needed, and it wont block navigation when its client side
@what1heh3ck
@what1heh3ck 2 месяца назад
I’m still confused. Does “await” matter?
@nishantrai982
@nishantrai982 Месяц назад
yes. For data to be accessible (not be a promise) in the script setup.
@div0ky
@div0ky Месяц назад
@@nishantrai982 Thanks! I listened to the video in the background and missed this key detail.
@amardeepgill3213
@amardeepgill3213 2 месяца назад
the pending ref is deprecated ;) best to use status
@TheAlexLichter
@TheAlexLichter 2 месяца назад
Very good point!
@TilenPirih
@TilenPirih 2 месяца назад
Is there also any trick when you need to pass authorization header for example? what would be the best solution in that case? do we create our own instance of useFetch, is it possible to set some global header somewhere in the config? What do you recommend? Typical example when you have to login and then get some items.
@notlekrut
@notlekrut 2 месяца назад
I follow the example in the documentation - "Use Custom Fetch Composable" - it's basically a wrapper around the use fetch with default request options. You can use the functions onResponse and onRequest in the options to change both the response and request respectively. Or just set the headers field, either from runtimeConfig if it's an app config, or from another composable if it's a user auth header for example
@LearnVue
@LearnVue 2 месяца назад
Alexander Lichter dropped a banger video that could be helpful here - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-jXH8Tr-exhI.htmlsi=RMZ23k-Vkwbqi6y9
@TilenPirih
@TilenPirih 2 месяца назад
In one project I created my own instance under composables and use that instance to pass data.
@dqrk0
@dqrk0 2 месяца назад
worst thing about nuxt is the lack of documentation, so you get into situations like this where you have to read through the source code to understand what these functions do
@najlepszyinformatyk1661
@najlepszyinformatyk1661 2 месяца назад
nuxt sucks because of this.
@Microphunktv-jb3kj
@Microphunktv-jb3kj 2 месяца назад
@@najlepszyinformatyk1661 makes you think they intentionally do bad docs... so they can sell their courses and certificate wich seems a thing now.... i think everyone would laugh in Estonia.. i would t try to get hired saying i have a "nuxt certificate" , would be seen as stupid tax.
@codybontecou
@codybontecou 2 месяца назад
The deeper you get into open-source libraries, the more you realize every library has this issue. Learning to read source and auto-generated documentation is key to mastering these tools.
@theseangle
@theseangle 2 месяца назад
Nuxt 2 gave me a horrible impression of Nuxt, so horrendous I just don't touch Nuxt nowadays. There was no human readable documentation, no typing, too much forced magical globals, string to symbol magic (even into global symbols), no proper informative errors, impossible migration/updates, very slow development of Nuxt 3 and the bridging methods, errors happening from absolutely nothing for zero reasons (that are non-documented and impossible to track down), very slow hot module replacement and a whole lot of other things that made me lose so much sleep and gave me gray hair. Just think about it: forced global variables, that have absolutely zero typing/type-hinting. Never fails to be a ground for eventual impossible to track down runtime errors. Forcing you into re-typing everything manually via .d.ts into global scope. Again, unmaintainable, unreliable and evil, because human factor. At least they have typing now
@quintencabo
@quintencabo 2 месяца назад
Idk what your talking about the docs are great now
@Nerlon93
@Nerlon93 2 месяца назад
Ok. Now the same but with some real dummy-app example not just abstractive theory pls! It's much easier to understand the abstraction if you have some peaches and apples to visualise those technical aspects :)
@yourivanmill
@yourivanmill 2 месяца назад
This feels so weird, because if you await a component the parent should be Suspend. So this is kinda a "hack"? Why did Nuxt not let the user use "normal" onServerPrefetch" hook?
@LearnVue
@LearnVue 2 месяца назад
the component will suspend with await, using lazy is a way to opt out of it client side i think it’s really nice to have the same code for both ssr and client, but the specifics of all the options can get confusing.
@blokche_dev
@blokche_dev 2 месяца назад
Nuxt is flexible. But damn! it's not always obvious to know which tool to use and when :/
@dlodeprojuicer
@dlodeprojuicer 2 месяца назад
So true!!
@LearnVue
@LearnVue 2 месяца назад
any specific tools youre thinking of? im always down to make some more vids !
@blokche_dev
@blokche_dev 2 месяца назад
​@@LearnVue I had to spend some time to figure out what was called on the server, what was not for example. Correct me if I'm wrong, but as I understand, server components (still experimental) are actually the only way to have secure logic inside components. Otherwise you have to use the server part and make api calls (where the first render may be safe and made on the server but all subsequent calls are made client side).
@TheAlexLichter
@TheAlexLichter 2 месяца назад
@@blokche_dev Correct
@virtuoz-ru
@virtuoz-ru 2 месяца назад
👍
@Tarabass
@Tarabass Месяц назад
And useLazyFetch? :P
@tolgabeyazoglu536
@tolgabeyazoglu536 2 месяца назад
very fast transition screen and is it possible to slow down your narration
@hyno
@hyno Месяц назад
Use ( Shift + < )
@Codethier
@Codethier 2 месяца назад
bit salty you just posted this, i kind of spent the last week coming to the same conclusion 😶😶
Далее
Server Components Keep Getting Better
4:29
Просмотров 7 тыс.
A Better Approach To Data Fetching In Nuxt?
4:51
Просмотров 3,8 тыс.
skibidi toilet zombie universe 33 ( New Virus)
02:59
Просмотров 2,2 млн
better fonts with less code? it's a win-win.
0:50
Просмотров 6 тыс.
This Should Have Been In CSS Years Ago
1:57
Просмотров 34 тыс.
Vue just got SO MUCH better
4:06
Просмотров 42 тыс.
why im NOT hyped for nuxt 4
4:00
Просмотров 14 тыс.
This is the Future of Vue
4:09
Просмотров 24 тыс.
Prisma and Nuxt is my new favorite combo
5:01
Просмотров 30 тыс.
My Favorite Vue Form Library
4:00
Просмотров 17 тыс.
Mastering Advanced Nuxt.js with Daniel Roe
1:19:33
Просмотров 8 тыс.
Самый СТРАННЫЙ смартфон!
0:57
Просмотров 35 тыс.
Это спасёт камеру iPhone
0:32
Просмотров 235 тыс.