Commit Graph

14143 Commits

Author SHA1 Message Date
Ziqi Chen 40f6998b67 added a null check on accessibilityStates
Summary:
Added a check for null on `accessibilityStates`.
Now, if a null value is passed in to the prop, it simply does not do anything.

Reviewed By: achen1

Differential Revision: D9034714

fbshipit-source-id: caffa41a1d8b08d5358d085e4e268e8e6f1c9344
2018-07-27 15:18:37 -07:00
Andrew Chen (Eng) 27b3aecb3d Fix RN Litho invalidations
Summary:
We were seeing a bug where embedded feed stories showed the loading spinner forever until a scroll event occurred. Embedded feed stories are built on top of our RN + Litho integration which requires additional logic to support remeasuring the shadow tree when the intrinsic size of the litho component changes (aka wrap_content). Previously, we simply overrode requestLayout() of ReactLithoView to inform the shadow tree that that node needs to be dirtied -- in which case a
subsequent layout pass would resolve these changes. This worked fine in dev builds, but it turns out that release builds never received a subsequent layout pass. Dev builds apparently have a loop that dispatches view updates every second or so while release doesn't (not sure why), but that was the reason why the dev version eventually invalidated the views. The solution here is to simply always invoke a view update when any embedded Litho component requires a relayout.

Reviewed By: mdvacca

Differential Revision: D8983995

fbshipit-source-id: 53c528b3c00aad2bbe8e7f6360dc8e1594da1298
2018-07-27 14:16:33 -07:00
Jan Kassens 7205232792 remove FbRelayNativeAdapter
Summary: Doesn't look like this is used anymore.

Reviewed By: schwink

Differential Revision: D9032481

fbshipit-source-id: c35b7db07c068b6238bacc25183a468c9d62661d
2018-07-27 13:37:12 -07:00
Wayne Cheng 86f8e9e760 Adding flow strict to as many xplat files as possible
Summary:
ag -L --ignore __snapshots__ 'flow strict$|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
  cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict/'
  cat ~/temp | xargs ag -L 'flow strict$' | xargs sed -i '' 's/flow strict-local$/flow strict/'
  until flow; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done

allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.

Reviewed By: yungsters

Differential Revision: D9003523

fbshipit-source-id: d0c9fbfe3c32e65d57819fa040d06cd6ebbd59cc
2018-07-27 12:31:42 -07:00
Ram N 059fb2fd81 Make Catalyst support lazy and non-lazy native modules
Summary:
An application could either have lazy, or non-lazy modules. This diff simply lets the individual reactPackages decide if they should be lazy or not, based on the variable in `ReactInstanceManagerBuilder`.

This diff also removed the method `setLazyNativeModules()` since an app can now have both native and non-native modules.

Reviewed By: achen1

Differential Revision: D8940026

fbshipit-source-id: 0399f4f39ad57f2b03e4dce117a9e2c28c4ed2b1
2018-07-27 12:02:09 -07:00
Zhaojun Zhang 6b5343019c Remove clang compiler warnings for Android: -Wno-unused-parameter
Summary: att

Reviewed By: gkmhub

Differential Revision: D8972835

fbshipit-source-id: c8b893eefec6ccb5d8506c959bcf5c3f43701e81
2018-07-27 11:03:32 -07:00
Trish Saylor 78676915ad Create a reusable IG Switch component with UIDocs and snapshot test
Summary: Switch is a standard component and needs some extra styling of the colors to be used in IG, so I've created a reusable switch component for Instagram React Native and added server snapshot tests with UIDocs for it so it will appear in https://our.intern.facebook.com/intern/uidocs/?docset=rn_iig for more people to use.

Reviewed By: lostatseajoshua

Differential Revision: D9023261

fbshipit-source-id: dd460ca4506e2fc072ed03cca56b4a3c172123bd
2018-07-27 06:46:26 -07:00
Ives van Hoorne 169d6839bb Bump Metro to 0.43.0
Summary: Bump to new version because of breaking configuration changes in metro

Reviewed By: hramos, rafeca

Differential Revision: D8989698

