Giter Club home page Giter Club logo

expo-mega-demo's Introduction

Expo Mega Demo

Experimenting with new awesome React Native + Expo features.

Work in progress. More info soon.

A preview video (click the image): Watch the video

Core features:

⚠️ Caution! Many features used in this demo are in early, experimental stage and they're not ready for production. Use on your own risk.

  • Uses Expo custom managed workflow. Prebuilds on Expo SDK 43 pre-alpha template.
  • All native changes (even these unusual) and patches are covered with config plugins and yarn postinstall script.
  • Uses Expo Dev Client, react-navigation, ui-kitten
  • Bluetooth communication using react-native-ble-plx with config plugin
  • Color picker using Expo GL, made from this tutorial from William Candillon, but rewritten to Reanimated v2
  • Music Picker is an expo-module written using Swift "Sweet" API. More info soon.
  • JSI real-time Audio streaming, taken from this PR, thank you Marc!
  • Player controls stolen from NCL (internal Expo rn-tester equivalent).
  • FFT is calculated in the JS thread. The spectrum bin heights are written to SharedValues and animated with Reanimated 2.

    There is plan to use react-native-multithreading and calculate it in a separate thread. But even without that, the JS keeps around 57-59 fps.

  • Hardware: Arduino Uno and the HM-10 BLE 4.0 module. Read more in the Hardware README.

How to run

First time:

  1. Make sure you have Expo and all the stuff installed and configured (including Xcode)
  2. yarn install
  3. yarn prebuild
  4. Copy AppDelegate.m from patches dir to ios/expomegademo directory - see below why.
  5. yarn run:ios

Just to start the bundler (without rebuilding client): run yarn start.

Known issues

Most of them are caused by using very early SDK 43 stuff, which is not yet published, and other published packages are not yet compatible.

  • expo-dev-client config plugin is not yet working with SDK 43 alpha.
    • It hangs the CLI for Android at the dangerousMod -> Main Activity so the -p ios must be added to the prebuild command.
    • It messes up the AppDelegate.m. Workign version can be found in ./patches/AppDelegate.m - need to be copied manually.
  • Frequency bin labels are wrong 🤷. I needed to display them in log scale and I am too lazy to think about how to recalculate everything properly.
  • Modifying the sound.onAudioSampleReceived callback and the Reanimated 2 stuff requires at least picking the song again to reload properly, sometimes whole app restart is needed.
  • Does not work on emulator.
  • Not yet works for Android
    • No JSI-related expo-av changes applied.
    • The MusicPicker module isn't implemented yet for that platform (there's a copy-pasted expo-haptics code ¯_(ツ)_/¯)

Applied patches

See the postinstall.js script and the plugins section of app.json to see how the patches are applied

  • patch-package for expo-gl and related libraries - needed, because of migration from @unimodules/core to expo-modules-core
  • new expo-modules-autolinking requires modules to be specified in package.json dependencies. I don't want to copy my custom native modules to node_modules they are deleted after being copied there by yarn.
  • by default, expo modules are built with xcframework if available, but that does not work for patched expo-gl, so its xcframework is deleted force build from source.
  • expo-gl installs wrong expo-modules-core dependency in its own node_modules - it is deleted, the global node_modules one is correct.
  • expo-cli built-in plugins sets the Push Notifications capability even when expo-notifications are not installed and I see no way to disable it. Another plugin was written to delete that entitlement.
  • iOS requires another Info.plist value about Media Library usage permission - a config plugin takes care of that
  • The custom_native_modules directory needs to be added to autolinking paths in Podfile. A config plugin takes care of that.
  • The AppDelegate.m is being broken by expo-dev-client config plugin, wrote another config plugin to copy the patched file - it does not work, still need to copy it manually.

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.