Giter VIP home page Giter VIP logo

react_native_sample's Introduction

Installation

npm install && bundle install

In node_modules/react-native/packager/react-packager/src/polyfills/polyfills.js, you need to modify the Object.assign polyfill because it will complain about Opal prototypes

Changed line 56

    for (var key in nextSource) {
      if (__DEV__) {
        var hasOwnProperty = Object.prototype.hasOwnProperty;
        if (!hasOwnProperty.call(nextSource, key) && key.indexOf('$') == -1) { // changed this line
          throw new TypeError(
            'One of the sources for assign has an enumerable key on the ' +
            'prototype chain. This is an edge case that we do not support. ' +
            'This error is a performance optimization and not spec compliant.'
          );
        }
      }
      target[key] = nextSource[key];
    }

Running

Fire off webpack watch with

bundle exec ./node_modules/.bin/webpack --watch &

Then run with react-native run-ios

Limitations/TODOs

  • Rather than commenting out the entire clause above, probably need to monkey patch it with an exclusion on all Opal prototypes. Couldn't easily do this in testing though
  • React packager is slow to refresh when index.ios.js is a big bundle with opal, etc. in it
  • https://github.com/mjohnston/react-native-webpack-server can sort of replace all of this but it's without a maintainer and currently has to fight against the React Native packager

react_native_sample's People

Contributors

wied03 avatar

Stargazers

Sean Scally avatar

Watchers

 avatar James Cloos 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.