Giter VIP home page Giter VIP logo

bartonhammond / snowflake Goto Github PK

View Code? Open in Web Editor NEW
4.6K 134.0 617.0 29.57 MB

:snowflake: A React-Native Android iOS Starter App/ BoilerPlate / Example with Redux, RN Router, & Jest with the Snowflake Hapi Server running locally or on RedHat OpenShift for the backend, or a Parse Server running locally or remotely on Heroku

Home Page: http://bartonhammond.github.io/snowflake/snowflake.js.html

License: MIT License

Java 0.88% Ruby 1.44% JavaScript 94.42% Objective-C 2.38% Python 0.88%
react-native redux jest immutablejs fastlane bitrise eslint parse-server hapi-server tcomb-form-native

snowflake's Introduction

Snowflake snowflake

A React-Native starter mobile app, or maybe just an example, or maybe a boilerplate (you decide) for iOS and Android with a single code base, with 2 backends to chose from: a Hapi or Parse Server solution- Demo

JavaScript Style Guide Codacy Badge Join the chat at https://gitter.im/bartonhammond/snowflake License React Native

Installation

Install Snowflake

  • Clone snowflake: git clone https://github.com/bartonhammond/snowflake.git

  • install dependencies

cd snowflake

npm install

Using Snowflake Hapi Server

Use the local or remote Snowflake Hapi Server

To make things easy for you, the config.example.js has been initialized to use the remote Snowflake Hapi Server which is running on Redhat OpenShift.

This Snowflake Hapi Server is Open Source. It can run either locally or on RedHat OpenShift. For your convince a server is running at: https://snowflakeserver-bartonhammond.rhcloud.com

Please refer to https://github.com/bartonhammond/snowflake-hapi-openshift for more information about the code and instructions for installation and setup of the server.

The following commands are for the client

  • Copy the src/lib/config.example.js to src/lib/config.js.
  • Note: the .gitignore includes config.js from being committed to GitHub
  • Note: you must select either hapiLocal or hapiRemote for the backend as shown below with hapiRemote set as the default.
  backend: {
    hapiLocal: false,
    hapiRemote: true,
    parseLocal: false,
    parseRemote: false
  },
  • To run Hapi locally, follow the instructions at https://github.com/bartonhammond/snowflake-hapi-openshift. You will have to install MongoDB and Redis.
  • Note: The default is to run remotely on the RedHat OpenShift Snowflake Server so there is nothing more to do if you want to use it! In that case, just use the config.js as is.
  • If you want to install and run the Snowflake Hapi Server locally, then update the src/lib/config.js file as shown below.
  • Note: use the ip from the ifconfig command for the local. This ip matches the Snowflake Hapi Server setup.
  • An example of the url is shown below assuming the ifconfig shows the local ip to be 192.168.0.5
  • Note: You don't have to provide the local.url value if you are using the remote
  HAPI: {
    local: {
      url: 'http://192.168.0.5:5000'
    },
    remote: {
      url: 'https://snowflakeserver-bartonhammond.rhcloud.com/'
    }
  }

Using Parse Server

This Snowflake Parse Heroku Server is Open Source. It can run either locally or on Heroku. For your convince a server is running at: https://snowflake-parse.herokuapp.com/parse

Please refer to https://github.com/bartonhammond/snowflake-parse-heroku for more information about the code and instructions for installation and setup of the server.

The following instructions are for the client

  • Copy the src/lib/config.example.js to src/lib/config.js.
  • Note: the .gitignore includes config.js from being committed to GitHub
  • Set parseLocal to true if you are running a local instance of parse-server
  • Otherwise, set parseRemote to true to indicate your parse server instance is hosted in the cloud
  backend: {
    hapiLocal: false,
    hapiRemote: false,
    parseLocal: true,
    parseRemote: false
  },
  PARSE: {
    appId: 'snowflake',                              // match APP_ID in parse-server's index.js
    local: {
    	url: 'http://localhost:1337/parse'             // match SERVER_URL in parse-server's index.js
    },
    remote: {
    	url: 'https://enter_your_snowflake_host.com'   // match SERVER_URL in parse-server's index.js
    }
  }

To run:

  • For iOS, from the command line, run via command: react-native run-ios or open XCode and load project, Run Product -> Run (⌘+R)
  • For Android, from the command line, run via the command: react-native run-android assuming you have an emulator or device running and attached
  • To run Jest, npm test
  • To debug Jest unit cases, install node_inspector and run npm run test-chrome
  • Enjoy!


Notes

Code is written to JS Standard and validated with Eslint. To setup your favorite editor using the Eslint configuration, see Editors

Navigation is handled with React Native Router Flux. Multiple scenes support Login, Register, and Reset Password. Once successfully logged in, there are 3 more scenes: Logout, Subview, and Profile.

A user can change their Email Address and User Name once they are logged in using the Profile form.

The icons used throughout the app are from React Native Vector Icons, namely using FontAwesome

Form building is extremely easy and consistent by using Tcomb Form Library by using domain models and writing less code.

Using Redux and Immutable, the state of the application is testable with Jest, which includes Snapshot tests currently with 85 tests and ~90% coverage!!!

To ease the pain of Redux Action definitions, Snowflake uses Key Mirror.

Using the Validate.JS Library, all user input is validated. Appropriate messages are displayed to the user guiding them in the input requirements.

Once a user is logged in, their Session State is stored in AsyncStorage so that subsequent usage does not require logging in again.

Snowflake supports multiple languages using I18n with English, French and Spanish.

Snowflake supports Hot Reloading of its state.

Snowflake uses CI with Bitrise.io and has extensive docs and 45+ min of video demonstating implementation.

Snowflake has a choice of servers, either


Content


Editor Configuration

Atom

apm install editorconfig es6-javascript javascript-snippets linter linter-eslint language-babel

Sublime

Others

Screens

Platform Register Login Profile
iOS iOS Profile iOS Login iOS Register
Android Android Register Android Login Android Profile

Summary

  1. The application runs on both iOS and Android with a single code base
  2. A User can Register, Login, Logout, Reset their Password and modify their Profile
  3. The Forms display messages for help and field validation.
  4. The Forms are protected when fetching.
  5. The Forms display spinner when fetching.
  6. Form submission errors are displayed (see above Login)
  7. All state changes* are actions to the Redux store.
  8. The backend is provided by either a Hapi server or Parse server using the Rest API
  9. Every action performed by the UI interfaces with the Redux actions and subsequently to the Redux Store. This reduces the complexity of the JSX Components tremendouslyand makes them easily testable.
  10. Jest Unit Tests cover ~90% of the application statements.
  11. Demonstrates how to setup React-Native to perform Jest testing with Mock modules
  12. Includes ability to debug Jest unit tests with Chrome
  13. Instructions and videos for continuous integration with Bitrise.io

Quotes

Some quotes from users of Snowflake

Open Source Mag: Learn best of React Native with these open source projects: http://opensourceforu.com/2016/05/learn-best-of-react-native-with-these-open-source-projects/

ICICletech Blog: Mobile App Development With 8 Awesome React-Native Starter Kits: We have listed some of our favorite starter kits and boilerplates to get started quickly. https://www.icicletech.com/blog/react-native-starter-kits

Infinite.Red: Ignite Your Mobile Development:

awesome releases as Barton Hammond’s snowflake.

https://shift.infinite.red/ignite-your-mobile-development-32417590ed3e#.pz7u3djtm

AdtMag: New Community Projects for React Native: Deco IDE and Pepperoni Boilerplate https://adtmag.com/articles/2016/05/26/react-native-projects.aspx Snowflake mentioned

Pepperoni App Kit (see Credits)

This project was initially motivated by Snowflake....you should check it out to see if it's a good fit for your app.

Viktor

Just saw the tweets, still watching the vids. It's awesome!! It's really really high quality, I'm truly amazed

John

project is awesome, thank you for providing it!

Eric:

I've been going through snowflake and love what you have done!

Nikos:

wow new videos, nice

Josh

thanks for the thorough videos!

Patrick

just wanna snowflake is awesome

Justin

Congrats - the project is super helpful

Stephen

Thanks so much for this amazing foundation!

Jim

Neat project


Technologies

The following are brief descriptions of the technologies used

React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React.

What more can I say? It's a fantastic leap forward in providing the ability to write native applications with Javascript that target both iOS and Android.

This application provides one code base that works on both platforms. It demonstrates Form interactions, Navigation, and use of many other components.

85 Unit tests that cover plain objects and JSX components

The de-facto standard for React/Native testing. This app demonstrates how to mock ReactNative, node_modules, classes and to properly test JSX components by programmatically changing the props, and throughly test the applications data state and the actions in conjunction with Redux.

Jest Coverage Analysis

Redux is a predictable state container for JavaScript apps. It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test.

Before Redux, application state was managed by all the various components in the app. Now, the state is managed in a predictable and consistent manner and it can be tested with Jest and best of all, it is independent of the UI. This is a major advancement in application design!

For me, Hapi provided a clear way for defining APIs and managing things clearly. Some folks like Express, I've used Express myself, and I wanted to try Hapi. I'm very satisfied with Hapi. As you may or may not know, WalMart Labs produced Hapi and they've used it in their business.

One of the needs of any application is server side processing. With the ability to run Hapi locally or on OpenShift, I'm able to write my server logic and test it locally. When I'm "happy" I can push the code to OpenShift. The same code runs in both environments.

As an alternative to Hapi, Snowflake also supports Parse Server. Parse Server is an open source version of the Parse backend that can be deployed to any infrastructure that can run Node.js.

Parse Server works with the Express web application framework. You can test it locally and push changes to your parse remote server when you are ready.

