Summary:
Adds a new script that runs Yarn with --frozen-lockfile, and fails if Yarn finds the lockfile is out of sync.
Keeping the lockfile in sync with package.json will ensure our internal open source tests can run offline, as our offline mirror is updated whenever the lockfile changes.
Reverted yarn.lock to https://raw.githubusercontent.com/facebook/react-native/6eeff75849c9b8bf91592c1b7906b4dab8fba518/yarn.lock, then ran `scripts/circleci/validate_yarn_lockfile.sh`, and verified the script failed as expected.
I then ran Yarn without the --frozen-lockfile flag, and reran the validation script. This time, the script finished successfully.
Pull Request resolved: https://github.com/facebook/react-native/pull/21739
Differential Revision: D10365642
Pulled By: hramos
fbshipit-source-id: 9ab7f03919427a86b12901d4c422ef04dd0839f6
Summary:
Fixes#20774
The new Xcode build system uses parallel execution to run build steps that don't have an obvious dependency. Our Xcode project was written with the assumption that the **Install Third Party** build step is run _before_ compiling the `third-party` libraries. To address this issue, this PR adds dependency information to the project to teach Xcode that `ios-install-third-party.sh` is generating the files under `third-party`. With this additional information, Xcode correctly waits for `ios-install-third-party.sh` to finish before advancing to the compile step.
In addition to the Xcode project changes, I had to make some changes to the script `ios-install-third-party.sh` so that
1. it would always execute the `ios-configure-glog.sh` script regardless of how it was invoked
2. it would always install the libraries even if Xcode had partially created the tree or if a previous install was interrupted
Pull Request resolved: https://github.com/facebook/react-native/pull/21458
Differential Revision: D10365495
Pulled By: hramos
fbshipit-source-id: c88042583f21d2447a16f6ae2b6abb929c659a26
Summary:
This PR converts `ProgressViewIOS` from a `createReactClass` component to a functional component, and removes the remaining proptypes. Its use of `NativeMethodsMixin` has been ported to a `forwardRef` to the native component.
Pull Request resolved: https://github.com/facebook/react-native/pull/21588
Reviewed By: hramos
Differential Revision: D10338888
Pulled By: RSNara
fbshipit-source-id: c49807e97a0e2cf774971d9aa5a8426f15a3e48d
Summary:
**Problem:**
When you type an invalid regex into the input field of the RNTester app, it crashes. What's worse is that it remembers the input string so refreshing the view doesn't get rid of the error. Observe:
https://pxl.cl/jdm3
Reviewed By: yungsters
Differential Revision: D10349249
fbshipit-source-id: aab5977bd47271e9a4ff6202c93b47550da778d2
Summary: Moving up when we start the CORE marker to `FbReactFragment.onFragmentCreate` on FB4A. Right now the CORE marker gets started with CREATE_REACT_CONTEXT_START, since it's possible for the instance manager to be created before TTI begins. We address this in HOME_TTI by collecting the getInstanceManager time, comparing to TTI start, and using that as bridgeStartupStartTime. Ideally, though, we'd just start the CORE marker at the right time so we can use it independently to measure RN startup. This diff moves up CORE start time to `onFragmentCreate` (even before `getReactInstanceManager`)
Reviewed By: alexeylang
Differential Revision: D10094921
fbshipit-source-id: 77986535915f8e81d4d2c5b9108cbed40d1a75be
Summary:
@public
The Chrome debugger can't handle synchronous method calls, so we should avoid doing them.
Double wrapped the if with a DEV check so that it's removed when bundling in non-dev mode.
Reviewed By: fkgozali
Differential Revision: D10345056
fbshipit-source-id: 7a7a2c73f089693da5edafdf3ecf7a3e5d767e52
Summary:
bump Android NDK to r17c, which is only available revision to download for r17. And it includes bug fixes.
Pull Request resolved: https://github.com/facebook/react-native/pull/21628
Differential Revision: D10352162
Pulled By: hramos
fbshipit-source-id: d372e55443260242a44a1f73698977a3e361f001
Summary: missing header and platform. attributedstring builds now, but still fails because of T34990592
Reviewed By: mdvacca
Differential Revision: D10349210
fbshipit-source-id: dcd163df9ac9a4fcb36399cb9f93dbf1b33c062d
Summary:
`YGRoundValueToPixelGrid` currently rounds negative numbers incorrectly. For example:
```
YGRoundValueToPixelGrid(-2.2, 1.0, /* ceil */ false, /* floor */ true) = -2.0
```
However, that operation is supposed to take the floor of the number so the result should acutally be `-3.0`.
There's a detailed comment in `YGRoundValueToPixelGrid` about the fix and why it works.
A symptom that manifested because of this bug is that text nodes could get smaller and smaller on each layout pass. For details see https://github.com/facebook/yoga/issues/824.
Fixes#824
Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/yoga/pull/825
Reviewed By: priteshrnandgaonkar
Differential Revision: D10282064
Pulled By: shergin
fbshipit-source-id: 16ca966e6cb0cfc88b1dbf4ba31e7b1dbe1f2049
Summary: This change updates the comments and warning to match the function name.
Reviewed By: achen1
Differential Revision: D10345724
fbshipit-source-id: 05b1c60703da97ed083d7de492559bafb46ad813
Summary:
The end-of-scrollable-range offset was not clipped before the nearestOffset calculation causing the ScrollView to not snap to the end of the view when the width of the ScrollView was not an exact multiple of snapToInterval.
Addresses https://github.com/facebook/react-native/issues/21116#issuecomment-427944838
Reviewed By: yungsters
Differential Revision: D10248545
fbshipit-source-id: 2bdc94ea0a9d9f063769f2c5da4c33d4872b1db2
Summary: Simplies UIManager a bit and some other tweaks
Reviewed By: shergin
Differential Revision: D10211883
fbshipit-source-id: 93ab23dd2baab2fdc6d9c54e976b001a19efab7f
Summary: There are no longer any callsites to this in React Native so we can remove it from the repo!
Reviewed By: RSNara
Differential Revision: D10316313
fbshipit-source-id: bd63c823c56bb1914e4249d972e0ce503aa189f8
Summary:
We're currently getting a redbox in Turkish when we try to convert the string 'easeInEaseOut' to an InterpolatorType. This is because I use toLowerCase() to compare the string without setting a locale; in Turkish, the capital letter 'I' doesn't convert to 'i' when you lowercase it, but rather to 'ı' (http://www.i18nguy.com/unicode/turkish-i18n.html).
Passing in a locale param to `toLowerCase()` fixes it. Also updating the test.
Differential Revision: D10315474
fbshipit-source-id: 54be3ff1d3f91cb2ec765ff705ac364b976b8c6f
Summary: Looks like we have to explicitly require the BuildConfig package if we want to use it.
Reviewed By: mdvacca
Differential Revision: D10275883
fbshipit-source-id: 4fbce3085e1ac6486a782b2bc0e335b7e48fe8de
Summary:
Related to #21581 .
Removed createReactClass from the RNTester/js/ImageExample.js
The diff of this PR is a little big. If there are any problems, please teach me �
- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android
[GENERAL] [ENHANCEMENT] [RNTester/js/ImageExample.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21602
Reviewed By: TheSavior
Differential Revision: D10304857
Pulled By: RSNara
fbshipit-source-id: 339b1220828c6218cad0d09c7a5034a61e623bc6
Summary:
This diff removes the `sinon` dependency from `metro` and `react-native-github`. It was only used in a handful of tests and having to learn and remember another mocking API just for these cases was not worth it IMO.
While doing the migration, most of the things that `sinon` provides can be done with `jest` in a very similar (and user friendly) way.
I've found, though, two small things that are more user friendly with `sinon`. I'm documenting them here because it may be worth adding them to jest:
With `sinon`:
```
stub.throws(new Error('foo'));
```
With `jest`:
```
mock.mockImplementation(() => {
throw new Error('foo');
});
```
Taking into account that `jest` has a `mockRejectedValue` method for mocks (to return a rejected promise) I don't see any reason why it does not have a `mockThrowError` method.
With `sinon`:
```
expect(mock1.calledBefore(mock2)).toBeTruthy();
```
With `jest`:
```
expect(mock1.mock.invocationCallOrder[0]).toBeLessThan(
mock2.mock.invocationCallOrder[0],
);
```
There's a community matcher that adds this matcher in `jest-extended`: https://github.com/jest-community/jest-extended#tohavebeencalledbefore, but we're not using `jest-extended` in `xplat/js`.
Reviewed By: jeanlauliac
Differential Revision: D10238331
fbshipit-source-id: 5441125b69596ad85bf8f56d203cfd20759bc358
Summary:
This consists of several fixes:
- Some of the C++ functions called by the tests were missing `WIN_EXPORT`
- It looks like Yoga was changed to round up after `TestMeasureFuncWithFloat` was written. Here's the function call that results in the rounding: 357ca78f9f/yoga/Yoga.cpp (L4019-L4026)
- The format of the result of the `Print` method was changed after `TestPrint` was written.
Pull Request resolved: https://github.com/facebook/yoga/pull/818
Differential Revision: D10282902
Pulled By: shergin
fbshipit-source-id: a5fd732a7dbff1a704cbafbfc95ae3e0c0a0cdd8
Summary:
`legacyImplementation` has caused a warning in FlatList for a long time. FlatList supports the use cases of the legacy implementation and should be adopted.
We will be removing the deprecated MetroListView and ListView components to reduce bundle sizes and the complexity of the codebase.
Reviewed By: yungsters
Differential Revision: D10245824
fbshipit-source-id: 60ff0d54974649b57bac9f9f29b769f34ca2701c
Summary: This diff avoids the serialization of color that are set as: "UndefinedColor". This allows the text rendering system to set the default color in the native side
Reviewed By: shergin
Differential Revision: D10275834
fbshipit-source-id: b81c7a5995bef65e04a246d99f44ff10cb20f548
Summary: This diff enables the onPress event for TextViews that render RawText
Reviewed By: shergin
Differential Revision: D10222183
fbshipit-source-id: 4b6a6ad548286453f7dd3a14a5e4ee453a55b923
Summary: This diff enables view flattening for Android when using Fabric.
Reviewed By: shergin
Differential Revision: D10254678
fbshipit-source-id: cc7acaa38a6d01e112ba0e8a92db61cdeefbffee
Summary: This diff introduces the collapsable props in the viewProps. This prop is used in product code to prevent specific Views to be removed from the view hierarchy
Reviewed By: shergin
Differential Revision: D10254679
fbshipit-source-id: 637665b8998a86e29e839eb6d405a0fac354c8d3
Summary: Previsouly, we basically didn't support Accessibility at all.
Reviewed By: mdvacca
Differential Revision: D10250635
fbshipit-source-id: d33eed8f56374f57310654653f41c312cb5942e6
Summary: This is the second and the final part of adopting clang-format.
Reviewed By: mdvacca
Differential Revision: D10229624
fbshipit-source-id: d97670b716800ea2488b84bd0aacaf54d8bd2e31
Summary: Quite obviously, having a `complete` method which accepts only `newRootShadowNode` was a baaad idea. When we `complete` or `commit` we always have to have two nodes (before and after). And only after layout and right before swapping (and acquiring the mutex) we have to verify that *current* root node is still the same as it was when we initialized the transaction (if not, we have to abort).
Reviewed By: mdvacca
Differential Revision: D10201902
fbshipit-source-id: 15adc78c5d31d6fd39fd7fc6e53203a5539717a8
Summary:
Size constraints are essential part of the running Surface, decoupling them from starting process means that we will have to perform additional commit later.
This and previous couple diffs fix a problem with initial zero size of the surface and following visible "jumpy" relayout.
Reviewed By: sahrens
Differential Revision: D10174280
fbshipit-source-id: 0ec48692cb814fd46cc3a1d044c5eb8ab9ecb031
Summary:
New `ShadowTree::synchronize` method allows to perform operations on ShadowTree without a risk of an unsuccessful commit. To make it happen, the `commitMutex_` is now recursive and `synchronize` acquires it before calling the callback.
Using that we finally can implement reliable `constraintLayout`.
Reviewed By: mdvacca
Differential Revision: D10174281
fbshipit-source-id: 9864ebb5343d40e2da205272a834710f0ab730db
Summary:
Setting the right expectations: setting layout constraints might fail. Nothing really changed.
Implementing a reliable `constraintLayout` which locks instead of returning immediately requires some additional work and new/additional API.
Reviewed By: mdvacca
Differential Revision: D10159457
fbshipit-source-id: bb23c7de105629ef086ae0b04667ff32c6ffb81d
Summary: With new `ShadowTree::getRootShadowNode()` method all access to rootShadowNode_ is protected by commit mutex.
Reviewed By: mdvacca
Differential Revision: D10159456
fbshipit-source-id: 0bc8676ca2564a8ef95d60e912356e99d9f172c1
Summary: This component has long been deprecated in the docs. Adding a warning to the code.
Reviewed By: sahrens
Differential Revision: D10261155
fbshipit-source-id: 462ce30a97f35e52477cfc135fb50c976b56e9cb