-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start putting the fiber docs together #24
Conversation
👍 Not sure if this is ready, but I am eager to learn! |
Now flow can tell us how to install all the things! ``` � fiber git:(fiber) � flow ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `appendChild`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `appendInitialChild`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `commitMount`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `commitTextUpdate`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `commitUpdate`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `createInstance`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `createTextInstance`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `finalizeInitialChildren`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `getChildHostContext`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `getPublicInstance`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `getRootHostContext`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `insertBefore`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `prepareForCommit`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `prepareUpdate`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `removeChild`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `resetAfterCommit`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `resetTextContent`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `scheduleAnimationCallback`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `scheduleDeferredCallback`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal ReactTinyFiber.js:30 30: const ReactFiberReconciler : (hostConfig: HostConfig<*, *, *, *, *, *, *, *>)=> Reconciler<*, *, *> = require('react-dom/lib/ReactFiberReconciler'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ property `shouldSetTextContent`. Property not found in 39: const TinyRenderer = ReactFiberReconciler({ ^ object literal Found 20 errors ```
@iamdustan First off, great work. Love this repo. Based on TinyRenderer I did manage to write a bare basic dom and canvas renderer. (I can share it if you like). Do you have any kind of notes/links/react PRs/github comments that can be referred. 1. I'd like to contribute here. 2. I want to make sure I'm on the right path writing renderers for fiber. |
Oh I suppose I could land this 😅 @prometheansacrifice I don’t have any PRs for reference off-hand, but I do want to add those references to this repo/documentation as relevant. |
Here's what I dug up
|
Appendix files are empty. Most likely, what is going to be the content of Rendering-A-Top-Level-Element and Reconcile-Transaction? |
Is this good to merge? I'm attempting to write a renderer and found this repo. Seems the /stack examples are not up to date and fiber is about to land in react. Should I use this branch as a resource? |
@prometheansacrifice I would appreciate a look at your canvas renderer if you don't mind |
@kevzettler Just to illustrate, I've put together a snippet. Try it with a simple component like
It will however fail for stateful components.
Canvas is a immediate mode api and doesn't work well as is. You might want to look at ART and use it to write a renderer yourself (Though react officially has Which brings me to another question: Is react suited only for retained mode graphics? (Will probably open a SO question) |
A bit premature perhaps, but I’ll still land this for now. It won’t work with the latest React 16 releases due to flat bundles, but if you stumble across this you can follow facebook/react#9103 for whenever a solution does land. |
No description provided.