I chose OpenShift because I could get a reasonable performing application for free. The Snowflake server (https://github.com/bartonhammond/snowflake-hapi-openshift uses 3 gears with MongoDB and Redis.

A structured model based approach to declarative forms

*With this library, you simplify form processing incredibly! Write a lot less code, get usability and accessibility for free (automatic labels, inline validation, etc) and no need to update forms when domain model changes. This application demonstrates how to test these forms also!

Validate.js provides a declarative way of validating javascript objects.

Using Validate.js for the Form processing was a breeze! And with the ability to test the validations to the Redux state was very easy!


Continuous Integration

CI proves to the developer that everything required to build and test the application is well defined and repeatable. Without CI, one would not know, for a fact, that all the required tools and assests are available for everyone to build with. CI gives us developers some "peace of mind" that our build process is repeatable.

The following videos will walk you through setting up CI with BitRise.io


Introduction
Introduction
  • Snowflake is a starter app so all tutorials are basic in nature
  • There are a bizzilion ways of doing any of this - I'm showing one
  • There's a number of CI sites, I chose Bitrise.io
  • There's a general understanding of why to us a CI
  • The build will be done on Bitrise.io - not locally
  • The only goal is to get the build to run on Bitrise.io
  • You can still run applications locally with simulators
Bitrise Overview
Bitrise.io Overview
  • Introduction to Bitrise.io https://www.bitrise.io/
  • Overview of what it does for us
  • Overview of the two WorkFlows
    • iOS
    • Android
iOS XCode Modifications
iOS XCode Modifications
XCode Certs Provision Profiles App Id
XCode Certs Provision Profiles
Create iOS App
Create iOS App
  • Login/Register Bitrise.io
  • Dashboard
  • Add App
  • Authenticate GitHub
  • Select repository, branch
  • Import YML
  • Download Certifications
  • Update KeyChain
  • Save .p12
  • Download Provision
  • Load .p12 and provision to Bitrise.io
  • Setup Secret and Env Vars
  • Build
iOS install
iOS install from email
  • From device, open email app
  • Open letsconnect
  • Follow instructions to load in Safarie
  • Follow prompts and enjoy!
Android Setup
Android Setup
  • Settings -> Docker Image
  • Secret Variables
  • App/build.gradle
  • Setup Secret and Env Vars
  • Import YML
  • Run build
Addendum #1
XCode Edge Stack
  • "XCode Edge Stack" for iOS
  • New React-Native steps for Install & Bundle
  • Upgraded Step versions
  • GitHub branch triggers
Things not addressed
  • Submission to any store
  • Working with other CIs
  • Complex setups for either iOS or Android
  • Debugging any failures
  • Shiny new things
  • No local builds with Bitrise CLI
  • No local builds with Fastlane
  • No tutorial on all the features of Fastlane

Redux State Management

This section explains a little about what I've learned with Redux and the management of application state.

Without Redux

Alt text

custom_mark10 digraph G { aize ="4,4"; login [shape=box]; login -> validate [style=bold,label="1"]; login -> restful [style=bold,label="2"]; restful -> parse [style=bold,label="3"]; login -> router [style=bold,label="4"]; router-> new_page [style=bold,label="5"]; } custom_mark10

A typical app, at least those I've written before, have logic and state scattered all through out. Frameworks help to organize but typically the developer has to know how to "stitch" it together by remembering to update certain state at certain times.

In the above diagram, the Login component is responsible for calling the Validate and making sure the rules are applied and errors are displayed. Then it has to have logic that confirms everything is in the right state, and pass that data to a Restul API to interact, in this case, with Parse. When that activity is complete the Router has to be informed and a new_page can be displayed.

This makes testing hard as the logic is partially contained in the Login component itself and the sequence of those events are encapsulated there too!

With Redux

Alt text

custom_mark11 digraph G { aize ="4,4"; login [shape=box]; login -> Action[style=bold,label="1"]; Action -> Reducer [style=bold,label="2"]; Reducer -> login [style=bold,label="3"]; login -> Action [style=bold,label="4"]; Action -> restful [style=bold,label="5"]; restful -> parse [style=bold,label="6"]; Action -> Reducer [style=bold,label="7"]; Reducer -> new_page [style=bold,label="8"]; } custom_mark11

What the above diagram depicts is that the logic for login is contained in the Actions and Reducer and can be tested in isolation from the UI. This also makes the UI Component Login much simpler to write as it just renders content based on props that are provided. The props are actually the Reducer Store.

So what is happening in this diagram? Where's the Validation? That would be in step 1. When the user enters characters on the form, they are sent to an action. The action packages them up and sends them to the Reducer. The reducer looks at what Type the Action is and performs the operation, in this case, Validate the parameters.

How does Login respond? Well, it recieves the updated Props - the properties which are the store. It then renders it's output based on those properties. Just straight forward logic - nothing more then checking the properties and display approptiately. At no time does the Login component change any property state.

The responsibility of changing state belongs to the Reducer.

Every time an Action is called, that Action interacts w/ the Reducer. The Reducer does state changes on the State or Store model.

Let's look at a concrete example, Resetting a Password. Now the UI is pretty simple, provide a Text Input for the email entry and a Button to click. Let's further assume that the email has been validated and the user clicks the "Reset Password" button. All that Login does is call an Action function called resetPassword passing the email value.

So don't get too overwhelmed with the following code. You can think of the dispatch calls as meerly as a messaging system. Each dispatch call invokes a function - it just calls a function in a Promise chain.

I want to now look at one specific Action and trace it's path. That action is the dispatch(resetPasswordRequest()); call. That call signals that the "reset password request" processing is starting. We'll look at that next and how it trickles all the way back to the Login ui.

Action.resetPassword

export function resetPassword(email) {
  return dispatch => {
    dispatch(resetPasswordRequest());
    return new Parse().resetPassword({
      email: email
    })
      .then((response) => {
        if (response.status === 200 || response.status === 201) {
          dispatch(loginState());
          dispatch(resetPasswordSuccess());
        } else {
          dispatch(resetPasswordFailure(JSON.parse(response._bodyInit)));
        }
        return response;
      })
      .then((response) => {
        if (response.status === 200 || response.status === 201) {
          dispatch(emitLoggedOut());
        }
      })
      .catch((error) => {
        dispatch(resetPasswordFailure(error));
      });

  };
}

The simple function returns an object with type RESET_PASSWORD_REQUEST. All of the activities performed have this pattern, make a REQUEST and then either have a SUCCESS or a FAILURE.

Now Redux is responsible for taking this returned Action object and passing it to the Reducer. What does the Reducer do with this Action? We'll look at that next.

Action.resetPasswordRequest

export function resetPasswordRequest() {
  return {
    type: RESET_PASSWORD_REQUEST
  };
}

The Reducer is a function with 2 parameters, state and action. What it does is to make modifications to the state depending upon the action. The state is any javascript object you like. This application uses Immutable.js for it's state so to guarantee the state is always immutable.

Notice the switch statement - it's looking at that Action.type value - all Actions have a type value. In our case, the type is RESET_PASSWORD_REQUEST.

So what's happening here. If any request type comes to the Reducer, including RESET_PASSWORD_REQUEST, we change the state by setting the form.isFetching to true and the form.error field to null. The returned new state value has these two fields set.

What happens with that new state? Well Redux makes that state available in the Login component props. And since the props have changed, Login needs to render. Let's look at that next.

Reducer.Action.ResetPasswordRequest snippet

export default function authReducer(state = initialState, action) {
  if (!(state instanceof InitialState)) return initialState.mergeDeep(state);
  switch (action.type) {

  case SESSION_TOKEN_REQUEST:
  case SIGNUP_REQUEST:
  case LOGOUT_REQUEST:
  case LOGIN_REQUEST:
  case RESET_PASSWORD_REQUEST:
      let nextState =  state.setIn(['form', 'isFetching'], true)
        .setIn(['form','error'],null);
    return nextState;
.....

So here in the render component we need to decide if a spinner should be displayed. It should display when the props.isFetching is true. That's the value set above in the Reducer! All the Login render() has to do is check that property and set the UI appropriately.

Login.Header.render snippet

  render() {
    let spinner = <Text> </Text>;
    if (this.props.isFetching) {
      spinner =  <GiftedSpinner/>;
    }

    return (
      <View style={styles.header}>
        <Image style={styles.mark} source={{uri:
                                            'http://i.imgur.com/da4G0Io.png'}}
        />
        {spinner}
      </View>
    );
  }

Hopefully this gives you some insight into how Redux is integrated into the application. In my opinion, this is a huge step in application logic.

If you'd like to read an excellent tutorial on Redux I can't recommend this one enough: http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial.html


Hot Reloading

This video shows Snowflake exporting and importing state from Redux. It demonstrates, with the iOS Simulator, the process of copying the state for import at a later time. After the demo, I walk through the code to clarify how I achieved this. It's assumed you have some familiarity with Redux. Hopefully it helps you gain a better understanding of what Redux provides you!

Snowflake Hot Loading


Faq

How do I change the Language of the App?

Just use the Settings of your Device or Simulator.

Why did you use the RestAPI instead of the (JS-sdk | ParseReact)

I looked at it initially and, imo, it had too much magic. For example, I couldn't see how I was going to isolate my JSX components easily and keep all my "state" in Redux. ParseReact is right there in the middle of your JSX component which would tie me to a very particular vendor and implementation detail. If I decided to later move away from ParseReact I'd have to rewrite a lot of code and tests.

Also, it had this statement

Mutations are dispatched in the manner of Flux Actions, allowing updates to be synchronized between many different components without requiring views to talk to each other

I don't want to deal w/ wrapping my head around Flux Actions and have to monkey-patch or something to get Redux Actions.

In a previous life, I worked with Parse JS SDK and it's based on backbone.js. So I didn't go that direction either, because, again, I didn't want to have another data model to deal with. Plus, at the time I was using it, the SDK was buggy and it was difficult to work with.

With the Parse Rest API, it's simple, can be tested itself from the command line with curl, it's clear, it's succinct and it's easily replaced with something else, an example such as Mongo/Mongoose without much, if any, impact on the code base.

-barton hammond

snowflake's People

Contributors

amilajack avatar andrewjack avatar ashsidhu avatar bartonhammond avatar benmidi avatar cpojer avatar davidlawson avatar gitter-badger avatar grifotv avatar hchoriq avatar jaxgit avatar jimthedev avatar jonathanpalma avatar kevinbluer avatar moduval avatar rajatscode avatar shenyyi avatar siemiatj avatar simchawe avatar tianling536 avatar tylermcginnis avatar veksen avatar wookiem avatar y00rb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snowflake's Issues

Don't check in config

Might be worth adding config to the .gitignore file so that people don't accidentally check in their configs and then having something like config.example.js that people can rename to config.js when they get started. Just a thought. Neat project.

Firebase integration

Hi!

I've started writing integration to Firebase. I have a few issues.

One is that Firebase doesn't have the possibility to use username as user identifier, it only relies on email. Do you @bartonhammond think it would be a better idea to fork the project in a firebase version, or write the integration alongside the Parse integration?

You are managing the session token in authActions. Wouldn't it be better to manage that in the Parse.js API-class? And have the Parse class handle the different response codes.
Also instead of creating a new instance of Parse class every time one of the actions are fired, authActions could have an instance of the api class.

[QUESTION] Can't properly setup async actions test on my app

Hi, I was looking at your project to get basic ideas for testing my RN app with redux, redux-thunk and a set of async actions. Thanks for your great work I've been able to successfully test basic actions and components rendering, but can't make it work with promises.

My app is RN 0.18 application with the following package.json config:

{
  "name": "myApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "react-native start",
    "test": "rm -rf ./node_modules/jest-cli/.haste_cache && jest --verbose",
    "test:watch": "npm run test -- --watch"
  },
  "jest": {
    "scriptPreprocessor": "jestSupport/scriptPreprocess.js",
    "setupEnvScriptFile": "node_modules/react-native/jestSupport/env.js",
    "testPathIgnorePatterns": [
      "/node_modules/",
      "packager/react-packager/src/Activity/"
    ],
    "testFileExtensions": [
      "js"
    ],
    "moduleFileExtensions": [
      "js"
    ],
    "unmockedModulePathPatterns": [
      "react",
      "react-addons-test-utils",
      "promise",
      "source-map",
      "key-mirror",
      "immutable",
      "fetch",
      "redux",
      "redux-thunk",
      "fbjs"
    ]
  },
  "dependencies": {
    "lodash": "^3.10.1",
    "react-native": "0.18.0",
    "react-native-android-statusbar": "^0.1.2",
    "react-native-fs": "1.1.0",
    "react-native-sqlite-storage": "^2.1.1",
    "react-native-vector-icons": "^1.0.0",
    "react-redux": "3.1.2",
    "react-timer-mixin": "^0.13.3",
    "redux": "^3.0.5",
    "redux-thunk": "^1.0.2"
  },
  "devDependencies": {
    "art": "^0.10.1",
    "babel-core": "^6.4.5",
    "babel-jest": "^6.0.1",
    "d3": "^3.5.12",
    "jest-cli": "^0.8.2",
    "moment": "^2.10.6",
    "react": "^0.14.3",
    "react-addons-test-utils": "^0.14.3"
  }
}

My tests are placed at the top directory like so:

. myApp
|-- index.android.js
|-- index.ios.js
|-- app/
|-- android/
|-- ios/
|-- __tests__
|  |-- actions
|    └-- appState-test.js
|-- mocks
|  └-- Store.js
└-- package.json

Store.js file looks exactly like the one you've got here and my appState-test.js file looks like:

'use strict';

jest.autoMockOff();

const mockStore = require('../../exampleStore/snowflakeStore').default;
const actions = require('../../app/actions/appState');

import * as types from '../../app/constants/actionTypes';

describe('appStateSnowflake', () => {
  pit('should fetchSMTH', () => {    
    const expectedActions = [
      {type: types.START_FETCH_SMTH},
      {type: types.END_FETCH_SMTH}
    ];

    const store = mockStore({}, expectedActions);
    return store.dispatch(actions.fetchSMTH());
  });
});

Where actions/appState.js looks following:

import * as types from '../constants/actionTypes';

function startFetchSMTH() {
  console.log('startFetchSMTH')
  return { type: types.START_FETCH_SMTH }
}

function endFetchSMTH() {
  console.log('endFetchSMTH')
  return { type: types.END_FETCH_SMTH }
}

function doSomething() {
  console.log('Doing smth')
  return Promise.resolve();
}

export function fetchSMTH() {
  console.log('fetchSMTH')

  return (dispatch) => {
    dispatch(startFetchSMTH());

    return doSomething().then(() => {
      console.log('Im here HELP ME!!!')
      dispatch(endFetchSMTH())
    });
  }
}

However when I'm running my tests, only START_FETCH_SMTH has been dispatched and then I'm getting timeout: timed out after 5000 msec waiting for something to happen.
As for me this config looks exactly like the one in snowflake (tests from snowflake are running well) but they still doesn't work and I can't figure out why. Will appreciate if someone can help me as there isn't much information about RN testing, especially with Jest.

If this is an inappropriate question/issue - feel free to close it.

Thanks.

Question about stability

Greetings Barton,

Thanks so much for this amazing foundation! I'm wondering, if we were to build a production app on top of this, would we be on stable ground? The nervousness I have with 0.0.8 is related not just to test failures, but also the warnings in the UI:

image

image

My assumption is this and the unit test failures around the Icon (which seem related) can be safely ignored since the app seems to function properly. The nervousness comes when building our own functionality such as replacing Parse with our own APIs and so forth. We'll be relying on the unit tests fairly heavily to make sure we don't step on each others' toes, so we can't just ignore the failures and warnings once we go to production.

Do you think it'll be fairly easy to stabilize and productionalize?

It's clear I have a lot to learn (I'm a Node novice and have come from a Java / Clojure background but mostly server-side), and the people I'm hiring [JavaScript / mobile developers] will hopefully have a lot more wisdom on this end, but I need to make a call about whether this tech is a good bet for our business, and this is the most complete example I've found. Any illumination you can provide would be extremely helpful!

Thanks again,

Stephen.

Upgrade react-redux to v.4.0.6 throw UnableToResolveError

Unable to upgrade react-redux to latest version.

Uncaught error Error: UnableToResolveError: Unable to resolve module react-redux/native.
Invalid directory /Users/node_modules/react-redux/native

Repro(s)
In package.json, change "react-redux": "^3.1.0" to "react-redux": "^4.0.5".
Click Build in XCode

screen shot 2015-12-29 at 1 49 03 pm

ENV

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm"
npm ERR! node v4.2.1
npm ERR! npm  v2.14.7

Related to facebook/react-native#4062 and #32

SyntaxError: Use of const in strict mode.

Following the instructions for initial setup, and trying to build, results in an exception for both Android and iOS:

react-native run-android

/Users/xyz/Workspace/ReactNative/snowflake/node_modules/react-native/local-cli/cli.js:73
  const setupEnvScript = /^win/.test(process.platform)
  ^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Module._extensions..js (module.js:474:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/xyz/Workspace/ReactNative/snowflake/node_modules/babel-core/node_modules/babel-register/lib/node.js:138:7)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/xyz/Workspace/ReactNative/snowflake/node_modules/react-native/cli.js:15:18)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

