This guide walks through how to set up your machine to develop a React Native app.
The tl;dr is:
- Install node.js
- Install yarn
- Install React Native Debugger
- Install the Expo mobile app on your device
// Inspired by https://stackoverflow.com/a/50523132/1171775 | |
import React, { Component } from 'react'; | |
import { | |
Animated, | |
StatusBar, | |
StyleSheet, | |
Text, | |
View, | |
} from 'react-native'; | |
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; |
#!/usr/bin/env bash | |
# Fix the third party mess. Run this after a `npm/yarn` install. | |
# This has (hopefully) been addressed by https://github.com/facebook/react-native/pull/21458, | |
# but at the time of writing (30/10/18) has not been merged into an official RN release. | |
echo "Fixing React Native third party folder..." | |
rm -rf ~/.rncache | |
WD=$(pwd) | |
cd node_modules/react-native | |
rm -fr third-party |
#!/usr/bin/env bash | |
# Fix the third party mess. Run this after a `npm/yarn` install. | |
# This has (hopefully) been addressed by https://github.com/facebook/react-native/pull/21458, | |
# but at the time of writing (17/10/18) has not been merged into an official RN release. | |
echo "Fixing React Native third party folder..." | |
rm -rf ~/.rncache | |
WD=$(pwd) | |
cd node_modules/react-native | |
rm -fr third-party |
0 info it worked if it ends with ok | |
1 verbose cli [ '/usr/local/Cellar/node/9.4.0/bin/node', | |
1 verbose cli '/usr/local/bin/npm', | |
1 verbose cli 'publish' ] | |
2 info using npm@5.6.0 | |
3 info using node@v9.4.0 | |
4 verbose npm-session 968a30f9973db62d | |
5 verbose publish [ '.' ] | |
6 info lifecycle react-native-in-app-browser@0.1.0~prepublish: react-native-in-app-browser@0.1.0 | |
7 info lifecycle react-native-in-app-browser@0.1.0~prepare: react-native-in-app-browser@0.1.0 |
This guide walks through how to set up your machine to develop a React Native app.
The tl;dr is:
As discussed on gitter, the plan is to implement the error handling as a two-stage process.
additionalCodes
property to the error
object passed in as the third argument to the api handler. This will specify the additional error responses that should be setup by API Gateway, and the associated regexes.claudia-api-errors
module, which will allow developers to throw a predefined set of Error
objects, which will correspond to response codes.Only 1. needs to be implemented to allow multiple error responses, 2. is more of a nice-to-have.
API Gateway allows you to parse the error message returned from a lambda function, and apply a response code according to a regex that you configure. Here's a good primer on how this works.
#!/bin/bash | |
if [ "$GIT_SSH_KEY" != "" ]; then | |
echo "Cleaning up SSH config" >&1 | |
echo "" >&1 | |
# Now that npm has finished running, | |
# we shouldn't need the ssh key/config anymore. | |
# Remove the files that we created. | |
rm -f ~/.ssh/config | |
rm -f ~/.ssh/deploy_key |
Date.prototype.duration = function(granularity) { | |
if(!granularity) { | |
granularity = 's'; | |
} | |
var units = [{ | |
enabled: /^[wdhms]$/.test(granularity), | |
singular: 'week', | |
plural: 'weeks', | |
inMillis: 7 * 24 * 60 * 60 * 1000 |
// Testing out some date parsing libraries. | |
'use strict'; | |
var chrono = require('chrono-node'); | |
require('datejs'); | |
require('sugar'); | |
var stringsToParse = [ | |
'today', |
var request = require('request'); | |
// The `auth` object will take precedence | |
// over the `Authorization` header | |
var options = { | |
url: 'http://requestb.in/1jt9nmk1', | |
method: 'GET', | |
headers: { | |
Authorization: 'Basic 1234' | |
}, |