Code Monkey home page Code Monkey logo

react-native-skia's Introduction

react-native-skia

React Native renderer based on Skia

Screenshot

Project State

The project is still in proof of concept and requires lots of work.

This board records TODO items for the project to production level

https://github.com/Kudo/react-native-skia/projects/1

If you have interesting for this project, please JOIN US to make it come true!

Supported platforms

Only macOS and Linux (Ubuntu 18) is supported in the mean time, but the most implementation is cross platform. It should be easy to extend for other Skia supported platforms.

Setup instructions

Setup instruction is common for both macOS and Linux except at step 2, where different arguments will be used for gn configuration.

Prerequisites

$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ export PATH="$PATH:/path/to/depot_tools"

Build instructions

  1. Get the code by gclient
$ mkdir react-native-skia && cd react-native-skia
$ gclient config --name src --unmanaged https://github.com/Kudo/react-native-skia.git@main
$ gclient sync --with_branch_heads

# We will use react-native-skia/src as working directory in the future steps.
$ cd /path/to/react-native-skia/src
  1. Generate build files
$ gn gen --args='mac_deployment_target="10.11.0" mac_min_system_version="10.11.0"' out/Debug

# Or release build
# $ gn gen --args='mac_deployment_target="10.11.0" mac_min_system_version="10.11.0" is_debug=false' out/Release

# For Linux (Ubuntu 18)
$ gn gen --args='use_sysroot=false enable_vulkan=false' out/Debug
  1. Sync JavaScript packages
$ yarn
  1. Build the code
$ ninja -C out/Debug ReactSkiaApp

# Build react-native JavaScript bundle
$ yarn workspace react-native-skia run react-native bundle \
    --platform ios \
    --dev false \
    --entry-file SimpleViewApp.js \
    --bundle-output ../../out/Debug/SimpleViewApp.bundle \
    --assets-dest ../../out/Debug
  1. Run the program
$ cd out/Debug && ./ReactSkia

Development flow

Sync & build latest code

$ git pull --rebase
$ gclient sync --with_branch_heads

# Sync node modules
$ yarn

# Incremental build C++ code
$ ninja -C out/Debug ReactSkiaApp

Third-party code sync

We use gclient and DEPS file to manage third party code, including react-native.

Once updating the git revision in DEPS, gclient sync could sync the local files accordingly. The change of DEPS could commit into git for others to have the update.

Third-party code patches

Here to list my patches for third-party code. The list should be as less as possible.

  1. react-native patch for cxx textlayoutmanager build break. https://github.com/Kudo/react-native/commit/b11c10371dec70ae6607286f23581585a401da09 (Will send a PR and hope to be fixed by upstream, then we don't have custom patch for react-native anymore)

  2. folly to support boringssl https://github.com/Kudo/folly/commit/2b9b7144fdafcc7c78d09465449f1c3a72386ac5

react-native-skia's People

Contributors

kudo avatar munezbn 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.