The following displays in a Terminal window which pops up when opening the iOS project in Xcode:

~/Workspace/ReactNative/snowflake/node_modules/react-native/packager ~

/Users/xyz/Workspace/ReactNative/snowflake/node_modules/react-native/local-cli/cli.js:73
  const setupEnvScript = /^win/.test(process.platform)
  ^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:929:3
~
Process terminated. Press <enter> to close the window

Upgrade to RN 0.18

https://github.com/facebook/react-native/releases/tag/v0.18.1

XCode has following error:

PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/Script-00DD1BFF1BD5951E006B06BC.sh
    cd /Users/barton/projects/stargazers/temp/snowflake/ios
    export ACTION=build
    export AD_HOC_CODE_SIGNING_ALLOWED=NO
    export ALTERNATE_GROUP=staff
    export ALTERNATE_MODE=u+w,go-w,a+rX
    export ALTERNATE_OWNER=barton
    export ALWAYS_SEARCH_USER_PATHS=NO
    export ALWAYS_USE_SEPARATE_HEADERMAPS=NO
    export APPLE_INTERNAL_DEVELOPER_DIR=/AppleInternal/Developer
    export APPLE_INTERNAL_DIR=/AppleInternal
    export APPLE_INTERNAL_DOCUMENTATION_DIR=/AppleInternal/Documentation
    export APPLE_INTERNAL_LIBRARY_DIR=/AppleInternal/Library
    export APPLE_INTERNAL_TOOLS=/AppleInternal/Developer/Tools
    export APPLICATION_EXTENSION_API_ONLY=NO
    export APPLY_RULES_IN_COPY_FILES=NO
    export ARCHS=x86_64
    export ARCHS_STANDARD="i386 x86_64"
    export ARCHS_STANDARD_32_64_BIT="i386 x86_64"
    export ARCHS_STANDARD_32_BIT=i386
    export ARCHS_STANDARD_64_BIT=x86_64
    export ARCHS_STANDARD_INCLUDING_64_BIT="i386 x86_64"
    export ASSETCATALOG_COMPILER_APPICON_NAME=AppIcon
    export AVAILABLE_PLATFORMS="watchos iphonesimulator macosx appletvsimulator watchsimulator appletvos iphoneos"
    export BITCODE_GENERATION_MODE=marker
    export BUILD_ACTIVE_RESOURCES_ONLY=YES
    export BUILD_COMPONENTS="headers build"
    export BUILD_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products
    export BUILD_ROOT=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products
    export BUILD_STYLE=
    export BUILD_VARIANTS=normal
    export BUILT_PRODUCTS_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator
    export CACHE_ROOT=/var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/C/com.apple.DeveloperTools/7.1.1-7B1005/Xcode
    export CCHROOT=/var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/C/com.apple.DeveloperTools/7.1.1-7B1005/Xcode
    export CHMOD=/bin/chmod
    export CHOWN=/usr/sbin/chown
    export CLANG_CXX_LANGUAGE_STANDARD=gnu++0x
    export CLANG_CXX_LIBRARY=libc++
    export CLANG_ENABLE_MODULES=YES
    export CLANG_ENABLE_OBJC_ARC=YES
    export CLANG_MODULES_BUILD_SESSION_FILE=/Users/barton/Library/Developer/Xcode/DerivedData/ModuleCache/Session.modulevalidation
    export CLANG_WARN_BOOL_CONVERSION=YES
    export CLANG_WARN_CONSTANT_CONVERSION=YES
    export CLANG_WARN_DIRECT_OBJC_ISA_USAGE=YES_ERROR
    export CLANG_WARN_EMPTY_BODY=YES
    export CLANG_WARN_ENUM_CONVERSION=YES
    export CLANG_WARN_INT_CONVERSION=YES
    export CLANG_WARN_OBJC_ROOT_CLASS=YES_ERROR
    export CLANG_WARN_UNREACHABLE_CODE=YES
    export CLANG_WARN__DUPLICATE_METHOD_MATCH=YES
    export CLASS_FILE_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/JavaClasses
    export CLEAN_PRECOMPS=YES
    export CLONE_HEADERS=NO
    export CODESIGNING_FOLDER_PATH=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator/snowflake.app
    export CODE_SIGNING_ALLOWED=NO
    export CODE_SIGN_CONTEXT_CLASS=XCiPhoneSimulatorCodeSignContext
    export CODE_SIGN_IDENTITY="iPhone Developer"
    export COLOR_DIAGNOSTICS=NO
    export COMBINE_HIDPI_IMAGES=NO
    export COMMAND_MODE=legacy
    export COMPOSITE_SDK_DIRS=/var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/C/com.apple.DeveloperTools/7.1.1-7B1005/Xcode/CompositeSDKs
    export COMPRESS_PNG_FILES=YES
    export CONFIGURATION=Debug
    export CONFIGURATION_BUILD_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator
    export CONFIGURATION_TEMP_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator
    export CONTENTS_FOLDER_PATH=snowflake.app
    export COPYING_PRESERVES_HFS_DATA=NO
    export COPY_HEADERS_RUN_UNIFDEF=NO
    export COPY_PHASE_STRIP=NO
    export COPY_RESOURCES_FROM_STATIC_FRAMEWORKS=YES
    export CORRESPONDING_DEVICE_PLATFORM_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
    export CORRESPONDING_DEVICE_PLATFORM_NAME=iphoneos
    export CORRESPONDING_DEVICE_SDK_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk
    export CORRESPONDING_DEVICE_SDK_NAME=iphoneos9.1
    export CP=/bin/cp
    export CREATE_INFOPLIST_SECTION_IN_BINARY=NO
    export CURRENT_ARCH=x86_64
    export CURRENT_PROJECT_VERSION=1
    export CURRENT_VARIANT=normal
    export DEAD_CODE_STRIPPING=NO
    export DEBUGGING_SYMBOLS=YES
    export DEBUG_INFORMATION_FORMAT=dwarf-with-dsym
    export DEFAULT_COMPILER=com.apple.compilers.llvm.clang.1_0
    export DEFAULT_KEXT_INSTALL_PATH=/System/Library/Extensions
    export DEFINES_MODULE=NO
    export DEPLOYMENT_LOCATION=NO
    export DEPLOYMENT_POSTPROCESSING=NO
    export DEPLOYMENT_TARGET_CLANG_ENV_NAME=IPHONEOS_DEPLOYMENT_TARGET
    export DEPLOYMENT_TARGET_CLANG_FLAG_NAME=mios-simulator-version-min
    export DEPLOYMENT_TARGET_CLANG_FLAG_PREFIX=-mios-simulator-version-min=
    export DEPLOYMENT_TARGET_SETTING_NAME=IPHONEOS_DEPLOYMENT_TARGET
    export DEPLOYMENT_TARGET_SUGGESTED_VALUES="6.0 6.1 7.0 7.1 8.0 8.1 8.2 8.3 8.4 9.0 9.1"
    export DERIVED_FILES_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/DerivedSources
    export DERIVED_FILE_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/DerivedSources
    export DERIVED_SOURCES_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/DerivedSources
    export DEVELOPER_APPLICATIONS_DIR=/Applications/Xcode.app/Contents/Developer/Applications
    export DEVELOPER_BIN_DIR=/Applications/Xcode.app/Contents/Developer/usr/bin
    export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
    export DEVELOPER_FRAMEWORKS_DIR=/Applications/Xcode.app/Contents/Developer/Library/Frameworks
    export DEVELOPER_FRAMEWORKS_DIR_QUOTED=/Applications/Xcode.app/Contents/Developer/Library/Frameworks
    export DEVELOPER_LIBRARY_DIR=/Applications/Xcode.app/Contents/Developer/Library
    export DEVELOPER_SDK_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
    export DEVELOPER_TOOLS_DIR=/Applications/Xcode.app/Contents/Developer/Tools
    export DEVELOPER_USR_DIR=/Applications/Xcode.app/Contents/Developer/usr
    export DEVELOPMENT_LANGUAGE=English
    export DOCUMENTATION_FOLDER_PATH=snowflake.app/English.lproj/Documentation
    export DO_HEADER_SCANNING_IN_JAM=NO
    export DSTROOT=/tmp/snowflake.dst
    export DT_TOOLCHAIN_DIR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
    export DWARF_DSYM_FILE_NAME=snowflake.app.dSYM
    export DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT=NO
    export DWARF_DSYM_FOLDER_PATH=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator
    export EFFECTIVE_PLATFORM_NAME=-iphonesimulator
    export EMBEDDED_CONTENT_CONTAINS_SWIFT=NO
    export EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE=NO
    export ENABLE_BITCODE=NO
    export ENABLE_HEADER_DEPENDENCIES=YES
    export ENABLE_ON_DEMAND_RESOURCES=YES
    export ENABLE_STRICT_OBJC_MSGSEND=YES
    export ENABLE_TESTABILITY=NO
    export EXCLUDED_INSTALLSRC_SUBDIRECTORY_PATTERNS=".DS_Store .svn .git .hg CVS"
    export EXCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES="*.nib *.lproj *.framework *.gch *.xcode* *.xcassets (*) .DS_Store CVS .svn .git .hg *.pbproj *.pbxproj"
    export EXECUTABLES_FOLDER_PATH=snowflake.app/Executables
    export EXECUTABLE_FOLDER_PATH=snowflake.app
    export EXECUTABLE_NAME=snowflake
    export EXECUTABLE_PATH=snowflake.app/snowflake
    export EXPANDED_CODE_SIGN_IDENTITY=
    export EXPANDED_CODE_SIGN_IDENTITY_NAME=
    export EXPANDED_PROVISIONING_PROFILE=
    export FILE_LIST=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/Objects/LinkFileList
    export FIXED_FILES_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/FixedFiles
    export FRAMEWORKS_FOLDER_PATH=snowflake.app/Frameworks
    export FRAMEWORK_FLAG_PREFIX=-framework
    export FRAMEWORK_SEARCH_PATHS="/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator "
    export FRAMEWORK_VERSION=A
    export FULL_PRODUCT_NAME=snowflake.app
    export GCC3_VERSION=3.3
    export GCC_C_LANGUAGE_STANDARD=gnu99
    export GCC_DYNAMIC_NO_PIC=NO
    export GCC_INLINES_ARE_PRIVATE_EXTERN=YES
    export GCC_OBJC_LEGACY_DISPATCH=YES
    export GCC_OPTIMIZATION_LEVEL=0
    export GCC_PFE_FILE_C_DIALECTS="c objective-c c++ objective-c++"
    export GCC_PREPROCESSOR_DEFINITIONS="DEBUG=1 "
    export GCC_SYMBOLS_PRIVATE_EXTERN=NO
    export GCC_TREAT_WARNINGS_AS_ERRORS=NO
    export GCC_VERSION=com.apple.compilers.llvm.clang.1_0
    export GCC_VERSION_IDENTIFIER=com_apple_compilers_llvm_clang_1_0
    export GCC_WARN_64_TO_32_BIT_CONVERSION=YES
    export GCC_WARN_ABOUT_RETURN_TYPE=YES_ERROR
    export GCC_WARN_UNDECLARED_SELECTOR=YES
    export GCC_WARN_UNINITIALIZED_AUTOS=YES_AGGRESSIVE
    export GCC_WARN_UNUSED_FUNCTION=YES
    export GCC_WARN_UNUSED_VARIABLE=YES
    export GENERATE_MASTER_OBJECT_FILE=NO
    export GENERATE_PKGINFO_FILE=YES
    export GENERATE_PROFILING_CODE=NO
    export GID=20
    export GROUP=staff
    export HEADERMAP_INCLUDES_FLAT_ENTRIES_FOR_TARGET_BEING_BUILT=YES
    export HEADERMAP_INCLUDES_FRAMEWORK_ENTRIES_FOR_ALL_PRODUCT_TYPES=YES
    export HEADERMAP_INCLUDES_NONPUBLIC_NONPRIVATE_HEADERS=YES
    export HEADERMAP_INCLUDES_PROJECT_HEADERS=YES
    export HEADERMAP_USES_FRAMEWORK_PREFIX_ENTRIES=YES
    export HEADERMAP_USES_VFS=NO
    export HEADER_SEARCH_PATHS="/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator/include /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include /Users/barton/projects/stargazers/temp/snowflake/ios/../node_modules/react-native/React/**"
    export HIDE_BITCODE_SYMBOLS=YES
    export HOME=/Users/barton
    export ICONV=/usr/bin/iconv
    export INFOPLIST_EXPAND_BUILD_SETTINGS=YES
    export INFOPLIST_FILE=snowflake/Info.plist
    export INFOPLIST_OUTPUT_FORMAT=binary
    export INFOPLIST_PATH=snowflake.app/Info.plist
    export INFOPLIST_PREPROCESS=NO
    export INFOSTRINGS_PATH=snowflake.app/English.lproj/InfoPlist.strings
    export INSTALL_DIR=/tmp/snowflake.dst/Applications
    export INSTALL_GROUP=staff
    export INSTALL_MODE_FLAG=u+w,go-w,a+rX
    export INSTALL_OWNER=barton
    export INSTALL_PATH=/Applications
    export INSTALL_ROOT=/tmp/snowflake.dst
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export JAVAC_DEFAULT_FLAGS="-J-Xms64m -J-XX:NewSize=4M -J-Dfile.encoding=UTF8"
    export JAVA_APP_STUB=/System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub
    export JAVA_ARCHIVE_CLASSES=YES
    export JAVA_ARCHIVE_TYPE=JAR
    export JAVA_COMPILER=/usr/bin/javac
    export JAVA_FOLDER_PATH=snowflake.app/Java
    export JAVA_FRAMEWORK_RESOURCES_DIRS=Resources
    export JAVA_JAR_FLAGS=cv
    export JAVA_SOURCE_SUBDIR=.
    export JAVA_USE_DEPENDENCIES=YES
    export JAVA_ZIP_FLAGS=-urg
    export JIKES_DEFAULT_FLAGS="+E +OLDCSO"
    export KEEP_PRIVATE_EXTERNS=NO
    export LD_DEPENDENCY_INFO_FILE=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/Objects-normal/x86_64/snowflake_dependency_info.dat
    export LD_GENERATE_MAP_FILE=NO
    export LD_MAP_FILE_PATH=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/snowflake-LinkMap-normal-x86_64.txt
    export LD_NO_PIE=NO
    export LD_QUOTE_LINKER_ARGUMENTS_FOR_COMPILER_DRIVER=YES
    export LD_RUNPATH_SEARCH_PATHS=" @executable_path/Frameworks"
    export LEGACY_DEVELOPER_DIR=/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer
    export LEX=lex
    export LIBRARY_FLAG_NOSPACE=YES
    export LIBRARY_FLAG_PREFIX=-l
    export LIBRARY_KEXT_INSTALL_PATH=/Library/Extensions
    export LIBRARY_SEARCH_PATHS="/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator "
    export LINKER_DISPLAYS_MANGLED_NAMES=NO
    export LINK_FILE_LIST_normal_x86_64=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/Objects-normal/x86_64/snowflake.LinkFileList
    export LINK_WITH_STANDARD_LIBRARIES=YES
    export LOCALIZABLE_CONTENT_DIR=
    export LOCALIZED_RESOURCES_FOLDER_PATH=snowflake.app/English.lproj
    export LOCAL_ADMIN_APPS_DIR=/Applications/Utilities
    export LOCAL_APPS_DIR=/Applications
    export LOCAL_DEVELOPER_DIR=/Library/Developer
    export LOCAL_LIBRARY_DIR=/Library
    export LOCROOT=
    export LOCSYMROOT=
    export MACH_O_TYPE=mh_execute
    export MAC_OS_X_PRODUCT_BUILD_VERSION=14F27
    export MAC_OS_X_VERSION_ACTUAL=101005
    export MAC_OS_X_VERSION_MAJOR=101000
    export MAC_OS_X_VERSION_MINOR=1005
    export MODULE_CACHE_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/ModuleCache
    export MTL_ENABLE_DEBUG_INFO=YES
    export NATIVE_ARCH=i386
    export NATIVE_ARCH_32_BIT=i386
    export NATIVE_ARCH_64_BIT=x86_64
    export NATIVE_ARCH_ACTUAL=x86_64
    export NO_COMMON=YES
    export OBJC_ABI_VERSION=2
    export OBJECT_FILE_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/Objects
    export OBJECT_FILE_DIR_normal=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/Objects-normal
    export OBJROOT=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates
    export ONLY_ACTIVE_ARCH=YES
    export OPTIMIZATION_LEVEL=0
    export OS=MACOS
    export OSAC=/usr/bin/osacompile
    export OTHER_LDFLAGS=-ObjC
    export PACKAGE_TYPE=com.apple.package-type.wrapper.application
    export PASCAL_STRINGS=YES
    export PATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    export PATH_PREFIXES_EXCLUDED_FROM_HEADER_DEPENDENCIES="/usr/include /usr/local/include /System/Library/Frameworks /System/Library/PrivateFrameworks /Applications/Xcode.app/Contents/Developer/Headers /Applications/Xcode.app/Contents/Developer/SDKs /Applications/Xcode.app/Contents/Developer/Platforms"
    export PBDEVELOPMENTPLIST_PATH=snowflake.app/pbdevelopment.plist
    export PFE_FILE_C_DIALECTS=objective-c
    export PKGINFO_FILE_PATH=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/PkgInfo
    export PKGINFO_PATH=snowflake.app/PkgInfo
    export PLATFORM_DEVELOPER_APPLICATIONS_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications
    export PLATFORM_DEVELOPER_BIN_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
    export PLATFORM_DEVELOPER_LIBRARY_DIR=/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library
    export PLATFORM_DEVELOPER_SDK_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
    export PLATFORM_DEVELOPER_TOOLS_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Tools
    export PLATFORM_DEVELOPER_USR_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr
    export PLATFORM_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
    export PLATFORM_DISPLAY_NAME="iOS Simulator"
    export PLATFORM_NAME=iphonesimulator
    export PLATFORM_PREFERRED_ARCH=x86_64
    export PLATFORM_VERSION_AVAILABILITY_H_FORMAT=90100
    export PLIST_FILE_OUTPUT_FORMAT=binary
    export PLUGINS_FOLDER_PATH=snowflake.app/PlugIns
    export PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR=YES
    export PRECOMP_DESTINATION_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/PrefixHeaders
    export PRESERVE_DEAD_CODE_INITS_AND_TERMS=NO
    export PRIVATE_HEADERS_FOLDER_PATH=snowflake.app/PrivateHeaders
    export PRODUCT_BUNDLE_IDENTIFIER=org.bartonhammond.snowflake
    export PRODUCT_MODULE_NAME=snowflake
    export PRODUCT_NAME=snowflake
    export PRODUCT_SETTINGS_PATH=/Users/barton/projects/stargazers/temp/snowflake/ios/snowflake/Info.plist
    export PRODUCT_TYPE=com.apple.product-type.application
    export PROFILING_CODE=NO
    export PROJECT=snowflake
    export PROJECT_DERIVED_FILE_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/DerivedSources
    export PROJECT_DIR=/Users/barton/projects/stargazers/temp/snowflake/ios
    export PROJECT_FILE_PATH=/Users/barton/projects/stargazers/temp/snowflake/ios/snowflake.xcodeproj
    export PROJECT_NAME=snowflake
    export PROJECT_TEMP_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build
    export PROJECT_TEMP_ROOT=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates
    export PUBLIC_HEADERS_FOLDER_PATH=snowflake.app/Headers
    export RECURSIVE_SEARCH_PATHS_FOLLOW_SYMLINKS=YES
    export REMOVE_CVS_FROM_RESOURCES=YES
    export REMOVE_GIT_FROM_RESOURCES=YES
    export REMOVE_HEADERS_FROM_EMBEDDED_BUNDLES=YES
    export REMOVE_HG_FROM_RESOURCES=YES
    export REMOVE_SVN_FROM_RESOURCES=YES
    export REZ_COLLECTOR_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/ResourceManagerResources
    export REZ_OBJECTS_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/ResourceManagerResources/Objects
    export REZ_SEARCH_PATHS="/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator "
    export SCAN_ALL_SOURCE_FILES_FOR_INCLUDES=NO
    export SCRIPTS_FOLDER_PATH=snowflake.app/Scripts
    export SCRIPT_INPUT_FILE_COUNT=0
    export SCRIPT_OUTPUT_FILE_COUNT=0
    export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk
    export SDK_DIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk
    export SDK_DIR_iphonesimulator9_1=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk
    export SDK_NAME=iphonesimulator9.1
    export SDK_NAMES=iphonesimulator9.1
    export SDK_PRODUCT_BUILD_VERSION=13B137
    export SDK_VERSION=9.1
    export SDK_VERSION_ACTUAL=90100
    export SDK_VERSION_MAJOR=90000
    export SDK_VERSION_MINOR=100
    export SED=/usr/bin/sed
    export SEPARATE_STRIP=NO
    export SEPARATE_SYMBOL_EDIT=NO
    export SET_DIR_MODE_OWNER_GROUP=YES
    export SET_FILE_MODE_OWNER_GROUP=NO
    export SHALLOW_BUNDLE=YES
    export SHARED_DERIVED_FILE_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator/DerivedSources
    export SHARED_FRAMEWORKS_FOLDER_PATH=snowflake.app/SharedFrameworks
    export SHARED_PRECOMPS_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/PrecompiledHeaders
    export SHARED_SUPPORT_FOLDER_PATH=snowflake.app/SharedSupport
    export SKIP_INSTALL=NO
    export SOURCE_ROOT=/Users/barton/projects/stargazers/temp/snowflake/ios
    export SRCROOT=/Users/barton/projects/stargazers/temp/snowflake/ios
    export STRINGS_FILE_OUTPUT_ENCODING=binary
    export STRIP_BITCODE_FROM_COPIED_FILES=NO
    export STRIP_INSTALLED_PRODUCT=YES
    export STRIP_STYLE=all
    export SUPPORTED_DEVICE_FAMILIES=1,2
    export SUPPORTED_PLATFORMS="iphonesimulator iphoneos"
    export SUPPORTS_TEXT_BASED_API=NO
    export SWIFT_PLATFORM_TARGET_PREFIX=ios
    export SYMROOT=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products
    export SYSTEM_ADMIN_APPS_DIR=/Applications/Utilities
    export SYSTEM_APPS_DIR=/Applications
    export SYSTEM_CORE_SERVICES_DIR=/System/Library/CoreServices
    export SYSTEM_DEMOS_DIR=/Applications/Extras
    export SYSTEM_DEVELOPER_APPS_DIR=/Applications/Xcode.app/Contents/Developer/Applications
    export SYSTEM_DEVELOPER_BIN_DIR=/Applications/Xcode.app/Contents/Developer/usr/bin
    export SYSTEM_DEVELOPER_DEMOS_DIR="/Applications/Xcode.app/Contents/Developer/Applications/Utilities/Built Examples"
    export SYSTEM_DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
    export SYSTEM_DEVELOPER_DOC_DIR="/Applications/Xcode.app/Contents/Developer/ADC Reference Library"
    export SYSTEM_DEVELOPER_GRAPHICS_TOOLS_DIR="/Applications/Xcode.app/Contents/Developer/Applications/Graphics Tools"
    export SYSTEM_DEVELOPER_JAVA_TOOLS_DIR="/Applications/Xcode.app/Contents/Developer/Applications/Java Tools"
    export SYSTEM_DEVELOPER_PERFORMANCE_TOOLS_DIR="/Applications/Xcode.app/Contents/Developer/Applications/Performance Tools"
    export SYSTEM_DEVELOPER_RELEASENOTES_DIR="/Applications/Xcode.app/Contents/Developer/ADC Reference Library/releasenotes"
    export SYSTEM_DEVELOPER_TOOLS=/Applications/Xcode.app/Contents/Developer/Tools
    export SYSTEM_DEVELOPER_TOOLS_DOC_DIR="/Applications/Xcode.app/Contents/Developer/ADC Reference Library/documentation/DeveloperTools"
    export SYSTEM_DEVELOPER_TOOLS_RELEASENOTES_DIR="/Applications/Xcode.app/Contents/Developer/ADC Reference Library/releasenotes/DeveloperTools"
    export SYSTEM_DEVELOPER_USR_DIR=/Applications/Xcode.app/Contents/Developer/usr
    export SYSTEM_DEVELOPER_UTILITIES_DIR=/Applications/Xcode.app/Contents/Developer/Applications/Utilities
    export SYSTEM_DOCUMENTATION_DIR=/Library/Documentation
    export SYSTEM_KEXT_INSTALL_PATH=/System/Library/Extensions
    export SYSTEM_LIBRARY_DIR=/System/Library
    export TARGETED_DEVICE_FAMILY=1
    export TARGETNAME=snowflake
    export TARGET_BUILD_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator
    export TARGET_DEVICE_MODEL=iPhone8,2
    export TARGET_DEVICE_OS_VERSION=9.1
    export TARGET_NAME=snowflake
    export TARGET_TEMP_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build
    export TEMP_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build
    export TEMP_FILES_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build
    export TEMP_FILE_DIR=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build
    export TEMP_ROOT=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates
    export TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault
    export TOOLCHAIN_DIR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
    export TREAT_MISSING_BASELINES_AS_TEST_FAILURES=NO
    export UID=501
    export UNLOCALIZED_RESOURCES_FOLDER_PATH=snowflake.app
    export UNSTRIPPED_PRODUCT=NO
    export USER=barton
    export USER_APPS_DIR=/Users/barton/Applications
    export USER_LIBRARY_DIR=/Users/barton/Library
    export USE_DYNAMIC_NO_PIC=YES
    export USE_HEADERMAP=YES
    export USE_HEADER_SYMLINKS=NO
    export VALIDATE_PRODUCT=NO
    export VALID_ARCHS="i386 x86_64"
    export VERBOSE_PBXCP=NO
    export VERSIONING_SYSTEM=apple-generic
    export VERSIONPLIST_PATH=snowflake.app/version.plist
    export VERSION_INFO_BUILDER=barton
    export VERSION_INFO_FILE=snowflake_vers.c
    export VERSION_INFO_STRING="\"@(#)PROGRAM:snowflake  PROJECT:snowflake-1\""
    export WRAPPER_EXTENSION=app
    export WRAPPER_NAME=snowflake.app
    export WRAPPER_SUFFIX=.app
    export WRAP_ASSET_PACKS_IN_SEPARATE_DIRECTORIES=NO
    export XCODE_APP_SUPPORT_DIR=/Applications/Xcode.app/Contents/Developer/Library/Xcode
    export XCODE_PRODUCT_BUILD_VERSION=7B1005
    export XCODE_VERSION_ACTUAL=0711
    export XCODE_VERSION_MAJOR=0700
    export XCODE_VERSION_MINOR=0710
    export XPCSERVICES_FOLDER_PATH=snowflake.app/XPCServices
    export YACC=yacc
    export arch=x86_64
    export variant=normal
    /bin/sh -c /Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Intermediates/snowflake.build/Debug-iphonesimulator/snowflake.build/Script-00DD1BFF1BD5951E006B06BC.sh

