Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-threads
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
冷佳娟
react-native-threads
Commits
85e2bd12
Commit
85e2bd12
authored
Jun 23, 2018
by
Travis Nuttall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update simple example
parent
10491242
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
955 additions
and
834 deletions
+955
-834
examples/SimpleExample/.flowconfig
examples/SimpleExample/.flowconfig
+12
-6
examples/SimpleExample/.gitignore
examples/SimpleExample/.gitignore
+3
-0
examples/SimpleExample/App.js
examples/SimpleExample/App.js
+1
-1
examples/SimpleExample/README.md
examples/SimpleExample/README.md
+17
-0
examples/SimpleExample/__tests__/App.js
examples/SimpleExample/__tests__/App.js
+0
-12
examples/SimpleExample/android/app/build.gradle
examples/SimpleExample/android/app/build.gradle
+11
-0
examples/SimpleExample/android/app/src/main/AndroidManifest.xml
...es/SimpleExample/android/app/src/main/AndroidManifest.xml
+2
-8
examples/SimpleExample/android/app/src/main/assets/threads/worker.thread.bundle
.../android/app/src/main/assets/threads/worker.thread.bundle
+636
-0
examples/SimpleExample/android/app/src/main/assets/threads/worker.thread.bundle.meta
...oid/app/src/main/assets/threads/worker.thread.bundle.meta
+1
-0
examples/SimpleExample/config.js
examples/SimpleExample/config.js
+1
-0
examples/SimpleExample/ios/SimpleExample.xcodeproj/project.pbxproj
...SimpleExample/ios/SimpleExample.xcodeproj/project.pbxproj
+249
-141
examples/SimpleExample/ios/SimpleExample.xcodeproj/xcshareddata/xcschemes/SimpleExample.xcscheme
...e.xcodeproj/xcshareddata/xcschemes/SimpleExample.xcscheme
+0
-2
examples/SimpleExample/ios/SimpleExample/AppDelegate.h
examples/SimpleExample/ios/SimpleExample/AppDelegate.h
+2
-4
examples/SimpleExample/ios/SimpleExample/AppDelegate.m
examples/SimpleExample/ios/SimpleExample/AppDelegate.m
+2
-4
examples/SimpleExample/ios/SimpleExample/Images.xcassets/Contents.json
...leExample/ios/SimpleExample/Images.xcassets/Contents.json
+6
-0
examples/SimpleExample/ios/SimpleExample/main.m
examples/SimpleExample/ios/SimpleExample/main.m
+2
-4
examples/SimpleExample/ios/SimpleExampleTests/SimpleExampleTests.m
...SimpleExample/ios/SimpleExampleTests/SimpleExampleTests.m
+2
-4
examples/SimpleExample/ios/worker.thread.js.meta
examples/SimpleExample/ios/worker.thread.js.meta
+0
-1
examples/SimpleExample/ios/worker.thread.jsbundle
examples/SimpleExample/ios/worker.thread.jsbundle
+0
-639
examples/SimpleExample/ios/worker.thread.jsbundle.meta
examples/SimpleExample/ios/worker.thread.jsbundle.meta
+0
-1
examples/SimpleExample/package.json
examples/SimpleExample/package.json
+7
-7
examples/SimpleExample/worker.thread.js
examples/SimpleExample/worker.thread.js
+1
-0
No files found.
examples/SimpleExample/.flowconfig
View file @
85e2bd12
...
...
@@ -16,11 +16,15 @@
; Ignore polyfills
.*/Libraries/polyfills/.*
; Ignore metro
.*/node_modules/metro/.*
[include]
[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
node_modules/react-native/flow-github/
[options]
emoji=true
...
...
@@ -31,18 +35,20 @@ munge_underscores=true
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe
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\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(
<VERSION>
\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(
<VERSION>
\\)? *\\(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.
53
.0
^0.
67
.0
examples/SimpleExample/.gitignore
View file @
85e2bd12
...
...
@@ -51,3 +51,6 @@ buck-out/
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
# Bundle artifact
*.jsbundle
examples/SimpleExample/App.js
View file @
85e2bd12
...
...
@@ -7,7 +7,7 @@ import {
}
from
'
react-native
'
;
import
{
Thread
}
from
'
react-native-threads
'
;
export
default
class
App
extends
Component
<
{}
>
{
export
default
class
App
extends
Component
{
state
=
{
messages
:
[]
}
workerThread
=
null
;
...
...
examples/SimpleExample/README.md
View file @
85e2bd12
...
...
@@ -34,3 +34,20 @@ npm run build-thread-ios
npm run build-thread-android
```
For running android in release mode, you will need to generate a signing key.
Follow these instructions to generate a key: https://facebook.github.io/react-native/docs/signed-apk-android.html#generating-a-signing-key
When you edit your
`~/.gradle/gradle.properties`
to put in the name of your
release keystore file, alias, and passwords, use the following format, with the
names of your keystore, alias, and actual passwords instead:
```
SIMPLE_EXAMPLE_RELEASE_STORE_FILE=your-release-key.keystore
SIMPLE_EXAMPLE_RELEASE_KEY_ALIAS=your-key-alias
SIMPLE_EXAMPLE_RELEASE_STORE_PASSWORD=*****
SIMPLE_EXAMPLE_RELEASE_KEY_PASSWORD=*****
```
This android project will be looking for the
`SIMPLE_EXAMPLE_`
prefixed variables
specifically.
examples/SimpleExample/__tests__/App.js
deleted
100644 → 0
View file @
10491242
import
'
react-native
'
;
import
React
from
'
react
'
;
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
(
<
App
/>
);
});
examples/SimpleExample/android/app/build.gradle
View file @
85e2bd12
...
...
@@ -107,6 +107,16 @@ android {
abiFilters
"armeabi-v7a"
,
"x86"
}
}
signingConfigs
{
release
{
if
(
project
.
hasProperty
(
'SIMPLE_EXAMPLE_RELEASE_STORE_FILE'
))
{
storeFile
file
(
SIMPLE_EXAMPLE_RELEASE_STORE_FILE
)
storePassword
SIMPLE_EXAMPLE_RELEASE_STORE_PASSWORD
keyAlias
SIMPLE_EXAMPLE_RELEASE_KEY_ALIAS
keyPassword
SIMPLE_EXAMPLE_RELEASE_KEY_PASSWORD
}
}
}
splits
{
abi
{
reset
()
...
...
@@ -119,6 +129,7 @@ android {
release
{
minifyEnabled
enableProguardInReleaseBuilds
proguardFiles
getDefaultProguardFile
(
"proguard-android.txt"
),
"proguard-rules.pro"
signingConfig
signingConfigs
.
release
}
}
// applicationVariants are e.g. debug, release
...
...
examples/SimpleExample/android/app/src/main/AndroidManifest.xml
View file @
85e2bd12
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.simpleexample"
android:versionCode=
"1"
android:versionName=
"1.0"
>
package=
"com.simpleexample"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
<uses-sdk
android:minSdkVersion=
"16"
android:targetSdkVersion=
"22"
/>
<application
android:name=
".MainApplication"
android:allowBackup=
"true"
android:label=
"@string/app_name"
android:icon=
"@mipmap/ic_launcher"
android:allowBackup=
"false"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".MainActivity"
...
...
examples/SimpleExample/android/app/src/main/assets/threads/worker.thread.bundle
0 → 100644
View file @
85e2bd12
This diff is collapsed.
Click to expand it.
examples/SimpleExample/android/app/src/main/assets/threads/worker.thread.bundle.meta
0 → 100644
View file @
85e2bd12
=*xsކnI
\ No newline at end of file
examples/SimpleExample/config.js
View file @
85e2bd12
...
...
@@ -10,3 +10,4 @@ if (__DEV__) {
console
.
tron
=
Reactotron
;
}
examples/SimpleExample/ios/SimpleExample.xcodeproj/project.pbxproj
View file @
85e2bd12
This diff is collapsed.
Click to expand it.
examples/SimpleExample/ios/SimpleExample.xcodeproj/xcshareddata/xcschemes/SimpleExample.xcscheme
View file @
85e2bd12
...
...
@@ -54,7 +54,6 @@
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
shouldUseLaunchSchemeArgsEnv =
"YES"
>
<Testables>
<TestableReference
...
...
@@ -84,7 +83,6 @@
buildConfiguration =
"Debug"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
language =
""
launchStyle =
"0"
useCustomWorkingDirectory =
"NO"
ignoresPersistentStateOnLaunch =
"NO"
...
...
examples/SimpleExample/ios/SimpleExample/AppDelegate.h
View file @
85e2bd12
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
...
...
examples/SimpleExample/ios/SimpleExample/AppDelegate.m
View file @
85e2bd12
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "AppDelegate.h"
...
...
examples/SimpleExample/ios/SimpleExample/Images.xcassets/Contents.json
0 → 100644
View file @
85e2bd12
{
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
examples/SimpleExample/ios/SimpleExample/main.m
View file @
85e2bd12
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import
<UIKit
/
UIKit
.
h
>
...
...
examples/SimpleExample/ios/SimpleExampleTests/SimpleExampleTests.m
View file @
85e2bd12
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
...
...
examples/SimpleExample/ios/worker.thread.js.meta
deleted
100644 → 0
View file @
10491242
fKWwYO"+62,
\ No newline at end of file
examples/SimpleExample/ios/worker.thread.jsbundle
deleted
100644 → 0
View file @
10491242
This diff is collapsed.
Click to expand it.
examples/SimpleExample/ios/worker.thread.jsbundle.meta
deleted
100644 → 0
View file @
10491242
JpBS
\ No newline at end of file
examples/SimpleExample/package.json
View file @
85e2bd12
...
...
@@ -6,19 +6,19 @@
"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"
"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"
:
"16.
3.1
"
,
"react-native"
:
"0.
55.4
"
,
"react-native-threads"
:
"file:../../"
},
"devDependencies"
:
{
"babel-jest"
:
"2
1.2.0
"
,
"babel-jest"
:
"2
3.0.1
"
,
"babel-preset-react-native"
:
"4.0.0"
,
"jest"
:
"2
1.2.1
"
,
"react-test-renderer"
:
"16.
0.0-beta.5
"
,
"reactotron-react-native"
:
"1.1
2.3
"
"jest"
:
"2
3.1.0
"
,
"react-test-renderer"
:
"16.
3.1
"
,
"reactotron-react-native"
:
"1.1
4.0
"
},
"jest"
:
{
"preset"
:
"react-native"
...
...
examples/SimpleExample/worker.thread.js
View file @
85e2bd12
...
...
@@ -11,3 +11,4 @@ self.onmessage = message => {
self
.
postMessage
(
`Message #
${
count
}
from worker thread!`
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment