Commit 49604e04 authored by Travis Nuttall's avatar Travis Nuttall

add simple example to demonstrate basic thread usage and debugging

parent d0985ced
......@@ -12,14 +12,15 @@
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js
; Ignore polyfills
.*/Libraries/polyfills/.*
[include]
[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
flow/
node_modules/react-native/flow/
[options]
emoji=true
......@@ -32,14 +33,16 @@ module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|we
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
unsafe.enable_getters_and_setters=true
[version]
^0.49.1
^0.53.0
......@@ -46,8 +46,8 @@ buck-out/
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
# https://docs.fastlane.tools/best-practices/source-control/
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
import React, { Component } from 'react';
import {
AppRegistry,
Button,
StyleSheet,
Text,
View,
TouchableOpacity,
View
} from 'react-native';
import { Thread } from 'react-native-threads';
class ThreadExample extends Component {
export default class App extends Component<{}> {
state = { messages: [] }
workerThread = null;
componentDidMount() {
this.worker= new Thread('worker.js');
this.workerThread = new Thread('./worker.thread.js');
this.workerThread.onmessage = this.handleMessage;
}
this.worker.onmessage = (message) => {
console.log("Got message from worker", message);
componentWillUnmount() {
this.workerThread.terminate();
this.workerThread = null;
}
handleMessage = message => {
console.tron.log(`APP: got message ${message}`);
this.setState(state => {
return { messages: [...state.messages, message] };
});
}
render() {
return (
<View style={styles.container}>
<TouchableOpacity onPress={() => {
console.log('SENDING MESSAGE TO WORKER');
this.worker.postMessage("Hello from main thread");
}}>
<Text style={styles.welcome}>
Send message
Welcome to React Native Threads!
</Text>
</TouchableOpacity>
<Button title="Send Message To Worker Thread" onPress={() => {
this.workerThread.postMessage('Hello')
}} />
<View>
<Text>Messages:</Text>
{this.state.messages.map((message, i) => <Text key={i}>{message}</Text>)}
</View>
</View>
);
}
......@@ -46,13 +61,5 @@ const styles = StyleSheet.create({
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
}
});
AppRegistry.registerComponent('ThreadExample', () => ThreadExample);
# React Native Threads Simple Example
A simple example of using react-native-threads.
A single button sends a message to the worker thread, and the thread responds
with a message count that is displayed in the UI.
This example also shows how to use Reactotron for debugging.
## Running the example
I assume that you have Node.js, react-native-cli, and the necessary iOS/Android
dependencies installed.
To see debugging messages, [install Reactotron](https://github.com/infinitered/reactotron/blob/master/docs/installing.md)
and open it before running the app.
```shell
git clone https://github.com/Traviskn/react-native-threads.git
cd react-native-threads/examples/SimpleExample
npm install
react-native run-ios
# or
react-native run-android
```
To run in release mode first build the release thread bundles with the example's
npm scripts:
```shell
npm run build-thread-ios
npm run build-thread-android
```
import 'react-native';
import React from 'react';
import Index from '../index.ios.js';
import App from '../App';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
it('renders correctly', () => {
const tree = renderer.create(
<Index />
<App />
);
});
......@@ -45,12 +45,12 @@ android_library(
android_build_config(
name = "build_config",
package = "com.threadexample",
package = "com.simpleexample",
)
android_resource(
name = "res",
package = "com.threadexample",
package = "com.simpleexample",
res = "src/main/res",
)
......
......@@ -72,6 +72,10 @@ import com.android.build.OutputFile
* ]
*/
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
/**
......@@ -94,7 +98,7 @@ android {
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.threadexample"
applicationId "com.simpleexample"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
......@@ -133,7 +137,7 @@ android {
}
dependencies {
compile project(':react-native-thread')
compile project(':react-native-threads')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.threadexample"
package="com.simpleexample"
android:versionCode="1"
android:versionName="1.0">
......
package com.threadexample;
package com.simpleexample;
import com.facebook.react.ReactActivity;
......@@ -10,6 +10,6 @@ public class MainActivity extends ReactActivity {
*/
@Override
protected String getMainComponentName() {
return "ThreadExample";
return "SimpleExample";
}
}
package com.threadexample;
package com.simpleexample;
import android.app.Application;
......@@ -24,9 +24,14 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNThreadPackage(mReactNativeHost)
new RNThreadPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
......
<resources>
<string name="app_name">ThreadExample</string>
<string name="app_name">SimpleExample</string>
</resources>
rootProject.name = 'SimpleExample'
include ':react-native-threads'
project(':react-native-threads').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-threads/android')
include ':app'
{
"name": "SimpleExample",
"displayName": "SimpleExample"
}
\ No newline at end of file
import Reactotron from 'reactotron-react-native'
console.tron = { log: Function.prototype };
if (__DEV__) {
Reactotron
.configure()
.useReactNative()
.connect();
console.tron = Reactotron;
}
import { AppRegistry } from 'react-native';
import App from './App';
import './config';
AppRegistry.registerComponent('SimpleExample', () => App);
......@@ -12,7 +12,8 @@
00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
00E356F31AD99517003FC87E /* ThreadExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ThreadExampleTests.m */; };
00E356F31AD99517003FC87E /* SimpleExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SimpleExampleTests.m */; };
11858900EBC34367AB271EAE /* libRNThread.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B75FC9FDF4C40A58AD26517 /* libRNThread.a */; };
133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };
......@@ -33,11 +34,11 @@
2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */; };
2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; };
2D02E4C91E0B4AEC006451C7 /* libReact-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */; };
2DCD954D1E0B4F2C00145EB5 /* ThreadExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ThreadExampleTests.m */; };
2DCD954D1E0B4F2C00145EB5 /* SimpleExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* SimpleExampleTests.m */; };
5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
F5C36ACF8B624BC7951A03AB /* libRNThread.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9720994578224250810A5EED /* libRNThread.a */; };
C0B25F4C1FA5236E00BD9CA3 /* worker.thread.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = C0B25F4B1FA5236E00BD9CA3 /* worker.thread.jsbundle */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -81,7 +82,7 @@
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
remoteInfo = ThreadExample;
remoteInfo = SimpleExample;
};
139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
......@@ -109,7 +110,7 @@
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7;
remoteInfo = "ThreadExample-tvOS";
remoteInfo = "SimpleExample-tvOS";
};
3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
......@@ -237,16 +238,30 @@
remoteGlobalIDString = 358F4ED71D1E81A9004DF814;
remoteInfo = RCTBlob;
};
C0B418EB1F6CFA3A00B9D224 /* PBXContainerItemProxy */ = {
C0B25F2E1FA51B4200BD9CA3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = ADD01A681E09402E00F6D226;
remoteInfo = "RCTBlob-tvOS";
};
C0B418FC1F6CFA3A00B9D224 /* PBXContainerItemProxy */ = {
C0B25F401FA51B4200BD9CA3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 76FA3779275F4C89AFE79AC6 /* RNThread.xcodeproj */;
containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3DBE0D001F3B181A0099AA32;
remoteInfo = fishhook;
};
C0B25F421FA51B4200BD9CA3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;
remoteInfo = "fishhook-tvOS";
};
C0B25F471FA51B4300BD9CA3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0BF39157221E4019BD05A50A /* RNThread.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 134814201AA4EA6300B7C361;
remoteInfo = RNThread;
......@@ -260,27 +275,28 @@
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = "<group>"; };
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = "<group>"; };
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = "<group>"; };
00E356EE1AD99517003FC87E /* ThreadExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ThreadExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356EE1AD99517003FC87E /* SimpleExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SimpleExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* ThreadExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ThreadExampleTests.m; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* SimpleExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SimpleExampleTests.m; sourceTree = "<group>"; };
0BF39157221E4019BD05A50A /* RNThread.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNThread.xcodeproj; path = "../node_modules/react-native-threads/ios/RNThread.xcodeproj"; sourceTree = "<group>"; };
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = "<group>"; };
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* ThreadExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ThreadExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ThreadExample/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = ThreadExample/AppDelegate.m; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* SimpleExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = SimpleExample/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = SimpleExample/AppDelegate.m; sourceTree = "<group>"; };
13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ThreadExample/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ThreadExample/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ThreadExample/main.m; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SimpleExample/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SimpleExample/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = SimpleExample/main.m; sourceTree = "<group>"; };
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
2D02E47B1E0B4A5D006451C7 /* ThreadExample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ThreadExample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E4901E0B4A5D006451C7 /* ThreadExample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ThreadExample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E47B1E0B4A5D006451C7 /* SimpleExample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SimpleExample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
2D02E4901E0B4A5D006451C7 /* SimpleExample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SimpleExample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
76FA3779275F4C89AFE79AC6 /* RNThread.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNThread.xcodeproj; path = "../node_modules/react-native-thread/ios/RNThread.xcodeproj"; sourceTree = "<group>"; };
6B75FC9FDF4C40A58AD26517 /* libRNThread.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNThread.a; sourceTree = "<group>"; };
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
9720994578224250810A5EED /* libRNThread.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNThread.a; sourceTree = "<group>"; };
ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
C0B25F4B1FA5236E00BD9CA3 /* worker.thread.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = worker.thread.jsbundle; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -309,7 +325,7 @@
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
F5C36ACF8B624BC7951A03AB /* libRNThread.a in Frameworks */,
11858900EBC34367AB271EAE /* libRNThread.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -380,13 +396,13 @@
name = Products;
sourceTree = "<group>";
};
00E356EF1AD99517003FC87E /* ThreadExampleTests */ = {
00E356EF1AD99517003FC87E /* SimpleExampleTests */ = {
isa = PBXGroup;
children = (
00E356F21AD99517003FC87E /* ThreadExampleTests.m */,
00E356F21AD99517003FC87E /* SimpleExampleTests.m */,
00E356F01AD99517003FC87E /* Supporting Files */,
);
path = ThreadExampleTests;
path = SimpleExampleTests;
sourceTree = "<group>";
};
00E356F01AD99517003FC87E /* Supporting Files */ = {
......@@ -411,13 +427,16 @@
children = (
139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */,
C0B25F411FA51B4200BD9CA3 /* libfishhook.a */,
C0B25F431FA51B4200BD9CA3 /* libfishhook-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
};
13B07FAE1A68108700A75B9A /* ThreadExample */ = {
13B07FAE1A68108700A75B9A /* SimpleExample */ = {
isa = PBXGroup;
children = (
C0B25F4B1FA5236E00BD9CA3 /* worker.thread.jsbundle */,
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.m */,
......@@ -426,7 +445,7 @@
13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
13B07FB71A68108700A75B9A /* main.m */,
);
name = ThreadExample;
name = SimpleExample;
sourceTree = "<group>";
};
146834001AC3E56700842450 /* Products */ = {
......@@ -477,7 +496,7 @@
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
76FA3779275F4C89AFE79AC6 /* RNThread.xcodeproj */,
0BF39157221E4019BD05A50A /* RNThread.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
......@@ -494,10 +513,11 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
13B07FAE1A68108700A75B9A /* ThreadExample */,
13B07FAE1A68108700A75B9A /* SimpleExample */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* ThreadExampleTests */,
00E356EF1AD99517003FC87E /* SimpleExampleTests */,
83CBBA001A601CBA00E9B192 /* Products */,
C0B25F281FA51B4100BD9CA3 /* Recovered References */,
);
indentWidth = 2;
sourceTree = "<group>";
......@@ -507,10 +527,10 @@
83CBBA001A601CBA00E9B192 /* Products */ = {
isa = PBXGroup;
children = (
13B07F961A680F5B00A75B9A /* ThreadExample.app */,
00E356EE1AD99517003FC87E /* ThreadExampleTests.xctest */,
2D02E47B1E0B4A5D006451C7 /* ThreadExample-tvOS.app */,
2D02E4901E0B4A5D006451C7 /* ThreadExample-tvOSTests.xctest */,
13B07F961A680F5B00A75B9A /* SimpleExample.app */,
00E356EE1AD99517003FC87E /* SimpleExampleTests.xctest */,
2D02E47B1E0B4A5D006451C7 /* SimpleExample-tvOS.app */,
2D02E4901E0B4A5D006451C7 /* SimpleExample-tvOSTests.xctest */,
);
name = Products;
sourceTree = "<group>";
......@@ -519,15 +539,23 @@
isa = PBXGroup;
children = (
ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */,
C0B418EC1F6CFA3A00B9D224 /* libRCTBlob-tvOS.a */,
C0B25F2F1FA51B4200BD9CA3 /* libRCTBlob-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
};
C0B418E41F6CFA3A00B9D224 /* Products */ = {
C0B25F281FA51B4100BD9CA3 /* Recovered References */ = {
isa = PBXGroup;
children = (
C0B418FD1F6CFA3A00B9D224 /* libRNThread.a */,
6B75FC9FDF4C40A58AD26517 /* libRNThread.a */,
);
name = "Recovered References";
sourceTree = "<group>";
};
C0B25F441FA51B4300BD9CA3 /* Products */ = {
isa = PBXGroup;
children = (
C0B25F481FA51B4300BD9CA3 /* libRNThread.a */,
);
name = Products;
sourceTree = "<group>";
......@@ -535,9 +563,9 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
00E356ED1AD99517003FC87E /* ThreadExampleTests */ = {
00E356ED1AD99517003FC87E /* SimpleExampleTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ThreadExampleTests" */;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "SimpleExampleTests" */;
buildPhases = (
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
......@@ -548,14 +576,14 @@
dependencies = (
00E356F51AD99517003FC87E /* PBXTargetDependency */,
);
name = ThreadExampleTests;
productName = ThreadExampleTests;
productReference = 00E356EE1AD99517003FC87E /* ThreadExampleTests.xctest */;
name = SimpleExampleTests;
productName = SimpleExampleTests;
productReference = 00E356EE1AD99517003FC87E /* SimpleExampleTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
13B07F861A680F5B00A75B9A /* ThreadExample */ = {
13B07F861A680F5B00A75B9A /* SimpleExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ThreadExample" */;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "SimpleExample" */;
buildPhases = (
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
......@@ -566,14 +594,14 @@
);
dependencies = (
);
name = ThreadExample;
name = SimpleExample;
productName = "Hello World";
productReference = 13B07F961A680F5B00A75B9A /* ThreadExample.app */;
productReference = 13B07F961A680F5B00A75B9A /* SimpleExample.app */;
productType = "com.apple.product-type.application";
};
2D02E47A1E0B4A5D006451C7 /* ThreadExample-tvOS */ = {
2D02E47A1E0B4A5D006451C7 /* SimpleExample-tvOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ThreadExample-tvOS" */;
buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "SimpleExample-tvOS" */;
buildPhases = (
2D02E4771E0B4A5D006451C7 /* Sources */,
2D02E4781E0B4A5D006451C7 /* Frameworks */,
......@@ -584,14 +612,14 @@
);
dependencies = (
);
name = "ThreadExample-tvOS";
productName = "ThreadExample-tvOS";
productReference = 2D02E47B1E0B4A5D006451C7 /* ThreadExample-tvOS.app */;
name = "SimpleExample-tvOS";
productName = "SimpleExample-tvOS";
productReference = 2D02E47B1E0B4A5D006451C7 /* SimpleExample-tvOS.app */;
productType = "com.apple.product-type.application";
};
2D02E48F1E0B4A5D006451C7 /* ThreadExample-tvOSTests */ = {
2D02E48F1E0B4A5D006451C7 /* SimpleExample-tvOSTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ThreadExample-tvOSTests" */;
buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "SimpleExample-tvOSTests" */;
buildPhases = (
2D02E48C1E0B4A5D006451C7 /* Sources */,
2D02E48D1E0B4A5D006451C7 /* Frameworks */,
......@@ -602,9 +630,9 @@
dependencies = (
2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */,
);
name = "ThreadExample-tvOSTests";
productName = "ThreadExample-tvOSTests";
productReference = 2D02E4901E0B4A5D006451C7 /* ThreadExample-tvOSTests.xctest */;
name = "SimpleExample-tvOSTests";
productName = "SimpleExample-tvOSTests";
productReference = 2D02E4901E0B4A5D006451C7 /* SimpleExample-tvOSTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
......@@ -631,7 +659,7 @@
};
};
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ThreadExample" */;
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "SimpleExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
......@@ -692,16 +720,16 @@
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
},
{
ProductGroup = C0B418E41F6CFA3A00B9D224 /* Products */;
ProjectRef = 76FA3779275F4C89AFE79AC6 /* RNThread.xcodeproj */;
ProductGroup = C0B25F441FA51B4300BD9CA3 /* Products */;
ProjectRef = 0BF39157221E4019BD05A50A /* RNThread.xcodeproj */;
},
);
projectRoot = "";
targets = (
13B07F861A680F5B00A75B9A /* ThreadExample */,
00E356ED1AD99517003FC87E /* ThreadExampleTests */,
2D02E47A1E0B4A5D006451C7 /* ThreadExample-tvOS */,
2D02E48F1E0B4A5D006451C7 /* ThreadExample-tvOSTests */,
13B07F861A680F5B00A75B9A /* SimpleExample */,
00E356ED1AD99517003FC87E /* SimpleExampleTests */,
2D02E47A1E0B4A5D006451C7 /* SimpleExample-tvOS */,
2D02E48F1E0B4A5D006451C7 /* SimpleExample-tvOSTests */,
);
};
/* End PBXProject section */
......@@ -889,18 +917,32 @@
remoteRef = ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
C0B418EC1F6CFA3A00B9D224 /* libRCTBlob-tvOS.a */ = {
C0B25F2F1FA51B4200BD9CA3 /* libRCTBlob-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libRCTBlob-tvOS.a";
remoteRef = C0B418EB1F6CFA3A00B9D224 /* PBXContainerItemProxy */;
remoteRef = C0B25F2E1FA51B4200BD9CA3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
C0B25F411FA51B4200BD9CA3 /* libfishhook.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libfishhook.a;
remoteRef = C0B25F401FA51B4200BD9CA3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
C0B25F431FA51B4200BD9CA3 /* libfishhook-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libfishhook-tvOS.a";
remoteRef = C0B25F421FA51B4200BD9CA3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
C0B418FD1F6CFA3A00B9D224 /* libRNThread.a */ = {
C0B25F481FA51B4300BD9CA3 /* libRNThread.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRNThread.a;
remoteRef = C0B418FC1F6CFA3A00B9D224 /* PBXContainerItemProxy */;
remoteRef = C0B25F471FA51B4300BD9CA3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
......@@ -917,6 +959,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C0B25F4C1FA5236E00BD9CA3 /* worker.thread.jsbundle in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
);
......@@ -975,7 +1018,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
00E356F31AD99517003FC87E /* ThreadExampleTests.m in Sources */,
00E356F31AD99517003FC87E /* SimpleExampleTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -1001,7 +1044,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2DCD954D1E0B4F2C00145EB5 /* ThreadExampleTests.m in Sources */,
2DCD954D1E0B4F2C00145EB5 /* SimpleExampleTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -1010,12 +1053,12 @@
/* Begin PBXTargetDependency section */
00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 13B07F861A680F5B00A75B9A /* ThreadExample */;
target = 13B07F861A680F5B00A75B9A /* SimpleExample */;
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
};
2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 2D02E47A1E0B4A5D006451C7 /* ThreadExample-tvOS */;
target = 2D02E47A1E0B4A5D006451C7 /* SimpleExample-tvOS */;
targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
......@@ -1027,7 +1070,7 @@
13B07FB21A68108700A75B9A /* Base */,
);
name = LaunchScreen.xib;
path = ThreadExample;
path = SimpleExample;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
......@@ -1043,9 +1086,9 @@
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-thread/ios",
"$(SRCROOT)/../node_modules/react-native-threads/ios",
);
INFOPLIST_FILE = ThreadExampleTests/Info.plist;
INFOPLIST_FILE = SimpleExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
......@@ -1057,7 +1100,7 @@
"-lc++",
);
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ThreadExample.app/ThreadExample";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleExample.app/SimpleExample";
};
name = Debug;
};
......@@ -1068,9 +1111,9 @@
COPY_PHASE_STRIP = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-thread/ios",
"$(SRCROOT)/../node_modules/react-native-threads/ios",
);
INFOPLIST_FILE = ThreadExampleTests/Info.plist;
INFOPLIST_FILE = SimpleExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
......@@ -1082,7 +1125,7 @@
"-lc++",
);
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ThreadExample.app/ThreadExample";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleExample.app/SimpleExample";
};
name = Release;
};
......@@ -1094,16 +1137,16 @@
DEAD_CODE_STRIPPING = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-thread/ios",
"$(SRCROOT)/../node_modules/react-native-threads/ios",
);
INFOPLIST_FILE = ThreadExample/Info.plist;
INFOPLIST_FILE = SimpleExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_NAME = ThreadExample;
PRODUCT_NAME = SimpleExample;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
......@@ -1115,16 +1158,16 @@
CURRENT_PROJECT_VERSION = 1;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-thread/ios",
"$(SRCROOT)/../node_modules/react-native-threads/ios",
);
INFOPLIST_FILE = ThreadExample/Info.plist;
INFOPLIST_FILE = SimpleExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_NAME = ThreadExample;
PRODUCT_NAME = SimpleExample;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
......@@ -1143,9 +1186,9 @@
GCC_NO_COMMON_BLOCKS = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-thread/ios",
"$(SRCROOT)/../node_modules/react-native-threads/ios",
);
INFOPLIST_FILE = "ThreadExample-tvOS/Info.plist";
INFOPLIST_FILE = "SimpleExample-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
......@@ -1155,7 +1198,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.ThreadExample-tvOS";
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.SimpleExample-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
......@@ -1177,9 +1220,9 @@
GCC_NO_COMMON_BLOCKS = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-thread/ios",
"$(SRCROOT)/../node_modules/react-native-threads/ios",
);
INFOPLIST_FILE = "ThreadExample-tvOS/Info.plist";
INFOPLIST_FILE = "SimpleExample-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
......@@ -1189,7 +1232,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.ThreadExample-tvOS";
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.SimpleExample-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
......@@ -1208,16 +1251,16 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "ThreadExample-tvOSTests/Info.plist";
INFOPLIST_FILE = "SimpleExample-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.ThreadExample-tvOSTests";
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.SimpleExample-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ThreadExample-tvOS.app/ThreadExample-tvOS";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleExample-tvOS.app/SimpleExample-tvOS";
TVOS_DEPLOYMENT_TARGET = 10.1;
};
name = Debug;
......@@ -1233,16 +1276,16 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "ThreadExample-tvOSTests/Info.plist";
INFOPLIST_FILE = "SimpleExample-tvOSTests/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.ThreadExample-tvOSTests";
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.SimpleExample-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ThreadExample-tvOS.app/ThreadExample-tvOS";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SimpleExample-tvOS.app/SimpleExample-tvOS";
TVOS_DEPLOYMENT_TARGET = 10.1;
};
name = Release;
......@@ -1326,7 +1369,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ThreadExampleTests" */ = {
00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "SimpleExampleTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
00E356F61AD99517003FC87E /* Debug */,
......@@ -1335,7 +1378,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ThreadExample" */ = {
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "SimpleExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
13B07F941A680F5B00A75B9A /* Debug */,
......@@ -1344,7 +1387,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ThreadExample-tvOS" */ = {
2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "SimpleExample-tvOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2D02E4971E0B4A5E006451C7 /* Debug */,
......@@ -1353,7 +1396,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "ThreadExample-tvOSTests" */ = {
2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "SimpleExample-tvOSTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2D02E4991E0B4A5E006451C7 /* Debug */,
......@@ -1362,7 +1405,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ThreadExample" */ = {
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "SimpleExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83CBBA201A601CBA00E9B192 /* Debug */,
......
......@@ -29,9 +29,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "ThreadExample-tvOS.app"
BlueprintName = "ThreadExample-tvOS"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExample-tvOS.app"
BlueprintName = "SimpleExample-tvOS"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
......@@ -43,9 +43,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
BuildableName = "ThreadExample-tvOSTests.xctest"
BlueprintName = "ThreadExample-tvOSTests"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExample-tvOSTests.xctest"
BlueprintName = "SimpleExample-tvOSTests"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
......@@ -61,9 +61,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
BuildableName = "ThreadExample-tvOSTests.xctest"
BlueprintName = "ThreadExample-tvOSTests"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExample-tvOSTests.xctest"
BlueprintName = "SimpleExample-tvOSTests"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
......@@ -71,9 +71,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "ThreadExample-tvOS.app"
BlueprintName = "ThreadExample-tvOS"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExample-tvOS.app"
BlueprintName = "SimpleExample-tvOS"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
......@@ -94,9 +94,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "ThreadExample-tvOS.app"
BlueprintName = "ThreadExample-tvOS"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExample-tvOS.app"
BlueprintName = "SimpleExample-tvOS"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
......@@ -113,9 +113,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "ThreadExample-tvOS.app"
BlueprintName = "ThreadExample-tvOS"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExample-tvOS.app"
BlueprintName = "SimpleExample-tvOS"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
......
......@@ -29,9 +29,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "ThreadExample.app"
BlueprintName = "ThreadExample"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExample.app"
BlueprintName = "SimpleExample"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
......@@ -43,9 +43,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "ThreadExampleTests.xctest"
BlueprintName = "ThreadExampleTests"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExampleTests.xctest"
BlueprintName = "SimpleExampleTests"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
......@@ -54,6 +54,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
......@@ -61,9 +62,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "ThreadExampleTests.xctest"
BlueprintName = "ThreadExampleTests"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExampleTests.xctest"
BlueprintName = "SimpleExampleTests"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
......@@ -71,18 +72,19 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "ThreadExample.app"
BlueprintName = "ThreadExample"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExample.app"
BlueprintName = "SimpleExample"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
......@@ -94,9 +96,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "ThreadExample.app"
BlueprintName = "ThreadExample"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExample.app"
BlueprintName = "SimpleExample"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
......@@ -113,9 +115,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "ThreadExample.app"
BlueprintName = "ThreadExample"
ReferencedContainer = "container:ThreadExample.xcodeproj">
BuildableName = "SimpleExample.app"
BlueprintName = "SimpleExample"
ReferencedContainer = "container:SimpleExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
......
......@@ -18,10 +18,10 @@
{
NSURL *jsCodeLocation;
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"ThreadExample"
moduleName:@"SimpleExample"
initialProperties:nil
launchOptions:launchOptions];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
......
......@@ -18,7 +18,7 @@
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ThreadExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SimpleExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
......
......@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>ThreadExample</string>
<string>SimpleExample</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
......
......@@ -16,11 +16,11 @@
#define TIMEOUT_SECONDS 600
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
@interface ThreadExampleTests : XCTestCase
@interface SimpleExampleTests : XCTestCase
@end
@implementation ThreadExampleTests
@implementation SimpleExampleTests
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
{
......
fKWwYO"+62,
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
JpBŒS
\ No newline at end of file
{
"name": "SimpleExample",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"build-thread-ios": "node node_modules/react-native/local-cli/cli.js bundle --dev false --assets-dest ./ios --entry-file worker.thread.js --platform ios --bundle-output ./ios/worker.thread.jsbundle",
"build-thread-android": "node node_modules/react-native/local-cli/cli.js bundle --dev false --assets-dest ./android/app/src/main/res/ --entry-file worker.thread.js --platform android --bundle-output ./android/app/src/main/ assets/threads/worker.thread.bundle"
},
"dependencies": {
"react": "16.0.0-beta.5",
"react-native": "0.49.5",
"react-native-threads": "file:../../"
},
"devDependencies": {
"babel-jest": "21.2.0",
"babel-preset-react-native": "4.0.0",
"jest": "21.2.1",
"react-test-renderer": "16.0.0-beta.5",
"reactotron-react-native": "1.12.3"
},
"jest": {
"preset": "react-native"
}
}
import { self } from 'react-native-threads';
import './config';
let count = 0;
self.onmessage = message => {
console.tron.log(`THREAD: got message ${message}`);
count++;
self.postMessage(`Message #${count} from worker thread!`);
}
import 'react-native';
import React from 'react';
import Index from '../index.android.js';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
it('renders correctly', () => {
const tree = renderer.create(
<Index />
);
});
rootProject.name = 'ThreadExample'
include ':react-native-thread'
project(':react-native-thread').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-thread/android')
include ':app'
{
"name": "ThreadExample",
"displayName": "ThreadExample"
}
\ No newline at end of file
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TouchableOpacity,
} from 'react-native';
import { Thread } from 'react-native-threads';
class ThreadExample extends Component {
componentDidMount() {
this.worker= new Thread('worker.js');
this.worker.onmessage = (message) => {
console.log("Got message from worker", message);
}
}
render() {
return (
<View style={styles.container}>
<TouchableOpacity onPress={() => {
console.log('SENDING MESSAGE TO WORKER');
this.worker.postMessage("Hello from main thread");
}}>
<Text style={styles.welcome}>
Send message
</Text>
</TouchableOpacity>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('ThreadExample', () => ThreadExample);
{
"name": "ThreadExample",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.48.3",
"react-native-threads": "file:../../"
},
"devDependencies": {
"babel-jest": "21.0.2",
"babel-preset-react-native": "4.0.0",
"jest": "21.1.0",
"react-test-renderer": "16.0.0-alpha.12"
},
"jest": {
"preset": "react-native"
}
}
import { self } from 'react-native-threads';
/*
* Web Worker
* you have access to all RN native modules (timeout, fetch, AsyncStorage, Vibration ...)
*/
// receive messages from main thread
self.onmessage = (message) => {
console.log('worker received message', message);
}
function ping() {
// send messages to main thread
console.log('SENDING PING FROM WORKER TO MAIN');
self.postMessage("Ping");
setTimeout(ping, 5000);
}
setTimeout(ping, 5000);
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment