Giter Site home page Giter Site logo

emission's Introduction

Reactions ⟶ Emissions

React Native Components used by Eigen.

Installation

  1. Install Node.js and type checking tool: $ brew install node flow
  2. Install file watcher used by React Native:
    • $ brew install pcre
    • $ brew link pcre
    • $ brew install watchman --HEAD
  3. Install NPM modules: $ npm install
  4. Install Pods: $ cd Example && pod install
  5. Configure secrets:
    • Copy configuration file: $ cd Example/Emission && cp Configuration.h.sample Configuration.h
    • Edit the configuration file as per the instructions inside.

Development

Using VS Code as an IDE

There is a full document covering our setup here.

Vanilla Commands

  1. Run $ npm start from the top directory, which will:

    • Clean the example app’s Xcode build dir.
    • Start the example app’s React Native packager.
  2. Run $ npm run storybook from the top directory, to get react-native-storybooks running.

  3. Now from Xcode you can run the app in Example/Emission.xcworkspace.

Updating Dependencies

  1. We vendor some data from other repositories that you will sometimes need to update. You can either update all of them with $ npm run sync-externals or individually:
    • The GraphQL schema of metaphysics that Relay uses to generate queries from: $ npm run sync-schema
    • The colors defined in Artsy’s style-guide: $ npm run sync-colors

Using Relay

Some helpful Relay documentation is listed below, but the general workflow is:

  1. Build a fragment for each child component that specifies only the attributes used by the component itself (no extraneous information).
  2. Ensure the parent component calls getFragment for each child component that uses Relay.
  3. Make sure to supply every child component’s props upon instantiation in the parent.

Another gotcha is around fragments that use variables. For this it is important to understand that whenever a Relay backed hierarchy is used, 2 trees will be rendered.

  1. A tree of all Relay query fragments is rendered into a single query.
  2. Once the query has been performed, the view component tree is rendered.

What this means in practice, is that you will need to pass variables down both those trees.

  1. Once from the Relay route down through all getFragment(name, variables) calls.
  2. Second down through the props of all components.

See:


Try quitting and restarting your node instance if you change something Relay-related and you run into this error:

Unhandled JS Exception: RelayQL: Unexpected invocation at runtime. Either the Babel transform was not set up, or it
failed to identify this call site. Make sure it is being used verbatim as `Relay.QL`

Resources

emission's People

Contributors

alloy avatar mennenia avatar orta avatar sarahscott avatar

Watchers

 avatar  avatar

Forkers

aaloul

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.