+ DEST=/Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator/snowflake.app
++ npm prefix -g
+ PATH=/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
+ '[' -z '' ']'
+ export NVM_DIR=/Users/barton/.nvm
+ NVM_DIR=/Users/barton/.nvm
+ [[ -s /Users/barton/.nvm/nvm.sh ]]
++ command -v brew
+ [[ -x /usr/local/bin/brew ]]
++ brew --prefix nvm
+ [[ -s /usr/local/Cellar/nvm/0.29.0/nvm.sh ]]
+ [[ -x /Users/barton/.nodenv/bin/nodenv ]]
+ react-native bundle --entry-file index.ios.js --platform ios --dev true --bundle-output /Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator/snowflake.app/main.jsbundle --assets-dest /Users/barton/Library/Developer/Xcode/DerivedData/snowflake-gjauksuvribablfmqjwsycravspz/Build/Products/Debug-iphonesimulator/snowflake.app
bundle: Created ReactPackager
uncaught error Error: Server closed unexpectedly.
Server ping connection attempt result: Error: connect ENOENT /var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-708a529ac28c6ee4f9bfa6acf3fea420
Socket path: `/var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-708a529ac28c6ee4f9bfa6acf3fea420` doesn't exist

Server logs:
Thu, 28 Jan 2016 17:46:20 GMT ReactNativePackager:SocketServer server got ipc message { type: 'createSocketServer',
  data: 
   { sockPath: '/var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-950f4141e8bb747fb12f1008320112e8',
     options: 
      { projectRoots: [Object],
        assetRoots: [Object],
        blacklistRE: [Object],
        transformModulePath: '/Users/barton/projects/stargazers/temp/oAuth/client/node_modules/react-native/packager/transformer.js' } } }
