Compare commits

...
30 Commits
Author SHA1 Message Date
Chirag Jain 099410b8f6 fix lint error 2018-05-08 12:53:49 -04:00
Chirag Jain c7d453d516 fix watchman installation issues 2018-05-08 12:15:45 -04:00
Mike Grabowski 370bcffba7 [0.55.4] Bump version numbers 2018-04-27 18:34:36 +02:00
shockdesignandMike Grabowski 5bb2e83f65 Switch equality check in BlobModule.java
Summary:
Switch the equality check to avoid crash on the first item. The check can be on a null object and return the correct result.

Fixes #18709

Just a simple switch on equals, to make sure we're not bombing out by having a null scheme.

No related PRs and does not require a document change.

[ANDROID][BUGFIX][BlobModule] Switch equality check in BlobModule.java
Closes https://github.com/facebook/react-native/pull/18893

Differential Revision: D7658036

Pulled By: hramos

fbshipit-source-id: db61b98dae178dbbb645070f7b0d73ab43d30541
2018-04-27 18:33:33 +02:00
Gabriele MondadaandMike Grabowski f8091fac04 fix use of C++ syntax in an header file
Summary:
All public header files can be included from Obj-C and Swift, except RCTSurfaceSizeMeasureMode.h which contains C++ code.

Change is trivial and can be validated by review.

None.

[IOS][BUGFIX][{RCTSurfaceSizeMeasureMode.h}] - fix use of C++ syntax in an header file that could be included from Obj-C and Swift
Closes https://github.com/facebook/react-native/pull/18730

Differential Revision: D7550290

Pulled By: shergin

