Compare commits

...
16 Commits
Author SHA1 Message Date
Mike Grabowski 5f3f3d463a [0.51.0] Bump version numbers 2017-12-05 18:39:30 -08:00
Mike Grabowski ec2f97ac1a [0.51.0-rc.3] Bump version numbers 2017-11-30 18:49:14 +01:00
James ReggioandMike Grabowski 43d1cf8fd1 Fix crash with non-zero blurRadius less than 1
Summary:
There's a crash-inducing bug with `Image.blurRadius` on Android.

`blurRadius` is specified in JavaScript as a `float`, but it's cast to `int` before being passed to the `IterativeBoxBlurPostProcessor`. However, in `IterativeBoxBlurPostProcessor`, there is an argument precondition requiring the integer `blurRadius` to be non-zero.

Because the `== 0` condition is evaluated on the `float`, it's possible for a `blurRadius` in the range of `(0, 1)` (non-inclusive) to pass the conditional, and then be truncated to `0` and passed as an argument to `IterativeBoxBlurPostProcessor`, which will fail its precondition and crash the app.

This change works in our app, which was previously crashing.

[ANDROID] [BUGFIX] [Image] Fixed crash when specifying an Image.blurRadius between (0, 1)
Closes https://github.com/facebook/react-native/pull/16845

Differential Revision: D6387416

Pulled By: shergin

fbshipit-source-id: d5191aa97e949ffd41e6d68c96b3c7bcbc82a52e
2017-11-30 18:49:03 +01:00
Nicolas CharpentierandJames Ide 9faf324d30 Fix markdown in requiresMainQueueSetup warning
Summary:
nit-picking

[IOS] [MINOR] [React/Base/RCTModuleData.mm] - Fix markdown in `requiresMainQueueSetup` warning
Closes https://github.com/facebook/react-native/pull/16916

Differential Revision: D6394725

Pulled By: shergin

fbshipit-source-id: 272c5a6ee529af0b162230e8a07275043a888907
2017-11-28 12:48:22 -08:00
Nicolas CharpentierandJames Ide 8e0d54d38b Implement requiresMainQueueSetup in RCTTVNavigationEventEmitter
Summary:
Fix the following warning:

> Module RCTTVNavigationEventEmitter requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.

Trivial change.

[IOS] [MINOR] [RCTTVNavigationEventEmitter] - Implement `requiresMainQueueSetup` in `RCTTVNavigationEventEmitter`
Closes https://github.com/facebook/react-native/pull/16915

Differential Revision: D6394636

Pulled By: shergin

fbshipit-source-id: 3981655832715e73e93ef917d987e25097029b84
2017-11-28 12:48:10 -08:00
Valentin SherginandJames Ide 2d88b63747 TextInput: Fixed autoscroll to cursor on Android
Summary:
This feature was disabled for multiline textinputs in D3528202 ... seems without a good reason.
The broken autoscroll-to-cursor feature is terribly harmful and counter-intuitive in ALL cases.
I also add a contentSize tracking in the example app to make sure that it is unaffected by this change.

https://pxl.cl/9RHP

https://github.com/facebook/react-native/issues/12799
https://github.com/facebook/react-native/issues/15778

Special thanks to konradkierus!

Reviewed By: sahrens

Differential Revision: D6405985

fbshipit-source-id: 337a390a9db7b3528200ef66c4a079b87608294e
2017-11-28 12:45:50 -08:00
Mike Grabowski d93de22ad9 [0.51.0-rc.2] Bump version numbers 2017-11-21 22:39:52 +01:00
Mike Grabowski f3cbd4f159 Fix CircleCI 2017-11-21 22:35:39 +01:00
Mike Grabowski a7fdca038f Revert "Automated fixups for Instagram"
This reverts commit dd016f334c.
2017-11-16 21:11:21 +01:00
Mike Grabowski 42879d21e8 Revert old Buck 2017-11-16 21:11:20 +01:00
Mike Grabowski d0bb66fbf7 Fix circle config:
One more deploy fix

Circle fixes

Fix deployment

Improve CI config

Update alias

