Git Product home page Git Product logo

Comments (3)

FredrikAugust avatar FredrikAugust commented on June 16, 2024 2

You can find the different types of levels here though (if I understood the document correctly):

https://github.com/facebook/react/blob/8c67bbf183cc5ae1cab15a8265c612daf80cd86f/packages/scheduler/src/Scheduler.js#L12

from react-fiber-architecture.

onstash avatar onstash commented on June 16, 2024

Hey @acdlite. Thank you for the detailed write up. 😃✋As @reccanti mentioned, ReactPriorityLevel is either absent or has been moved into a different module in the react codebase. Could you point how to fix this? I think this is minor and can be quickly resolved. Thanks again! 😄

from react-fiber-architecture.

poxrud avatar poxrud commented on June 16, 2024

Based on my understanding (I can be wrong) it looks like the concept of priorities is gone for now. Instead we have "Sync" and "Async" units of work.

If you look at the workLoop function we have:

function workLoop(isAsync) {
    if (!isAsync) {
      // Flush all expired work.
      while (nextUnitOfWork !== null) {
        nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
      }
    } else {
      // Flush asynchronous work until the deadline runs out of time.
      while (nextUnitOfWork !== null && !shouldYield()) {
        nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
      }
    }
  }

So basically render everything right away if we're dealing with a regular update, or if it's an async update render it if we have the time to do so.
shouldYield checks if we have enough time to render the current unitOfWork.

from react-fiber-architecture.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.