[11:46:20 AM] <START> Building Dependency Graph
[11:46:20 AM] <START> Crawling File System
[11:46:20 AM] <START> Loading bundles layout
[11:46:20 AM] <END>   Loading bundles layout (0ms)
Thu, 28 Jan 2016 17:46:20 GMT ReactNativePackager:SocketServer Process 77120 listening on socket path /var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-950f4141e8bb747fb12f1008320112e8 for server with options {"projectRoots":["/Users/barton/projects/stargazers/temp/oAuth/client"],"assetRoots":["/Users/barton/projects/stargazers/temp/oAuth/client"],"blacklistRE":{},"transformModulePath":"/Users/barton/projects/stargazers/temp/oAuth/client/node_modules/react-native/packager/transformer.js","nonPersistent":true}
Thu, 28 Jan 2016 17:46:20 GMT ReactNativePackager:SocketServer succesfully created server
Thu, 28 Jan 2016 17:46:20 GMT ReactNativePackager:SocketServer connection to server 77120
Thu, 28 Jan 2016 17:46:20 GMT ReactNativePackager:SocketServer got request { type: 'buildBundle',
  data: 
   { entryFile: 'index.ios.js',
     dev: true,
     minify: false,
     platform: 'ios' },
  id: 'yurhljo' }
[11:46:20 AM] <START> find dependencies
[11:46:25 AM] <END>   Crawling File System (4827ms)
[11:46:25 AM] <START> Building in-memory fs for JavaScript
[11:46:29 AM] <END>   Building in-memory fs for JavaScript (3626ms)
[11:46:29 AM] <START> Building in-memory fs for Assets
[11:46:32 AM] <END>   Building in-memory fs for Assets (3570ms)
[11:46:32 AM] <START> Building Haste Map
[11:46:34 AM] <START> Building (deprecated) Asset Map
[11:46:35 AM] <END>   Building (deprecated) Asset Map (754ms)
[11:46:35 AM] <END>   Building Haste Map (2613ms)
[11:46:35 AM] <END>   Building Dependency Graph (14661ms)
[11:46:35 AM] <END>   find dependencies (14778ms)
[11:46:35 AM] <START> transform
[11:46:43 AM] <END>   transform (7915ms)
Thu, 28 Jan 2016 17:46:43 GMT ReactNativePackager:SocketServer request finished result
Thu, 28 Jan 2016 17:47:13 GMT ReactNativePackager:SocketServer server dying 77120
Thu, 28 Jan 2016 17:47:14 GMT ReactNativePackager:SocketServer exit code: 0
Thu, 28 Jan 2016 21:31:04 GMT ReactNativePackager:SocketServer server got ipc message { type: 'createSocketServer',
  data: 
   { sockPath: '/var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-950f4141e8bb747fb12f1008320112e8',
     options: 
      { projectRoots: [Object],
        assetRoots: [Object],
        blacklistRE: [Object],
        transformModulePath: '/Users/barton/projects/stargazers/temp/oAuth/client/node_modules/react-native/packager/transformer.js' } } }
