What is the Composition API? (Vue 3)

  Рет қаралды 18,202

Make Apps with Danny

Make Apps with Danny

Күн бұрын

Пікірлер: 79
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Please Like, Share, Subscribe & Comment - it all helps me create more content for you! 👉 Vue 3 Composition API Course: dannys.link/compositionapi 👉 My Courses: dannys.link/courses 👉 Download Fudget: www.fudget.com 👉 My VSCode Setup: dannys.link/vscodesetup 👉 DONT CLICK THIS: dannys.link/dontclick
@VolkunSports
@VolkunSports Жыл бұрын
you nailed the concept when masked the code for clarity.
@MakeAppswithDanny
@MakeAppswithDanny Жыл бұрын
Thanks 👍
@aspirinemaga
@aspirinemaga 2 жыл бұрын
In Vue 1 and 2 we've learned how to properly distribute and have organized chunks of code across the SFC (.vue). In Vue3 Composition API we are trying to forget about that and smash them together. Simplicity and well organized code was the root why I stayed with vue when it was 0.1v
@evolutionx1
@evolutionx1 2 жыл бұрын
Options should be the default and Composition only used for rare cases where you can't do it with Options.
@aspirinemaga
@aspirinemaga 2 жыл бұрын
@@evolutionx1 that's absolutely right. I should be glad for still being able to use options api in vue3 anyway
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
@@aspirinemaga good points guys. I felt the same way at first. I really didn’t like Composition API at first. But after spending 12 months working on a complicated app with it, I will NEVER go back 👍
@stefanonesi8712
@stefanonesi8712 2 жыл бұрын
@@MakeAppswithDanny I'm still in the stage where i hate composition API. But, i know that i'll eventually switch to Composition anytime soon, and convert options to composition is really boring, so...
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
@@stefanonesi8712 Check out my Vue 3 Composition API series it might change your mind: kzbin.info/aero/PLAiDzIdBfy8jr-ccMU8ymPn7o85RAZ_6T
@davidpile2576
@davidpile2576 2 жыл бұрын
Thanks Danny. Nice little into to composables
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Thanks David!
@medslk9753
@medslk9753 10 ай бұрын
thank you , you explained the concept really well
@MakeAppswithDanny
@MakeAppswithDanny 10 ай бұрын
You're welcome 👍
@0-Will-0
@0-Will-0 2 жыл бұрын
Really nice demo of why composition api is worth using.
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Thanks Will. Yeah I thought it was needed. I haven’t seen a good explanation of why the flip I should switch to it anywhere. It’s only through using it to create a complex app that I finally see the benefits 👍
@dekebaoe
@dekebaoe 2 жыл бұрын
Awesome as always, 👍 Thank you Danny
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Thanks Basar! 👍
@universecode1101
@universecode1101 2 жыл бұрын
The composition Api is a game changer for Vue.js 🔥 Nice Danny ✌🏻
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Definitely. Especially since Script Setup! 👍
@CyrilViXP
@CyrilViXP 13 күн бұрын
Fixes the problem that never existed
@Huntmare
@Huntmare 2 жыл бұрын
Thank you for the video, great as always ! love your courses also !!
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Thanks a z! 👍
@nickoquiamco978
@nickoquiamco978 2 жыл бұрын
does the composition API and options API have a difference in terms of performance ?
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
I’m not sure, but the the Vue 3 codebase has some indications that it’s more optimised for Composition API than Options API. I talked about this in one of my other videos 👍
@jofftiquez
@jofftiquez Жыл бұрын
I'm a bit iffy about the multiple onMounted hooks, wouldn't it be weird that way? I mean I'm totally down for it if it is, I just don't know if it's "normal" thanks.
@MakeAppswithDanny
@MakeAppswithDanny Жыл бұрын
It's up to you. You can have a single onMounted if you like, and put all your logic in there. Or use multiple, to separate concers.
@dipanshu2207
@dipanshu2207 2 жыл бұрын
great video! One question, why would you want to use a state management system like Pinia when simply using a composable/composition api state management? I had built a small app, which I used the composition apis state system and its easy and intuitive to work with, I have no experience with Pinia but for my purpose, I never really felt I needed a separate state management system, so in what cases I might want to use it?
@bartduisters3455
@bartduisters3455 2 жыл бұрын
If you want a similar approach to what you have been using, but also want Vue Devtools integration. Which allows for 'time traveling', which means you can see what your frontend looks like with different states. It also allows you to edit the state directly from the plugin and see the result live. If you have a small application and feel no need for the Vue Devtools functionality, you are probably just fine with the composition approach.
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Yes like Bart said. The only real benefit is debugging capabilities (via Vue Devtools) 👍!
@dipanshu2207
@dipanshu2207 2 жыл бұрын
Great, thanks guys
@CCDevYt
@CCDevYt 2 жыл бұрын
Danny if you would not mind. Make a informational video about Vue Router 4 too. Thank u :)
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
I will be covering Vue Router 4 in the full course, Clint! And also a bit here on KZbin. 👍
@Viktorres1
@Viktorres1 Жыл бұрын
Thanks Danny from your Udemy student)
@MakeAppswithDanny
@MakeAppswithDanny Жыл бұрын
My pleasure!
@saeed17
@saeed17 2 жыл бұрын
Thanks for the clear, concise explanation and easy-to-follow examples.
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Thanks Saeed!
@eberguerra3002
@eberguerra3002 10 ай бұрын
Siento que los composables aumentan la cantidad de archivos, y si se reducen en un archivo pero al final van a crecer en otros, la manera en la que estaban antes estructurados tenía un enfoque donde sabias donde podía encontrar todo, no se no me gusta mucho el nuevo estilo 😅
@MakeAppswithDanny
@MakeAppswithDanny 10 ай бұрын
Ése es un punto razonable. 👍
@bobobobo-ki2fw
@bobobobo-ki2fw Жыл бұрын
Thank you.
@MakeAppswithDanny
@MakeAppswithDanny Жыл бұрын
You're welcome!
@hakimov_dev
@hakimov_dev 2 жыл бұрын
Awesome bro )
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Thanks Hakimov!
@tanzimibthesam5861
@tanzimibthesam5861 2 жыл бұрын
Will course be available at Udemy?
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Yes it will Tanzim
@FloodGold
@FloodGold 2 жыл бұрын
Okay hurry up ha just kidding - I'll get anything you create whenever you make it available.
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
@@FloodGold haha. Keep an eye on KZbin today around 12pm 👍
@TyronC199
@TyronC199 Жыл бұрын
Sold
@MakeAppswithDanny
@MakeAppswithDanny Жыл бұрын
Me too! 👍
@salva-dev
@salva-dev 2 жыл бұрын
Thanks for your videos (and your great courses) , Danny. This video has made me think that maybe we should also use Composition API in vue 2 (and quasar v1) developments in my team in order to migrate easily (we're going to migrate to vue 3 but we must support IE11 this year 😓 ) . Do you think the same?
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
I don't know, I guess you need to look at how long it would take to switch over, and whether it's financially worthwhile at this point. But if time & money are not obstacles, I would say go for it 👍
@punithgowda6723
@punithgowda6723 2 жыл бұрын
Cool
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Thanks Punith!
@bharathhs1161
@bharathhs1161 7 ай бұрын
Always options api
@Tarabass
@Tarabass Жыл бұрын
Only opinion. What about performance, testing, migration, schooling.
@adriatic123
@adriatic123 Жыл бұрын
Options API is not RIP but well and prospering. Composition API is a fad, syntactic sugar without a single benefit (for example in code execution speed and size). More and more programmers realize that, while they are forced by their managers to be 'more modern'. I immediately know that such manager doesn't have the basic knowledge about Vue.
@MrBotv0091
@MrBotv0091 2 жыл бұрын
Danny, you look tired. Take care of yourself. Thx 4 info.
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
Yeah not been sleeping much lately. Been going through a separation while recording this course … 🙁
@flogginga_dead_horse4022
@flogginga_dead_horse4022 2 жыл бұрын
@@MakeAppswithDanny sorry to hear that!! I know what you mean!!
@MrBotv0091
@MrBotv0091 2 жыл бұрын
@@MakeAppswithDanny This one sucks. Hold on, bro, your students are with you!
@alexlytle089
@alexlytle089 2 жыл бұрын
I personally prefer the options API. Its simple easy to use
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
I know what you mean, Alex. I felt the same way for a long time. Look out for my Composition API series starting very soon. It may just change your mind a little bit 👍
@alexlytle089
@alexlytle089 2 жыл бұрын
@@MakeAppswithDanny Thanks Danny looking forward to it.
@James-li8cm
@James-li8cm 7 ай бұрын
this honestly looks more complicated... the only good thing it does is allow you to block your code out... my recommendation instead is: make smaller components use service classes for reusable code.
@hakimov_dev
@hakimov_dev 2 жыл бұрын
First like me )
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
😂
@UwU-dx5hu
@UwU-dx5hu 6 күн бұрын
This looks a lot like react😂
@MakeAppswithDanny
@MakeAppswithDanny 6 күн бұрын
Does it? 👍
@flogginga_dead_horse4022
@flogginga_dead_horse4022 2 жыл бұрын
one of a few things that ruined Vue for me...
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
😂 I know right. I HATED Composition API for a while. It really annoyed me. Love it now though, after creating a big app with it 👍
@flogginga_dead_horse4022
@flogginga_dead_horse4022 2 жыл бұрын
@@MakeAppswithDanny I don't like all the "refs" and such. Also have a big application that used BootstrapVue and that project died at version 2. Even Vuetify still doesn't work with 3, luckily Quasar does!!!
@flogginga_dead_horse4022
@flogginga_dead_horse4022 2 жыл бұрын
@@MakeAppswithDanny Hello, I just wanted to revisit this comment. I totally hated composition even after reading many things about it and looking at other training. After going half way through your Udemy class you have totally changed my mind!! I never saw it compared so well to options. It really does scale better. On the other hand it's like a completely different version of Vue and it's like starting over. I wish this was how it was done to begin with. Also I have a large project using Vuex and to have Pinia suddenly be the best practice is kind of annoying. Some of the decisions Evan makes have really messed up my projects. Another example is VueCLI and UI seemed like a really good way to manage projects and seemed like the standard and then along comes Vite and makes it all obsolete. All these changes make it nearly impossible to write apps without immediate technical debt. Sorry to write a novel. Enjoying your course!!
@MakeAppswithDanny
@MakeAppswithDanny 2 жыл бұрын
@@flogginga_dead_horse4022 Glad to hear you are starting to enjoy Composition API. I know, the changes are annoying, but that's just the bummer that comes with all tech, it's always changing. It took me 3 days to convert Fudget 2 over to Pinia (instead of Composable State Management). 👍
@raghavendra6978
@raghavendra6978 Ай бұрын
thank you!
@MakeAppswithDanny
@MakeAppswithDanny Ай бұрын
You're welcome!
Vue 3 Script Setup Tutorial - This Changes Everything!
23:40
Make Apps with Danny
Рет қаралды 62 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Vue 3 Composition API Tutorial #8 - Child Components
36:37
Make Apps with Danny
Рет қаралды 16 М.
Build your own Custom Composables in Vue
12:13
Vue Mastery
Рет қаралды 44 М.
Vapor: The Future Of Vue
21:27
Theo - t3․gg
Рет қаралды 127 М.
Why I’m Switching To Go in 2024
8:10
Awesome
Рет қаралды 100 М.
React VS Svelte...10 Examples
8:35
Beyond Fireship
Рет қаралды 596 М.
The Ultimate Vue 3 Tutorial (100% Composition API)
6:12:34
Laith Academy
Рет қаралды 270 М.
A Better Way To Organize Components In Vue
10:10
Program With Erik
Рет қаралды 26 М.
Vue 3 Composition API Introduction [FULL TUTORIAL]
23:46
Academind
Рет қаралды 177 М.
Organize your Composition API code (2k subscriber special)
18:22
Alexander Lichter
Рет қаралды 26 М.