fbshipit-source-id: 3835e2c57697a067ff94afdaeaca06bce132ef66
2018-04-27 18:33:01 +02:00
Mehdi MulaniandMike Grabowski e187b07690 Properly tear down the reachabilityRef in RCTNetInfo
Summary: The pull request that added this (#17397) simply forgot to remove the callback, which would cause crashes if the RCTNetInfo module was ever deallocated. While that usually doesn't happen in apps, it can if the user logs out and you need to wipe all the RCT modules (to remove user data, for instance).

Reviewed By: PeteTheHeat

Differential Revision: D7322999

fbshipit-source-id: e49ec7311b39920f7b7743a5854c0dda1dbccc73
2018-04-27 18:32:54 +02:00
Mike Grabowski 2845a8661c [0.55.3] Bump version numbers 2018-04-17 13:43:40 -07:00
Eric RozellandMike Grabowski 31a1b72d73 Revert "Remove Platform check from WebSocket module"
Summary:
This reverts commit b9be28915c.

Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Fix #18696

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

Run Jest tests.
Run WebSocket example from RNTester on Android.

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[CATEGORY] [TYPE] [LOCATION] - Message

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
[ANDROID][BUGFIX][WebSocketModule] - revert change that regresses WebSocketModule
Closes https://github.com/facebook/react-native/pull/18733

Differential Revision: D7548850

Pulled By: hramos

fbshipit-source-id: b8c79810c1cd6e5a30ec4118bd5ff8ad719f04b9
2018-04-17 13:43:19 -07:00
Gustav AhlbergandMike Grabowski 4fc2886e1f exclude React/Fabric/ from core
Summary:
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

React native does not build on iOS when using Podspec environment. I tried the solution proposed in https://github.com/facebook/react-native/issues/18683 and got it to build.

Fixes https://github.com/facebook/react-native/issues/18683

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[IOS] [BUGFIX] [React.podspec] - Exclude `React/Fabric/*` from Core subspec
<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/18688

Differential Revision: D7505267

Pulled By: hramos

fbshipit-source-id: 8e7138ee966d08209a74193e418feaecceefb86a
2018-04-17 13:42:58 -07:00
Mike Grabowski a05f85172e [0.55.2] Bump version numbers 2018-04-06 18:20:54 +02:00
Mike GrabowskiandGitHub a716e324a3 Revert temporarily to old launching logic 2018-04-06 18:16:55 +02:00
Mike Grabowski 7fdf9d2efb Fix deprecation warnings 2018-04-06 18:13:33 +02:00
Mike Grabowski c2c4f486a2 Revert "Fix: Added scroll Bounds check in scrollToOffset method in RCTScrollView on iOS"
This reverts commit 16c9e5b715.
2018-04-06 18:10:34 +02:00
Mike Grabowski 44f19f745b [0.55.1] Bump version numbers 2018-04-05 23:56:49 +02:00
Brian VaughnandMike Grabowski f7f0a22083 React sync for revisions 9d484ed...1c2876d
Reviewed By: gaearon

Differential Revision: D7500761

fbshipit-source-id: 8dc1cda879942fc4990b23144a616039fdbe6dc0
2018-04-05 23:46:51 +02:00
Héctor RamosandMike Grabowski 69c77d6492 React sync for revisions ced176e...9d484ed
Reviewed By: bvaughn

Differential Revision: D7338640

fbshipit-source-id: e2d75d2f1795fb3c37f193d15216951c707711d9
2018-04-05 23:46:44 +02:00
Brian VaughnandMike Grabowski 73ffa6003a React sync for revisions ad9544f...ced176e
Reviewed By: sebmarkbage

Differential Revision: D7281277

fbshipit-source-id: 75a638114cf2a65a5c973dbdf218f6d3ba042cc4
2018-04-05 23:46:37 +02:00
Mike Grabowski b1bddd7952 Revert "React sync for revisions 9d484ed...1c2876d"
This reverts commit 54f23f4b3c.
2018-04-05 23:45:58 +02:00
Brian VaughnandMike Grabowski 54f23f4b3c React sync for revisions 9d484ed...1c2876d
Reviewed By: gaearon

Differential Revision: D7500761

fbshipit-source-id: 8dc1cda879942fc4990b23144a616039fdbe6dc0
2018-04-05 23:43:48 +02:00
Mike GrabowskiandGitHub ab5db0c81c Fix runIOS CFBundleIdentifier
Copying https://github.com/facebook/react-native/pull/18700
2018-04-05 23:36:07 +02:00
Mike GrabowskiandGitHub 589eae1432 Fixes runIOS regressions #18681 2018-04-05 23:30:39 +02:00
Mike Grabowski 2e384184bc [0.55.0] Bump version numbers 2018-04-03 16:58:34 +02:00
Danny CochranandMike Grabowski 3d69b5ce5c Pass invertStickyHeaders to ScrollView
Summary:
invertStickyHeaders was being set to "this.props.inverted" -- it should just inherit from the props of VirtualizedList instead, per discussion in https://github.com/facebook/react-native/issues/18471

Fixes #18471

Pass "invertStickyHeaders: false" to a SectionList (or FlatList), and expect that your sticky headers stick to the bottom of the ScrollView, instead of the top.

none

[ANDROID] [BUGFIX] [SectionList] - invertStickyHeaders can now be set from SectionList or FlatList.
Closes https://github.com/facebook/react-native/pull/18524

Differential Revision: D7386163

Pulled By: hramos

fbshipit-source-id: 3b66dfca280e657303f69f98c5a8bc0df033f9f7
2018-04-03 16:57:52 +02:00
Mike Grabowski c70578ab76 [0.55.0-rc.2] Bump version numbers 2018-03-28 19:12:20 +02:00
Janic DuplessisandMike Grabowski 093a78d99d Fix blob response parsing for empty body on iOS
Summary:
We currently handle empty body poorly in the iOS blob implementation, this happens because of an early return that cause the blob response to not be processed by the blob module, resulting in an empty string as the body instead of a blob object. We also need to make sure to create an empty blob object when data is nil (empty body) as per the XMLHttpRequest spec. The Android implementation was already handling this properly.

Fixes #18223

Send a HEAD request

```js
fetch('https://apipre.monkimun.com/whoami', {
  body: null,
  method: 'HEAD',
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
})
```

[IOS][BUGFIX][Blob] - Fix blob response parsing for empty body
Closes https://github.com/facebook/react-native/pull/18547

Differential Revision: D7415950

Pulled By: hramos

fbshipit-source-id: 56860532c6171255869f02a0960f55d155184a46
2018-03-28 19:12:09 +02:00
Eric SamelsonandMike Grabowski 8a6ab14200 fix ReadableNativeMap.toHashMap() for nested maps and arrays
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Commit https://github.com/facebook/react-native/commit/7891805d22e3fdc821961ff0ccc5c450c3d625c8 broke the previous behavior of `ReadableNativeMap.toHashMap()` for nested maps and arrays. Previously, all nested `ReadableNativeMap`s and `ReadableNativeArray`s were recursively converted to `HashMap`s and `ArrayList`s, but this is lost when only `getLocalMap()` is returned.

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

Call `ReadableNativeMap.toHashMap()` on a map with values of type `ReadableNativeMap` and `ReadableNativeArray`. Verify the returned hash map has these converted to `HashMap` and `ArrayList`, respectively.

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BUGFIX] [ReadableNativeMap] - Fix toHashMap() for nested maps and arrays

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/18455