[3:31:04 PM] <START> Building Dependency Graph
[3:31:04 PM] <START> Crawling File System
[3:31:04 PM] <START> Loading bundles layout
[3:31:04 PM] <END>   Loading bundles layout (0ms)
Thu, 28 Jan 2016 21:31:04 GMT ReactNativePackager:SocketServer Process 77779 listening on socket path /var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-950f4141e8bb747fb12f1008320112e8 for server with options {"projectRoots":["/Users/barton/projects/stargazers/temp/oAuth/client"],"assetRoots":["/Users/barton/projects/stargazers/temp/oAuth/client"],"blacklistRE":{},"transformModulePath":"/Users/barton/projects/stargazers/temp/oAuth/client/node_modules/react-native/packager/transformer.js","nonPersistent":true}
Thu, 28 Jan 2016 21:31:04 GMT ReactNativePackager:SocketServer succesfully created server
Thu, 28 Jan 2016 21:31:04 GMT ReactNativePackager:SocketServer connection to server 77779
Thu, 28 Jan 2016 21:31:04 GMT ReactNativePackager:SocketServer got request { type: 'buildBundle',
  data: 
   { entryFile: 'index.ios.js',
     dev: true,
     minify: false,
     platform: 'ios' },
  id: 'vwf9pds' }