Fix Buck and tests on master

Hardcode Buck version

Fix Buck cache keys
2017-11-16 20:54:01 +01:00
Mike Grabowski c85aa82cd0 [0.51.0-rc.1] Bump version numbers 2017-11-05 00:48:48 +01:00
Mehdi MulaniandJames Ide 91509751ef Fix memory leak in RCTSafeAreaView
Summary:
According to the retain code collector, RCTSafeAreaView is in a cycle:
-> _bridge -> RCTCxxBridge -> _moduleDataByName -> __NSDictionaryM -> RCTModuleData -> _instance -> RCTUIManager -> _viewRegistry -> __NSDictionaryM -> RCTSafeAreaView
This should break the cycle.

Reviewed By: shergin

Differential Revision: D6213668

fbshipit-source-id: efb9c1dd148b72f66fe4485b81c16cd4c2d18b17
2017-11-03 23:34:29 -07:00
James Ide 87e524b4a4 [podspec] Define pod_target_xcconfig for PrivateDatabase
We don't strictly need this since all the other subspecs that use this set up the header search path for ReactCommon anyway but do it just for correctness.
2017-11-03 17:09:10 -07:00
Joshua MayandJames Ide 6817f05f63 Adds PrivateDatabase podspec
Summary:
Resolves #16663.

Walked through the reproduction steps in #16663, but with successful build.

We can also now see the files are included in the `Pods` project:

<img width="236" alt="screen shot 2017-11-03 at 7 43 21 pm" src="https://user-images.githubusercontent.com/33126/32390596-4a06c05c-c0cf-11e7-8616-3ae547f8cca2.png">

(I noticed a subspec called `_ignore_me_subspec_for_linting_` so do we have tests for the podspec?)

[IOS] [BUGFIX] [React.podspec] - Resolves build error about missing symbols for PrivateDatabase.{cpp,h}
Closes https://github.com/facebook/react-native/pull/16664

Differential Revision: D6238178

Pulled By: hramos

fbshipit-source-id: b57007ab8c7c8bd0faf1f2f11269a7a2c28183e5
2017-11-03 17:09:06 -07:00
Mike Grabowski 7f4fe158a2 [0.51.0-rc.0] Bump version numbers 2017-11-03 17:50:06 +01:00
26 changed files with 242 additions and 201 deletions
+156 -148
View File
@@ -52,6 +52,10 @@ aliases:
keys:
- v1-android-ndk-{{ arch }}-r10e-32-64
- &install-ndk
|
source scripts/circle-ci-android-setup.sh && getAndroidNDK
- &save-cache-ndk
paths:
- /opt/ndk
@@ -87,6 +91,19 @@ aliases:
|
npm install --no-package-lock --no-spin --no-progress
- &install-buck
|
if [[ ! -e ~/buck ]]; then
git clone https://github.com/facebook/buck.git ~/buck --branch v2017.09.04.02 --depth=1
fi
cd ~/buck && ant
buck --version
- &install-node
|
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
- &run-node-tests
|
npm test -- --maxWorkers=2
@@ -99,6 +116,11 @@ aliases:
- /.*-stable/
- master
- &filter-only-stable
branches:
only:
- /.*-stable/
- &filter-ignore-gh-pages
branches:
ignore: gh-pages
@@ -110,9 +132,54 @@ aliases:
- /.*-stable/
- gh-pages
- &create-ndk-directory
|
if [[ ! -e /opt/ndk ]]; then
sudo mkdir /opt/ndk
fi
sudo chown ${USER:=$(/usr/bin/id -run)}:$USER /opt/ndk
# CircleCI does not support interpolating env variables in the environment
# https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables
- &configure-android-path
|
echo 'export PATH=${ANDROID_NDK}:~/react-native/gradle-2.9/bin:~/buck/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
- &install-android-packages
|
source scripts/circle-ci-android-setup.sh && getAndroidSDK
- &install-build-dependencies
|
sudo apt-get update -y
sudo apt-get install ant autoconf automake g++ gcc libqt5widgets5 lib32z1 lib32stdc++6 make maven python-dev python3-dev qml-module-qtquick-controls qtdeclarative5-dev file -y
- &install-android-app-dependencies
|
buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
buck fetch ReactAndroid/src/main/java/com/facebook/react
buck fetch ReactAndroid/src/main/java/com/facebook/react/shell
buck fetch ReactAndroid/src/test/...
buck fetch ReactAndroid/src/androidTest/...
./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSCHeaders
defaults: &defaults
working_directory: ~/react-native
android_defaults: &android_defaults
<<: *defaults
docker:
- image: circleci/android:api-26-alpha
resource_class: "large"
environment:
- TERM: "dumb"
- ADB_INSTALL_TIMEOUT: 10
- _JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
- GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError"'
- ANDROID_NDK: '/opt/ndk/android-ndk-r10e'
- BUILD_THREADS: 2
version: 2
jobs:
# Runs JavaScript tests on Node 8
@@ -208,6 +275,7 @@ jobs:
- save-cache: *save-node-cache
- run: ./scripts/process-podspecs.sh
# Tests website
test-website:
<<: *defaults
docker:
@@ -228,6 +296,7 @@ jobs:
name: Test Build Static Website
command: cd website && node ./server/generate.js
# Deploys website
deploy-website:
<<: *defaults
docker:
@@ -252,6 +321,46 @@ jobs:
echo "Skipping deploy."
fi
# Publishes new version onto npm
deploy:
<<: *android_defaults
steps:
- checkout
# Configure Android dependencies
- run: *configure-android-path
- run: *install-build-dependencies
- restore-cache: *restore-cache-android-packages
- run: *install-android-packages
- save-cache: *save-cache-android-packages
- run: *create-ndk-directory
- restore-cache: *restore-cache-ndk
- run: *install-ndk
- save-cache: *save-cache-ndk
- restore-cache: *restore-cache-buck
- run: *install-buck
- save-cache: *save-cache-buck
- run: *install-node
- restore-cache: *restore-node-cache
- run: *install-node-dependencies
- save-cache: *save-node-cache
- restore-cache: *restore-cache-buck-downloads
- run: *install-android-app-dependencies
- save-cache: *save-cache-buck-downloads
- run:
name: Publish React Native Package
command: |
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
echo "//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}" > ~/.npmrc
git config --global user.email "reactjs-bot@users.noreply.github.com"
git config --global user.name "Website Deployment Script"
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" > ~/.netrc
node ./scripts/publish-npm.js
else
echo "Skipping deploy."
fi
# Build JavaScript bundle for Android tests
build-js-bundle:
<<: *defaults
@@ -274,116 +383,55 @@ jobs:
# Runs unit tests tests on Android
test-android:
<<: *defaults
docker:
- image: circleci/android:api-26-alpha
environment:
- TERM: "dumb"
- ADB_INSTALL_TIMEOUT: 10
- GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx512m -XX:+HeapDumpOnOutOfMemoryError"'
- ANDROID_NDK: '/opt/ndk/android-ndk-r10e'
- BUILD_THREADS: 2
<<: *android_defaults
steps:
- checkout
# CircleCI does not support interpolating env variables in the environment: step above.
# https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables
- run:
name: Configure PATH
command: |
echo 'export PATH=${ANDROID_NDK}:~/react-native/gradle-2.9/bin:~/buck/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
# Configure dependencies
- run:
name: Install Build Dependencies
command: |
sudo apt-get update -y
sudo apt-get install ant autoconf automake g++ gcc libqt5widgets5 lib32z1 lib32stdc++6 make maven python-dev python3-dev qml-module-qtquick-controls qtdeclarative5-dev -y
# Configure Android dependencies
- run: *configure-android-path
- run: *install-build-dependencies
- restore-cache: *restore-cache-android-packages
- run:
name: Install Android Packages
command: source scripts/circle-ci-android-setup.sh && getAndroidSDK
- run: *install-android-packages
- save-cache: *save-cache-android-packages
# Starting emulator in advance as it takes some time to boot.
- run:
name: Create Android Virtual Device
command: source scripts/circle-ci-android-setup.sh && createAVD
# Starting emulator in advance as it takes some time to boot.
- run:
name: Launch Android Virtual Device in Background
command: source scripts/circle-ci-android-setup.sh && launchAVD
background: true
# Continue configuring dependencies while AVD boots.
- run:
name: Create Android NDK Directory
command: |
if [[ ! -e /opt/ndk ]]; then
sudo mkdir /opt/ndk
fi
sudo chown ${USER:=$(/usr/bin/id -run)}:$USER /opt/ndk
# Keep configuring Android dependencies while AVD boots up
- run: *create-ndk-directory
- restore-cache: *restore-cache-ndk
- run:
name: Install Android NDK
command: source scripts/circle-ci-android-setup.sh && getAndroidNDK
- run: *install-ndk
- save-cache: *save-cache-ndk
- restore-cache: *restore-cache-buck
- run:
name: Install Buck
command: |
if [[ ! -e ~/buck ]]; then
git clone https://github.com/facebook/buck.git ~/buck --branch v2017.09.04.02 --depth=1
fi
cd ~/buck && ant
buck --version
- run: *install-buck
- save-cache: *save-cache-buck
- run:
name: Install Node
command: |
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
- run: *install-node
- restore-cache: *restore-node-cache
- run: *install-node-dependencies
- save-cache: *save-node-cache
# TODO: Install and use watchman to speed up builds
# - restore-cache: *restore-cache-watchman
# - run:
# name: Install Watchman Dependencies
# command: |
# sudo apt-get update -y
# sudo apt-get install libtool pkg-config -y
# - run:
# name: Install Watchman
# command: |
# if [[ ! -e ~/watchman ]]; then
# mkdir ~/watchman
# git clone https://github.com/facebook/watchman.git ~/watchman --branch v4.9.0 --depth=1
# cd ~/watchman
# ./autogen.sh
# ./configure
# make
# fi
# cd ~/watchman
# sudo make install
# - save-cache: *save-cache-watchman
- restore-cache: *restore-cache-buck-downloads
- run:
name: Download Android App Dependencies
command: |
buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
buck fetch ReactAndroid/src/main/java/com/facebook/react
buck fetch ReactAndroid/src/main/java/com/facebook/react/shell
buck fetch ReactAndroid/src/test/...
buck fetch ReactAndroid/src/androidTest/...
./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSCHeaders
- run: *install-android-app-dependencies
- save-cache: *save-cache-buck-downloads
- run:
name: Build Android App
command: |
buck build ReactAndroid/src/main/java/com/facebook/react
buck build ReactAndroid/src/main/java/com/facebook/react/shell
# Wait for AVD to finish booting before running tests
# Wait for AVD to finish booting before running tests
- run:
name: Wait for Android Virtual Device
command: source scripts/circle-ci-android-setup.sh && waitForAVD
# The JavaScript Bundle is built as part of the build-js-bundle workflow, and is required for instrumentation tests.
# The JavaScript Bundle is built as part of the build-js-bundle workflow,
# and is required for instrumentation tests.
- attach_workspace:
at: ReactAndroid/src/androidTest/assets/
- run:
@@ -394,7 +442,8 @@ jobs:
else
echo "JavaScript bundle found.";
fi
# Tests
# Tests
- run:
name: Compile Native Libs for Unit and Integration Tests
command: ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=$BUILD_THREADS -Pcom.android.build.threadPoolSize=1
@@ -402,28 +451,19 @@ jobs:
- run:
name: Unit Tests
command: buck test ReactAndroid/src/test/... --config build.threads=$BUILD_THREADS
# Integration Tests
# Integration Tests
- run:
name: Build and Install Test APK
command: source scripts/circle-ci-android-setup.sh && NO_BUCKD=1 retry3 buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS
# TODO: Uncomment, test was already failing on Circle 1.0
# - run:
# name: Run Installed APK with Tests
# command: node ./scripts/run-android-ci-instrumentation-tests.js --retries 3 --path ./ReactAndroid/src/androidTest/java/com/facebook/react/tests --package com.facebook.react.tests
# TODO: Should be disabled, pending on https://our.intern.facebook.com/intern/tasks?t=16912142
# - run:
# name: Run Android End to End Tests
# command: source scripts/circle-ci-android-setup.sh && retry3 node ./scripts/run-ci-e2e-tests.js --android --js --retries 2
# post (always runs)
# post (always runs)
- run:
name: Collect Test Results
command: |
mkdir -p ~/junit/
find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} ~/junit/ \;
find . -type f -regex ".*/outputs/androidTest-results/connected/.*xml" -exec cp {} ~/junit/ \;
# TODO: Circle does not understand Buck's report, maybe need to transform xml slightly
# find . -type f -regex ".*/buck-out/gen/ReactAndroid/src/test/.*/.*xml" -exec cp {} ~/junit/ \;
when: always
- store_test_results:
path: ~/junit
@@ -449,7 +489,6 @@ jobs:
echo "Skipping dependency installation."
fi
- save-cache: *save-cache-analysis
# Run Danger
- run:
name: Analyze Pull Request
command: |
@@ -459,7 +498,6 @@ jobs:
echo "Skipping pull request analysis."
fi
when: always
# Run eslint
- run:
name: Analyze Code
command: |
@@ -469,81 +507,51 @@ jobs:
echo "Skipping code analysis."
fi
publish-npm:
<<: *defaults
docker:
- image: circleci/node:8
steps:
- checkout
- run: *install-node-dependencies
- run:
name: Publish React Native Package
command: |
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
echo "//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}" > ~/.npmrc
git config --global user.email "reactjs-bot@users.noreply.github.com"
git config --global user.name "Website Deployment Script"
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" > ~/.netrc
node ./scripts/publish-npm.js
else
echo "Skipping publication."
fi
# Workflows enables us to run multiple jobs in parallel
workflows:
version: 2
test_node:
build:
jobs:
# Test Javascript on Node 8 and 6
- test-js-node-8:
filters: *filter-ignore-gh-pages
- test-js-node-6:
filters: *filter-ignore-gh-pages
# TODO: Re-enable. Node 4 tests are already failing on Circle 1.0
# - test-js-node-4:
# filters: *filter-ignore-gh-pages
test_android:
jobs:
# Test Android
- build-js-bundle:
filters: *filter-ignore-gh-pages
- test-android:
requires:
- build-js-bundle
test_ios:
jobs:
# Test iOS & tvOS
- test-objc-ios:
filters: *filter-ignore-gh-pages
- test-objc-tvos:
filters: *filter-ignore-gh-pages
- test-objc-e2e:
filters: *filter-ignore-gh-pages
# TODO: Re-enable. Podspec tests are already failing on Travis
# - test-podspec:
# filters: *filter-ignore-gh-pages
website:
jobs:
# Test website
- test-website:
filters: *filter-ignore-gh-pages
- deploy-website:
requires:
- test-website
filters: *filter-only-master-stable
analyze:
jobs:
- analyze-pull-request:
filters: *filter-ignore-master-stable
deploy:
jobs:
# If we are on a stable branch, deploy to `npm`
- hold:
type: approval
- publish-npm:
requires:
- deploy:
filters: *filter-only-stable
requires:
- hold
# If we are on a master / stable branch, deploy docs
- deploy-website:
filters: *filter-only-master-stable
requires:
- test-website
- analyze-pull-request:
filters: *filter-ignore-master-stable
+1 -1
View File
@@ -14,7 +14,7 @@
exports.version = {
major: 0,
minor: 0,
minor: 51,
patch: 0,
prerelease: null,
};
@@ -427,6 +427,20 @@
remoteGlobalIDString = 134814201AA4EA6300B7C361;
remoteInfo = RCTSettings;
};
AD9FBECB1FD7597F00CADA08 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 9936F3131F5F2E4B0010BF04;
remoteInfo = privatedata;
};
AD9FBECD1FD7597F00CADA08 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04;
remoteInfo = "privatedata-tvOS";
};
D85B829B1AB6D5CE003F4FE2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */;
@@ -806,6 +820,8 @@
2D66FF8C1ECA405900F0A767 /* libthird-party.a */,
3D507F441EBC88B700B56834 /* libdouble-conversion.a */,
2D66FF8E1ECA405900F0A767 /* libdouble-conversion.a */,
AD9FBECC1FD7597F00CADA08 /* libprivatedata.a */,
AD9FBECE1FD7597F00CADA08 /* libprivatedata-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
@@ -1478,6 +1494,20 @@
remoteRef = 834C36D11AF8DA610019C93C /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
AD9FBECC1FD7597F00CADA08 /* libprivatedata.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libprivatedata.a;
remoteRef = AD9FBECB1FD7597F00CADA08 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
AD9FBECE1FD7597F00CADA08 /* libprivatedata-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libprivatedata-tvOS.a";
remoteRef = AD9FBECD1FD7597F00CADA08 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
D85B829C1AB6D5CE003F4FE2 /* libRCTVibration.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@@ -44,13 +44,6 @@ RCT_TEST(LayoutExample)
RCT_TEST(ARTExample)
RCT_TEST(ScrollViewExample)
RCT_TEST(TextExample)
#if !TARGET_OS_TV
// No switch or slider available on tvOS
RCT_TEST(SwitchExample)
RCT_TEST(SliderExample)
// TabBarExample on tvOS passes locally but not on Travis
RCT_TEST(TabBarExample)
#endif
- (void)testZZZNotInRecordMode
{
+2
View File
@@ -11,6 +11,8 @@
*/
'use strict';
require('MessageQueue').spy(true);
const AsyncStorage = require('AsyncStorage');
const BackHandler = require('BackHandler');
const Linking = require('Linking');
+7 -1
View File
@@ -320,10 +320,14 @@ class AutogrowingTextInputExample extends React.Component<{}> {
width: 100,
multiline: true,
text: '',
contentSize: {
width: 0,
height: 0,
},
};
}
componentDidReceiveProps(props) {
componentWillReceiveProps(props) {
this.setState({
multiline: props.multiline,
});
@@ -351,10 +355,12 @@ class AutogrowingTextInputExample extends React.Component<{}> {
multiline={this.state.multiline}
style={[style, {width: this.state.width + '%'}]}
onChangeText={(value) => this.setState({text: value})}
onContentSizeChange={(event) => this.setState({contentSize: event.nativeEvent.contentSize})}
{...props}
/>
<Text>Plain text value representation:</Text>
<Text>{this.state.text}</Text>
<Text>Content Size: {JSON.stringify(this.state.contentSize)}</Text>
</View>
);
}
+7
View File
@@ -109,6 +109,7 @@ Pod::Spec.new do |s|
s.subspec "jschelpers" do |ss|
ss.dependency "Folly", "2016.09.26.00"
ss.dependency "React/PrivateDatabase"
ss.compiler_flags = folly_compiler_flags
ss.source_files = "ReactCommon/jschelpers/*.{cpp,h}"
ss.private_header_files = "ReactCommon/jschelpers/*.h"
@@ -116,6 +117,12 @@ Pod::Spec.new do |s|
ss.framework = "JavaScriptCore"
end
s.subspec "PrivateDatabase" do |ss|
ss.source_files = "ReactCommon/privatedata/*.{cpp,h}"
ss.private_header_files = "ReactCommon/privatedata/*.h"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"" }
end
s.subspec "cxxreact" do |ss|
ss.dependency "React/jschelpers"
ss.dependency "boost"
+1 -1
View File
@@ -65,7 +65,7 @@
methodName = "init";
}
RCTLogWarn(@"Module %@ requires main queue setup since it overrides `%s` but doesn't implement "
"`requiresMainQueueSetup. In a future release React Native will default to initializing all native modules "
"`requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules "
"on a background thread unless explicitly opted-out of.", _moduleClass, methodName);
}
}
+1 -1
View File
@@ -11,7 +11,7 @@
#define RCT_REACT_NATIVE_VERSION @{ \
@"major": @(0), \
@"minor": @(0), \
@"minor": @(51), \
@"patch": @(0), \
@"prerelease": [NSNull null], \
}
@@ -17,6 +17,11 @@ static NSString *const TVNavigationEventName = @"onTVNavEvent";
RCT_EXPORT_MODULE()
+ (BOOL)requiresMainQueueSetup
{
return NO;
}
- (instancetype)init
{
if (self = [super init]) {
+1 -1
View File
@@ -15,7 +15,7 @@
#import "RCTSafeAreaViewLocalData.h"
@implementation RCTSafeAreaView {
RCTBridge *_bridge;
__weak RCTBridge *_bridge;
UIEdgeInsets _currentSafeAreaInsets;
}
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0-master
VERSION_NAME=0.51.0
GROUP=com.facebook.react
POM_NAME=ReactNative
@@ -12,7 +12,6 @@ android_library(
provided_deps = [
react_native_dep("third-party/android/support/v4:lib-support-v4"),
],
required_for_source_only_abi = True,
visibility = [
"PUBLIC",
],
@@ -16,7 +16,6 @@ android_library(
provided_deps = [
react_native_dep("third-party/android/support/v4:lib-support-v4"),
],
required_for_source_only_abi = True,
visibility = [
"PUBLIC",
],
@@ -9,14 +9,17 @@
package com.facebook.react.devsupport;
import android.os.Handler;
import android.os.Looper;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.bridge.JavaJSExecutor;
import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.Nullable;
import android.os.Handler;
import android.os.Looper;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.bridge.JavaJSExecutor;
/**
* Executes JS remotely via the react nodejs server as a proxy to a browser on the host machine.
@@ -157,7 +160,8 @@ public class WebsocketJavaScriptExecutor implements JavaJSExecutor {
}
@Override
public void loadApplicationScript(String sourceURL) throws JavaJSExecutor.ProxyExecutorException {
public void loadApplicationScript(String sourceURL)
throws ProxyExecutorException {
JSExecutorCallbackFuture callback = new JSExecutorCallbackFuture();
Assertions.assertNotNull(mWebSocketClient).loadApplicationScript(
sourceURL,
@@ -172,7 +176,7 @@ public class WebsocketJavaScriptExecutor implements JavaJSExecutor {
@Override
public @Nullable String executeJSCall(String methodName, String jsonArgsArray)
throws JavaJSExecutor.ProxyExecutorException {
throws ProxyExecutorException {
JSExecutorCallbackFuture callback = new JSExecutorCallbackFuture();
Assertions.assertNotNull(mWebSocketClient).executeJSCall(
methodName,
@@ -3,7 +3,6 @@ include_defs("//ReactAndroid/DEFS")
android_library(
name = "annotations",
srcs = glob(["**/*.java"]),
required_for_source_only_abi = True,
visibility = [
"PUBLIC",
],
@@ -18,7 +18,7 @@ import java.util.Map;
public class ReactNativeVersion {
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
"major", 0,
"minor", 0,
"minor", 51,
"patch", 0,
"prerelease", null);
}
@@ -14,7 +14,6 @@ android_library(
provided_deps = [
react_native_dep("third-party/android/support/v4:lib-support-v4"),
],
required_for_source_only_abi = True,
visibility = [
"PUBLIC",
],
@@ -3,7 +3,6 @@ include_defs("//ReactAndroid/DEFS")
android_library(
name = "annotations",
srcs = glob(["*.java"]),
required_for_source_only_abi = True,
visibility = [
"PUBLIC",
],
@@ -12,7 +12,7 @@ import android.view.animation.Transformation;
*/
/* package */ class OpacityAnimation extends Animation {
static class OpacityAnimationListener implements Animation.AnimationListener {
static class OpacityAnimationListener implements AnimationListener {
private final View mView;
private boolean mLayerTypeChanged = false;
@@ -11,7 +11,6 @@ android_library(
react_native_dep("third-party/android/support-annotations:android-support-annotations"),
react_native_dep("third-party/android/support/v4:lib-support-v4"),
],
required_for_source_only_abi = True,
visibility = ["PUBLIC"],
deps = [
react_native_dep("third-party/java/jsr-305:jsr-305"),
@@ -229,11 +229,11 @@ public class ReactImageView extends GenericDraweeView {
}
public void setBlurRadius(float blurRadius) {
if (blurRadius == 0) {
int pixelBlurRadius = (int) PixelUtil.toPixelFromDIP(blurRadius);
if (pixelBlurRadius == 0) {
mIterativeBoxBlurPostProcessor = null;
} else {
mIterativeBoxBlurPostProcessor =
new IterativeBoxBlurPostProcessor((int) PixelUtil.toPixelFromDIP(blurRadius));
mIterativeBoxBlurPostProcessor = new IterativeBoxBlurPostProcessor(pixelBlurRadius);
}
mIsDirty = true;
}
@@ -117,16 +117,7 @@ public class ReactEditText extends EditText {
// TODO: t6408636 verify if we should schedule a layout after a View does a requestLayout()
@Override
public boolean isLayoutRequested() {
// If we are watching and updating container height based on content size
// then we don't want to scroll right away. This isn't perfect -- you might
// want to limit the height the text input can grow to. Possible solution
// is to add another prop that determines whether we should scroll to end
// of text.
if (mContentSizeWatcher != null) {
return isMultiline();
} else {
return false;
}
return false;
}
@Override
@@ -54,13 +54,13 @@ public class ReactViewGroup extends ViewGroup implements
/**
* This listener will be set for child views when removeClippedSubview property is enabled. When
* children layout is updated, it will call {@link #updateSubviewClipStatus} to notify parent view
* about that fact so that view can be attached/detached if necessary.
* children layout is updated, it will call {@link #updateSubviewClipStatus} to notify parent
* view about that fact so that view can be attached/detached if necessary.
*
* <p>TODO(7728005): Attach/detach views in batch - once per frame in case when multiple children
* TODO(7728005): Attach/detach views in batch - once per frame in case when multiple children
* update their layout.
*/
private static final class ChildrenLayoutChangeListener implements View.OnLayoutChangeListener {
private static final class ChildrenLayoutChangeListener implements OnLayoutChangeListener {
private final ReactViewGroup mParent;
@@ -396,7 +396,7 @@ public class ReactViewGroup extends ViewGroup implements
}
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
public void addView(View child, int index, LayoutParams params) {
// This will get called for every overload of addView so there is not need to override every method.
mDrawingOrderHelper.handleAddView(child);
setChildrenDrawingOrderEnabled(mDrawingOrderHelper.shouldEnableCustomDrawingOrder());
@@ -468,8 +468,7 @@ public class ReactViewGroup extends ViewGroup implements
addViewWithSubviewClippingEnabled(child, index, sDefaultLayoutParam);
}
/*package*/ void addViewWithSubviewClippingEnabled(
View child, int index, ViewGroup.LayoutParams params) {
/*package*/ void addViewWithSubviewClippingEnabled(View child, int index, LayoutParams params) {
Assertions.assertCondition(mRemoveClippedSubviews);
Assertions.assertNotNull(mClippingRect);
Assertions.assertNotNull(mAllChildren);
@@ -9,17 +9,19 @@
package com.facebook.react.views.viewpager;
import java.util.ArrayList;
import java.util.List;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.uimanager.UIManagerModule;
import com.facebook.react.uimanager.events.EventDispatcher;
import com.facebook.react.uimanager.events.NativeGestureUtil;
import java.util.ArrayList;
import java.util.List;
/**
* Wrapper view for {@link ViewPager}. It's forwarding calls to {@link ViewGroup#addView} to add
@@ -116,7 +118,7 @@ public class ReactViewPager extends ViewPager {
}
}
private class PageChangeListener implements ViewPager.OnPageChangeListener {
private class PageChangeListener implements OnPageChangeListener {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "react-native",
"version": "1000.0.0",
"version": "0.51.0",
"description": "A framework for building native apps using React",
"license": "BSD-3-Clause",
"repository": {
@@ -207,4 +207,4 @@
"shelljs": "^0.7.8",
"sinon": "^2.2.0"
}
}
}