Reviewed By: kathryngray

Differential Revision: D7347344

Pulled By: mdvacca

fbshipit-source-id: af2bca9dec6c0cb8a7da099b6757434fcc3ac785
2018-03-28 19:12:05 +02:00
Mike Grabowski b20827250e [0.55.0-rc.1] Bump version numbers 2018-03-20 21:50:22 +01:00
Mike Grabowski ca8ce83cc3 Fix issues with pollParams and link 2018-03-20 21:43:47 +01:00
Héctor RamosandMike Grabowski 85b690fb22 React sync for revisions ab4280b...ad9544f
Reviewed By: bvaughn

Differential Revision: D7256390

fbshipit-source-id: 9fe1324da93cb8f4a7f478e1037944774b9b95ff
2018-03-20 21:39:49 +01:00
Mike Grabowski 9c29faf6a9 [0.55.0-rc.0] Bump version numbers 2018-03-12 23:53:13 +01:00
28 changed files with 5580 additions and 3774 deletions
+27 -23
View File
@@ -157,7 +157,7 @@ aliases:
- &run-js-tests
name: JavaScript Test Suite
command: yarn test-ci
- &run-lint-checks
name: Lint code
command: yarn lint --format junit -o ~/react-native/reports/junit/js-lint-results.xml
@@ -174,7 +174,7 @@ aliases:
./scripts/circleci/check_license.sh
./scripts/circleci/check_cache.sh
when: always
- &build-android-app
name: Build Android App
command: |
@@ -184,7 +184,7 @@ aliases:
- &create-avd
name: Create Android Virtual Device
command: source scripts/circle-ci-android-setup.sh && createAVD
- &launch-avd
name: Launch Android Virtual Device in Background
command: source scripts/circle-ci-android-setup.sh && launchAVD
@@ -210,11 +210,11 @@ aliases:
- &run-android-instrumentation-tests
name: Run Instrumentation Tests
command: |
if [[ ! -e ReactAndroid/src/androidTest/assets/AndroidTestBundle.js ]]; then
if [[ ! -e ReactAndroid/src/androidTest/assets/AndroidTestBundle.js ]]; then
echo "JavaScript bundle missing, cannot run instrumentation tests. Verify build-js-bundle step completed successfully."; exit 1;
fi
source scripts/circle-ci-android-setup.sh && NO_BUCKD=1 retry3 timeout 300 buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS
- &collect-android-test-results
name: Collect Test Results
command: |
@@ -225,9 +225,9 @@ aliases:
- &setup-artifacts
name: Initial Setup
command: |
command: |
mkdir -p ~/react-native/reports/junit/
- &run-objc-ios-tests
name: iOS Test Suite
command: ./scripts/objc-test-ios.sh test
@@ -345,6 +345,8 @@ jobs:
at: ~/react-native
- run: xcrun instruments -w "iPhone 5s (11.1)" || true
# See https://github.com/Homebrew/homebrew-core/issues/26358.
- run: brew upgrade python > /dev/null
- run: brew install watchman
- run: *run-objc-ios-tests
@@ -359,6 +361,8 @@ jobs:
at: ~/react-native
- run: xcrun instruments -w "Apple TV 1080p (11.1)" || true
# See https://github.com/Homebrew/homebrew-core/issues/26358.
- run: brew upgrade python > /dev/null
- run: brew install watchman
- run: *run-objc-tvos-tests
@@ -386,14 +390,14 @@ jobs:
at: ~/react-native
- run: ./scripts/process-podspecs.sh
# Publishes new version onto npm
publish_npm_package:
<<: *android_defaults
steps:
# Checkout code so that we can work with `git` in publish.js
- checkout
# Configure Android SDK and related dependencies
- run: *configure-android-path
- run: *install-android-build-dependencies
@@ -424,7 +428,7 @@ jobs:
- restore-cache: *restore-yarn-cache
- run: *yarn
- save-cache: *save-yarn-cache
- run:
name: Publish React Native Package
command: |
@@ -435,7 +439,7 @@ jobs:
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" > ~/.netrc
node ./scripts/publish-npm.js
else
echo "Skipping deploy."
echo "Skipping deploy."
fi
# Set up an Android environment for downstream jobs
@@ -454,7 +458,7 @@ jobs:
- run: *validate-android-sdk
# Starting emulator in advance as it takes some time to boot.
# Starting emulator in advance as it takes some time to boot.
- run: *create-avd
- run: *launch-avd
@@ -494,7 +498,7 @@ jobs:
# Test Suite
- run: *run-android-unit-tests
- run: *run-android-instrumentation-tests
# post (always runs)
- run: *collect-android-test-results
- store_test_results:
@@ -520,7 +524,7 @@ jobs:
cd bots
yarn install --non-interactive --cache-folder ~/.cache/yarn
else
echo "Skipping dependency installation."
echo "Skipping dependency installation."
fi
- save-cache: *save-cache-analysis
@@ -531,7 +535,7 @@ jobs:
if [ -n "$CIRCLE_PR_NUMBER" ]; then
cd bots && DANGER_GITHUB_API_TOKEN="b186c9a82bab3b08ec80""c0818117619eec6f281a" yarn danger
else
echo "Skipping pull request analysis."
echo "Skipping pull request analysis."
fi
when: always
- run:
@@ -541,7 +545,7 @@ jobs:
if [ -n "$CIRCLE_PR_NUMBER" ]; then
cat <(echo eslint; yarn --silent lint --format=json; echo flow; yarn --silent flow check --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" CI_USER=$CIRCLE_PROJECT_USERNAME CI_REPO=$CIRCLE_PROJECT_REPONAME PULL_REQUEST_NUMBER=$CIRCLE_PR_NUMBER node bots/code-analysis-bot.js
else
echo "Skipping code analysis."
echo "Skipping code analysis."
fi
when: always
@@ -600,16 +604,16 @@ workflows:
# Checkout repo and run Yarn
- checkout_code:
filters: *filter-ignore-master-stable
# Run code checks
- analyze_pr:
- analyze_pr:
filters: *filter-ignore-master-stable
requires:
requires:
- checkout_code
# Only runs on NN-stable branches
deploy:
jobs:
jobs:
# If we are on a stable branch, wait for approval to deploy to npm
- approve_publish_npm_package:
filters: *filter-only-stable
@@ -619,9 +623,9 @@ workflows:
requires:
- approve_publish_npm_package
# These tests are flaky or are yet to be fixed. They are placed on their own
# These tests are flaky or are yet to be fixed. They are placed on their own
# workflow to avoid marking benign PRs as broken.
# To run them, uncomment the entire block and open a PR (do not merge).
# To run them, uncomment the entire block and open a PR (do not merge).
# Once a test is fixed, move the test definition to the 'tests' workflow.
# disabled_tests:
# jobs:
@@ -629,7 +633,7 @@ workflows:
# - checkout_code:
# filters: *filter-ignore-gh-pages
# # The following were DISABLED because they have not run since
# # The following were DISABLED because they have not run since
# # the migration from Travis, and they have broken since then,
# # CocoaPods
# - test_podspec:
+3
View File
@@ -258,6 +258,9 @@ RCT_EXPORT_METHOD(release:(NSString *)blobId)
- (id)handleNetworkingResponse:(NSURLResponse *)response data:(NSData *)data
{
// An empty body will have nil for data, in this case we need to return
// an empty blob as per the XMLHttpRequest spec.
data = data ?: [NSData new];
return @{
@"blobId": [self store:data],
@"offset": @0,
+2 -2
View File
@@ -12,7 +12,7 @@
exports.version = {
major: 0,
minor: 0,
patch: 0,
minor: 55,
patch: 4,
prerelease: null,
};
+4 -1
View File
@@ -899,7 +899,10 @@ class VirtualizedList extends React.PureComponent<Props, State> {
onScrollEndDrag: this._onScrollEndDrag,
onMomentumScrollEnd: this._onMomentumScrollEnd,
scrollEventThrottle: this.props.scrollEventThrottle, // TODO: Android support
invertStickyHeaders: this.props.inverted,
invertStickyHeaders:
this.props.invertStickyHeaders !== undefined
? this.props.invertStickyHeaders
: this.props.inverted,
stickyHeaderIndices,
};
if (inversionStyle) {
+1
View File
@@ -164,6 +164,7 @@ RCT_EXPORT_METHOD(getCurrentConnectivity:(RCTPromiseResolveBlock)resolve
reject:(__unused RCTPromiseRejectBlock)reject)
{
SCNetworkReachabilityRef reachability = [self getReachabilityRef];
SCNetworkReachabilityUnscheduleFromRunLoop(reachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);
CFRelease(reachability);
resolve(@{@"connectionType": _connectionType ?: RCTConnectionTypeUnknown,
@"effectiveConnectionType": _effectiveConnectionType ?: RCTEffectiveConnectionTypeUnknown,
+4 -4
View File
@@ -439,10 +439,6 @@ RCT_EXPORT_MODULE()
{
RCTAssertThread(_methodQueue, @"sendData: must be called on method queue");
if (data.length == 0) {
return;
}
id responseData = nil;
for (id<RCTNetworkingResponseHandler> handler in _responseHandlers) {
if ([handler canHandleNetworkingResponse:responseType]) {
@@ -452,6 +448,10 @@ RCT_EXPORT_MODULE()
}
if (!responseData) {
if (data.length == 0) {
return;
}
if ([responseType isEqualToString:@"text"]) {
// No carry storage is required here because the entire data has been loaded.
responseData = [RCTNetworking decodeTextData:data fromResponse:task.response withCarryData:nil];
+1 -1
View File
@@ -1 +1 @@
ab4280b3e98dbb97d3e753083dab19879167c3f5
1c2876d5b558b8591feb335d8d7204bc46f7da8a
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -12,7 +12,7 @@
const ReactFeatureFlags = {
debugRenderPhaseSideEffects: false,
debugRenderPhaseSideEffectsForStrictMode: false,
warnAboutDeprecatedLifecycles: true,
warnAboutDeprecatedLifecycles: false,
};
module.exports = ReactFeatureFlags;
+1 -16
View File
@@ -86,27 +86,12 @@ type SecretInternalsType = {
// And how much information to fill in for the above types.
};
declare class ReactNativeComponent<Props, State = void>
extends React$Component<Props, State> {
blur(): void,
focus(): void,
measure(callback: MeasureOnSuccessCallback): void,
measureInWindow(callback: MeasureInWindowOnSuccessCallback): void,
measureLayout(
relativeToNativeNode: number,
onSuccess: MeasureLayoutOnSuccessCallback,
onFail: () => void,
): void,
setNativeProps(nativeProps: Object): void,
}
/**
* Flat ReactNative renderer bundles are too big for Flow to parse efficiently.
* Provide minimal Flow typing for the high-level RN API and call it a day.
*/
export type ReactNativeType = {
NativeComponent: typeof ReactNativeComponent,
NativeComponent: any,
findNodeHandle(componentOrHandle: any): ?number,
render(
element: React$Element<any>,
+9 -7
View File
@@ -62,7 +62,7 @@ export type ReactProvider<T> = {
export type ReactProviderType<T> = {
$$typeof: Symbol | number,
context: ReactContext<T>,
_context: ReactContext<T>,
};
export type ReactConsumer<T> = {
@@ -72,7 +72,7 @@ export type ReactConsumer<T> = {
ref: null,
props: {
children: (value: T) => ReactNodeList,
bits?: number,
unstable_observedBits?: number,
},
};
@@ -80,10 +80,12 @@ export type ReactContext<T> = {
$$typeof: Symbol | number,
Consumer: ReactContext<T>,
Provider: ReactProviderType<T>,
calculateChangedBits: ((a: T, b: T) => number) | null,
defaultValue: T,
currentValue: T,
changedBits: number,
_calculateChangedBits: ((a: T, b: T) => number) | null,
_defaultValue: T,
_currentValue: T,
_changedBits: number,
// DEV only
_currentRenderer?: Object | null,
@@ -99,5 +101,5 @@ export type ReactPortal = {
};
export type RefObject = {|
value: any,
current: any,
|};
+2 -1
View File
@@ -14,6 +14,7 @@ const EventTarget = require('event-target-shim');
const NativeEventEmitter = require('NativeEventEmitter');
const BlobManager = require('BlobManager');
const NativeModules = require('NativeModules');
const Platform = require('Platform');
const WebSocketEvent = require('WebSocketEvent');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
@@ -202,7 +203,7 @@ class WebSocket extends EventTarget(...WEBSOCKET_EVENTS) {
}
_close(code?: number, reason?: string): void {
if (WebSocketModule.close.length === 3) {
if (Platform.OS === 'android') {
// See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
const statusCode = typeof code === 'number' ? code : CLOSE_NORMAL;
const closeReason = typeof reason === 'string' ? reason : '';
+1
View File
@@ -51,6 +51,7 @@ Pod::Spec.new do |s|
"React/Inspector/*",
"ReactCommon/yoga/*",
"React/Cxx*/*",
"React/Fabric/*",
ss.ios.exclude_files = "React/**/RCTTV*.*"
ss.tvos.exclude_files = "React/Modules/RCTClipboard*",
"React/Views/RCTDatePicker*",
+2 -2
View File
@@ -21,8 +21,8 @@ static void __makeVersion()
{
__rnVersion = @{
RCTVersionMajor: @(0),
RCTVersionMinor: @(0),
RCTVersionPatch: @(0),
RCTVersionMinor: @(55),
RCTVersionPatch: @(4),
RCTVersionPrerelease: [NSNull null],
};
}
@@ -73,8 +73,8 @@ RCT_NOT_IMPLEMENTED(- (nullable instancetype)initWithCoder:(NSCoder *)coder)
RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
self.bounds.size,
_sizeMeasureMode,
minimumSize,
maximumSize
&minimumSize,
&maximumSize
);
[_surface setMinimumSize:minimumSize
@@ -110,8 +110,8 @@ RCT_NOT_IMPLEMENTED(- (nullable instancetype)initWithCoder:(NSCoder *)coder)
RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
size,
_sizeMeasureMode,
minimumSize,
maximumSize
&minimumSize,
&maximumSize
);
return [_surface sizeThatFitsMinimumSize:minimumSize
@@ -28,6 +28,6 @@ typedef NS_OPTIONS(NSInteger, RCTSurfaceSizeMeasureMode) {
RCT_EXTERN void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
CGSize size,
RCTSurfaceSizeMeasureMode sizeMeasureMode,
CGSize &minimumSize,
CGSize &maximumSize
CGSize *minimumSize,
CGSize *maximumSize
);
@@ -12,25 +12,25 @@
void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode(
CGSize size,
RCTSurfaceSizeMeasureMode sizeMeasureMode,
CGSize &minimumSize,
CGSize &maximumSize
CGSize *minimumSize,
CGSize *maximumSize
) {
minimumSize = CGSizeZero;
maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);
*minimumSize = CGSizeZero;
*maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) {
minimumSize.width = size.width;
maximumSize.width = size.width;
minimumSize->width = size.width;
maximumSize->width = size.width;
}
else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) {
maximumSize.width = size.width;
maximumSize->width = size.width;
}
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) {
minimumSize.height = size.height;
maximumSize.height = size.height;
minimumSize->height = size.height;
maximumSize->height = size.height;
}
else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) {
maximumSize.height = size.height;
maximumSize->height = size.height;
}
}
-3
View File
@@ -575,9 +575,6 @@ static inline void RCTApplyTransformationAccordingLayoutDirection(UIView *view,
- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated
{
if (!CGPointEqualToPoint(_scrollView.contentOffset, offset)) {
CGFloat maxOffsetX = _scrollView.contentSize.width - _scrollView.bounds.size.width + _scrollView.contentInset.right;
CGFloat maxOffsetY = _scrollView.contentSize.height - _scrollView.bounds.size.height + _scrollView.contentInset.bottom;
offset = CGPointMake(MAX(0, MIN(maxOffsetX, offset.x)), MAX(0, MIN(maxOffsetY, offset.y)));
// Ensure at least one scroll event will fire
_allowNextScrollNoMatterWhat = YES;
[_scrollView setContentOffset:offset animated:animated];
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0-master
VERSION_NAME=0.55.4
GROUP=com.facebook.react
POM_NAME=ReactNative
@@ -11,6 +11,7 @@ import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
import java.util.HashMap;
import java.util.Iterator;
import com.facebook.infer.annotation.Assertions;
import javax.annotation.Nullable;
@@ -248,7 +249,31 @@ public class ReadableNativeMap extends NativeMap implements ReadableMap {
}
return hashMap;
}
return getLocalMap();
// we can almost just return getLocalMap(), but we need to convert nested arrays and maps to the
// correct types first
HashMap<String, Object> hashMap = new HashMap<>(getLocalMap());
Iterator iterator = hashMap.keySet().iterator();
while (iterator.hasNext()) {
String key = (String) iterator.next();
switch (getType(key)) {
case Null:
case Boolean:
case Number:
case String:
break;
case Map:
hashMap.put(key, Assertions.assertNotNull(getMap(key)).toHashMap());
break;
case Array:
hashMap.put(key, Assertions.assertNotNull(getArray(key)).toArrayList());
break;
default:
throw new IllegalArgumentException("Could not convert object with key: " + key + ".");
}
}
return hashMap;
}
/**
@@ -79,7 +79,7 @@ public class BlobModule extends ReactContextBaseJavaModule {
@Override
public boolean supports(Uri uri, String responseType) {
String scheme = uri.getScheme();
boolean isRemote = scheme.equals("http") || scheme.equals("https");
boolean isRemote = "http".equals(scheme) || "https".equals(scheme);
return (!isRemote && responseType.equals("blob"));
}
@@ -16,7 +16,7 @@ import java.util.Map;
public class ReactNativeVersion {
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
"major", 0,
"minor", 0,
"patch", 0,
"minor", 55,
"patch", 4,
"prerelease", null);
}
+11 -11
View File
@@ -37,7 +37,9 @@ log.heading = 'rnpm-link';
const dedupeAssets = (assets) => uniqBy(assets, asset => path.basename(asset));
const linkDependency = (platforms, project, dependency) => {
const linkDependency = async (platforms, project, dependency) => {
const params = await pollParams(dependency.config.params);
Object.keys(platforms || {})
.forEach(platform => {
if (!project[platform] || !dependency.config[platform]) {
@@ -56,18 +58,16 @@ const linkDependency = (platforms, project, dependency) => {
return null;
}
return pollParams(dependency.config.params).then(params => {
log.info(`Linking ${dependency.name} ${platform} dependency`);
log.info(`Linking ${dependency.name} ${platform} dependency`);
linkConfig.register(
dependency.name,
dependency.config[platform],
params,
project[platform]
);
linkConfig.register(
dependency.name,
dependency.config[platform],
params,
project[platform]
);
log.info(`Platform '${platform}' module ${dependency.name} has been successfully linked`);
});
log.info(`Platform '${platform}' module ${dependency.name} has been successfully linked`);
});
};
+8 -11
View File
@@ -24,7 +24,7 @@ const getBuildPath = function (configuration = 'Debug', appName, isDevice) {
device = 'iphonesimulator';
}
return `Build/Products/${configuration}-${device}/${appName}.app`;
return `build/Build/Products/${configuration}-${device}/${appName}.app`;
};
const xcprettyAvailable = function() {
try {
@@ -115,22 +115,19 @@ function runOnSimulator(xcodeProject, args, scheme) {
if (!selectedSimulator.booted) {
const simulatorFullName = formattedDeviceName(selectedSimulator);
console.log(`Booting ${simulatorFullName}...`);
console.log(`Launching ${simulatorFullName}...`);
try {
child_process.execFileSync('xcrun', ['simctl', 'boot', selectedSimulator.udid]);
child_process.spawnSync('xcrun', ['instruments', '-w', selectedSimulator.udid]);
} catch (e) {
throw new Error(
`Could not boot ${args.simulator} simulator. Is there already a simulator running?
Running multiple simulators is only supported from Xcode 9 and up.
Try closing the simulator or run the command again without specifying a simulator.`
);
// instruments always fail with 255 because it expects more arguments,
// but we want it to only launch the simulator
}
}
buildProject(xcodeProject, selectedSimulator.udid, scheme, args.configuration, args.packager, args.verbose)
.then((appName) => resolve(selectedSimulator.udid, appName));
buildProject(xcodeProject, selectedSimulator.udid, scheme, args.configuration, args.packager, args.verbose, args.port)
.then((appName) => resolve({ udid: selectedSimulator.udid, appName }));
})
.then((udid, appName) => {
.then(({udid, appName}) => {
if (!appName) {
appName = scheme;
}
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "react-native",
"version": "1000.0.0",
"version": "0.55.4",
"description": "A framework for building native apps using React",
"license": "MIT",
"repository": {
@@ -142,7 +142,7 @@
"react-native": "local-cli/wrong-react-native.js"
},
"peerDependencies": {
"react": "^16.3.0-alpha.0"
"react": "16.3.1"
},
"dependencies": {
"absolute-path": "^0.0.0",
@@ -219,9 +219,9 @@
"jest": "22.4.2",
"jest-junit": "3.6.0",
"prettier": "1.9.1",
"react": "^16.3.0-alpha.1",
"react-test-renderer": "^16.3.0-alpha.1",
"react": "16.3.1",
"react-test-renderer": "16.3.1",
"shelljs": "^0.7.8",
"sinon": "^2.2.0"
}
}
}