fbshipit-source-id: 6f397004f4a87075909ee47b1950a3fe32c1caff
2018-07-27 05:31:47 -07:00
Build Service fd30cf8308 translation auto-update for i18n/instagram-directapp.config.json on master
fbshipit-source-id: 6ea5ace7986919af565061e24f923efa1221ad17
2018-07-26 21:32:51 -07:00
Build Service a414a3b47d translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: 8ab20fd38a37a5ba7f183e1664356e469dca55ad
2018-07-26 21:32:50 -07:00
Build Service 2dc53b0285 translation auto-update for i18n/expresswifi.config.json on master
fbshipit-source-id: ac1a06371a5b0309df0cb0d2485e3a192c8852e1
2018-07-26 21:32:50 -07:00
Build Service f68f1adcfd translation auto-update for i18n/creatorapp.config.json on master
fbshipit-source-id: 05c5d8510fa4ba69bd31eb8ebf9fd00c62350958
2018-07-26 21:32:50 -07:00
Build Service df10d0c4a5 translation auto-update for i18n/analyticsapp.config.json on master
fbshipit-source-id: ae87f5a5b499b5c6990ad2e9e2e8ca634cc2f8ca
2018-07-26 21:32:50 -07:00
Build Service 876d82c77b translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 594329624d7db939ec5bde5c6e878dac9834fff6
2018-07-26 21:32:50 -07:00
Ziqi Chen 48b3d1322b Made strings in the uimanager resource folder non translatable
Summary:
In D8884991, I added a strings.xml file to react-native-github UI Manager resources.
Because this gets deployed to open source, and not all apps have the same Locale support that Facebook has, we temporarily don't want these strings to be translated.

I added `translatable = false` to the strings in this diff.

Reviewed By: fkgozali

Differential Revision: D9018766

fbshipit-source-id: 04d06478d0ac665fa02387e6df035c31522fdea6
2018-07-26 16:01:28 -07:00
Ram N c7fdd2701f Added more info to Module Registry systraces
Summary:
Added module names to systraces for getConstants and getMethods.

Also added systrace for moduleNames.

We are starting to look at ways to optimize native modules, and having these traces helps

Reviewed By: javache

Differential Revision: D9012702

fbshipit-source-id: c79222f36988bef3a108ed91d1ea1318d3576b40
2018-07-26 15:35:54 -07:00
Ziqi Chen 1bc52267f5 accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 3/3
Summary:
Previously, I created two props, `accessibilityRole` and `accessibilityStates` for view. These props were intended to be a cross-platform solution to replace  `accessibilityComponentType` on Android and `accessibilityTraits` on iOS.

In this stack, I ran a code mod to replace instances of the two old properties used in our codebase with the new ones.
For this diff, I did a search for the few remaining uses of `accessibilityTraits` that was not caught by my script or the previous diff in the stack, and I manually changed them to `accessibilityRole` and `accessibilityStates`.

Changes in this diff generally followed this pattern:

Before:
```
function accessibilityTraits(props: Props): Array<string> {
  const traits = ['button'];
  if (props.selected) {
    traits.push('selected');
  }
  return traits;
}

  <AdsManagerTouchableHighlight
        accessibilityTraits={accessibilityTraits(this.props)}
```

After:
```
function accessibilityStates(props: Props): Array<AccessibilityState> {
  const states = [];
  if (!props.enabled) {
    states.push('disabled');
  }
  if (props.checked) {
    states.push('selected');
  }
  return states;
}

  <AdsManagerTouchableHighlight
        accessibilityRole="button"
        accessibilityStates={accessibilityStates(this.props)}
```

Reviewed By: PeteTheHeat

Differential Revision: D8944741

fbshipit-source-id: 4b309d9c858e7e831fbf971aca2f546df7a1431d
2018-07-26 13:48:29 -07:00
Build Service 52a55fd8d1 translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: 3cedbf3b0adee97cc3c33c9c3de88ea4dcf94548
2018-07-26 06:07:09 -07:00
Build Service 4fe5acc570 translation auto-update for i18n/expresswifi.config.json on master
fbshipit-source-id: a22833a1a3eeab52e41e136fe16ed2f4a98d05cb
2018-07-26 06:07:08 -07:00
Build Service 00b4c7da09 translation auto-update for i18n/creatorapp.config.json on master
fbshipit-source-id: a6651b67b5e82543fa846bfddb4553a1202fbf2b
2018-07-26 06:07:07 -07:00
Build Service da5c202fdc translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 271e127b935afb22acdec01b5477ed6f30910ec0
2018-07-26 06:07:07 -07:00
Ziqi Chen 121e2e5ca6 accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 2/3
Summary:
Previously, I created two props, `accessibilityRole` and `accessibilityStates` for view. These props were intended to be a cross-platform solution to replace  `accessibilityComponentType` on Android and `accessibilityTraits` on iOS.

In this stack, I ran a code mod to replace instances of the two old properties used in our codebase with the new ones.
For this diff, I did a search for all the remnant uses of `accessibilityComponentType` that was not caught by my script, and I manually changed them to `accessibilityRole` and `accessibilityStates`. If the same prop also set `accessibilityTraits` I also removed that here because the two new props works on both platforms.

It was difficult to write a script for this, because most of them were contextual changes.
Out of the contextual changes, most of them followed one of these two patterns:

Before:

```
const accessibilityComponentType = 'button';
const accessibilityTraits = ['button'];

if (this.props.checked) {
  accessibilityTraits.push('selected');
}
if (this.props.disabled) {
 accessibilityTraits.push('disabled');
}

      contentView = (
        <AdsManagerTouchableHighlight
          accessibilityComponentType={accessibilityComponentType}
          accessibilityTraits={accessibilityTraits}
```

