React Ape

• React Renderer to build UI interfaces using canvas/WebGL (TV and Hardware...

README


React Renderer to build UI interfaces using Canvas/WebGL





DISCLAIMER: In experimental stage


React Ape is a react renderer to build UI interfaces using canvas/WebGL. React Ape was built to be an optional React-TV renderer. It's mainly a renderer focused on creating things for TV, PS5, PS4, Nintendo Switch, PS Vita, PS3 and low memory devices.

React Ape lets you build Canvas apps using React. React Ape uses the same design as React, letting you compose a rich UI from declarative components.

Understanding the Problem



Crafting a high-performance TV user interface based on DOM is a real challenge, because of some reasons:

- Limited graphics acceleration
- Single core CPUs
- High Memory Usage for a common TV App

These restrictions make super responsive 60fps experiences especially tricky. The strategy is step in the renderer based on a hardware-accelerated canvas.

Examples


AppGithubApp
---------------------------------------
Photo[raphamorim/react-ape-photo-gallery](https://github.com/raphamorim/react-ape-photo-gallery)[Check
Movie[raphamorim/react-ape-movie-list-demo](https://github.com/raphamorim/react-ape-movie-list-demo)[Check
[Add------------------

API Usage


Install it using NPM or Yarn


  1. ``` sh
  2. # NPM
  3. npm install react-ape

  4. # Yarn
  5. yarn add react-ape
  6. ```

React Ape's API usage example


  1. ``` js
  2. import React, { Component } from 'react';
  3. import { Text, View } from 'react-ape';

  4. class ReactApeComponent extends Component {
  5.   render() {
  6.     return (
  7.       <View>
  8.         <Text>
  9.           Render this text on Canvas
  10.         </Text>
  11.         <Text>
  12.           You just use React Ape components like 'View' and 'Text',
  13.           just like React Native.
  14.         </Text>
  15.       </View>
  16.     );
  17.   }
  18. }
  19. ```

Demo on PS Vita


Demo on PS Vita

Demo on TV


Demo on TV

Testing it


React-Ape's CI uses macos-latest and since canvas renders a different output based on the operating system (node-canvas have rasterize fonts in different ways based on OS). It requires run the tests on the same OS. Please be aware that if you want to contribute using a different OS, make sure that you have Docker installed.

Roadmap


You can follow React-Ape development status here: Roadmap

Credits


A special thanks to Raphael Eckhardt for making the logo <3