Summary:
Currently `SafeAreaView` works only on iOS 11, because implemented in terms of native safeArea API, that not exists in older iOS versions. But this make it hard to use the component in real applications, because content will be under top bars on older versions of iOS and no reliable way to workaround this in js. More motivation in #17638
This changeset emulate safe area in terms of `UIViewController` layout guides API if safeArea not available.
Fixes#17638, #18255
I run RNTester with these simulators: iPhone6 (9.3), iPhone6 (10.0), iPhone6 (11.2), iPhoneX (11.2)
- Start RNTester application
- Look on top header, it should not overlap status bar
- Go to the `<SafeAreaView>` example, open modal
- Modal area should not overlap status bar
<img src="http://vovkasm.skitch.vovkasm.org/iPhone6_10_20662C5B.png" width="40%"> <img src="http://vovkasm.skitch.vovkasm.org/iPhone6_11_20662CC8.png" width="40%">
<img src="http://vovkasm.skitch.vovkasm.org/iPhone6_10_pr_20662DE6.png" width="40%"> <img src="http://vovkasm.skitch.vovkasm.org/iPhone6_11_pr_20662DA8.png" width="40%">
[IOS] [BUGFIX] [SafeAreaView] - Make SafeAreaView to work on iOS < 11
Pull Request resolved: https://github.com/facebook/react-native/pull/18534
Reviewed By: PeteTheHeat, shergin
Differential Revision: D9166052
Pulled By: hramos
fbshipit-source-id: c086e1ae4af13110a7453b770ca75b6e0d5321ea
Summary: Reverting due to problems with prepack.
Reviewed By: gaearon
Differential Revision: D9482931
fbshipit-source-id: 0ec5d0fb80dab32a07521a465dd2a501e6bb4d30
Summary:
This pull request addresses the failing publish-npm.js script from earlier this week. For background, last month we reset all npm access tokens for any package related to Facebook, and we now require all accounts with publish permissions to have two factor enabled.
The publish-npm.js script relied on one such token that is configured in Circle CI as a envvar. The token has been updated in Circle CI, but we now need a way of passing the one time password to npm.
With this PR, we can now grab the otp from Circle CI's envvars. Considering otps are ephemeral, this requires the NPM_CONFIG_OTP envvar to be set by someone with publishing permissions anytime a new release will be pushed to npm. The token is short lived, but it would still be good to clear the envvar after the package is published. Circle CI envvars are not passed on to PR/forked builds.
This PR is effectively a breaking change for the release process, as the publish step will not succeed if the OTP is not valid.
OTPs are short-lived, and the publish_npm_package job will definitely outlive the token. Unfortunately this will require some timing to get right, but the alternative is to ssh into the Circle CI machine and re-run the `npm publish --otp` command, which again would still require someone with publish access to provide the otp.
Pull Request resolved: https://github.com/facebook/react-native/pull/20701
Differential Revision: D9478488
Pulled By: hramos
fbshipit-source-id: 6af631a9cb425271b98c03d158aec390ebc95304
Summary:
Bump android gradle plugin to 3.1.4. We have been stay to 2.x too long. With 3.x we can have instant run and great performance and new features brought by google.
Also thanks to CFKevinRef great pr to make this possible.
pass all current ci. I have also tested RNTester release version works without crash.
https://github.com/facebook/react-native/pull/17967.
[GENERAL] [ANDROID] [FEATURE] - bump android gradle to 3.1.4
Pull Request resolved: https://github.com/facebook/react-native/pull/20767
Differential Revision: D9437576
Pulled By: hramos
fbshipit-source-id: 6084056a1390582a75a879918f2538b0480f6299
Summary:
I found that android support library 27.x (874cca1ac2) requires compileSdkVersion to be 27. Also found that many FB projects use SDK 27.
Pull Request resolved: https://github.com/facebook/react-native/pull/20777
Differential Revision: D9478431
Pulled By: hramos
fbshipit-source-id: ca100f6b5b39e7d112926124423f9510a0efc291
Summary:
[DOCS] [BUGFIX] [react-native-cli/README.md] - fixed sinopia configuration docs
now that babel uses scoped packages the extra sinpoia config also
requires the rule to cover ** which will satisfy such repositories like
babel/core
The only other issue I had with getting started using this doc was node-gyp being an absolute horror to get running (a dependancy of sinpoia) I don't really know if writing debugging tips/links for macos in these docs is relevant.
Pull Request resolved: https://github.com/facebook/react-native/pull/20789
Differential Revision: D9468340
Pulled By: hramos
fbshipit-source-id: c7a41f384655b36e5e46b39d1e7e14313cab9f68
Summary:
Fixes#20769
Release notes
--------------
[CLI] [BUGFIX] [local-cli/server/checkNodeVersion.js] - Disable auto-formatting in `local-cli/server/checkNodeVersion.js` since it introduces ES6 and ES7 syntax (trailing comma in argument list) which in turn makes ES5 engines crash with a `SyntaxError`.
Pull Request resolved: https://github.com/facebook/react-native/pull/20779
Differential Revision: D9468346
Pulled By: hramos
fbshipit-source-id: 24761a377a5fd104e11ed6b6e86da15e96a0e38b
Summary:
@public
This diff fixes the `projectRoot` calculation on React Native when the app does not have a config file. This should fix the issues reported in https://github.com/facebook/react-native/issues/20712
Reviewed By: hramos
Differential Revision: D9444982
fbshipit-source-id: 4cb41fa5224d2addf92976cc119e49dea6a6346b
Summary: This diff moves the prop-type definitions for View out into it's own file. We will be able to do this with a bunch of the prop-type definitions and then move them out into a deprecated npm package.
Reviewed By: yungsters
Differential Revision: D9444394
fbshipit-source-id: 4fd0a78533211b598ba2da4eb5015ffcc20bb675
Summary: When running a trace, reduce the noise from the `__DEV__`-only `ForwardRef(View)` elements.
Reviewed By: ejanzer
Differential Revision: D9445865
fbshipit-source-id: 7cfe87bab6dd62d3800d2ca239724b5063c55c89
Summary:
Elevation should be supported by the native driver as it's a non-layout prop.
Pull Request resolved: https://github.com/facebook/react-native/pull/20739
Differential Revision: D9468318
Pulled By: hramos
fbshipit-source-id: f8b8ca7536968ab8f6229c134fd169c321ccc651
Summary:
This PR removes TextLayoutBuilder, which is not used anywhere.
Pull Request resolved: https://github.com/facebook/react-native/pull/20600
Reviewed By: achen1
Differential Revision: D9367345
Pulled By: hramos
fbshipit-source-id: 407a6a80f5c69650fcc7167b28214f7315beed2f
Summary: This caught a few flow types that weren't defined for attributes that Android exposes. Ensuring that these stay in sync will be necessary for codegen in the future.
Reviewed By: sahrens
Differential Revision: D9444165
fbshipit-source-id: 8ee00af7b732c35d7f6befcdf79f77b73eac6a1b
Summary:
As we add js view configs to our view managers, we want this type to be a little bit more strict.
This will be especially useful as we start removing certain keys (like NativeProps) which aren't actually necessary, this will make sure we remove them everywhere.
Reviewed By: yungsters
Differential Revision: D9416905
fbshipit-source-id: 6b12e38b9d56969a81ec5d4f2920298e4919f7be
Summary: Moving this config to native for android so we skip the native lookup for the config.
Reviewed By: yungsters
Differential Revision: D9415726
fbshipit-source-id: 84cac3f0dfa4f6ea8800de77676f1e2896ee463d
Summary:
Description:
------------
While creating a custom component I added a prop `style: ?ViewStyleProp`. When I tried to pass the following object
```
style={{
opacity: new Animated.Value(0),
}}
```
to this `style` prop I received a yellow box with the warning:
```
Warning: Failed prop type: Invalid prop `opacity` of type `object` supplied to `MyComponent`, expected `number`.
```
Then I browsed through the source code and found an inconsistency in types checks. Namely,
https://github.com/facebook/react-native/blob/master/Libraries/StyleSheet/StyleSheetTypes.js#L158 has the following declaration `opacity?: number | AnimatedNode`, whereas https://github.com/facebook/react-native/blob/master/Libraries/Components/View/ViewStylePropTypes.js#L50 is willing to accept **only** a `number`: `opacity: ReactPropTypes.number`.
Pull Request resolved: https://github.com/facebook/react-native/pull/20773
Differential Revision: D9464634
Pulled By: TheSavior
fbshipit-source-id: fa21f706cb890dbeec136f1c4fab468904cd284b
Summary:
Per [this comment on the issue](https://github.com/facebook/react-native/issues/20710#issuecomment-414631827):
> Babel by default tries to find .babelrc files to configure itself, and once it finds the one from the RN app (which links to the RN preset that only works on Babel 7) it fails.
> The easiest patch to fix this issue is to add babelrc: false to the babel-register method, so Babel does not read any additional .babelrc file.
Fixes#20710
Pull Request resolved: https://github.com/facebook/react-native/pull/20790
Differential Revision: D9458502
Pulled By: hramos
fbshipit-source-id: 3a0ed7261322fdd9e0c0840f8a3944974f38b233
Summary:
This diff adds a middleware to the RN development server to prevent processing requests coming from a third-party website.
The way we choose to do it is to block any request that has an origin header and it's different than localhost. This will still allow simulators to work properly while blocking potential external websites to do malign CORS requests.
This is just a first quick measure to block a potential attack vector while we implement full authentication in the RN development server
Reviewed By: mjesun
Differential Revision: D9238674
fbshipit-source-id: b7bdc40dabc2f4d92f5ac84515f93b89efa4e833
Summary:
We have several disabled tests in Circle, and they are not running at all.
This prevents us from seeing when a disabled test might actually be fixed, as enabling the test requires uncommenting the correct line in Circle CI's config.
In this PR, we use the existing swallow_error script to run known-failing steps, without failing the job. This will let us see the step's output in CI, without polluting PRs that have not introduced new failures to CI.
Pull Request resolved: https://github.com/facebook/react-native/pull/20775
Differential Revision: D9442412
Pulled By: hramos
fbshipit-source-id: 83c930811a559fdcf6d7b926b4073343e862d2b3
Summary:
This diff fixes the height calculation logic for the nodes with baseline. Before height calculation for baseline was done at wrong place.
The task was created due to the regression caused by D9219678.
Reviewed By: IanChilds
Differential Revision: D9421551
fbshipit-source-id: 3fbb738314130b346c4186ec45d00c9ea63bc9f4
Summary:
This PR removes infer-annotation from the repo and uses latest version of it from maven.
Pull Request resolved: https://github.com/facebook/react-native/pull/20599
Differential Revision: D9437594
Pulled By: hramos
fbshipit-source-id: 93c33041dd8a61b220c352fb187a23bb2dd1b4db
Summary:
There are multiple UI thread passes during the layout process. The first is with all of the operations from React (createView, manageChildren, etc). The second is during onCollectExtraUpdates after the layout pass, when things like Text need to be precomputed before later being sent over to the views.
The onLayoutUpdateListener needs to run AFTER onCollectExtraUpdates operations are executed, so this is now queued up in the UIViewOperationQueue
Reviewed By: mdvacca
Differential Revision: D9416260
fbshipit-source-id: d1a4eaf38a4f6c82d41def34ffb94d303e8f50d4
Summary:
The API was available only on Android (with no mention to that effect in the docs, AFAICT).
This commit adds a simple iOS implementation based on NSURLCache. It should be possible to
query the decoded image cache as well to provide higher fidelity (i.e. "disk", "memory",
"decoded") if the caller passes size, scale, etc. in addition to the image URL, but it's
probably not worth the complexity. The assumption is that callers are interested in the
durability rather than performance aspect of the returned information.
Tested with RNTester on iPhone emulator.
[IOS] [ENHANCEMENT] [Image] - Implemented queryCache
Pull Request resolved: https://github.com/facebook/react-native/pull/18782
Differential Revision: D9411533
Pulled By: hramos
fbshipit-source-id: b430263959bb5f9b8ed9e28bb0a95f8879df881a
Summary:
Commit 79e498b7fb claims that "--terminal" has been added as an argument to the "run-android" script which it hasn't. Instead it adds a new environment variable "process.env.REACT_TERMINAL" which seems to be undocumented and nowhere else in the repository.
This commit now allows Linux and OSX users to specify their custom terminal :
react-native run-android --terminal=x-terminal-emulator
Additionally the metro bundler child process "detached" option has been set to false if no terminal has been specified on Linux which fixes an issue where the packager would be running in the background and would have to manually be closed by finding the process.
Fixes#18122
Pull Request resolved: https://github.com/facebook/react-native/pull/20584
Differential Revision: D9234990
Pulled By: hramos
fbshipit-source-id: 60e4cc57b2790c419d5a4f9027add04313ddf6f8
Summary: Changes `Animated` so that the convenience components are lazily initialized.
Reviewed By: TheSavior
Differential Revision: D9394785
fbshipit-source-id: 1a2c9a9af500c02d6c91ccb5ddff341c94b17bd1
Summary: We were using a locale-specific `toUpperCase()` for accessibility roles. In the Turkish locale, `"image".toUpperCase()` does not become `"IMAGE"`; it becomes some weird turkish alphabet word, and we throw an error. This diff uses US-locale to avoid the error.
Reviewed By: YaoPersonal
Differential Revision: D9402330
fbshipit-source-id: a3fd7c54eec4b313c7e9df9236adb7ae42854ed8
Summary:
The `--reset-cache` argument was not working correctly with the `bundle` command. This ensures the `--reset-cache` arg is passed to metro.
Fixes#20703
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.
If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
Pull Request resolved: https://github.com/facebook/react-native/pull/20706
Differential Revision: D9400548
Pulled By: hramos
fbshipit-source-id: 2c7ed0226cfcdffa8cc77506500c314552baef3f
Summary:
add `packager.sh` for run-android task for unix like system. This only fix on linux and macOS.
pass all current ci.
none
[GENERAL] [BUGFIX] [CLI] - add `packager.sh` back for run-android task
Pull Request resolved: https://github.com/facebook/react-native/pull/20751
Differential Revision: D9398197
Pulled By: hramos
fbshipit-source-id: 213b066c0c034136c5ad5bbf8d45c6f331b1d185
Summary:
This diff updates the logic which reassigns `remainingFreeSpace` when the node's calculated dimension falls below min width of the node.
So we will have to update the `remainingFreeSpace` as there is more available space since the calculated nodes width is less than the min width.
I have also added comments at relevant places in the code so that it is clearer.
This diff solves the issue raised in litho support grp. The details can be found here T32199608. This diff also makes sure that it doesn't break fblite, as the earlier version broke it, details of which can be found here T32881750.
Reviewed By: IanChilds
Differential Revision: D9359026
fbshipit-source-id: 4168e385e962c168a9de9370220c75f14a6726a7
Summary: The controller you requested could not be found.
Reviewed By: gabelevi
Differential Revision: D9390604
fbshipit-source-id: 68ba89ba197f74322e4c85c3bfc1f334fb740852
Summary:
[RFC] WIP: Way to register RCT_MODULE in Plugin2.0 instead of +load
This seemed like the simplest way to do this to register in the existing
didNotFindModule callback so that we don't have to touch any opensource code.
NOTE: The new version of this fixes the problems with dylibs, but not the -ObjC flag removal. This seems like the right call to avoid users having to implement c-functions to return their classes; instead we used objc_getClass.
Reviewed By: dshahidehpour
Differential Revision: D9112719
fbshipit-source-id: cf8df97d7c443cafa0e06a1e61bdf2612944ed87
Summary:
React Native overrides the `metro.config.js` settings for, e.g., `hasteImplModulePath`, which prevents us from adding a `metro.config.js` file to the repo for `react-native-windows` to allow us to resolve Haste modules at the top-level of the repo. This change ensures that if a user has a `metro.config.js` file, those settings are not overwritten by React Native.
Pull Request resolved: https://github.com/facebook/react-native/pull/20705
Differential Revision: D9390146
Pulled By: hramos
fbshipit-source-id: 5ccc137490410ace72d7b0e68f2bafcbb233c59f
Summary:
When running Systrace, we currently only surface the JavaScript bundle that is pre-packaged in the binary.
This changes `ReactInstanceManager` so that we prefer a cached bundle if one exists. This allows running Systrace with local changes (as long as you load them into the client before running Systrace).
Differential Revision: D9389704
fbshipit-source-id: 031321b2e07539efc7f47a7c6947ab7b82dc7dfc
Summary:
kelset should we link to Discuss more prominently? There are some lightweight discussions that probably don't belong in the discussions repo.
Pull Request resolved: https://github.com/facebook/react-native/pull/20697
Differential Revision: D9386345
Pulled By: hramos
fbshipit-source-id: 53d81bcc3d9b2570a094017cc134726140e1a3bb
Summary: This allows callers of RCTTestRunner to provide custom bridge delegate for custom test run handling.
Reviewed By: jdthomas
Differential Revision: D9373947
fbshipit-source-id: fcc9080bd6962d6a0497aee85e900853c4727c6d