After:
      const accessibilityRole = 'button';
      const accessibilityStates = [];

        if (this.props.checked) {
          accessibilityStates.push('selected');
        }
        if (this.props.disabled) {
           accessibilityStates.push('disabled');
        }

      contentView = (
        <AdsManagerTouchableHighlight
          accessibilityRole={accessibilityRole}
          accessibilityStates={accessibilityStates}

Before:

```
  <PressableBackground
          accessible={this.props.accessible}
          accessibilityLabel={this.props.accessibilityLabel}
          accessibilityTraits={this.props.accessibilityTraits}
```

After:

```
  <PressableBackground
          accessible={this.props.accessible}
          accessibilityLabel={this.props.accessibilityLabel}
          accessibilityRole={this.props.accessibilityRole}
          accessibilityRole={this.props.accessibilityStates}
```

In addition to changing the props on the components,
Another fix I had to do was to add props  accessibilityRole and accessibilityStates to components that don't directly inherit properties from view including text input and touchables.

Reviewed By: PeteTheHeat

Differential Revision: D8943499

fbshipit-source-id: fbb40a5e5f5d630b0fe56a009ff24635d4c8cc93
2018-07-25 23:48:26 -07:00
Ziqi Chen 50e400128e accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 1/3
Summary:
Previously, I created two props, `accessibilityRole` and `accessibilityStates` for view. These props were intended to be a cross-platform solution to replace  `accessibilityComponentType` on Android and `accessibilityTraits` on iOS.

In this stack, I ran a code mod to replace instances of the two old properties used in our codebase with the new ones.
For this diff, I wrote a script that focuses on replacing instances of the two properties that only added a single role to `accessibilityTraits` and `accessibilityComponentType`. In summary, this script:
* replaces instances of `accessibilityTraits = "<iOStrait>"` with `accessibilityRole = "<iOStrait>"`
* replaces instances of `accessibilityTraits = {['<iOStrait>']}` with `accessibilityRole = "<iOStrait>"`
* replaces instances of `accessibilityTraits = {"<iOStrait>"}` with `accessibilityRole = "<iOStrait>"`
* removes instances of `accessibilityComponentType`

```

The following is the codeshift script I wrote:
/**
 * Copyright (c) 2015-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * format
 */

'use strict';

export default function transformer(file, api) {
  const j = api.jscodeshift;
  const root = j(file.source);

  let hasChanges = false;
  const elements = root.find(j.JSXElement);
  let values;
  let valuess;
  let valuesss;
  elements.forEach(path => {
    const openEl = path.node.openingElement;
    hasChanges = true;
    for (let i = 0; i < openEl.attributes.length; i++) {
		if (openEl.attributes[i].name.name === 'accessibilityComponentType') {
        	openEl.attributes.splice(i, 1);
        }
      if (openEl.attributes[i].name.name === 'accessibilityTraits') {
        if (openEl.attributes[i].value.expression) {
          if (openEl.attributes[i].value.expression.type === 'Literal') {
            values = openEl.attributes[i].value.expression.value;
            openEl.attributes[i] = j.jsxAttribute(
              j.jsxIdentifier('accessibilityRole'),
              j.literal(values),
            );
          }
        }

        if (openEl.attributes[i].value) {
          if (
            openEl.attributes[i].value &&
            openEl.attributes[i].value.type === 'Literal'
          ) {
            valuess = openEl.attributes[i].value.value;
            openEl.attributes[i] = j.jsxAttribute(
              j.jsxIdentifier('accessibilityRole'),
              j.literal(valuess),
            );
          }
        }

        if (openEl.attributes[i].value.expression) {
          if (
            openEl.attributes[i].value.expression.type === 'ArrayExpression' &&
            openEl.attributes[i].value.expression.elements.length === 1
          ) {
            valuesss = openEl.attributes[i].value.expression.elements[0].value;
            openEl.attributes[i] = j.jsxAttribute(
              j.jsxIdentifier('accessibilityRole'),
              j.literal(valuesss),
            );
          }
        }
      }
    }
  });
  if (hasChanges) {
    return root.toSource();
  } else {
    return null;
  }
}
```
I then used this command to run the codemod:

```
./scripts/js1/node_modules/.bin/jscodeshift -c 10 --parser=flow --transform ./scripts/js1/commands/codeshift/add-accessibilityRoles/index.js /data/sandcastle/boxes/instance-ide/xplat/js/RKJSModules/Apps
hg status -n | xargs /data/sandcastle/boxes/instance-ide/tools/third-party/prettier/node_modules/.bin/prettier --single-quote --no-bracket-spacing --jsx-bracket-same-line --trailing-comma all --parser flow --write --require-pragma --no-config
hg status -n | xargs ./scripts/eslint/eslint --plugin lint --no-eslintrc --parser babel-eslint --rule "lint/sort-requires: 1" --fix
js1 build buckfiles
```

Lastly, I had to add a few manual fixes:
* Checked that instances of `accessibilityComponentType` that were deleted were indeed replaced with `accessibilityRole`
* Added props  `accessibilityRole` and `accessibilityStates` to `TouchableWithoutFeedBack` components and `TextProps` because they don't inherit properties directly from view.

Reviewed By: PeteTheHeat

Differential Revision: D8937323

fbshipit-source-id: 85bf4d596e8e7c7ace75ab0b0e68599043760840
2018-07-25 23:48:26 -07:00
Build Service 2472c8e392 translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: a0029007ee29dc6281d75aa2db5d93119b027709
2018-07-25 21:19:55 -07:00
Build Service 581d87c498 translation auto-update for i18n/creatorapp.config.json on master
fbshipit-source-id: f1b00452ca258faad0a8e26c1b8c6db8c7e99bee
2018-07-25 21:19:55 -07:00
Build Service 50b5be9e16 translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 46d36267672d931519a6ffca90a1953d643c63da
2018-07-25 21:19:55 -07:00
Vincent Riemer c4bcca6685 Whitelist react-native-dom in haste/cli config defaults (#20393)
Summary:
This adds `react-native-dom` to `hasteImpl.js` because it's not currently possible to configure it from an out of tree platform. Also adds the relevant `providesModuleNodeModules` and `platforms` values to the default RN CLI config. This should hopefully be able to be removed once better support for out of tree platforms is implemented.
Pull Request resolved: https://github.com/facebook/react-native/pull/20393

Differential Revision: D9007186

Pulled By: hramos

fbshipit-source-id: 67077860dc1fb191d80300fb980599ed76d5f91c
2018-07-25 17:47:42 -07:00
Mats Byrkeland 253b29dbd8 Add accessibilityHint for iOS (#18093)
Summary:
This adds the accessibilityHint for View, Text and Touchable* on iOS.
The accessibilityHint provides some more information about an element
when the accessibilityLabel is not enough.

The accessibilityHint is a core accessibility property on iOS.

From https://developer.apple.com/documentation/objectivec/nsobject/1615093-accessibilityhint:
> An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not obvious from the accessibility label.

Related issue: https://github.com/facebook/react-native/issues/14706

The npm scripts `test`, `flow`, `lint` and `prettier` are satisfied.

I added a couple of examples to the RNTester app. The Accessibility Inspector on Mac helps debugging accessibility stuff on a simulator, but it does not show the accessibilityHint. Therefore I tested the RNTester app on an iPhone 8 device using VoiceOver to verify the hint functionality. It works fine, and I've tested disabling and enabling "read hints" in the VoiceOver settings on the phone.

https://github.com/facebook/react-native-website/pull/222

[IOS][FEATURE][Accessibility] - Add accessibilityHint for View, Text, Touchable* on iOS
Closes https://github.com/facebook/react-native/pull/18093

Reviewed By: hramos

Differential Revision: D7230780

Pulled By: ziqichen6

fbshipit-source-id: 172ad28dc9ae2b67ea256100f6acb939f2466d0b
2018-07-25 17:47:42 -07:00
Andrew Clark b7bb25fe4c React sync for revisions ca0941f...bc1ea9c
Summary:
@public
This sync includes the following changes:
- **[bc1ea9cd9](https://github.com/facebook/react/commit/bc1ea9cd9)**: Handle errors thrown in gDSFP of a module-style context provider (#13269) //<Andrew Clark>//
- **[0154a79fe](https://github.com/facebook/react/commit/0154a79fe)**: Remove 'warning' module from the JS scheduler (#13264) //<Flarnie Marchan>//
- **[dbd16c8a9](https://github.com/facebook/react/commit/dbd16c8a9)**: Add flow directive to findDOMNode shim (#13265) //<Brian Vaughn>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions ca0941f...bc1ea9c

Reviewed By: bvaughn

Differential Revision: D9005608

fbshipit-source-id: c293add468badc5323179fda9341912710d4e840
2018-07-25 16:17:51 -07:00
Build Service 12e15e4fdf translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 898dfa57c675ca4e1bbbb89046c124c4efcba576
2018-07-25 11:19:49 -07:00
Ives van Hoorne aaf797ad67 Use new config internally in Metro
Summary: Change the internals of Metro to use the new configuration instead of `ServerOptions`.

Reviewed By: rafeca

Differential Revision: D8734685

fbshipit-source-id: 1215f799419fcaa0e5fb7814683da1cbba96795c
2018-07-25 05:47:58 -07:00
Ives van Hoorne a32620dc3b Use new configuration in react-native public cli
Summary: Change the public react-native CLI to use the new configuration of Metro.

Reviewed By: rafeca

Differential Revision: D8801217

fbshipit-source-id: 112e4812b430ebee1ed41489f803b90c182ccdb4
2018-07-25 05:47:58 -07:00
Ives van Hoorne f0daaf3568 Convert internal react-native-cli
Summary: In this diff I change the internal react-native cli to use our new configuration. Another change here is that Metro starts using the new configuration already as its entry points (like `metro#runMetro`).

Reviewed By: rafeca

Differential Revision: D8728612

fbshipit-source-id: 9f43dee31ebaccd35cf6274d5c4dec0a227a6eec
2018-07-25 05:47:57 -07:00
Build Service c3d31cd1de translation auto-update for i18n/instagram-directapp.config.json on master
fbshipit-source-id: 8364dc804cfcc22e765c57ace66150a3123261a0
2018-07-25 02:02:42 -07:00
Build Service 16b169eb7a translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: 0253d535046458f83e7df40d28cbf1d47a7b6c6d
2018-07-25 02:02:42 -07:00
Build Service afa58a2f44 translation auto-update for i18n/expresswifi.config.json on master
fbshipit-source-id: 2250f8f41db0be084e9fd136d033a13d65dda1b3
2018-07-25 02:02:42 -07:00
Build Service 924f49bcef translation auto-update for i18n/creatorapp.config.json on master
fbshipit-source-id: b588c750185c4b20b2cdacdc702285b1f2f06665
2018-07-25 02:02:42 -07:00
Build Service c8c2fece88 translation auto-update for i18n/analyticsapp.config.json on master
fbshipit-source-id: 46ce06cbe9e11893c7fdba4b5a33146acbda0818
2018-07-25 02:02:42 -07:00
Build Service 44734a28a1 translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 2ca74c012a56fe460ae0ffab898949e7e98da334
2018-07-25 02:02:42 -07:00
Kevin Gozali 201ba8c69d Catch JS bundle load failure and prevent calls to JS after that
Summary: There are cases where JS bundle fails to be evaluated, which throws an exception already, but then there were pending calls into JS which would fail in a weird way. This prevents those calls (because it's mostly meaningless at that point). For now, those extra calls will still throw an exception, but with a specific message so that it doesn't confuse people.

Reviewed By: yungsters

Differential Revision: D8961622

fbshipit-source-id: 3f67fb63fdfa9fc5b249de0096e893b07956776a
2018-07-24 19:48:32 -07:00
Ziqi Chen c36e8b3307 added accessibilityIgnoresInvertColors to module.exports in ViewPropTypes
Summary:
Previously, I exposed the "accessibilityIgnoresInvertColors" API on iOS to react native views.

In this diff, I added this property to the `module.exports` in `ViewPropTypes` so that the property can be accessed by other files.

Reviewed By: PeteTheHeat

Differential Revision: D8977515

fbshipit-source-id: d0aba5eac3bc1528e18b6027f3f055e5f4a1147a
2018-07-24 18:31:59 -07:00
Ziqi Chen b5b704dc19 added accessibilityStates and accessibilityRole to ReactNativeViewAttributes
Summary:
Previously, I added accessibilityRole and accessibilityStates as View Properties.

In this diff, I added accessibilityRole and accessibilityStates to ReactNativeViewAttributes.UIView, which is used for viewconfig in some components.

The NativeMethodsMixing uses the set view config when invoking `setNativeProps`, and it's used to make those components look like an actual native component class.

Reviewed By: PeteTheHeat

Differential Revision: D8976524

fbshipit-source-id: 16a5ba7d91ee9cfb6488c2d94f7f23b9093e5b81
2018-07-24 18:31:58 -07:00
Ziqi Chen 9f01e4ccff Added logic to only override role description that is said on TalkBack if it's in english.
Summary:
Context:
On Android, I am currently overriding the role description for TalkBack on certain Roles. Currently, these are done only in English.
I needed to add a checker that only overrides these role descriptions if the language of the phone is set

Changes:
* Added a language checker before I call setRoleDescription
* Put the strings into variables.

Note:
This is done to prioritize a codemod for accessibilityRole. Eventually, we hope to add support for other languages on these roles.

Reviewed By: blavalla

Differential Revision: D8884991

fbshipit-source-id: 3182eb5856ea57939fb25b17522d4b79ef2078e3
2018-07-24 16:47:31 -07:00
Héctor Ramos dfcf9c50b6 Fix test_android test failure, add libpulse0 dep
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/20377

Differential Revision: D8983760

Pulled By: hramos

fbshipit-source-id: d36cdb577b0eadc78e3274db755d05d440ae423f
2018-07-24 16:33:49 -07:00
Héctor Ramos 70913a4623 React sync for revisions ae14317...ca0941f
Summary:
@public
This sync includes the following changes:
- **[ca0941fce](https://github.com/facebook/react/commit/ca0941fce)**: Add regression test for Placeholder fallbacks with lifecycle methods (#13254) //<Andrew Clark>//
- **[a32c727f2](https://github.com/facebook/react/commit/a32c727f2)**: Optimize readContext for Subsequent Reads of All Bits (#13248) //<Sebastian Markbåge>//
- **[2b509e2c8](https://github.com/facebook/react/commit/2b509e2c8)**: [Experimental] API for reading context from within any render phase function (#13139) //<Andrew Clark>//
- **[5776fa3fc](https://github.com/facebook/react/commit/5776fa3fc)**: Update www warning shim (#13244) //<Dan Abramov>//
- **[3d3506d37](https://github.com/facebook/react/commit/3d3506d37)**: Include Modes in the component stack (#13240) //<Dan Abramov>//
- **[71b4e9990](https://github.com/facebook/react/commit/71b4e9990)**: [react-test-renderer] Jest matchers for async tests (#13236) //<Andrew Clark>//
- **[2c560cb99](https://github.com/facebook/react/commit/2c560cb99)**: Fix unwinding starting with a wrong Fiber on error in the complete phase (#13237) //<Dan Abramov>//
- **[ead08827d](https://github.com/facebook/react/commit/ead08827d)**: Add more flexibility in testing errors in begin/complete phases (#13235) //<Dan Abramov>//
- **[e4e58343e](https://github.com/facebook/react/commit/e4e58343e)**: Move unstable_yield to main export (#13232) //<Andrew Clark>//
- **[0e235bb8f](https://github.com/facebook/react/commit/0e235bb8f)**: Removed unused state argument in unsubscribe method of <Subscription /> (#13233) //<Mateusz Burzyński>//
- **[236f60872](https://github.com/facebook/react/commit/236f60872)**: Fail tests if toWarnDev() does not wrap warnings in array (#13227) //<Dan Abramov>//
- **[acbb4f93f](https://github.com/facebook/react/commit/acbb4f93f)**: Remove the use of proxies for synthetic events in DEV (#13225) //<Dan Abramov>//
- **[171e0b7d4](https://github.com/facebook/react/commit/171e0b7d4)**: Fix “no onChange handler” warning to fire on falsy values ("", 0, false) too (#12628) //<Nicole Levy>//
- **[606c30aa5](https://github.com/facebook/react/commit/606c30aa5)**: fixed a typo in commentout in ReactFiberUnwindWork.js (#13172) //<Fumiya Shibusawa>//
- **[9f78913b2](https://github.com/facebook/react/commit/9f78913b2)**: Update prettier (#13205) //<Johan Henriksson>//
- **[6d3e26288](https://github.com/facebook/react/commit/6d3e26288)**: Remove unnecessary `typeof` checks (#13196) //<jddxf>//
- **[82c7ca4cc](https://github.com/facebook/react/commit/82c7ca4cc)**: Add component stacks to some warnings (#13218) //<Dan Abramov>//
- **[21ac62c77](https://github.com/facebook/react/commit/21ac62c77)**: Fix a portal unmounting crash for renderers with distinct Instance and Container (#13220) //<Thibault Malbranche>//
- **[d6a0626b3](https://github.com/facebook/react/commit/d6a0626b3)**: Set current fiber during before-mutation traversal (#13219) //<Dan Abramov>//
- **[f9358c51c](https://github.com/facebook/react/commit/f9358c51c)**: Change warning() to automatically inject the stack, and add warningWithoutStack() as opt-out (#13161) //<Dan Abramov>//
- **[467d13910](https://github.com/facebook/react/commit/467d13910)**: Enforce presence or absence of component stack in tests (#13215) //<Dan Abramov>//
- **[43ffae2d1](https://github.com/facebook/react/commit/43ffae2d1)**: Suspending inside a constructor outside of strict mode (#13200) //<Andrew Clark>//
- **[659a29cec](https://github.com/facebook/react/commit/659a29cec)**: Reorganize how shared internals are accessed (#13201) //<Dan Abramov>//
- **[58f3b29d9](https://github.com/facebook/react/commit/58f3b29d9)**: Added SSR/hydration tests for modes, forwardRef, and Profiler (#13195) //<Brian Vaughn>//
- **[1c89cb62f](https://github.com/facebook/react/commit/1c89cb62f)**: Use ReactDebugCurrentFrame.getStackAddendum() in element validator (#13198) //<Dan Abramov>//
- **[e6076ecf4](https://github.com/facebook/react/commit/e6076ecf4)**: Remove ad-hoc forks of getComponentName() and fix it (#13197) //<Dan Abramov>//
- **[32f6f258b](https://github.com/facebook/react/commit/32f6f258b)**: Remove event simulation of onChange events (#13176) //<Philipp Spieß>//
- **[9ca37f843](https://github.com/facebook/react/commit/9ca37f843)**: docs: update comments (#13043) //<Sen Yang>//
- **[f89f25f47](https://github.com/facebook/react/commit/f89f25f47)**: Correct type of `ref` in forwardRef render() (#13100) //<Moti Zilberman>//
- **[7b99ceabe](https://github.com/facebook/react/commit/7b99ceabe)**: Deprecate test utils mock component follow up (#13194) //<Brian Vaughn>//
- **[6ebc8f3c0](https://github.com/facebook/react/commit/6ebc8f3c0)**: Add support for re-entrant SSR stacks (#13181) //<Dan Abramov>//
- **[d64d1ddb5](https://github.com/facebook/react/commit/d64d1ddb5)**: Deprecate ReactTestUtils.mockComponent() (#13193) //<Brian Vaughn>//
- **[e79366d54](https://github.com/facebook/react/commit/e79366d54)**: Link create-subscription doc to GH issue with de-opt explanation (#13187) //<Brian Vaughn>//
- **[1f32d3c6d](https://github.com/facebook/react/commit/1f32d3c6d)**: Test renderer flushAll method verifies an array of expected yields (#13174) //<Brian Vaughn>//
- **[377e1a049](https://github.com/facebook/react/commit/377e1a049)**: Add a test for SSR stack traces (#13180) //<Dan Abramov>//
- **[96d38d178](https://github.com/facebook/react/commit/96d38d178)**: Fix concatenation of null to a warning message (#13166) //<Dan Abramov>//
- **[095dd5049](https://github.com/facebook/react/commit/095dd5049)**: Add DEV warning if forwardRef function doesn't use the ref param (#13168) //<Brian Vaughn>//
- **[566259567](https://github.com/facebook/react/commit/566259567)**: Refactor stack handling (no functional changes) (#13165) //<Dan Abramov>//
- **[ebbd22143](https://github.com/facebook/react/commit/ebbd22143)**: Configure react-test-renderer as a secondary (#13164) //<Brandon Dail>//
- **[ddc91af79](https://github.com/facebook/react/commit/ddc91af79)**: Decrease nested update limit from 1000 to 50 (#13163) //<Andrew Clark>//
- **[3596e40b3](https://github.com/facebook/react/commit/3596e40b3)**: Fix nested update bug (#13160) //<Andrew Clark>//
- **[449f6ddd5](https://github.com/facebook/react/commit/449f6ddd5)**: create a new FeatureFlags file for test renderer on www (#13159) //<Chang Yan>//
- **[f762b3abb](https://github.com/facebook/react/commit/f762b3abb)**: Run react-dom SSR import test in jsdom-less environment (#13157) //<Dan Abramov>//
- **[6f6b560a6](https://github.com/facebook/react/commit/6f6b560a6)**: Renamed selfBaseTime/treeBaseTime Fiber attributes to selfBaseDuration/treeBaseDuration (#13156) //<Brian Vaughn>//
- **[1386ccddd](https://github.com/facebook/react/commit/1386ccddd)**: Fix ReferenceError when requestAnimationFrame isn't defined (#13152) //<Dan Abramov>//
- **[f5779bbc1](https://github.com/facebook/react/commit/f5779bbc1)**: Run server rendering test on bundles (#13153) //<Dan Abramov>//
- **[9faf389e7](https://github.com/facebook/react/commit/9faf389e7)**: Reset profiler timer correctly after errors (#13123) //<Brian Vaughn>//
- **[85fe4ddce](https://github.com/facebook/react/commit/85fe4ddce)**: Fix - issue #12765 / the checked attribute is not initially set on the input (#13114) //<XuMM_12>//
- **[07fefe333](https://github.com/facebook/react/commit/07fefe333)**: Drop handling for ms and O prefixes for CSS transition and animation events. (#13133) //<Rouven Weßling>//
- **[88d7ed8bf](https://github.com/facebook/react/commit/88d7ed8bf)**: React.Timeout -> React.Placeholder (#13105) //<Andrew Clark>//
- **[f128fdea4](https://github.com/facebook/react/commit/f128fdea4)**: Suspending outside of strict trees and async trees (#13098) //<Andrew Clark>//
- **[aa8266c4f](https://github.com/facebook/react/commit/aa8266c4f)**: Prepare placeholders before timing out (#13092) //<Andrew Clark>//
- **[c039c16f2](https://github.com/facebook/react/commit/c039c16f2)**: Fix this in a functional component for ShallowRenderer (#13144) //<Toru Kobayashi>//
- **[64e1921aa](https://github.com/facebook/react/commit/64e1921aa)**: Fix Flow type that event target can be null (#13124) //<Sebastian Markbåge>//
- **[6d6de6011](https://github.com/facebook/react/commit/6d6de6011)**: Add PROFILE bundles for www+DOM and fbsource+RN/RF (#13112) //<Brian Vaughn>//
- **[71a60ddb1](https://github.com/facebook/react/commit/71a60ddb1)**: Add link to another article about React renderers //<Dan Abramov>//
- **[6a530e3ba](https://github.com/facebook/react/commit/6a530e3ba)**: adding check for mousemove (#13090) //<Jason Williams>//
- **[c35a1e748](https://github.com/facebook/react/commit/c35a1e748)**: Fix crash during server render in react 16.4.1. (#13088) //<Dustin Masters>//
- **[076bbeace](https://github.com/facebook/react/commit/076bbeace)**: Fall back to 'setTimeout' when 'requestAnimationFrame' is not called (#13091) //<Flarnie Marchan>//
- **[da5c87bdf](https://github.com/facebook/react/commit/da5c87bdf)**: Fixes children when using dangerouslySetInnerHtml in a selected <option> (#13078) //<Michael Ridgway>//
- **[a960d18bc](https://github.com/facebook/react/commit/a960d18bc)**: eliminate unnecessary do-while loop in renderRoot() (#13087) //<Nathan Quarles>//
- **[5b3d17a5f](https://github.com/facebook/react/commit/5b3d17a5f)**: setting a flag, so that the first movement will have the correct value (#13082) //<Jason Williams>//
- **[b0f60895f](https://github.com/facebook/react/commit/b0f60895f)**: Automatically Profile roots when DevTools is present (#13058) //<Brian Vaughn>//
- **[ae8c6dd53](https://github.com/facebook/react/commit/ae8c6dd53)**: remove some redundant lines (#13077) //<Nathan Quarles>//
- **[0fcf92d06](https://github.com/facebook/react/commit/0fcf92d06)**: Add a link to custom renderer intro article //<Dan Abramov>//
- **[97af3e1f3](https://github.com/facebook/react/commit/97af3e1f3)**:  Do not add additional work to a batch that is already rendering (#13072) //<Andrew Clark>//
- **[4fe6eec15](https://github.com/facebook/react/commit/4fe6eec15)**: Always batch updates of like priority within the same event (#13071) //<Andrew Clark>//
- **[8e87c139b](https://github.com/facebook/react/commit/8e87c139b)**: Remove transitive dependency on fbjs (#13075) //<Dan Abramov>//
- **[aeda7b745](https://github.com/facebook/react/commit/aeda7b745)**: Remove fbjs dependency (#13069) //<Dan Abramov>//
- **[b1b3acbd6](https://github.com/facebook/react/commit/b1b3acbd6)**: Inline fbjs/lib/emptyObject (#13055) //<Dan Abramov>//

Release Notes:
[GENERAL] [FEATURE] [React] - React sync for revisions ae14317...ca0941f

Reviewed By: bvaughn

Differential Revision: D8979192

fbshipit-source-id: 7a14d3b0a253a81d162d7f8c899e99cf6ac4fee4
2018-07-24 14:47:52 -07:00
Simon Jensen 17485e8ed4 Fix conversion from double to int16_t in JSC bindings
Summary:
Converting from double to int16_t is undefined behavior if the value
doesn't fit in int16_t.

Reviewed By: tmikov

Differential Revision: D8925246

fbshipit-source-id: 4cf57631686a4ce05546f8d30a46e3f9def3aee2
2018-07-24 12:03:30 -07:00
Héctor Ramos 8116c3f91a Fix Android apt-get step failure
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/20373

Differential Revision: D8976675

Pulled By: hramos

fbshipit-source-id: 5b46e5325fe546f091173153de0428bbef9f53da
2018-07-24 11:49:36 -07:00
Bhavik Patel 1a6666a116 Check if config contains a key before fetching. Default to 0 (#19808)
Summary:
Potential Fix to #19793

modified the code and tried to recreate the bug and was unable to. The red screen never popped up and nothing else seemed to be affected in a negative way.

[ANDROID] [BUGFIX] [FrameBasedAnimationDriver.java] - Safely unwrapping ReadableMap by defaulting to 0 if key not present.
Pull Request resolved: https://github.com/facebook/react-native/pull/19808

Differential Revision: D8960388

Pulled By: hramos

fbshipit-source-id: 400cc0467e041dfcf2d6b1ec0b61d716c2de159f
2018-07-23 17:02:51 -07:00
Mehdi Mulani 3d8b83927b Use module copies in RCTBridge APIs
Summary: This array can be modified while it's being iterated, so we need to take a copy. I also found another crash and guarded against it.

Reviewed By: fkgozali

Differential Revision: D8955708

fbshipit-source-id: 76250bc5d451776e74505733c0f3c14e555fb576
2018-07-23 14:47:45 -07:00
Dulmandakh ccdd450b12 bump NDK toolchain to 4.9 (#19945)
Summary:
This PR will bump NDK_TOOLCHAIN_VERSION to 4.9 or use GCC 4.9 to build C++ code. Once merged, we can bump folly to a newer version, which requires GCC 4.9.
Pull Request resolved: https://github.com/facebook/react-native/pull/19945

Reviewed By: fkgozali

Differential Revision: D8943282

Pulled By: hramos

fbshipit-source-id: d239ca67a08788b12e115a9d78443b13a10403f6
2018-07-23 13:47:30 -07:00