mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
49
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
074845106d | ||
|
|
4152e70b47 | ||
|
|
c66315e367 | ||
|
|
49150aa3d0 | ||
|
|
7b0774811e | ||
|
|
555c6c68f8 | ||
|
|
e05ceb824c | ||
|
|
9b18b5b1cf | ||
|
|
75505993f0 | ||
|
|
692493bff8 | ||
|
|
03e4af6dc1 | ||
|
|
39fc0864d9 | ||
|
|
1be38926c0 | ||
|
|
f885710aa6 | ||
|
|
8caaf5fab9 | ||
|
|
8017386169 | ||
|
|
e88c7a91b2 | ||
|
|
245a84c141 | ||
|
|
d99bb768fd | ||
|
|
f5b126f1c9 | ||
|
|
e4f66944a7 | ||
|
|
bcae5b7d8f | ||
|
|
43ded753b1 | ||
|
|
cc6978f396 | ||
|
|
a535cc9c06 | ||
|
|
7334025627 | ||
|
|
7ad4d23409 | ||
|
|
36440ff4b5 | ||
|
|
657b1d2a7a | ||
|
|
e405249ee3 | ||
|
|
e2ab0b762d | ||
|
|
9db3c51d11 | ||
|
|
095b8f054a | ||
|
|
7fbfaa6f1f | ||
|
|
2c0d7b461e | ||
|
|
2ecb2edcef | ||
|
|
860d2d2012 | ||
|
|
39644d0abb | ||
|
|
86e6a048ef | ||
|
|
9b7d6d6b87 | ||
|
|
cb02754ba9 | ||
|
|
c7d17766b4 | ||
|
|
770d08b989 | ||
|
|
8965e0ca18 | ||
|
|
8954897948 | ||
|
|
e9b5753eb4 | ||
|
|
e5ec57d807 | ||
|
|
be136a000f | ||
|
|
7e61f433ef |
+77
-64
@@ -128,10 +128,6 @@ aliases:
|
||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||
sudo apt-get update && sudo apt-get install yarn
|
||||
|
||||
- &install-node-dependencies
|
||||
|
|
||||
npm install --no-package-lock --no-spin --no-progress
|
||||
|
||||
- &install-buck
|
||||
name: Install BUCK
|
||||
command: |
|
||||
@@ -147,13 +143,6 @@ aliases:
|
||||
mkdir -p ~/react-native/tooling/junit
|
||||
cp -R ~/okbuck/tooling/junit/* ~/react-native/tooling/junit/.
|
||||
|
||||
|
||||
- &install-node
|
||||
name: Install Node
|
||||
command: |
|
||||
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
|
||||
- &create-ndk-directory
|
||||
name: Create Android NDK Directory
|
||||
command: |
|
||||
@@ -194,17 +183,11 @@ aliases:
|
||||
# eslint sometimes runs into trouble generating the reports
|
||||
- &run-lint-checks
|
||||
name: Lint code
|
||||
command: |
|
||||
if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
|
||||
scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ~/react-native/reports/junit/eslint/results.xml
|
||||
fi
|
||||
command: scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ~/react-native/reports/junit/eslint/results.xml
|
||||
|
||||
- &run-flow-checks
|
||||
name: Check for errors in code using Flow
|
||||
command: |
|
||||
if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
|
||||
yarn flow check
|
||||
fi
|
||||
command: yarn flow check
|
||||
|
||||
- &run-sanity-checks
|
||||
name: Sanity checks
|
||||
@@ -282,35 +265,45 @@ aliases:
|
||||
mkdir -p ~/react-native/reports/junit/
|
||||
mkdir -p ~/react-native/reports/outputs/
|
||||
|
||||
- &brew-install-watchman
|
||||
name: Install Watchman
|
||||
command: |
|
||||
brew install watchman
|
||||
touch .watchmanconfig
|
||||
|
||||
- &boot-simulator-iphone
|
||||
name: Boot iPhone Simulator
|
||||
command: xcrun simctl boot "iPhone 5s" || true
|
||||
|
||||
- &boot-simulator-iphone-with-parallelism
|
||||
name: Boot iPhone Simulator
|
||||
command: |
|
||||
if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
|
||||
xcrun simctl boot "iPhone 5s" || true
|
||||
fi
|
||||
|
||||
- &boot-simulator-appletv
|
||||
- &boot-simulator-appletv-with-parallelism
|
||||
name: Boot Apple TV Simulator
|
||||
command: |
|
||||
if [ $((1 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
|
||||
xcrun simctl boot "Apple TV" || true
|
||||
fi
|
||||
|
||||
- &run-objc-ios-tests
|
||||
- &run-objc-ios-tests-with-parallelism
|
||||
name: iOS Test Suite
|
||||
command: |
|
||||
if [ $((0 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
|
||||
./scripts/objc-test-ios.sh test
|
||||
fi
|
||||
|
||||
- &run-objc-tvos-tests
|
||||
- &run-objc-tvos-tests-with-parallelism
|
||||
name: tvOS Test Suite
|
||||
command: |
|
||||
if [ $((1 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
|
||||
./scripts/objc-test-tvos.sh test
|
||||
fi
|
||||
|
||||
- &run-podspec-tests
|
||||
- &run-podspec-tests-with-parallelism
|
||||
name: Test CocoaPods
|
||||
command: |
|
||||
if [ $((2 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
|
||||
@@ -321,6 +314,29 @@ aliases:
|
||||
name: End-to-End Test Suite
|
||||
command: node ./scripts/run-ci-e2e-tests.js --android --ios --tvos --js --retries 3;
|
||||
|
||||
- &install-node-8
|
||||
name: Install Node 8
|
||||
command: |
|
||||
echo 'export PATH=/usr/local/opt/node@8/bin:$PATH' >> $BASH_ENV
|
||||
source $BASH_ENV
|
||||
brew install node@8
|
||||
brew link node@8
|
||||
node -v
|
||||
|
||||
- &install-apple-simulator-utils
|
||||
name: Install Apple Simulator Utilities
|
||||
command: |
|
||||
brew tap wix/brew
|
||||
brew install applesimutils
|
||||
|
||||
- &build-ios-app-e2e
|
||||
name: Build iOS App for Simulator
|
||||
command: yarn run build-ios-e2e
|
||||
|
||||
- &run-ios-detox-tests
|
||||
name: Run Detox Tests
|
||||
command: yarn run test-ios-e2e
|
||||
|
||||
- &run-objc-ios-e2e-tests
|
||||
name: iOS End-to-End Test Suite
|
||||
command: |
|
||||
@@ -425,56 +441,46 @@ jobs:
|
||||
- attach_workspace:
|
||||
at: ~/react-native
|
||||
|
||||
- run: *boot-simulator-iphone
|
||||
- run: *boot-simulator-appletv
|
||||
- run: brew install watchman
|
||||
- run: *boot-simulator-iphone-with-parallelism
|
||||
- run: *boot-simulator-appletv-with-parallelism
|
||||
- run: *brew-install-watchman
|
||||
|
||||
- run: *run-objc-ios-tests
|
||||
- run: *run-objc-tvos-tests
|
||||
- run: *run-podspec-tests
|
||||
- run: *run-objc-ios-tests-with-parallelism
|
||||
- run: *run-objc-tvos-tests-with-parallelism
|
||||
- run: *run-podspec-tests-with-parallelism
|
||||
|
||||
- store_test_results:
|
||||
path: ~/react-native/reports/junit
|
||||
|
||||
# Runs end to end tests
|
||||
test_end_to_end:
|
||||
# Runs end to end tests (Objective-C)
|
||||
test_objc_end_to_end:
|
||||
<<: *macos_defaults
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ~/react-native
|
||||
|
||||
- run:
|
||||
name: Boot iOS Simulator
|
||||
command: xcrun simctl boot "iPhone 5s" || true
|
||||
|
||||
- run:
|
||||
name: Configure Environment Variables
|
||||
command: |
|
||||
echo 'export PATH=/usr/local/opt/node@8/bin:$PATH' >> $BASH_ENV
|
||||
source $BASH_ENV
|
||||
|
||||
- run:
|
||||
name: Install Node 8
|
||||
command: |
|
||||
brew install node@8
|
||||
brew link node@8
|
||||
node -v
|
||||
- run: *boot-simulator-iphone
|
||||
|
||||
- run: *run-objc-ios-e2e-tests
|
||||
|
||||
- run:
|
||||
name: Install Apple Simulator Utilities
|
||||
command: |
|
||||
brew tap wix/brew
|
||||
brew install applesimutils
|
||||
- store_test_results:
|
||||
path: ~/react-native/reports/junit
|
||||
|
||||
- run:
|
||||
name: Build iOS App for Simulator
|
||||
command: yarn run build-ios-e2e
|
||||
# Runs end to end tests (Detox)
|
||||
# Disabled.
|
||||
test_detox_end_to_end:
|
||||
<<: *macos_defaults
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ~/react-native
|
||||
|
||||
- run:
|
||||
name: Run Detox Tests
|
||||
command: yarn run test-ios-e2e
|
||||
- run: *boot-simulator-iphone
|
||||
|
||||
- run: *install-node-8
|
||||
- run: *install-apple-simulator-utils
|
||||
- run: *build-ios-app-e2e
|
||||
|
||||
- run: *run-ios-detox-tests
|
||||
|
||||
- store_test_results:
|
||||
path: ~/react-native/reports/junit
|
||||
@@ -669,11 +675,19 @@ workflows:
|
||||
requires:
|
||||
- checkout_code
|
||||
|
||||
# Disabled on master.
|
||||
|
||||
# End-to-end tests
|
||||
- test_end_to_end:
|
||||
filters: *filter-ignore-gh-pages
|
||||
requires:
|
||||
- checkout_code
|
||||
# - test_objc_end_to_end:
|
||||
# filters: *filter-ignore-gh-pages
|
||||
# requires:
|
||||
# - checkout_code
|
||||
|
||||
# - test_detox_end_to_end:
|
||||
# filters: *filter-ignore-gh-pages
|
||||
# requires:
|
||||
# - checkout_code
|
||||
|
||||
|
||||
# Only runs on vX.X.X tags if all tests are green
|
||||
- publish_npm_package:
|
||||
@@ -687,8 +701,7 @@ workflows:
|
||||
- test_javascript
|
||||
- test_objc
|
||||
- test_android
|
||||
- test_end_to_end
|
||||
- analyze
|
||||
# - test_objc_end_to_end
|
||||
|
||||
# Only runs on PRs
|
||||
analyze:
|
||||
|
||||
+4
-4
@@ -56,7 +56,6 @@ module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
|
||||
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
|
||||
module.system.haste.paths.blacklist=.*/__tests__/.*
|
||||
module.system.haste.paths.blacklist=.*/__mocks__/.*
|
||||
module.system.haste.paths.blacklist=<PROJECT_ROOT>/Libraries/Animated/src/polyfills/.*
|
||||
module.system.haste.paths.whitelist=<PROJECT_ROOT>/Libraries/.*
|
||||
module.system.haste.paths.whitelist=<PROJECT_ROOT>/RNTester/.*
|
||||
module.system.haste.paths.whitelist=<PROJECT_ROOT>/IntegrationTests/.*
|
||||
@@ -71,13 +70,14 @@ suppress_type=$FlowFixMe
|
||||
suppress_type=$FlowFixMeProps
|
||||
suppress_type=$FlowFixMeState
|
||||
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native_oss|react_native_fb][a-z,_]*\\)?)\\)
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native_oss|react_native_fb][a-z,_]*\\)?)\\)?:? #[0-9]+
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_ios\\)?_oss|react_native\\(_ios\\)?_fb][a-z,_]*\\)?)\\)
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_ios\\)?_oss|react_native\\(_ios\\)?_fb][a-z,_]*\\)?)\\)?:? #[0-9]+
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
|
||||
|
||||
[lints]
|
||||
all=warn
|
||||
unnecessary-optional-chain=off
|
||||
|
||||
# There is an ESLint rule for this
|
||||
unclear-type=off
|
||||
@@ -100,4 +100,4 @@ untyped-import
|
||||
untyped-type-import
|
||||
|
||||
[version]
|
||||
^0.77.0
|
||||
^0.78.0
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
[ignore]
|
||||
; We fork some components by platform
|
||||
.*/*[.]ios.js
|
||||
|
||||
; Ignore templates for 'react-native init'
|
||||
.*/local-cli/templates/.*
|
||||
|
||||
; Ignore the Dangerfile
|
||||
<PROJECT_ROOT>/bots/dangerfile.js
|
||||
|
||||
; Ignore "BUCK" generated dirs
|
||||
<PROJECT_ROOT>/\.buckd/
|
||||
|
||||
; Ignore unexpected extra "@providesModule"
|
||||
.*/node_modules/.*/node_modules/fbjs/.*
|
||||
|
||||
; Ignore duplicate module providers
|
||||
; 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
|
||||
|
||||
; Ignore polyfills
|
||||
.*/Libraries/polyfills/.*
|
||||
|
||||
; Ignore metro
|
||||
.*/node_modules/metro/.*
|
||||
|
||||
; These should not be required directly
|
||||
; require from fbjs/lib instead: require('fbjs/lib/invariant')
|
||||
.*/node_modules/invariant/.*
|
||||
.*/node_modules/warning/.*
|
||||
|
||||
[include]
|
||||
|
||||
[libs]
|
||||
Libraries/react-native/react-native-interface.js
|
||||
flow/
|
||||
flow-github/
|
||||
|
||||
[options]
|
||||
emoji=true
|
||||
|
||||
esproposal.optional_chaining=enable
|
||||
esproposal.nullish_coalescing=enable
|
||||
|
||||
module.system=haste
|
||||
module.system.haste.use_name_reducers=true
|
||||
# keep the following in sync with server/haste/hasteImpl.js
|
||||
# get basename
|
||||
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
|
||||
# strip .js or .js.flow suffix
|
||||
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
|
||||
# strip .android suffix
|
||||
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
|
||||
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
|
||||
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
|
||||
module.system.haste.paths.blacklist=.*/__tests__/.*
|
||||
module.system.haste.paths.blacklist=.*/__mocks__/.*
|
||||
module.system.haste.paths.whitelist=<PROJECT_ROOT>/Libraries/.*
|
||||
module.system.haste.paths.whitelist=<PROJECT_ROOT>/RNTester/.*
|
||||
module.system.haste.paths.whitelist=<PROJECT_ROOT>/IntegrationTests/.*
|
||||
module.system.haste.paths.blacklist=<PROJECT_ROOT>/Libraries/Animated/src/polyfills/.*
|
||||
|
||||
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'
|
||||
|
||||
suppress_type=$FlowIssue
|
||||
suppress_type=$FlowFixMe
|
||||
suppress_type=$FlowFixMeProps
|
||||
suppress_type=$FlowFixMeState
|
||||
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_android\\)?_oss|react_native\\(_android\\)?_fb][a-z,_]*\\)?)\\)
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_android\\)?_oss|react_native\\(_android\\)?_fb][a-z,_]*\\)?)\\)?:? #[0-9]+
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
|
||||
|
||||
[lints]
|
||||
all=warn
|
||||
unnecessary-optional-chain=off
|
||||
|
||||
# There is an ESLint rule for this
|
||||
unclear-type=off
|
||||
|
||||
sketchy-null=off
|
||||
sketchy-null-number=warn
|
||||
sketchy-null-mixed=warn
|
||||
|
||||
# This is noisy for now. We *do* still want to warn on importing types
|
||||
# from untyped files, which is covered by untyped-type-import
|
||||
untyped-import=off
|
||||
|
||||
[strict]
|
||||
deprecated-type
|
||||
nonstrict-import
|
||||
sketchy-null
|
||||
unclear-type
|
||||
unsafe-getters-setters
|
||||
untyped-import
|
||||
untyped-type-import
|
||||
|
||||
[version]
|
||||
^0.78.0
|
||||
@@ -51,10 +51,6 @@ node_modules
|
||||
*.log
|
||||
.nvm
|
||||
/bots/node_modules/
|
||||
|
||||
# TODO: Check in yarn.lock in open source. Right now we need to keep it out
|
||||
# from the GitHub repo as importing it might conflict with internal workspaces
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
|
||||
# OS X
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -95,13 +95,13 @@ class AnimatedStyle extends AnimatedWithChildren {
|
||||
}
|
||||
|
||||
__makeNative() {
|
||||
super.__makeNative();
|
||||
for (const key in this._style) {
|
||||
const value = this._style[key];
|
||||
if (value instanceof AnimatedNode) {
|
||||
value.__makeNative();
|
||||
}
|
||||
}
|
||||
super.__makeNative();
|
||||
}
|
||||
|
||||
__getNativeConfig(): Object {
|
||||
|
||||
@@ -22,7 +22,6 @@ class AnimatedTransform extends AnimatedWithChildren {
|
||||
}
|
||||
|
||||
__makeNative() {
|
||||
super.__makeNative();
|
||||
this._transforms.forEach(transform => {
|
||||
for (const key in transform) {
|
||||
const value = transform[key];
|
||||
@@ -31,6 +30,7 @@ class AnimatedTransform extends AnimatedWithChildren {
|
||||
}
|
||||
}
|
||||
});
|
||||
super.__makeNative();
|
||||
}
|
||||
|
||||
__getValue(): $ReadOnlyArray<Object> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -35,6 +35,8 @@ const _subscriptions = new Map();
|
||||
*/
|
||||
|
||||
const AccessibilityInfo = {
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
fetch: function(): Promise {
|
||||
return new Promise((resolve, reject) => {
|
||||
RCTAccessibilityInfo.isTouchExplorationEnabled(function(resp) {
|
||||
|
||||
@@ -103,6 +103,8 @@ const ActivityIndicator = (
|
||||
styles.container,
|
||||
style,
|
||||
)}>
|
||||
{/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was
|
||||
* found when making Flow check .android.js files. */}
|
||||
<RCTActivityIndicator {...nativeProps} />
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict
|
||||
* @flow
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
@@ -131,7 +131,11 @@ let CheckBox = createReactClass({
|
||||
let props = {...this.props};
|
||||
props.onStartShouldSetResponder = () => true;
|
||||
props.onResponderTerminationRequest = () => false;
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
props.enabled = !this.props.disabled;
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
props.on = this.props.value;
|
||||
props.style = [styles.rctCheckBox, this.props.style];
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -49,6 +49,8 @@ class PickerAndroid extends React.Component<
|
||||
},
|
||||
*,
|
||||
> {
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
static propTypes = {
|
||||
...ViewPropTypes,
|
||||
style: pickerStyleType,
|
||||
@@ -60,6 +62,8 @@ class PickerAndroid extends React.Component<
|
||||
testID: ReactPropTypes.string,
|
||||
};
|
||||
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
const state = this._stateFromProps(props);
|
||||
@@ -70,6 +74,8 @@ class PickerAndroid extends React.Component<
|
||||
};
|
||||
}
|
||||
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
this.setState(this._stateFromProps(nextProps));
|
||||
}
|
||||
@@ -86,6 +92,8 @@ class PickerAndroid extends React.Component<
|
||||
label: child.props.label,
|
||||
};
|
||||
if (child.props.color) {
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was
|
||||
* found when making Flow check .android.js files. */
|
||||
childProps.color = processColor(child.props.color);
|
||||
}
|
||||
return childProps;
|
||||
@@ -106,6 +114,8 @@ class PickerAndroid extends React.Component<
|
||||
selected: this.state.initialSelectedIndex,
|
||||
testID: this.props.testID,
|
||||
style: [styles.pickerAndroid, this.props.style],
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
accessibilityLabel: this.props.accessibilityLabel,
|
||||
};
|
||||
|
||||
@@ -116,18 +126,26 @@ class PickerAndroid extends React.Component<
|
||||
if (this.props.onValueChange) {
|
||||
const position = event.nativeEvent.position;
|
||||
if (position >= 0) {
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was
|
||||
* found when making Flow check .android.js files. */
|
||||
const children = React.Children.toArray(this.props.children);
|
||||
const value = children[position].props.value;
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was
|
||||
* found when making Flow check .android.js files. */
|
||||
this.props.onValueChange(value, position);
|
||||
} else {
|
||||
this.props.onValueChange(null, position);
|
||||
}
|
||||
}
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
this._lastNativePosition = event.nativeEvent.position;
|
||||
this.forceUpdate();
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
this._lastNativePosition = this.state.initialSelectedIndex;
|
||||
}
|
||||
|
||||
@@ -140,11 +158,15 @@ class PickerAndroid extends React.Component<
|
||||
// truth, not the native component.
|
||||
if (
|
||||
this.refs[REF_PICKER] &&
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
this.state.selectedIndex !== this._lastNativePosition
|
||||
) {
|
||||
this.refs[REF_PICKER].setNativeProps({
|
||||
selected: this.state.selectedIndex,
|
||||
});
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
this._lastNativePosition = this.state.selectedIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict
|
||||
* @flow
|
||||
* @format
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const NativeEventEmitter = require('NativeEventEmitter');
|
||||
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found when
|
||||
* making Flow check .android.js files. */
|
||||
module.exports = new NativeEventEmitter('StatusBarManager');
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -10,16 +10,15 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const SwitchNativeComponent = require('SwitchNativeComponent');
|
||||
const Platform = require('Platform');
|
||||
const React = require('React');
|
||||
const ReactNative = require('ReactNative');
|
||||
const StyleSheet = require('StyleSheet');
|
||||
|
||||
const requireNativeComponent = require('requireNativeComponent');
|
||||
|
||||
import type {SwitchChangeEvent} from 'CoreEventTypes';
|
||||
import type {ColorValue} from 'StyleSheetTypes';
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
import type {NativeAndroidProps, NativeIOSProps} from 'SwitchNativeComponent';
|
||||
|
||||
export type Props = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
@@ -75,41 +74,6 @@ export type Props = $ReadOnly<{|
|
||||
onValueChange?: ?(value: boolean) => Promise<void> | void,
|
||||
|}>;
|
||||
|
||||
// @see ReactSwitchManager.java
|
||||
type NativeAndroidProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
enabled?: ?boolean,
|
||||
on?: ?boolean,
|
||||
onChange?: ?(event: SwitchChangeEvent) => mixed,
|
||||
thumbTintColor?: ?string,
|
||||
trackTintColor?: ?string,
|
||||
|}>;
|
||||
|
||||
// @see RCTSwitchManager.m
|
||||
type NativeIOSProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
disabled?: ?boolean,
|
||||
onChange?: ?(event: SwitchChangeEvent) => mixed,
|
||||
onTintColor?: ?string,
|
||||
thumbTintColor?: ?string,
|
||||
tintColor?: ?string,
|
||||
value?: ?boolean,
|
||||
|}>;
|
||||
|
||||
type NativeSwitchType = Class<
|
||||
ReactNative.NativeComponent<
|
||||
$ReadOnly<{|
|
||||
...NativeAndroidProps,
|
||||
...NativeIOSProps,
|
||||
|}>,
|
||||
>,
|
||||
>;
|
||||
|
||||
const NativeSwitch: NativeSwitchType =
|
||||
Platform.OS === 'android'
|
||||
? (requireNativeComponent('AndroidSwitch'): any)
|
||||
: (requireNativeComponent('RCTSwitch'): any);
|
||||
|
||||
/**
|
||||
* A visual toggle between two mutually exclusive states.
|
||||
*
|
||||
@@ -119,7 +83,7 @@ const NativeSwitch: NativeSwitchType =
|
||||
* supplied `value` prop instead of the expected result of any user actions.
|
||||
*/
|
||||
class Switch extends React.Component<Props> {
|
||||
_nativeSwitchRef: ?React.ElementRef<NativeSwitchType>;
|
||||
_nativeSwitchRef: ?React.ElementRef<typeof SwitchNativeComponent>;
|
||||
|
||||
render() {
|
||||
const {
|
||||
@@ -197,13 +161,13 @@ class Switch extends React.Component<Props> {
|
||||
}: NativeIOSProps);
|
||||
|
||||
return (
|
||||
<NativeSwitch
|
||||
<SwitchNativeComponent
|
||||
{...props}
|
||||
{...platformProps}
|
||||
onChange={this._handleChange}
|
||||
onResponderTerminationRequest={returnsFalse}
|
||||
onStartShouldSetResponder={returnsTrue}
|
||||
ref={this._handleNativeSwitchRef}
|
||||
ref={this._handleSwitchNativeComponentRef}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -230,7 +194,9 @@ class Switch extends React.Component<Props> {
|
||||
}
|
||||
};
|
||||
|
||||
_handleNativeSwitchRef = (ref: ?React.ElementRef<NativeSwitchType>) => {
|
||||
_handleSwitchNativeComponentRef = (
|
||||
ref: ?React.ElementRef<typeof SwitchNativeComponent>,
|
||||
) => {
|
||||
this._nativeSwitchRef = ref;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const Platform = require('Platform');
|
||||
const ReactNative = require('ReactNative');
|
||||
|
||||
const requireNativeComponent = require('requireNativeComponent');
|
||||
|
||||
import type {SwitchChangeEvent} from 'CoreEventTypes';
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
|
||||
// @see ReactSwitchManager.java
|
||||
export type NativeAndroidProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
enabled?: ?boolean,
|
||||
on?: ?boolean,
|
||||
onChange?: ?(event: SwitchChangeEvent) => mixed,
|
||||
thumbTintColor?: ?string,
|
||||
trackTintColor?: ?string,
|
||||
|}>;
|
||||
|
||||
// @see RCTSwitchManager.m
|
||||
export type NativeIOSProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
disabled?: ?boolean,
|
||||
onChange?: ?(event: SwitchChangeEvent) => mixed,
|
||||
onTintColor?: ?string,
|
||||
thumbTintColor?: ?string,
|
||||
tintColor?: ?string,
|
||||
value?: ?boolean,
|
||||
|}>;
|
||||
|
||||
type SwitchNativeComponentType = Class<
|
||||
ReactNative.NativeComponent<
|
||||
$ReadOnly<{|
|
||||
...NativeAndroidProps,
|
||||
...NativeIOSProps,
|
||||
|}>,
|
||||
>,
|
||||
>;
|
||||
|
||||
const SwitchNativeComponent: SwitchNativeComponentType =
|
||||
Platform.OS === 'android'
|
||||
? (requireNativeComponent('AndroidSwitch'): any)
|
||||
: (requireNativeComponent('RCTSwitch'): any);
|
||||
|
||||
module.exports = SwitchNativeComponent;
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -326,18 +326,8 @@ const TextInput = createReactClass({
|
||||
statics: {
|
||||
State: {
|
||||
currentlyFocusedField: TextInputState.currentlyFocusedField,
|
||||
focusTextInput: (textFieldID: ?number) => {
|
||||
console.warn(
|
||||
'`focusTextInput` is deprecated, use the `focus` method of the `TextInput` ref instead.',
|
||||
);
|
||||
TextInputState.focusTextInput(textFieldID);
|
||||
},
|
||||
blurTextInput: (textFieldID: ?number) => {
|
||||
console.warn(
|
||||
'`blurTextInput` is deprecated, use `Keyboard.dismiss` or the `blur` method of the `TextInput` ref.',
|
||||
);
|
||||
TextInputState.blurTextInput(textFieldID);
|
||||
},
|
||||
focusTextInput: TextInputState.focusTextInput,
|
||||
blurTextInput: TextInputState.blurTextInput,
|
||||
},
|
||||
},
|
||||
propTypes: {
|
||||
@@ -591,6 +581,12 @@ const TextInput = createReactClass({
|
||||
* The text color of the placeholder string.
|
||||
*/
|
||||
placeholderTextColor: ColorPropType,
|
||||
/**
|
||||
* If `false`, scrolling of the text view will be disabled.
|
||||
* The default value is `true`. Does only work with 'multiline={true}'.
|
||||
* @platform ios
|
||||
*/
|
||||
scrollEnabled: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the text input obscures the text entered so that sensitive text
|
||||
* like passwords stay secure. The default value is `false`. Does not work with 'multiline={true}'.
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* should be funneled through here
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -16,6 +16,7 @@ const ReactNative = require('ReactNative');
|
||||
const Touchable = require('Touchable');
|
||||
const TouchableWithoutFeedback = require('TouchableWithoutFeedback');
|
||||
const UIManager = require('UIManager');
|
||||
const View = require('View');
|
||||
|
||||
const createReactClass = require('create-react-class');
|
||||
const ensurePositiveDelayProps = require('ensurePositiveDelayProps');
|
||||
@@ -238,7 +239,7 @@ const TouchableNativeFeedback = createReactClass({
|
||||
render: function() {
|
||||
const child = React.Children.only(this.props.children);
|
||||
let children = child.props.children;
|
||||
if (Touchable.TOUCH_TARGET_DEBUG && child.type.displayName === 'View') {
|
||||
if (Touchable.TOUCH_TARGET_DEBUG && child.type === View) {
|
||||
if (!Array.isArray(children)) {
|
||||
children = [children];
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ const React = require('React');
|
||||
const PropTypes = require('prop-types');
|
||||
const TimerMixin = require('react-timer-mixin');
|
||||
const Touchable = require('Touchable');
|
||||
const View = require('View');
|
||||
|
||||
const createReactClass = require('create-react-class');
|
||||
const ensurePositiveDelayProps = require('ensurePositiveDelayProps');
|
||||
@@ -225,28 +226,12 @@ const TouchableWithoutFeedback = ((createReactClass({
|
||||
// $FlowFixMe(>=0.41.0)
|
||||
const child = React.Children.only(this.props.children);
|
||||
let children = child.props.children;
|
||||
warning(
|
||||
!child.type || child.type.displayName !== 'Text',
|
||||
'TouchableWithoutFeedback does not work well with Text children. Wrap children in a View instead. See ' +
|
||||
((child._owner && child._owner.getName && child._owner.getName()) ||
|
||||
'<unknown>'),
|
||||
);
|
||||
if (
|
||||
Touchable.TOUCH_TARGET_DEBUG &&
|
||||
child.type &&
|
||||
child.type.displayName === 'View'
|
||||
) {
|
||||
if (Touchable.TOUCH_TARGET_DEBUG && child.type === View) {
|
||||
children = React.Children.toArray(children);
|
||||
children.push(
|
||||
Touchable.renderDebugView({color: 'red', hitSlop: this.props.hitSlop}),
|
||||
);
|
||||
}
|
||||
const style =
|
||||
Touchable.TOUCH_TARGET_DEBUG &&
|
||||
child.type &&
|
||||
child.type.displayName === 'Text'
|
||||
? [child.props.style, {color: 'red'}]
|
||||
: child.props.style;
|
||||
return (React: any).cloneElement(child, {
|
||||
accessible: this.props.accessible !== false,
|
||||
accessibilityLabel: this.props.accessibilityLabel,
|
||||
@@ -266,7 +251,6 @@ const TouchableWithoutFeedback = ((createReactClass({
|
||||
onResponderMove: this.touchableHandleResponderMove,
|
||||
onResponderRelease: this.touchableHandleResponderRelease,
|
||||
onResponderTerminate: this.touchableHandleResponderTerminate,
|
||||
style,
|
||||
children,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
const Platform = require('Platform');
|
||||
|
||||
@@ -5,18 +5,17 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const React = require('React');
|
||||
const TextAncestor = require('TextAncestor');
|
||||
const ViewNativeComponent = require('ViewNativeComponent');
|
||||
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
const requireNativeComponent = require('requireNativeComponent');
|
||||
|
||||
import type {NativeComponent} from 'ReactNative';
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
|
||||
export type Props = ViewProps;
|
||||
@@ -28,11 +27,13 @@ export type Props = ViewProps;
|
||||
*
|
||||
* @see http://facebook.github.io/react-native/docs/view.html
|
||||
*/
|
||||
const RCTView = requireNativeComponent('RCTView');
|
||||
|
||||
let ViewToExport = RCTView;
|
||||
let ViewToExport = ViewNativeComponent;
|
||||
if (__DEV__) {
|
||||
const View = (props: Props, forwardedRef: ?React.Ref<'RCTView'>) => {
|
||||
const View = (
|
||||
props: Props,
|
||||
forwardedRef: React.Ref<typeof ViewNativeComponent>,
|
||||
) => {
|
||||
return (
|
||||
<TextAncestor.Consumer>
|
||||
{hasTextAncestor => {
|
||||
@@ -40,7 +41,7 @@ if (__DEV__) {
|
||||
!hasTextAncestor,
|
||||
'Nesting of <View> within <Text> is not currently supported.',
|
||||
);
|
||||
return <RCTView {...props} ref={forwardedRef} />;
|
||||
return <ViewNativeComponent {...props} ref={forwardedRef} />;
|
||||
}}
|
||||
</TextAncestor.Consumer>
|
||||
);
|
||||
@@ -49,6 +50,4 @@ if (__DEV__) {
|
||||
ViewToExport = React.forwardRef(View);
|
||||
}
|
||||
|
||||
module.exports = ((ViewToExport: $FlowFixMe): Class<
|
||||
NativeComponent<ViewProps>,
|
||||
>);
|
||||
module.exports = ((ViewToExport: $FlowFixMe): typeof ViewNativeComponent);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const ReactNative = require('ReactNative');
|
||||
|
||||
const requireNativeComponent = require('requireNativeComponent');
|
||||
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
|
||||
type ViewNativeComponentType = Class<ReactNative.NativeComponent<ViewProps>>;
|
||||
|
||||
const ViewNativeComponent = ((requireNativeComponent(
|
||||
'RCTView',
|
||||
): any): ViewNativeComponentType);
|
||||
|
||||
module.exports = ViewNativeComponent;
|
||||
@@ -134,7 +134,6 @@ module.exports = {
|
||||
* an action on the accessibility element when that result is not obvious from the
|
||||
* accessibility label.
|
||||
*
|
||||
* @platform ios
|
||||
*
|
||||
* See http://facebook.github.io/react-native/docs/view.html#accessibilityHint
|
||||
*/
|
||||
@@ -165,7 +164,7 @@ module.exports = {
|
||||
accessibilityComponentType: PropTypes.oneOf(AccessibilityComponentTypes),
|
||||
|
||||
/**
|
||||
* Indicates to accessibility services to treat UI component like a
|
||||
* Indicates to accessibility services to treat UI component like a specific role.
|
||||
*/
|
||||
accessibilityRole: PropTypes.oneOf(AccessibilityRoles),
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -82,6 +82,8 @@ class ViewPagerAndroid extends React.Component<{
|
||||
keyboardDismissMode?: 'none' | 'on-drag',
|
||||
scrollEnabled?: boolean,
|
||||
}> {
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
static propTypes = {
|
||||
...ViewPropTypes,
|
||||
/**
|
||||
@@ -154,14 +156,20 @@ class ViewPagerAndroid extends React.Component<{
|
||||
}
|
||||
}
|
||||
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
getInnerViewNode = (): ReactComponent => {
|
||||
return this.refs[VIEWPAGER_REF].getInnerViewNode();
|
||||
};
|
||||
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
_childrenWithOverridenStyle = (): Array => {
|
||||
// Override styles so that each page will fill the parent. Native component
|
||||
// will handle positioning of elements, so it's not important to offset
|
||||
// them correctly.
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
return React.Children.map(this.props.children, function(child) {
|
||||
if (!child) {
|
||||
return null;
|
||||
@@ -247,6 +255,8 @@ class ViewPagerAndroid extends React.Component<{
|
||||
<NativeAndroidViewPager
|
||||
{...this.props}
|
||||
ref={VIEWPAGER_REF}
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was
|
||||
* found when making Flow check .android.js files. */
|
||||
style={this.props.style}
|
||||
onPageScroll={this._onPageScroll}
|
||||
onPageScrollStateChanged={this._onPageScrollStateChanged}
|
||||
|
||||
@@ -435,9 +435,10 @@ class WebView extends React.Component {
|
||||
|
||||
const viewManager = nativeConfig.viewManager || RCTWebViewManager;
|
||||
|
||||
const compiledWhitelist = (this.props.originWhitelist || []).map(
|
||||
WebViewShared.originWhitelistToRegex,
|
||||
);
|
||||
const compiledWhitelist = [
|
||||
'about:blank',
|
||||
...(this.props.originWhitelist || []),
|
||||
].map(WebViewShared.originWhitelistToRegex);
|
||||
const onShouldStartLoadWithRequest = (event: Event) => {
|
||||
let shouldStart = true;
|
||||
const {url} = event.nativeEvent;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
*
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @generated by scripts/bump-oss-version.js
|
||||
* @flow
|
||||
*/
|
||||
|
||||
exports.version = {
|
||||
major: 0,
|
||||
minor: 0,
|
||||
minor: 57,
|
||||
patch: 0,
|
||||
prerelease: null,
|
||||
prerelease: 'rc.0',
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -100,6 +100,7 @@ class SwipeableFlatList<ItemT> extends React.Component<Props<ItemT>, State> {
|
||||
}}
|
||||
onScroll={this._onScroll}
|
||||
renderItem={this._renderItem}
|
||||
extraData={this.state}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict
|
||||
* @flow
|
||||
* @format
|
||||
*/
|
||||
|
||||
@@ -219,8 +219,12 @@ let Image = (
|
||||
let style;
|
||||
let sources;
|
||||
if (source?.uri != null) {
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
const {width, height} = source;
|
||||
style = flattenStyle([{width, height}, styles.base, props.style]);
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
sources = [{uri: source.uri}];
|
||||
} else {
|
||||
style = flattenStyle([styles.base, props.style]);
|
||||
@@ -232,6 +236,8 @@ let Image = (
|
||||
style,
|
||||
shouldNotifyLoadEvents: !!(onLoadStart || onLoad || onLoadEnd || onError),
|
||||
src: sources,
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
headers: source?.headers,
|
||||
defaultSrc: defaultSource ? defaultSource.uri : null,
|
||||
loadingIndicatorSrc: loadingIndicatorSource
|
||||
|
||||
@@ -35,6 +35,12 @@ UIImage *RCTBlurredImageWithRadius(UIImage *inputImage, CGFloat radius)
|
||||
size_t bytes = buffer1.rowBytes * buffer1.height;
|
||||
buffer1.data = malloc(bytes);
|
||||
buffer2.data = malloc(bytes);
|
||||
if (!buffer1.data || !buffer2.data) {
|
||||
// CWE - 391 : Unchecked error condition
|
||||
// https://www.cvedetails.com/cwe-details/391/Unchecked-Error-Condition.html
|
||||
// https://eli.thegreenplace.net/2009/10/30/handling-out-of-memory-conditions-in-c
|
||||
abort();
|
||||
}
|
||||
|
||||
// A description of how to compute the box kernel width from the Gaussian
|
||||
// radius (aka standard deviation) appears in the SVG spec:
|
||||
@@ -45,6 +51,12 @@ UIImage *RCTBlurredImageWithRadius(UIImage *inputImage, CGFloat radius)
|
||||
//create temp buffer
|
||||
void *tempBuffer = malloc((size_t)vImageBoxConvolve_ARGB8888(&buffer1, &buffer2, NULL, 0, 0, boxSize, boxSize,
|
||||
NULL, kvImageEdgeExtend + kvImageGetTempBufferSize));
|
||||
if (!tempBuffer) {
|
||||
// CWE - 391 : Unchecked error condition
|
||||
// https://www.cvedetails.com/cwe-details/391/Unchecked-Error-Condition.html
|
||||
// https://eli.thegreenplace.net/2009/10/30/handling-out-of-memory-conditions-in-c
|
||||
abort();
|
||||
}
|
||||
|
||||
//copy image data
|
||||
CFDataRef dataSource = CGDataProviderCopyData(CGImageGetDataProvider(imageRef));
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -50,6 +50,12 @@ static NSString *RCTGenerateFormBoundary()
|
||||
const char *boundaryChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.";
|
||||
|
||||
char *bytes = (char*)malloc(boundaryLength);
|
||||
if (!bytes) {
|
||||
// CWE - 391 : Unchecked error condition
|
||||
// https://www.cvedetails.com/cwe-details/391/Unchecked-Error-Condition.html
|
||||
// https://eli.thegreenplace.net/2009/10/30/handling-out-of-memory-conditions-in-c
|
||||
abort();
|
||||
}
|
||||
size_t charCount = strlen(boundaryChars);
|
||||
for (int i = 0; i < boundaryLength; i++) {
|
||||
bytes[i] = boundaryChars[arc4random_uniform((u_int32_t)charCount)];
|
||||
|
||||
@@ -522,6 +522,8 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
|
||||
this._url,
|
||||
this._headers,
|
||||
data,
|
||||
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
|
||||
* when making Flow check .android.js files. */
|
||||
nativeResponseType,
|
||||
incrementalEvents,
|
||||
this.timeout,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -115,20 +115,20 @@ expectErrorBlock:(BOOL(^)(NSString *error))expectErrorBlock
|
||||
{
|
||||
__weak RCTBridge *batchedBridge;
|
||||
NSNumber *rootTag;
|
||||
RCTLogFunction defaultLogFunction = RCTGetLogFunction();
|
||||
// Catch all error logs, that are equivalent to redboxes in dev mode.
|
||||
__block NSMutableArray<NSString *> *errors = nil;
|
||||
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
||||
defaultLogFunction(level, source, fileName, lineNumber, message);
|
||||
if (level >= RCTLogLevelError) {
|
||||
if (errors == nil) {
|
||||
errors = [NSMutableArray new];
|
||||
}
|
||||
[errors addObject:message];
|
||||
}
|
||||
});
|
||||
|
||||
@autoreleasepool {
|
||||
__block NSMutableArray<NSString *> *errors = nil;
|
||||
RCTLogFunction defaultLogFunction = RCTGetLogFunction();
|
||||
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
||||
defaultLogFunction(level, source, fileName, lineNumber, message);
|
||||
if (level >= RCTLogLevelError) {
|
||||
if (errors == nil) {
|
||||
errors = [NSMutableArray new];
|
||||
}
|
||||
[errors addObject:message];
|
||||
}
|
||||
});
|
||||
|
||||
RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:_scriptURL
|
||||
moduleProvider:_moduleProvider
|
||||
launchOptions:nil];
|
||||
@@ -172,7 +172,16 @@ expectErrorBlock:(BOOL(^)(NSString *error))expectErrorBlock
|
||||
testModule.view = nil;
|
||||
}
|
||||
|
||||
RCTSetLogFunction(defaultLogFunction);
|
||||
// From this point on catch only fatal errors.
|
||||
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
||||
defaultLogFunction(level, source, fileName, lineNumber, message);
|
||||
if (level >= RCTLogLevelFatal) {
|
||||
if (errors == nil) {
|
||||
errors = [NSMutableArray new];
|
||||
}
|
||||
[errors addObject:message];
|
||||
}
|
||||
});
|
||||
|
||||
#if RCT_DEV
|
||||
NSArray<UIView *> *nonLayoutSubviews = [vc.view.subviews filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id subview, NSDictionary *bindings) {
|
||||
@@ -208,8 +217,10 @@ expectErrorBlock:(BOOL(^)(NSString *error))expectErrorBlock
|
||||
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||
}
|
||||
// Note: this deallocation isn't consistently working in test setup, so disable the assertion.
|
||||
// RCTAssert(batchedBridge == nil, @"Bridge should be deallocated after the test");
|
||||
RCTAssert(errors == nil, @"RedBox errors during bridge invalidation: %@", errors);
|
||||
RCTAssert(batchedBridge == nil, @"Bridge should be deallocated after the test");
|
||||
|
||||
RCTSetLogFunction(defaultLogFunction);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const React = require('React');
|
||||
const StyleSheet = require('StyleSheet');
|
||||
const Text = require('Text');
|
||||
const View = require('View');
|
||||
|
||||
function ReactFabricIndicator(): React.Node {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.text}>FABRIC</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
backgroundColor: 'rgba(0,0,0, 0.25)',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
right: 0,
|
||||
padding: 2,
|
||||
},
|
||||
text: {
|
||||
fontSize: 6,
|
||||
color: '#ffffff',
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = ReactFabricIndicator;
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
const AppContainer = require('AppContainer');
|
||||
const React = require('React');
|
||||
const ReactFabricIndicator = require('ReactFabricIndicator');
|
||||
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
|
||||
@@ -24,12 +25,16 @@ function renderApplication<Props: Object>(
|
||||
rootTag: any,
|
||||
WrapperComponent?: ?React.ComponentType<*>,
|
||||
fabric?: boolean,
|
||||
showFabricIndicator?: boolean,
|
||||
) {
|
||||
invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag);
|
||||
|
||||
let renderable = (
|
||||
<AppContainer rootTag={rootTag} WrapperComponent={WrapperComponent}>
|
||||
<RootComponent {...initialProps} rootTag={rootTag} />
|
||||
{fabric === true && showFabricIndicator === true ? (
|
||||
<ReactFabricIndicator />
|
||||
) : null}
|
||||
</AppContainer>
|
||||
);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Stub of Sample for Android.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Stub of Sample for Android.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
58B511D31A9E6C8500147676 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0610;
|
||||
LastUpgradeCheck = 0940;
|
||||
ORGANIZATIONNAME = Facebook;
|
||||
TargetAttributes = {
|
||||
58B511DA1A9E6C8500147676 = {
|
||||
@@ -130,19 +130,31 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
@@ -170,19 +182,30 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -48,6 +48,7 @@ RCT_REMAP_VIEW_PROPERTY(selectionColor, backedTextInputView.tintColor, UIColor)
|
||||
RCT_REMAP_VIEW_PROPERTY(spellCheck, backedTextInputView.spellCheckingType, UITextSpellCheckingType)
|
||||
RCT_REMAP_VIEW_PROPERTY(caretHidden, backedTextInputView.caretHidden, BOOL)
|
||||
RCT_REMAP_VIEW_PROPERTY(clearButtonMode, backedTextInputView.clearButtonMode, UITextFieldViewMode)
|
||||
RCT_REMAP_VIEW_PROPERTY(scrollEnabled, backedTextInputView.scrollEnabled, BOOL)
|
||||
RCT_EXPORT_VIEW_PROPERTY(blurOnSubmit, BOOL)
|
||||
RCT_EXPORT_VIEW_PROPERTY(clearTextOnFocus, BOOL)
|
||||
RCT_EXPORT_VIEW_PROPERTY(keyboardType, UIKeyboardType)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
|
||||
@@ -124,3 +124,37 @@ if (!String.prototype.codePointAt) {
|
||||
return first;
|
||||
};
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd
|
||||
if (!String.prototype.padEnd) {
|
||||
String.prototype.padEnd = function padEnd(targetLength, padString) {
|
||||
targetLength = targetLength >> 0; //floor if number or convert non-number to 0;
|
||||
padString = String(typeof padString !== 'undefined' ? padString : ' ');
|
||||
if (this.length > targetLength) {
|
||||
return String(this);
|
||||
} else {
|
||||
targetLength = targetLength - this.length;
|
||||
if (targetLength > padString.length) {
|
||||
padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed
|
||||
}
|
||||
return String(this) + padString.slice(0, targetLength);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart
|
||||
if (!String.prototype.padStart) {
|
||||
String.prototype.padStart = function padStart(targetLength, padString) {
|
||||
targetLength = targetLength >> 0; //truncate if number or convert non-number to 0;
|
||||
padString = String(typeof padString !== 'undefined' ? padString : ' ');
|
||||
if (this.length > targetLength) {
|
||||
return String(this);
|
||||
} else {
|
||||
targetLength = targetLength - this.length;
|
||||
if (targetLength > padString.length) {
|
||||
padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed
|
||||
}
|
||||
return padString.slice(0, targetLength) + String(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user