Git Product home page Git Product logo

react-fiber-architecture's Issues

Why the key and type are copied over directly?

In the doc:

In fact, when a fiber is created from an element, these two fields are copied over directly.

But I check the src code:

var createFiber = function(tag: TypeOfWork, key: null | string): Fiber {
  var fiber: Fiber = {
    // Instance

    tag: tag,

    key: key,

    type: null,

   ....
  }
}

So,key is from the caller which means it can be null or not,just decided by the caller,but type is null.So,I think "these two fields are copied over directly" is not correct.

And BTW,I know what the type is from the src code's description and react-devtools.But I am not sure what the key means.Does it is what we see in the react-devtools just like type?

Broken link

The link referencing ReactPriorityLevel is broken. https://github.com/facebook/react/blob/master/src/renderers/shared/fiber/ReactPriorityLevel.js

Please can you let me know which file nor references these and I will be happy to create a PR to fix it.

I have had a look through the codebase and I have found the following files that contain priorities, although I'm not 100% sure what the new equivalent is to the old file.

https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactInternalTypes.js (line 41)
This contains the same var name as referenced ReactPriorityLevel, but it doesn't contain NoWork priority.

https://github.com/facebook/react/blob/master/packages/react-reconciler/src/ReactFiberExpirationTime.new.js
contains NoWork and others.

Anybody have any ideas?

Why is the numerical value of "pendingWorkPriority" inversely proportional to its meaning?

This line is the only one I had to read multiple times (> 2) to understand it. Because it went against my intuition and I had to make sure I read that correctly.

With the exception of NoWork, which is 0, a larger number indicates a lower priority

Shouldn't a higher priority be represented by a higher number? The way it's currently proposed sounds more like a pendingWorkNiceness than a priority. I believe this will result in unnecessary mental overhead now and in the future. Every time someone touches code or reads about something related to priorities it causes this twist in the brain. For example the pseudo code "to check if a fiber's priority is at least as high as the given level" compares it with the given level using <= (read: smaller than or equal then the given). I believe someone implementing the code would first use >=, then run the tests and go "oh right, higher means lower", facepalms for second and goes on.

Given that NoWork is the lowest priority, so low that it will never be scheduled, has a value of 0 (and not +Infinity), makes it even more complicated.

I'm curious what led to this decision. Apart from that cheers for the concepts behind Fiber, sounds a lot like process scheduling on a CPU mixed with some dynamic programming ✌️.

When will react-fiber be released officially?

We want to start a new project . We did POC for about a month on choice of frameworks. We chose React for building our application. So just wanted to know if you got an idea on when will facebook officially release React-fiber because we dont want to be doomed.

Link to key PRs and meeting notes

Would love if you could link/reference some of the core React teams's activity around fiber into this document. It'd make it easier to understand the actual implementation and current status.

You probably know this better, but I'm seeing the following items:

Cheers and thanks for putting this together!

Confusion

I see that you describe reconciling as finding what changed and the render phase as to update the app itself
But I read somewhere else that reconciling is actually 2 phases
Render phase which async and here I think we find changes
And commit phase in which we apply those changes to the DOM
Now I'm so confused what is actually correct

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.