-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
11,175 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React, { Component } from 'react'; | ||
import { Platform, StyleSheet, Text, View, TouchableOpacity } from 'react-native'; | ||
|
||
const instructions = Platform.select({ | ||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu', | ||
android: | ||
'Double tap R on your keyboard to reload,\n' + | ||
'Shake or press menu button for dev menu', | ||
}); | ||
|
||
export default class App extends Component { | ||
state = { | ||
counter: 0, | ||
} | ||
|
||
render() { | ||
return ( | ||
<View style={styles.container}> | ||
<Text style={styles.welcome}>App 0</Text> | ||
<Text style={styles.instructions}>To get started, edit App.js</Text> | ||
<Text style={styles.instructions}>{instructions}</Text> | ||
<Text style={styles.instructions}>Counter: {this.state.counter}</Text> | ||
<TouchableOpacity onPress={() => { | ||
this.setState(state => ({ counter: state.counter + 1 })) | ||
}}><Text style={styles.instructions}>Increment</Text></TouchableOpacity> | ||
</View> | ||
); | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
backgroundColor: '#F5FCFF', | ||
}, | ||
welcome: { | ||
fontSize: 36, | ||
textAlign: 'center', | ||
color: '#282828', | ||
}, | ||
instructions: { | ||
textAlign: 'center', | ||
color: '#333333', | ||
marginBottom: 5, | ||
}, | ||
body: { | ||
fontSize: 24, | ||
textAlign: 'center', | ||
color: '#282828', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('../babel.config'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { withPolyfills, makeConfig } from '../../../packages/haul-preset-0.60'; | ||
import makeBaseDllConfig from 'base-dll/makeConfig'; | ||
|
||
export default makeConfig({ | ||
bundles: { | ||
base_dll: makeBaseDllConfig(), | ||
app0: { | ||
entry: './App', | ||
dependsOn: ['base_dll'], | ||
app: true, | ||
} | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "app0", | ||
"version": "0.1.0", | ||
"files": [ | ||
"dist/" | ||
], | ||
"scripts": { | ||
"haul": "node ../../../packages/haul-cli/bin/haul.js", | ||
"build:base": "yarn haul multi-bundle --skip-host-check", | ||
"build:ios:dev": "yarn build:base --platform ios --dev true --bundle-output dist/ios/dev --assets-dest dist/ios/dev", | ||
"build:ios:prod": "yarn build:base --platform ios --dev false --bundle-output dist/ios/prod --assets-dest dist/ios/prod", | ||
"build:android:dev": "yarn build:base --platform android --dev true --bundle-output dist/android/dev --assets-dest dist/android/dev", | ||
"build:android:prod": "yarn build:base --platform android --dev false --bundle-output dist/android/prod --assets-dest dist/android/prod", | ||
"build:all": "yarn build:ios:dev && yarn build:ios:prod && yarn build:android:dev && yarn build:android:prod" | ||
}, | ||
"dependencies": { | ||
"react": "^16.8.6", | ||
"react-native": "^0.60.5", | ||
"react-native-gesture-handler": "^1.3.0", | ||
"react-navigation": "^3.11.0", | ||
"base-dll": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [`module:${require.resolve('../../packages/haul-babel-preset-react-native')}`], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('../babel.config'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { withPolyfills, makeConfig } from '../../../packages/haul-preset-0.60'; | ||
import { join } from 'path'; | ||
|
||
const entry = withPolyfills([ | ||
require.resolve('react'), | ||
require.resolve('react-native'), | ||
require.resolve('react-navigation'), | ||
]); | ||
|
||
export default makeConfig({ | ||
bundles: { | ||
base_dll: ({ dev }) => ({ | ||
entry, | ||
dll: true, | ||
type: dev ? 'basic-bundle' : 'indexed-ram-bundle', | ||
}), | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { join } from 'path'; | ||
|
||
export default function makeConfig(copyBundle = false) { | ||
return ({ platform, bundleTarget, dev }) => { | ||
const basePath = join( | ||
__dirname, | ||
`./dist/${platform}/${dev || bundleTarget === 'server' ? 'dev' : 'prod'}` | ||
); | ||
const filename = `base_dll${ | ||
platform === 'ios' ? '.jsbundle' : '.android.bundle' | ||
}`; | ||
return { | ||
dll: true, | ||
copyBundle, | ||
bundlePath: join(basePath, filename), | ||
manifestPath: join(basePath, 'base_dll.manifest.json'), | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "base-dll", | ||
"version": "0.1.0", | ||
"files": [ | ||
"makeConfig.js", | ||
"dist/" | ||
], | ||
"scripts": { | ||
"haul": "node ../../../packages/haul-cli/bin/haul.js", | ||
"build:base": "yarn haul multi-bundle --skip-host-check", | ||
"build:ios:dev": "yarn build:base --platform ios --dev true --bundle-output dist/ios/dev --assets-dest dist/ios/dev", | ||
"build:ios:prod": "yarn build:base --platform ios --dev false --bundle-output dist/ios/prod --assets-dest dist/ios/prod", | ||
"build:android:dev": "yarn build:base --platform android --dev true --bundle-output dist/android/dev --assets-dest dist/android/dev", | ||
"build:android:prod": "yarn build:base --platform android --dev false --bundle-output dist/android/prod --assets-dest dist/android/prod", | ||
"build:all": "yarn build:ios:dev && yarn build:ios:prod && yarn build:android:dev && yarn build:android:prod" | ||
}, | ||
"dependencies": { | ||
"react": "^16.8.6", | ||
"react-native": "^0.60.5", | ||
"react-native-gesture-handler": "^1.3.0", | ||
"react-navigation": "^3.11.0" | ||
} | ||
} |
Oops, something went wrong.