Vuex vs Pinia | Vue 3 Tutorial

Поделиться
HTML-код
  • Опубликовано: 12 июн 2024
  • Vue core team member Ben Hong presents the first two lessons in his new course "From Vuex to Pinia". To watch the rest of the course, visit: www.vuemastery.com/courses/fr...
    Ready to master Vue.js? With weekly Vue js tutorials on the latest topics, and exclusive content with Evan You (the creator of Vue), Vue Mastery is the ultimate learning resource for Vue developers to level-up their skills. Watch more free Vuejs tutorials 👉 www.vuemastery.com/courses
    Get in touch 👉 team@vuemastery.com
    0:00 Overview
    Link mentioned: www.vuemastery.com/courses/vu...
    0:38 What is Pinia?
    1:28 What you'll learn in this course
    2:16 Why Migrate from Vuex?
    2:45 Benefits of Pinia: Simpler API
    4:02 Benefits of Pinia: DevTool Support
    4:30 Benefits of Pinia: TypeScript Support
    5:05 Is your app being actively developed?
    5:34 Let's ReVue
    Keep watching this course on VueMastery.com
  • НаукаНаука

Комментарии • 32

  • @emberchord
    @emberchord 2 года назад +15

    Someone had fun editing this video.

  • @JosepCrespoSantacreu
    @JosepCrespoSantacreu 2 года назад +7

    Pinia is Vuex simplified and, with TypeScript support. Great! ❤️

  • @VueMastery
    @VueMastery  2 года назад +2

    🍍 You can watch the full "From Vuex to Pinia" course here: www.vuemastery.com/courses/from-vuex-to-pinia/what-is-pinia

  • @AngelHdzMultimedia
    @AngelHdzMultimedia 2 года назад +11

    It's briefly mentioned in the docs, but we can pass a function instead of an object as 2nd argument in defineStore(), and it will look like the setup method of Composition API. For me, it's even better, because it matches Vue 3's workflow and syntax.
    export const useMainStore = defineStore('main', () => {
    const count = ref( 0 )
    function increase() {
    count.value += 1
    }
    return {
    count,
    increase
    }
    })

    • @yourivanmill
      @yourivanmill 2 года назад +1

      Defining stores this way, is so nice. You don’t have to deal anymore with that ugly state, actions and getters object

  • @yekt3805
    @yekt3805 26 дней назад

    I love it! Only a real javascript dev can look at syntax that messed up and dare to use the word "simplicity"

  • @jhonatan2266
    @jhonatan2266 2 года назад +1

    this changes are incredible, i am super happy for differences, thank you team of Vue.

  • @SomeOne-cx2kq
    @SomeOne-cx2kq 2 года назад +3

    I'm super interested in knowing what are you using to create this video typography and graphic motions, it looks super cool. :D

  • @adin00
    @adin00 2 года назад +1

    4:34 is there any chance the devtool will find its way into device inspector too? state debugging is quite hard without it

  • @HoangNguyen85
    @HoangNguyen85 2 года назад +3

    I love Vuex but after migrate to Pinia, I can say Pinia is simpler and easier to use, full typescript support.

  • @caiovinicius7871
    @caiovinicius7871 2 года назад

    I Love Pinia, Good Job guys!

  • @hazimdds
    @hazimdds 2 года назад

    yea im glad that i stiped using vue.

  • @user-cf5uf7vf2g
    @user-cf5uf7vf2g Год назад

    oh lucky i browse more video before start coding in vue, so much better framework flood out continuously.

  • @muharief3885
    @muharief3885 2 года назад +1

    may be it's mobx version against redux in react. Well that how open source works, any one can develop library and claim its better than the other. On the end, it's just a tools, take what ever click on you and call it a day.

  • @timotting6151
    @timotting6151 2 года назад +2

    3:15 in and I still haven't learned anything about Pinia 🤔

    • @pashutaz
      @pashutaz 2 года назад +3

      7:08 in and still haven't learned anything about Pinia :)

    • @daleryanaldover6545
      @daleryanaldover6545 2 года назад

      This is VueMastery guys, you need to pay to watch the whole crap. This is just the introductory video.

  • @druharper
    @druharper 2 года назад +1

    It’s peen-ya… no pin-ee-uh.
    Great informative video :)

  • @bombrman1994
    @bombrman1994 Год назад

    simplifying my life I always hated those messy Vuex stuff same when I used to learn GraphQL

  • @hashzones
    @hashzones 5 месяцев назад

    I liked the video, however the background music is really annoying. The parts without music were clearer and eaasy to understand.

  • @asiacuisine4869
    @asiacuisine4869 2 года назад +1

    Looks like i wasnt the only that dislike Vuex and hadnt use it all these while.

  • @mikebean.
    @mikebean. 2 года назад

    Whenever I learn vue3 I think ill drop vuex for it

  • @anj000
    @anj000 Год назад +2

    Oh god.
    On the one hand it is good that Vue is developing.
    but on the other hand - IT IS A HOT MESS.
    New version, composition API, and now new state manager. Not to mention TypeScript is becoming the norm. I get that I don't need to learn all of this but if I want to find a job in Vue I can encounter projects with any number of different combination of those. It is becoming impossible to just say "I'm proficient in Vue" because there is so much variation.

  • @michaeldausmann6066
    @michaeldausmann6066 Год назад +1

    I'm a gonna go ahead and have a complain. All my opionions.
    re: 'vuex is complicated'... Bullshit...the counter action is not necessary, if there is no async fetch required, just use the mutation....Mutations are specifically for mutation while Actions are for handling async fetches, it's so simple, why u gotta fuck it up and conflate/complex the 2 things back together?
    re: vuex doesn't work with typescript.. bullshit, it works fine
    re: invoking mutations with a string... yes agree, this is a pain.
    re: pinia is 'simpler'.. conflating/complecting 2 things which are different is not simpler... it's more complex..its in the word.
    re: use it because it's brand new.... this is not a reason
    You haven't changed my opinion that splitting state management into another lib is a dumb idea.

  • @mikebean.
    @mikebean. 2 года назад

    Haha ReVue lol

  • @firelights3675
    @firelights3675 2 года назад +6

    Vuex guidelines when it came out: you should separate vuex into mutations and actions, DO NOT CALL MUTATIONS FROM COMPONENTS.
    It took you this many years to realise the separation is useless? JavaScript world is such a joke

    • @harshmudhar96
      @harshmudhar96 2 года назад

      It looks like a good lesson on over-engineering for the team.

  • @lazykid9167
    @lazykid9167 Год назад +2

    for gods sake, please stop using the easiest toy examples like a counter app. I can't see it anymore. it doesnt help.

  • @noise8653
    @noise8653 2 года назад +1

    its already easier in vueX , structure and everything. wouldn't it be possible if we remove the mutation from VueX and make it work everything (async etc) with just actions?
    so we can just use $store.dispatch() or just $store.stateProperty.

    • @AngelHdzMultimedia
      @AngelHdzMultimedia 2 года назад +2

      Is not already easier in Vuex. Pinia was fused with Vuex 5 so they are basically the same thing now.
      So if you are using Vuex 5 you are using Pinia.