How Vue.js as a web framework optimises rendering speed

Sdílet
Vložit
  • čas přidán 20. 04. 2023
  • Original talk "Seeking the Balance in Framework Design" by Evan You creator of Vue.js at JSConf.Asia 2019 in Singapore. Find it at • Evan You on Vue.js: Se...
  • Věda a technologie

Komentáře • 133

  • @ninhdang1106
    @ninhdang1106 Před rokem +284

    Just one short to distinguish between React and Vue :o

    • @starscream320
      @starscream320 Před rokem +2

      ​@@darthvader4899 can you elaborate more on svelte in contrast to react or vue or both?

    • @darthvader4899
      @darthvader4899 Před rokem +25

      @@starscream320 svelte is already a compiler which compiles your .svelte files into vanilla javascript

    • @ccgarciab
      @ccgarciab Před rokem +21

      ​@@starscream320 Svelte takes this idea and runs with it. Svelte does no diffing and instead overloads the semantics of the assignment operator to detect reassignments and re-render only affected elements. This also allows it to ship much less js, making sites lighter and faster to process.

    • @paschanchik
      @paschanchik Před rokem

      react do same using keys

    • @climatechangedoesntbargain9140
      @climatechangedoesntbargain9140 Před rokem

      Or react and sycamore

  • @Steve-Richter
    @Steve-Richter Před rokem +31

    Very difficult to debug a vite/vue /typescript program in the browser. Source maps are not accurate.

  • @xushenxin
    @xushenxin Před rokem +37

    So next version of Vue will do direct dom update like Svelte?

    • @jithinshah2754
      @jithinshah2754 Před rokem +2

      There is a proposal for vapour mode

    • @user-re8lt2gy3g
      @user-re8lt2gy3g Před 11 měsíci

      they say that they will take the solidjs approch of doing things

  • @marcusrehn6915
    @marcusrehn6915 Před rokem +2

    would the static way to do this result in an instruction that uses a simple xpath?

  • @masoud1128
    @masoud1128 Před rokem +54

    Svelte, solidjs Qwik : 🤓

    • @deviance7331
      @deviance7331 Před 10 měsíci

      Latest benchmarks show Vue3 as faster by a margin than svelte in total.

    • @acopier
      @acopier Před 4 měsíci

      all of these have basically no ecosystem

  • @sBerryCandy
    @sBerryCandy Před rokem +2

    what is original video of this shorts?

  • @jinushaun
    @jinushaun Před 10 měsíci

    Haven’t seen the whole video, but this is a very contrived example. In the real world, the component tree would be filled with hundreds of dynamic elements.

  • @khoroshoigra8388
    @khoroshoigra8388 Před rokem +8

    in short, vue using virtual DOM

  • @pierreollivier1
    @pierreollivier1 Před 11 měsíci +5

    I prefer raw WASM just to flex

  • @azulay7
    @azulay7 Před rokem

    What about AOT, cd already knows where is the exact location to change it right?

  • @icarusgk
    @icarusgk Před rokem +27

    Vue already performs better than React in all cases and Svelte in some cases, just with VDOM optimizations.
    But later this year (2023) Vue will soon have a compiler too, just as Svelte’s called Vapor Mode.
    Dropping the VDOM completely and having a performance similar to that of SolidJS

    • @phoenix-tt
      @phoenix-tt Před rokem +1

      Vue has a compiler :)

    • @icarusgk
      @icarusgk Před rokem +1

      @@phoenix-tt yup, I meant a compiler as in vDOM less compiler hehe

  • @mauriciomatias6261
    @mauriciomatias6261 Před rokem +4

    Evan es mi pastor

  • @anj000
    @anj000 Před rokem +13

    Is it just me, or the code at the beginning and at the end is exactly fooking same?

    • @shivanshsharma7422
      @shivanshsharma7422 Před rokem +1

      It is the exact same. He’s using the same markup as an example to distinguish how the vdom diffing algo needs to go through each tag compared to vue templates

    • @anj000
      @anj000 Před rokem +5

      @@shivanshsharma7422 maybe I'm just stupid or this explanation is misleading.

    • @shivanshsharma7422
      @shivanshsharma7422 Před rokem +1

      @@anj000 i think itd be better to watch the whole talk where it has his explanation on how vue tracks updates or whatever. Anyways, svelte ftw!

  • @Titanman316
    @Titanman316 Před rokem +35

    *coughs in svelte*

    • @icarusgk
      @icarusgk Před rokem +8

      *coughs in Vapor mode*

    • @yourivanmill
      @yourivanmill Před rokem +1

      Vapor mode wil change everything in terms of speed etc

    • @hamm8934
      @hamm8934 Před 11 měsíci +2

      Coughs in knockout

    • @kirilyakovlev6024
      @kirilyakovlev6024 Před 10 měsíci

      Good luck in finding svelte job

    • @semyaza555
      @semyaza555 Před 8 měsíci

      @@yourivanmill Will it change the speed in which Nuxt3 released?

  • @klemenko345
    @klemenko345 Před rokem +13

    or you add an unique key to each p tag.

    • @jackwang9424
      @jackwang9424 Před 9 měsíci

      unique key can just speed up the process of diff at the same level, Block tree can hoist all VDoms :)

  • @bawabro
    @bawabro Před rokem +2

    Someone simplify this for me please

  • @mahmoudelwan4337
    @mahmoudelwan4337 Před 7 měsíci

    Original Video:
    czcams.com/video/ANtSWq-zI0s/video.html&ab_channel=JSConf

  • @sergion3584
    @sergion3584 Před rokem +1

    Why does he say recursively? Isn’t it iteratively that you progress through the DOM?

    • @none_the_less
      @none_the_less Před rokem +2

      The algorithm to traverse a tree with nodes can be recursive.

  • @daviddiazfernandez637
    @daviddiazfernandez637 Před rokem +1

    🚀

  • @owenwexler7214
    @owenwexler7214 Před rokem

    Isn’t this basically also how MillionJS works?

  • @FirdausAziz
    @FirdausAziz Před rokem

    Isn't this how other programming language like Python (Jinja, Mako, DTL), PHP, Ruby on Rails, Go, Rust have been?

  • @dpsheals
    @dpsheals Před 10 měsíci

    My computer has a conscious. Dun dun dunnnn

  • @thelazycoder64
    @thelazycoder64 Před rokem +5

    Can i get a full video

    • @angelsv
      @angelsv Před rokem

      Sure here you have 📼

    • @nonicknameee
      @nonicknameee Před rokem

      ​@@angelsv he wants to study. Give him a link

    • @angelsv
      @angelsv Před rokem

      @@nonicknameee Nah mate, user username checks out.

    • @KingDarkHacks
      @KingDarkHacks Před rokem

      @@nonicknameee he's lazy , why u care 🤣

  • @P8860
    @P8860 Před rokem

    so many classes

  • @StephanHoyer
    @StephanHoyer Před rokem +21

    Or you can just build a simpler framework that uses just javascript as templating language and let the browser do the optimization for you 🤷‍♀️

    • @phoenix-tt
      @phoenix-tt Před rokem +4

      No, you can't, as this will be yet another library. Vue does a lot more, starting from SSR and all the way to very cool features that make you productive.
      Don't focus on runtime

    • @und0
      @und0 Před rokem

      Vue/nuxt just does everything slightly worse and uglier than react/next

    • @StephanHoyer
      @StephanHoyer Před rokem +1

      @@und0 and they do it bad already

  • @darthvader4899
    @darthvader4899 Před rokem +19

    Svelte is pioneer of this

    • @veronibishi206
      @veronibishi206 Před rokem +12

      Pioneer of something vue has been doing since 2015?

    • @CurseTheVulgar
      @CurseTheVulgar Před rokem +3

      Svelte released November 2016, Vue released February 2014. Unless Svelte also pioneered time travel your comment is a lie.

    • @hamm8934
      @hamm8934 Před 11 měsíci +1

      Knockout did it first my friend lol, just not with a compiler.

  • @SamWestonJ
    @SamWestonJ Před rokem

    I think you meant iterative not recursion.

  • @ar_xiv
    @ar_xiv Před 9 měsíci

    Why does it feel like we haven’t really done better than php

  • @guseynismayylov1945
    @guseynismayylov1945 Před 2 měsíci

    Or you can just use EHTML and map your data on template

  • @IsraelAraujoBR
    @IsraelAraujoBR Před rokem +2

    Pair that with Inertia and Laravel and you gonna be a happy developer.

  • @ohcrap2222
    @ohcrap2222 Před rokem +11

    Why not just add an id? Maybe I'm not getting what he is saying.

  • @yashguma
    @yashguma Před rokem

    Nuxt 3 is great

  • @Gol_D_Roger_The_Pirate_King

    So basically what is Svelte is doing from the start

    • @DarkzarichV2
      @DarkzarichV2 Před 11 měsíci +3

      Svelte appeared after Vue so I don't get your point here. It sounds as if you want to say that Svelte invented that before Vue did which is not true

    • @Gol_D_Roger_The_Pirate_King
      @Gol_D_Roger_The_Pirate_King Před 11 měsíci

      @@DarkzarichV2 Svelte is doing that beofre Vue implements it. VueJs version 1 and 2 doesnt have that. What are you saying that VueJS invented that.

    • @hamm8934
      @hamm8934 Před 11 měsíci +1

      @@Gol_D_Roger_The_Pirate_Kingand solid implemented it before svelte, and knockout before solid…

  • @henrybenedict6357
    @henrybenedict6357 Před rokem +19

    Svelte: 👀

    • @BackUp-cz6zn
      @BackUp-cz6zn Před rokem +1

      let's go

    • @arson5304
      @arson5304 Před rokem +3

      solidjs

    • @peanutcelery
      @peanutcelery Před rokem +1

      @@arson5304 this

    • @icarusgk
      @icarusgk Před rokem +1

      Vue already performs better than Svelte in some cases just with VDOM optimizations like this one

  • @kenichimori8533
    @kenichimori8533 Před rokem

    P class NP complete process point.

  • @joseluisguzman6881
    @joseluisguzman6881 Před 26 dny

    Nextjs

  • @marcellomarianetti1770

    I'm feeling stupid but I don't see the difference between the two code fragments lol

    • @shrin210
      @shrin210 Před 6 měsíci

      He is just explaining how the compiler driven development will give more performance than by implementing vdom.

  • @jimson7070
    @jimson7070 Před rokem

    didn't make sense to me.

  • @Kenbomp
    @Kenbomp Před rokem

    Still just talk and no walk

  • @TheScriptPunk
    @TheScriptPunk Před 10 měsíci

    Maybe dont use node

  • @kuyajj68
    @kuyajj68 Před rokem +1

    Vue is the king ! Evan is the techlead!

  • @1998goodboy
    @1998goodboy Před rokem

    Yall ever heard about old school template? Like the ones we used to write in php? 🤔

    • @ccgarciab
      @ccgarciab Před rokem +1

      Templating doesn't inherently support reactivity, although you can always add the effect of reactivity with just js. The frameworks add the semantic layer that makes it easy and scalable.

    • @1998goodboy
      @1998goodboy Před rokem

      @@ccgarciab its the reason why the internet is a sucky experience

  • @loekloekloek
    @loekloekloek Před rokem

    Isn't it just creating a hash table of the "virtual dom" to have instant lookup and replace?

  • @Tom_Seeker
    @Tom_Seeker Před 3 dny

    It's obvious to me

  • @Friskni
    @Friskni Před rokem +6

    imagine obsessing over these nonproblems.

    • @chaost11
      @chaost11 Před rokem +11

      What??? That's a big, big problem for large, complex websites

    • @OcarinaOfVali
      @OcarinaOfVali Před rokem +6

      This is the problem in the web. Our hardware is insane nowadays but somehow the web is always as slow and bloated...

    • @Friskni
      @Friskni Před rokem +2

      @@chaost11 the problem comes from making large, complex websites. Its unfortunate, but this kind of problem is a bandage for shit design, shit UX and/or feature creep gone too far. And the problem usually just does not start in the frontend, but from the data side altogether.
      In all my time working across the stack in a variety of companies, the ones that actually spend time designing and thinking end up making simple websites. Then your users will actually maybe use the thing.

    • @scorelessbow128
      @scorelessbow128 Před rokem

      Sorry guys, but I’m new to programming and starting to grasp the idea of code structures and it’s expectations. Do you guys feel that following simple code rules are a good way to exercise algorithm implementation, or should I go into this understanding with a bit more of a challenging approach? I ask this because I sometimes am quick to refer to documentation rather than pushing my own ideals into a program and “seeing what happens” kind of behavior. I honestly find it good to take either route but with all the tools in the world, it’s easy to make an approach. But with the reality of time and limitations towards learning, I feel It’s risky to make wrong turns and take up too much time going in the wrong direction, so that’s something I feel I wanted clarification on.

  • @underflowexception
    @underflowexception Před rokem

    perf wise vue is most likely quicker but I hate the DX and prefer react personally

  • @shaylaruhoff1905
    @shaylaruhoff1905 Před rokem

    *Promo sm*

  • @hasanassidiqin9497
    @hasanassidiqin9497 Před rokem

    Template

  • @AmansLab
    @AmansLab Před rokem

    it looks like boiler plate to me but i am not a web dev

  • @fevicoI
    @fevicoI Před rokem +2

    Write an entire application to find out which is better. This is not a proper comparison.

    • @e-jarod4110
      @e-jarod4110 Před rokem

      It would also not be a proper comparison though
      a proper comparison would be to write the same large app considering :
      - how much you understand the framework's internal stuff,
      - how much you optimises it,
      - within a limited timespan,
      - with one or many teams
      - with automated tests
      - the efficiency of each developer to release features
      - ...
      so you just keep some small comparisons like this because the "true" comparison would be impossible

  • @victorangelo3373
    @victorangelo3373 Před 8 měsíci

    frontend problems:

  • @justanaveragebalkan
    @justanaveragebalkan Před rokem +1

    Or don't write JavaScript and avoid all JavaScript problems :)

  • @vetrivendhan6122
    @vetrivendhan6122 Před rokem

    React: why don't you provide me keys and I will optimise this for you.. 😊

  • @pt5956
    @pt5956 Před rokem +1

    The best solution would be to throw out JS and replace it with a programming language.

  • @Akrucious
    @Akrucious Před rokem +2

    Solution for people who use the same class name for every element, lmao.
    0/10

    • @Apeuda
      @Apeuda Před rokem

      but you're supposed to use a class name on multiple elements

    • @Akrucious
      @Akrucious Před rokem

      @@Apeuda From my experience, you should only use a class name when there are going to be multiple elements which rely on the same underying layout.
      Edit: Not for every single element throughout the entire application.

  • @SahilP2648
    @SahilP2648 Před rokem

    This genius is comparing a compiler to an AGI and talking about intentions

    • @icarusgk
      @icarusgk Před rokem

      WHAT??

    • @SahilP2648
      @SahilP2648 Před rokem

      @@icarusgk what do you mean what? It's not hard to understand what I wrote.

    • @icarusgk
      @icarusgk Před rokem

      @@SahilP2648 In what point what AI mentioned in the vid? I don't get the AGI point

    • @SahilP2648
      @SahilP2648 Před rokem +1

      @@icarusgk the guy in the video is talking about compiler understanding your coding intentions -_- how is it hard to understand that compilers just convert your code into bytecode (and check if the code even builds first). They don't understand your 'intentions'.

    • @icarusgk
      @icarusgk Před rokem +2

      @@SahilP2648 You're taking what Evan You said too literal

  • @a.andrade345
    @a.andrade345 Před rokem

    Angular is better

  • @und0
    @und0 Před rokem

    Vue (budget react) monkey patching in features already invented by other libraries. If you want performance use solid or qwik. If you want full vdom capabilities use react. End of story

  • @VS-nq1ro
    @VS-nq1ro Před rokem +6

    Angular ❤

  • @_bug56
    @_bug56 Před rokem

    Isn't this just the concept of a pure component?

  • @rosux5540
    @rosux5540 Před rokem +1

    doesnt it all just use the browser dom api?

    • @CurseTheVulgar
      @CurseTheVulgar Před rokem

      His point is that if you have no constraints you need to constantly work with and traverse the entire DOM which quickly becomes slow and expensive, whereas a limited template makes the necessary DOM actions predictable and lets you avoid a lot of of unnecessary checks/traversals.

    • @rosux5540
      @rosux5540 Před rokem

      @@CurseTheVulgar so its a sort of api between the virtual dom and real dom? and using the "api" thing is faster?

    • @CurseTheVulgar
      @CurseTheVulgar Před rokem +3

      @@rosux5540 Yes exactly. What it improves (i.e. where you gain speed) is essentially that it has "pre-calculated" a lot of DOM paths and element locations (but not just that) meaning it can better manipulate the DOM via the browser api without running costly functions like querySelectorAll()/getElementById()/etc. (There's a bit more to it, but basically that's the gist of it.)

  • @crftr-com
    @crftr-com Před rokem +3

    💩ing on the virtual dom is only effective until the virtual dom makes a similar optimization.

    • @yaminnather521
      @yaminnather521 Před rokem +5

      Unless it's not able to because of its constraints?
      What was the point of this comment after again?
      Pretty sure that guy explained it pretty clearly, I'm not that smart and even I understood it

    • @ccgarciab
      @ccgarciab Před rokem

      There's no code that runs faster than that which doesn't even exist. Virtual DOM can only play catch up to pre optimized, and therefore pre pruned code.