-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #147 - Adds support for F5 bundling in Playground.
- Loading branch information
Showing
9 changed files
with
180 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,4 +73,7 @@ packages/ | |
#Other files | ||
*.DotSettings | ||
.vs/ | ||
*project.lock.json | ||
*project.lock.json | ||
|
||
#JavaScript files | ||
*.jsbundle |
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,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Target Name="DoBundle"> | ||
<Message Text="Installing react-native node module..." /> | ||
<Exec Command="npm install" /> | ||
<Message Text="Bundling the entry file..." /> | ||
<Exec Command="react-native bundle --entry-file=index.ios.js --bundle-output=main.jsbundle" /> | ||
</Target> | ||
</Project> |
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 was deleted.
Oops, something went wrong.
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,62 @@ | ||
'use strict'; | ||
|
||
const React = require('react-native'); | ||
const styles={ | ||
views:{ | ||
flexDirection: 'column' | ||
}, | ||
images: { | ||
height:200, | ||
width:250, | ||
borderWidth: 5, | ||
borderColor: '#f099f0', | ||
borderRadius: 10 | ||
}, | ||
textInput: { | ||
height: 40, | ||
borderWidth: 5, | ||
borderColor: '#015d87' | ||
}, | ||
longTextInput: { | ||
height: 80, | ||
borderWidth: 3, | ||
borderColor: '#ccc' | ||
} | ||
}; | ||
|
||
var {AppRegistry, View, Text, TextInput, Image } = React; | ||
|
||
var ReactRoot = React.createClass({ | ||
|
||
getInitialState: function(){ | ||
var text = "You can see me!"; | ||
var longText = "This is such a long text that it needs to go into a new lineThis is such a long text that it needs to go into a new lineThis is such a long text that it needs to go into a new lineThis is such a long text that it needs to go into a new lineThis is such a long text that it needs to go into a new line"; | ||
|
||
return {value: text, | ||
longText: longText}; | ||
}, | ||
|
||
render: function() { | ||
let imageURL = "http://facebook.github.io/react-native/img/opengraph.png?2"; | ||
|
||
return ( | ||
<View> | ||
<View style={styles.views}> | ||
<Text>Hello World!</Text> | ||
{(this.state && this.state.value) | ||
? <TextInput value={this.state.value} style={styles.textInput}></TextInput> | ||
: undefined} | ||
|
||
{(this.state && this.state.longText) | ||
? <TextInput value={this.state.longText} multiline={true} style={styles.longTextInput}></TextInput> | ||
: undefined} | ||
</View> | ||
<View style={styles.views}> | ||
<Image source={{uri: 'http://facebook.github.io/origami/public/images/blog-hero.jpg?r=1'}} style={styles.images}/> | ||
</View> | ||
</View> | ||
); | ||
} | ||
}); | ||
|
||
AppRegistry.registerComponent('ReactRoot', () => ReactRoot); |
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,11 @@ | ||
{ | ||
"name": "Playground", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"start": "node node_modules/react-native/local-cli/cli.js start" | ||
}, | ||
"dependencies": { | ||
"react-native": "^0.19.0" | ||
} | ||
} |
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,17 @@ | ||
## Using React-Native's CLI to package a Java Script Asset Bundle | ||
|
||
React Native is distributed as two npm packages, `react-native-cli` and `react-native`. The first one is a lightweight package that should be installed globally (`npm install -g react-native-cli`), while the second one contains the actual React Native framework code and is installed locally into your project when you run `react-native init`. | ||
|
||
`react-native init` is a CLI utility that stands up a React Native project environment for both Android and iOS. The React Native Windows team will add Visual Studio support for UWP builds. | ||
|
||
### Creating a Javascript Bundle File | ||
|
||
Run this to setup react native CLI using Git Bash. Please make sure you're running [Node v4.2.3](https://nodejs.org/en/download/). You'll also have to install Python version [2.7](https://www.python.org/downloads/release/python-2710/). Please remember to update your %PATH% envinorment variable to include the python directory. You will need to restart your computer after Python is installed. | ||
|
||
$ npm install -g react-native-cli | ||
$ cd {REACT_NATIVE_CWD}/windows-packager | ||
$ npm install | ||
|
||
Your bundles entry point file(<entry-file>) needs to be named as either index.ios.js or index.android.js. We have an open issue to enhance RN to support index.windows.js named files. | ||
|
||
$ react-native bundle --dev false --entry-file <entry-file> --bundle-output <main.jsbundle> |