GithubHelp home page GithubHelp logo

forking-a-repo / react-fiber-resources Goto Github PK

View Code? Open in Web Editor NEW

This project forked from koba04/react-fiber-resources

0.0 1.0 0.0 2.59 MB

Resources for React Fiber

License: MIT License

JavaScript 100.00%

react-fiber-resources's Introduction

React Fiber resources PRs Welcome

This is a repository for resources about React Fiber.

React Fiber is a new React reconciliation algorithm, which started using from v16. React Fiber makes many features like Suspense and Concurrent Mode possible.

Concurrent Mode is still in experimental stage, but React already has the documentation so you can see what Concurrent Mode makes possible at the documentation.

https://reactjs.org/docs/concurrent-mode-intro.html

React internal algorithm

If you are not familiar with React internals, I recommend you reading the documentations first, which are very helpful resources.

React Fiber

Articles & Slides

Videos

React Fiber function call stacks

[Note] React Fiber now behaves as synchronous by default. See #8127. This call stacks are results in the time when it behaved as asynchronous.

ReactDOMFiber

React Fiber function call stack

ReactDOM

ReactDOM function call stack

ReactDOMFiber with 10000 items (Async Scheduling)

React Fiber function call stack with 10000 items (async)

--- working asynchronously ---------------------------------------------------------------------------
| ------- Fiber ---------------    ------- Fiber ---------------    ------ Fiber ---------------     |
| | beginWork -> completeWork | -> | beginWork -> completeWork | -> |beginWork -> completeWork | ... |
| -----------------------------   ------------------------------    ----------------------------     |
------------------------------------------------------------------------------------------------------
                      ↓↓↓
-----------------------------------------------------------------------
| commitAllWork(flush side effects computed in the above to the host) |
-----------------------------------------------------------------------

ReactDOMFiber with 10000 items (Sync Scheduling)

React Fiber function call stack with 10000 items (sync)

ReactDOM with 10000 items

ReactDOMFiber function call stack with 10000 items

React Fiber call tree

ReactDOMFiber call tree

Related Words

Custom Renderer Interface

React doesn't depend on any specific environments like DOM and React provides us a way to create own custom renderers based on Fiber reconciliation. ReactDOM and ReactNative are implemented as one of the custom renderers.

I've presented about the custom renderer; here is the link to the slide.

The following is a custom renderer named react-fs, which is a renderer for fs package

const React = require('react');
const { ReactFS } = require('@koba04/react-fs');

const targetDir = "test-react-fs-project";
ReactFS.render(
  <>
    <file name="README.md">
      # Title
    </file>
    <directory name="src">
      <file name="index.js">
        console.log("Hello");
      </file>
    </directory>
  </>,
  targetDir
);

ReactNoop

ReactNoop is a renderer for React Fiber, which is using for testing and debugging. It is very useful to understand React Fiber renderer!! 👀

react-fiber-resources's People

Contributors

koba04 avatar jaykan avatar pomber avatar skred avatar azu avatar

Watchers

James Cloos avatar

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.