[3:31:04 PM] <START> find dependencies
[3:31:09 PM] <END>   Crawling File System (4449ms)
[3:31:09 PM] <START> Building in-memory fs for JavaScript
[3:31:12 PM] <END>   Building in-memory fs for JavaScript (3412ms)
[3:31:12 PM] <START> Building in-memory fs for Assets
[3:31:16 PM] <END>   Building in-memory fs for Assets (3432ms)
[3:31:16 PM] <START> Building Haste Map
[3:31:17 PM] <START> Building (deprecated) Asset Map
[3:31:18 PM] <END>   Building (deprecated) Asset Map (721ms)
[3:31:18 PM] <END>   Building Haste Map (2537ms)
[3:31:18 PM] <END>   Building Dependency Graph (13846ms)
[3:31:18 PM] <END>   find dependencies (13914ms)
[3:31:18 PM] <START> transform
[3:31:23 PM] <END>   transform (4783ms)
Thu, 28 Jan 2016 21:31:23 GMT ReactNativePackager:SocketServer request finished result
Thu, 28 Jan 2016 21:31:53 GMT ReactNativePackager:SocketServer server dying 77779
Thu, 28 Jan 2016 21:31:54 GMT ReactNativePackager:SocketServer exit code: 0
Fri, 29 Jan 2016 00:10:15 GMT ReactNativePackager:SocketServer server got ipc message { type: 'createSocketServer',
  data: 
   { sockPath: '/var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-708a529ac28c6ee4f9bfa6acf3fea420',
     options: 
      { projectRoots: [Object],
        assetRoots: [Object],
        blacklistRE: [Object],
        transformModulePath: '/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/packager/transformer.js' } } }
[6:10:15 PM] <START> Building Dependency Graph
[6:10:15 PM] <START> Crawling File System
[6:10:15 PM] <START> Loading bundles layout
[6:10:15 PM] <END>   Loading bundles layout (0ms)
Fri, 29 Jan 2016 00:10:15 GMT ReactNativePackager:SocketServer Process 79655 listening on socket path /var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-708a529ac28c6ee4f9bfa6acf3fea420 for server with options {"projectRoots":["/Users/barton/projects/stargazers/temp/snowflake"],"assetRoots":["/Users/barton/projects/stargazers/temp/snowflake"],"blacklistRE":{},"transformModulePath":"/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/packager/transformer.js","nonPersistent":true}
Fri, 29 Jan 2016 00:10:15 GMT ReactNativePackager:SocketServer succesfully created server
Fri, 29 Jan 2016 00:10:15 GMT ReactNativePackager:SocketServer connection to server 79655
Fri, 29 Jan 2016 00:10:15 GMT ReactNativePackager:SocketServer got request { type: 'buildBundle',
  data: 
   { entryFile: 'index.ios.js',
     dev: true,
     minify: false,
     platform: 'ios' },
  id: 'mg8tgvl' }
