Inspecting React Fiber Reconciliation: Deep Dive (Part 2)

Поділитися
Вставка
  • Опубліковано 31 гру 2024

КОМЕНТАРІ • 70

  • @ShivamSharma-dq4pu
    @ShivamSharma-dq4pu Рік тому +4

    Thanks!

    • @tejask
      @tejask  Рік тому

      WOW, thanks for this!!!

    • @ShivamSharma-dq4pu
      @ShivamSharma-dq4pu Рік тому +1

      Thanks, Suraj for making this video. You are a great teacher and communicator also your content is very riveting

    • @tejask
      @tejask  Рік тому +1

      @@ShivamSharma-dq4pu who is suraj

    • @ShivamSharma-dq4pu
      @ShivamSharma-dq4pu Рік тому

      @@tejask jeez mother hugging Christ! I can explain. I was in the kitchen boiling water while typing and sorry I messed up with your name. sorry Tejas

    • @piyushmahapatra7806
      @piyushmahapatra7806 Рік тому

      @@tejask 😂😂

  • @utkarshmishra5201
    @utkarshmishra5201 3 місяці тому +1

    Best deep information on youtube about Fiber!

    • @tejask
      @tejask  3 місяці тому

      Glad you like it

  • @adityapalve3752
    @adityapalve3752 Рік тому +2

    i got hooked onto ur video when u first explained how react hooks worked internally. never regretted, Love this!!

    • @tejask
      @tejask  Рік тому +1

      Awesome! Thank you!

    • @ouzidouhali771
      @ouzidouhali771 Місяць тому

      Can you share the link of this video ?

  • @yahayaoyinkansola8258
    @yahayaoyinkansola8258 7 місяців тому +1

    This was so detailed, and replay is an amazing software, I never knew this kind of thing even existed. Thank you for these series, I am always afraid to dive into the codebase of a language, but looking at this, even though I might not know a lotx it still helps to get a good understanding of how things work behind the scenes

    • @tejask
      @tejask  7 місяців тому

      Happy to help!!

  • @washingtonsoaresb
    @washingtonsoaresb Рік тому +1

    @tejask I have no words to express how thrilled I'm watching this video. So inspiring! Keep going, you rock!

    • @tejask
      @tejask  Рік тому +1

      Wow, thank you so much! I hope it adds value to you!

  • @dipeshrajoria
    @dipeshrajoria Рік тому +1

    I am your fan since i watched your destructuring react video.. i feel glad we have people like you in our developer communinty❤

  • @BartekKozera
    @BartekKozera Рік тому +1

    I have to say I wasn't fan of your conference talks but I take it back - very nice videos, would love to see even more of a deep dive into react internals

    • @tejask
      @tejask  9 місяців тому

      Why weren’t you a fan of my talks? The feedback will help me grow.

  • @vishaldas978
    @vishaldas978 Рік тому +1

    Thanks a lot! 👍 I initially started this interview prep, but it unexpectedly sparked my curiosity, and I've been diving deep into understanding how everything comes together and works. It's been quite an interesting journey! 😄

    • @tejask
      @tejask  9 місяців тому

      Appreciate it!!

  • @NeerajLagwankar
    @NeerajLagwankar Рік тому +2

    Replay is bonkers! I wasn't aware it was this powerful!
    Also thanks for such a great breakdown and demo of how reconciliation works

    • @tejask
      @tejask  Рік тому

      Glad it was helpful!

  • @madhuiitb-cse
    @madhuiitb-cse 4 місяці тому

    Next level knowledge, on point. Kudos to you man!.

  • @tirthradadiya1565
    @tirthradadiya1565 10 днів тому

    Great explanation. I have one question.
    let's say while creating fiber tree in render phase another high priority task came like input. so current workInProgress will run in background and input workInProgress starts and finishes and painted on DOM. So, wouldn't old workInProgress will have old copy of fiber?

  • @dipeshrajoria
    @dipeshrajoria Рік тому +3

    Man !.. You are already doing great job!❤️
    Can you please cover topics like advanced patterns , optimization and related to writing performant code !

  • @arogyabichpuria3262
    @arogyabichpuria3262 Рік тому +1

    wowyy, could you bring more explanations on advance UI patterns ?

  • @hackytech7494
    @hackytech7494 Рік тому +2

    Thank you so much for such wonderfull explanation with demonstration. I am bit confused though. Like, if reactjs constructs this fiber tree then Is the "Virtual DOM " == "fiber tree" ? OR "Virtual DOM " is calculated again based on fiber tree ? or its something else.

  • @textyre
    @textyre Рік тому

    Thank you for your content, it is really treasure about React and web in general. I would be glad to see similar content, maybe about event loop in time loop with details, about render phases in browser, when it is blocked, when it is layoted, composed, painted and so on. Maybe how to handle async functions in usual for-loop and such other content. Thank you again!

  • @tbrwba1373
    @tbrwba1373 Рік тому +1

    Hello! I want to know how you debug in the browser and how you code in the browser? Can you introduce it? thank you!

  • @sandipshelke5111
    @sandipshelke5111 11 місяців тому +1

    Masterpiece.

    • @tejask
      @tejask  9 місяців тому

      Thanks!

  • @vmscode
    @vmscode Рік тому

    Amazing video! Would be awesome if you could make a video on how to create a custom react renderer and also a video about how does the Canvas state is handled/related to the React state?
    I know these videos are hard to make, thank you for taking the time to create it, helps a lot!

  • @ManishGupta-nv5by
    @ManishGupta-nv5by 13 днів тому

    i really like replay part where i actually how the processes happening

  • @Max-nr1bv
    @Max-nr1bv Рік тому +1

    Awesome bro! Keep going!
    How do React actually perform commit of the root node?
    If we will do append child of the entire document it should be slow...
    I was thinking about it that React updates only necessary DOM nodes. But as I understand from yours explanation React updates all nodes in commit phase

    • @tejask
      @tejask  Рік тому +1

      It does necessary only update the different host nodes based on diffing the VDOM with the DOM.

  • @rmnkot
    @rmnkot 8 місяців тому +1

    Awesome 👍

    • @tejask
      @tejask  8 місяців тому

      Thanks 🤗

  • @mordernmonk194
    @mordernmonk194 8 місяців тому

    why this video has very less views this is amazing

    • @tejask
      @tejask  8 місяців тому

      subscribe

  • @chinmaykumar7975
    @chinmaykumar7975 Рік тому

    wow! this was something really cool.

    • @tejask
      @tejask  Рік тому

      Share it with your friends!

  • @pubgindia2833
    @pubgindia2833 4 місяці тому

    Thanks mate. Now I can breathe well, after watching this😅

    • @tejask
      @tejask  4 місяці тому

      Glad it’s helpful!

    • @pubgindia2833
      @pubgindia2833 4 місяці тому

      @@tejask It is highly useful, where did you learn these kind of stuff?

  • @simplehonestmusic2261
    @simplehonestmusic2261 Рік тому

    Hey Tejas, I have a question I'm wondering if you can clarify for me regarding the beginWork() phase.
    From what I can tell, it seems like the beginWork() phase not only marks the fibers for work updates, but also creates new fibers if they aren't already existing and being copied over from the Current fiber tree??
    I'm trying to figure out if the beginWork() function ONLY marks fibers for updated work, if if it is also responsible for assembling the work in progress tree?
    And if it isn't responsible, what DOES assemble the work in progress tree?
    I'm aware of functions like createFiberFromElement().
    Hopefully my question makes sense?

  • @AnkitGupta-lr1qq
    @AnkitGupta-lr1qq Рік тому

    Dayum 🔥

  • @damilareemichaell5245
    @damilareemichaell5245 Рік тому +1

    Okay so oooooo 😈 I was bout to blast you for the svelte thingy 😄😄😄

  • @pavlof
    @pavlof Рік тому

    awesome, thx

  • @ashish_prajapati_tr
    @ashish_prajapati_tr Рік тому +3

    it's so deep

  • @danielllachvaldivieso6555
    @danielllachvaldivieso6555 7 місяців тому +1

    • @tejask
      @tejask  7 місяців тому

      ❤️

  • @piyushmahapatra7806
    @piyushmahapatra7806 Рік тому +1

    Ah, that's a cool svelte shirt

  • @KartikKewalramani-q6v
    @KartikKewalramani-q6v 4 місяці тому

    Great video, You Could've shown how input from a user action takes priority over some other work like rendering animations.

  • @shakyasarkar7143
    @shakyasarkar7143 Рік тому

    Its awesome!!! Just awesome explanation of going though the actual src code!! A big thanks to you Tejas!
    It would be great if you could help me in solving just one doubt..
    So, regarding the Virtual DOM ---> Its basically a tree of React elements.
    Therefore, this particular JSX
    1st span child
    Click

    Okay done

    boils down to this object creation:
    {
    type: "div"
    ref: null
    key: null
    props:{
    children:[
    {type: "span",
    props:{
    prps1: "Hello",
    children: "1st span child"
    },
    {type: "button", ......},
    {type: "div", ...............}
    ]
    }
    }
    and this is what we call as VDOM. (please correct me if I'm wrong)
    So when the state is changed, the VDOM is created again with new object references, and React makes a diff between the old VDOM nodes and new VDOM nodes, and whenever it finds the changes it lists them them down in a list, which are then flushed to the DOM in the commit phase.
    Now my question is, for Fiber Reconcilliation, does the same architecture of the VDOM creation happens followed by this, the current and workInProgress, and then the changes are flushed to the DOM based on effects list?
    Or how does this new Fiber fit into the structure of comparing old VDOM and new VDOM and tagging the nodes that need an update? Like how does this work with the Fiber?
    I know its a lot for you to look upon over here in the youtube comment section, but it would be great if you could solve my doubt. I am really tangled in here..

    • @shakyasarkar7143
      @shakyasarkar7143 Рік тому

      Anyone?

    • @__issamae
      @__issamae Рік тому

      @@shakyasarkar7143 not sure that this completely answers your questions, but this is written in the legacy React docs:
      "In React world, the term “virtual DOM” is usually associated with React elements since they are the objects representing the user interface. React, however, also uses internal objects called “fibers” to hold additional information about the component tree. They may also be considered a part of “virtual DOM” implementation in React."
      i might be wrong, but based on that, it sounds like Fiber is what actually creates the VDOM for React

  • @favouritejome
    @favouritejome Рік тому

    It is complicated, I cann't say I understand it 😏

  • @VikaBorel
    @VikaBorel 7 місяців тому +1

    Thank you very much for this video 🤍

    • @tejask
      @tejask  7 місяців тому

      No problem 👍

  • @lilywang3968
    @lilywang3968 9 місяців тому +1

    Awesome thanks

    • @tejask
      @tejask  9 місяців тому

      Happy to help!