• Stars
    star
    774
  • Rank 58,703 (Top 2 %)
  • Language
    JavaScript
  • Created over 8 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Learn you a React Renderer for Great Good

Tiny React Renderer

Creating a React Renderer will give you the opportunity to apply the same React knowledge that you and your team already know and enjoy from the web and native to whatever host environment you need.

Creating a renderer is a fairly straight-forward affair once you know what you’re looking for.

Many languages have this concept of a main—the entry point to your application. If you look at any React application code you’ve written you’ll see that you “start” your app with a call like the following:

// web
ReactDOM.render(React.createElement(MyApp), document.getElementById('app'));

// native
AppRegistry.registerComponent('MyApp', () => MyApp);

This is where your application enters into the React domain and comes alive. Your root React element is instantiated and attached to the host environment.

If you follow either the ReactDOM or React Native codebases from where these methods are defined you will quickly find yourself at the React{Host}Mount.js file. Our renderer also begins there.

With that let’s get started! Our tour continues in ./src/stack/mount.js.

Work in Progress

Please note this guide is a work in progress. Much of this knowledge is derived from my experience in creating React Hardware.

Tests

  • npm test will run the tests with the stack-based renderer
  • npm test -- --fiber will run the tests with the upcoming fiber implementation

Renderer Implementations

  • Stack
  • Fiber

The React that we have worked with to date has been using what is called the stack renderer. This is because it is implemented on the traditional JavaScript stack and operates within those confines.

Fiber, on the other-hand, can be thought of like a React VM. It is influenced by OCaml, algebraic effects, and other functional ideas. From an implementation level, Fiber has a first-class renderer API allowing creating custom renderers a much nicer experience.

The documentation for stack is no in maintenance mode and will not be very accurate as time progresses. This can be found in ./src/stack. The Fiber API changes will be followed throughout its development to a stable release in ./src/fiber

Thanks

More Repositories

1

smoothscroll

Scroll Behavior polyfill
JavaScript
3,849
star
2

react-hardware

A React renderer for Hardware.
JavaScript
793
star
3

yellowbox-react

YellowBox renders warnings at the bottom of the app being developed.
JavaScript
67
star
4

arbiter

A lightweight html5 history library for ender.js
JavaScript
17
star
5

component-playground-responsive-iframe

A responsive iframe renderer for the React component playground.
JavaScript
11
star
6

blessed-standup

Blessed UI for team standups, recorded in a google spreadsheet
JavaScript
7
star
7

queryless

Create a mediaquery free stylesheet for archaic browsers
CSS
7
star
8

iamdustan.github.io

HTML
6
star
9

PUI

A lightweight prototype UI library.
JavaScript
5
star
10

bonsai-demos

Article and demos concerning bonsai for node knockout 2012.
JavaScript
5
star
11

slack-imposter

Pretend to be your colleagues!
Rust
4
star
12

esprima-loader

webpack loader to pipe a file’s AST through arbitrary transforms
JavaScript
4
star
13

react-testing-stateless-components

Failing test case of `React.findDOMNode` with stateless function components.
JavaScript
4
star
14

cypress-react-test

JavaScript
3
star
15

redux-devtools-ui

Experimental UI fun for the redux devtools
JavaScript
2
star
16

d8-fun

JavaScript
2
star
17

all-things-open-2016

JavaScript
2
star
18

dotfiles

Lua
2
star
19

parse-vs-ast-startup-time

Kicked off from https://twitter.com/TheLarkInn/status/852252004277682176
JavaScript
2
star
20

babel-plugin-react-isomorphic

Babel plugin to transform react imports to react/lib/ReactIsomorphic
JavaScript
2
star
21

simplegit

A simple, stripped-down git library for nodejs.
JavaScript
2
star
22

reasonexamples_of_ocapic

OCaPIC tutorial examples on ReasonML
OCaml
2
star
23

jadeplate

A jade+stylus standalone template.
JavaScript
2
star
24

cltjs-welcome-to-the-responsive-web

Responsive slide-deck for the October 2011 CltJS meetup.
JavaScript
2
star
25

bs-audio-context

Experimental bucklescript bindings for the WebAudio API
OCaml
1
star
26

postcss-rs

WIP PostCSS compatible parser written in Rust.
Rust
1
star
27

react-ascii

maybe a new toy
1
star
28

slidenator

JavaScript
1
star
29

granger

A modern, lightweight range UI component with an aim towards integration simplicity and accessibility across all input methods.
CoffeeScript
1
star
30

reworkcss_ast_explorer

Rework CSS’s AST Explorer
JavaScript
1
star
31

lendly

Never forget who you borrow your things to again! Part of The Mentorship Project.
JavaScript
1
star