[6:10:15 PM] <START> find dependencies
[6:10:21 PM] <END>   Crawling File System (5728ms)
[6:10:21 PM] <START> Building in-memory fs for JavaScript
[6:10:26 PM] <END>   Building in-memory fs for JavaScript (4948ms)
[6:10:26 PM] <START> Building in-memory fs for Assets
[6:10:31 PM] <END>   Building in-memory fs for Assets (4699ms)
[6:10:31 PM] <START> Building Haste Map
[6:10:33 PM] <START> Building (deprecated) Asset Map
[6:10:34 PM] <END>   Building (deprecated) Asset Map (868ms)
Error building DependencyGraph:
 Error: Naming collision detected: /Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/fbjs/lib/CSSCore.js collides with /Users/barton/projects/stargazers/temp/snowflake/node_modules/react/node_modules/fbjs/lib/CSSCore.js
    at HasteMap._updateHasteMap (HasteMap.js:132:13)
    at HasteMap.js:103:28
    at tryCallOne (/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
    at /Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/promise/lib/core.js:123:15
    at flush (/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
    at doNTCallback0 (node.js:419:9)
    at process._tickCallback (node.js:348:13)
Fri, 29 Jan 2016 00:10:34 GMT ReactNativePackager:SocketServer exit code: 1
Fri, 29 Jan 2016 00:13:19 GMT ReactNativePackager:SocketServer server got ipc message { type: 'createSocketServer',
  data: 
   { sockPath: '/var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-708a529ac28c6ee4f9bfa6acf3fea420',
     options: 
      { projectRoots: [Object],
        assetRoots: [Object],
        blacklistRE: [Object],
        transformModulePath: '/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/packager/transformer.js' } } }
[6:13:19 PM] <START> Building Dependency Graph
[6:13:19 PM] <START> Crawling File System
[6:13:19 PM] <START> Loading bundles layout
[6:13:19 PM] <END>   Loading bundles layout (0ms)
Fri, 29 Jan 2016 00:13:19 GMT ReactNativePackager:SocketServer Process 79798 listening on socket path /var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-708a529ac28c6ee4f9bfa6acf3fea420 for server with options {"projectRoots":["/Users/barton/projects/stargazers/temp/snowflake"],"assetRoots":["/Users/barton/projects/stargazers/temp/snowflake"],"blacklistRE":{},"transformModulePath":"/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/packager/transformer.js","nonPersistent":true}
Fri, 29 Jan 2016 00:13:19 GMT ReactNativePackager:SocketServer succesfully created server
Fri, 29 Jan 2016 00:13:19 GMT ReactNativePackager:SocketServer connection to server 79798
Fri, 29 Jan 2016 00:13:19 GMT ReactNativePackager:SocketServer got request { type: 'buildBundle',
  data: 
   { entryFile: 'index.ios.js',
     dev: true,
     minify: false,
     platform: 'ios' },
  id: '4k2a4ja' }
[6:13:19 PM] <START> find dependencies
[6:13:24 PM] <END>   Crawling File System (4521ms)
[6:13:24 PM] <START> Building in-memory fs for JavaScript
[6:13:29 PM] <END>   Building in-memory fs for JavaScript (4770ms)
[6:13:29 PM] <START> Building in-memory fs for Assets
[6:13:33 PM] <END>   Building in-memory fs for Assets (4701ms)
[6:13:33 PM] <START> Building Haste Map
[6:13:35 PM] <START> Building (deprecated) Asset Map
[6:13:36 PM] <END>   Building (deprecated) Asset Map (853ms)
Error building DependencyGraph:
 Error: Naming collision detected: /Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/fbjs/lib/CSSCore.js collides with /Users/barton/projects/stargazers/temp/snowflake/node_modules/react/node_modules/fbjs/lib/CSSCore.js
    at HasteMap._updateHasteMap (HasteMap.js:132:13)
    at HasteMap.js:103:28
    at tryCallOne (/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
    at /Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/promise/lib/core.js:123:15
    at flush (/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
    at doNTCallback0 (node.js:419:9)
    at process._tickCallback (node.js:348:13)
Fri, 29 Jan 2016 00:13:37 GMT ReactNativePackager:SocketServer exit code: 1
Fri, 29 Jan 2016 00:16:15 GMT ReactNativePackager:SocketServer server got ipc message { type: 'createSocketServer',
  data: 
   { sockPath: '/var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-708a529ac28c6ee4f9bfa6acf3fea420',
     options: 
      { projectRoots: [Object],
        assetRoots: [Object],
        blacklistRE: [Object],
        transformModulePath: '/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/packager/transformer.js' } } }
[6:16:15 PM] <START> Building Dependency Graph
[6:16:15 PM] <START> Crawling File System
[6:16:15 PM] <START> Loading bundles layout
[6:16:15 PM] <END>   Loading bundles layout (0ms)
Fri, 29 Jan 2016 00:16:15 GMT ReactNativePackager:SocketServer Process 79902 listening on socket path /var/folders/3f/mjjtxmz94jx7fhx1d4m926cw0000gn/T/react-packager-708a529ac28c6ee4f9bfa6acf3fea420 for server with options {"projectRoots":["/Users/barton/projects/stargazers/temp/snowflake"],"assetRoots":["/Users/barton/projects/stargazers/temp/snowflake"],"blacklistRE":{},"transformModulePath":"/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/packager/transformer.js","nonPersistent":true}
Fri, 29 Jan 2016 00:16:15 GMT ReactNativePackager:SocketServer succesfully created server
Fri, 29 Jan 2016 00:16:15 GMT ReactNativePackager:SocketServer connection to server 79902
Fri, 29 Jan 2016 00:16:16 GMT ReactNativePackager:SocketServer got request { type: 'buildBundle',
  data: 
   { entryFile: 'index.ios.js',
     dev: true,
     minify: false,
     platform: 'ios' },
  id: '04a838k' }
[6:16:16 PM] <START> find dependencies
[6:16:20 PM] <END>   Crawling File System (4277ms)
[6:16:20 PM] <START> Building in-memory fs for JavaScript
[6:16:24 PM] <END>   Building in-memory fs for JavaScript (4569ms)
[6:16:24 PM] <START> Building in-memory fs for Assets
[6:16:29 PM] <END>   Building in-memory fs for Assets (4680ms)
[6:16:29 PM] <START> Building Haste Map
[6:16:31 PM] <START> Building (deprecated) Asset Map
[6:16:32 PM] <END>   Building (deprecated) Asset Map (881ms)
Error building DependencyGraph:
 Error: Naming collision detected: /Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/fbjs/lib/CSSCore.js collides with /Users/barton/projects/stargazers/temp/snowflake/node_modules/react/node_modules/fbjs/lib/CSSCore.js
    at HasteMap._updateHasteMap (HasteMap.js:132:13)
    at HasteMap.js:103:28
    at tryCallOne (/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
    at /Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/promise/lib/core.js:123:15
    at flush (/Users/barton/projects/stargazers/temp/snowflake/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
    at doNTCallback0 (node.js:419:9)
    at process._tickCallback (node.js:348:13)
Fri, 29 Jan 2016 00:16:32 GMT ReactNativePackager:SocketServer exit code: 1

    at terminate (SocketClient.js:59:17)
    at Socket.<anonymous> (SocketClient.js:74:37)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at emitErrorNT (net.js:1253:8)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)
Command /bin/sh failed with exit code 1

Startup error when tried to run on ios

I followed the setup instructions and tried to run on ios and I got the following error.

2016-01-19 22:29:06.967 [warn][tid:com.facebook.React.JavaScript] Invariant Violation: Application snowflake has not been registered. This is either due to a require() error during initialization or failure to call AppRegistry.registerComponent.

Android signing issues

One note, if you generate the Android signing files from code it'll generate a new signing file for every build
Which means that if you have the app installed on your Android device you won't be able to update to a new version
It'll be treated as a separate app, or the install will be rejected
Unless you uninstall the already installed version first
Code signing for android is even worse than for iOS
Because there's no way of regenerating the same keystore
If you lose it you won't be able to push an update to Play Store
We had this issue once, and the only solution is to upload the new version as a completely new app..
We researched this for days, as we didn't believe that there's no other way
But we found no other solution, even after contacting Google
So the keystore file is really really important in case of Android
At least when you publish to Google play store

Is the local server required when using Parse?

After "Setup" with the following /src/lib/config.js:

module.exports = {
  PARSE: {
    APP_ID: '...',
    REST_API_KEY: '...',
    SESSION_TOKEN_KEY: 'SESSION_TOKEN_KEY'
  },
  backend: {
    parse: true,
    hapiLocal: false,
    hapiRemote: false
  }
}

Running the iOS app in Xcode fails with the following error:

Could not connect to development server.

Ensure the following:
- Node Server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate

URL: http://localhosts/index.ios.bundle?platform=ios&dev=true

So, 4 things (EDIT: 5 things):

  1. Obviously it's not running, because I thought / it seemed it was possible to run the app using only Parse for the backend.
  2. I didn't see anything in "Setup" about updating AppDelegate; I do see mention of it in the "Continuous Integration" steps.
  3. The default / original value used in AppDelegate is localhosts. Is that a typo?
  4. Is it possibly to run this without the local server using only Parse?
  5. Also, switching to the automatically generated "pre-bundled file on disk" results in a successful build, with no error, but a blank (black) screen.

EDIT: Added 5th point above.
EDIT 2: Working just fine with local server AND Parse using localhost:8081 URL in AppDelegate instead of localhosts (assuming the latter is a typo).

Cannot build iOS project because of node modules collision

Hi,

This project is a great effort to make unit tests work for React Native. However, I've run into the same problems as on my own project. The unit tests do run, but the iOS project doesn't build anymore. It happens because of the react module in node_modules.

When I run the project in Xcode, I receive an error from the React Native packager:

Error building DependencyGraph:
 Error: Naming collision detected: /Users/mikeborozdin/dev/react-native/snowflake/node_modules/react/node_modules/fbjs/lib/VersionRange.js collides with /Users/mikeborozdin/dev/react-native/snowflake/node_modules/react-native/node_modules/fbjs/lib/VersionRange.js
    at HasteMap._updateHasteMap (HasteMap.js:132:13)
    at HasteMap.js:103:28

iOS & Android Versions Numbers

for iOS, the Fastlane "increment version" is running in Bitrise.io. But the updated project is not updated in GitHub so ..

Need to have process to grab the version number, eg 0.0.6, from the package.json and update both iOS and Android w/ that "release"

[Feature request] Comms

Hi can we have some public forum to discuss with others that are using this? Maybe we could add one to discord reactiflux or glitter?

If not I'm happy to use issues here)

Password validation should be more consistent

Some special characters are accepted, and some aren't. This confuses the user as the rule says that passwords should "have at least a number and a special character and between 6-12 in length".

Example:

This password is accepted: TestTes12*
This password is not accepted: TestTes12?
This password is not accepted: TestTes12±
This password is not accepted: TestTes12(

Software keyboard

Doesn't seem to handle software (virtual) keyboard resizes/scrolls properly.

Default server URL is wrong; Typo in AppDelegate

See #45 for more background on reproducing the error.

In AppDelegate.m, the default development server URL is invalid:

// Run bundle depending on DEBUG flag
    #ifdef DEBUG
       jsCodeLocation = [NSURL URLWithString:@"http://localhosts/index.ios.bundle?platform=ios&dev=true"];

And results in the the following error on app load:

Could not connect to development server.

Ensure the following:
- Node Server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate

URL: http://localhosts/index.ios.bundle?platform=ios&dev=true

Steps to resolve: Update localhosts to localhost:8081 as used elsewhere AppDelegate.m:

jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];

Error: Naming collision detected on latest code (31-Jan)

I got this issue on console when click start app from xcode:
[1:57:42 PM] Building (deprecated) Asset Map (2391ms)
Error building DependencyGraph:
Error: Naming collision detected: /Users/supermac/Projects/snowflake/node_modules/react/node_modules/fbjs/lib/warning.js collides with /Users/supermac/Projects/snowflake/node_modules/react-native/node_modules/fbjs/lib/warning.js
at HasteMap._updateHasteMap (HasteMap.js:132:13)
at HasteMap.js:103:28
at tryCallOne (/Users/supermac/Projects/snowflake/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
at /Users/supermac/Projects/snowflake/node_modules/react-native/node_modules/promise/lib/core.js:123:15
at flush (/Users/supermac/Projects/snowflake/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
at nextTickCallbackWith0Args (node.js:433:9)
at process._tickCallback (node.js:362:13)

Android

Hi,
This looks fantastic and just what I've been looking for to jump start my react-native apps. I certainly hope I get to a place where I can contribute.

  1. I just built on a win10 using genymotion and get the following
    config.js
module.exports = {
  backend: {
    parse: false,
    hapiRemote: false,
    hapiLocal: true
  },
   HAPI: {
    local: {
      url: 'http://127.0.0.1:5000'
    }
  }
}

The screen starts to display as shown in your screen-shots but then I get the red-screen of death

Thanks,
John
rea-0008

npm i fails

I can't run npm i because of this:

apsl-react-native-button": "[email protected]:bartonhammond/react-native-button.git",

npm ERR! Command failed: git clone --template=/Users/nikos/.npm/_git-remotes/_templates --mirror ssh://[email protected]/bartonhammond/react-native-button.git

Unable to build in IOS xCode

I am unable to build snowflake. I am getting the following error.

screen shot 2015-12-29 at 1 49 03 pm

I suspect it might have something to do with my redux-redux installation, but I confirmed that it is installed in my ./node_module directory.

uncaught error Error: UnableToResolveError: Unable to resolve module react-redux/native from /Users/thachp/Code/snowflake/src/snowflake.js: Invalid directory /Users/node_modules/react-redux/native

Repro(s)
I followed the instructions in setup.md and made the suggested adjustments in xCode in one of your videos.

I loaded the snowflake project in xCode, hit build

ENV

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "clean"
npm ERR! node v4.2.1
npm ERR! npm  v2.14.7

npm start shows error

After cloning the repository and doing npm install. I did npm start which shows error like..

pranjal@pranjal-HP-ProBook-4540s:~/snowflake$ npm start

[email protected] start /home/pranjal/snowflake
react-native start

Looks like you installed react-native globally, maybe you meant react-native-cli?
To fix the issue, run:
npm uninstall -g react-native
npm install -g react-native-cli

Even after following the steps to fix the issue, I get the same error. My other projects show no such error.

some tests fail: SyntaxError: Unexpected token {

When cloning from master and running the tests, 4 test suites fail with errors similar to this one:

FAIL  src/components/__tests__/ItemCheckbox-test.js 
● Runtime Error
Error: Failed to get mock metadata: /Users/Yonah/development/react/snowflake_2/node_modules/react/lib/canDefineProperty.js
    at Loader._generateMock (/Users/Yonah/development/react/snowflake_2/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:251:15)
    at Loader.requireMock (/Users/Yonah/development/react/snowflake_2/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:677:45)
    at Loader.requireModuleOrMock (/Users/Yonah/development/react/snowflake_2/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:788:19)
    at Object.eval (/Users/Yonah/development/react/snowflake_2/node_modules/react/lib/ReactElement.js:17:25)
    at Loader._execModule (/Users/Yonah/development/react/snowflake_2/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:206:17)
    at Loader.requireModule (/Users/Yonah/development/react/snowflake_2/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:760:14)
    at Loader._generateMock (/Users/Yonah/development/react/snowflake_2/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:243:34)
    at Loader.requireMock (/Users/Yonah/development/react/snowflake_2/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:677:45)
    at Loader.requireModuleOrMock (/Users/Yonah/development/react/snowflake_2/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:788:19)
    at Object.eval (/Users/Yonah/development/react/snowflake_2/node_modules/react/lib/ReactMount.js:18:20)

is this related to #29 or #11?

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.