Compare commits

...
116 Commits
Author SHA1 Message Date
Hector Ramos dc04bf3d96 Working! 2017-11-15 15:34:32 -08:00
Hector Ramos 8e34e7bd5f latest 2017-11-14 12:51:44 -08:00
Hector Ramos 68f6799b7c Lots of progress into build-docs.js 2017-11-13 14:21:44 -08:00
Hector Ramos 2c130e6a9f wip3 2017-10-31 14:11:35 -07:00
Hector Ramos 21423bdf22 WIP 2017-10-31 14:09:41 -07:00
Hector Ramos e5332504cc wip 2017-10-31 11:51:47 -07:00
Hector Ramos 292f035ae8 progress 2017-10-31 11:19:00 -07:00
Hector Ramos a6c4ae0e75 Moving on to master docs 2017-10-30 17:04:16 -07:00
Hector Ramos e4b5e9ef85 Progress 2017-10-27 13:23:00 -07:00
Hector Ramos 732831dc27 Progress :D 2017-10-27 11:51:58 -07:00
Hector Ramos b150fdfdce mostly there 2017-10-26 23:46:53 -07:00
Hector Ramos 73f2007679 moast there 2017-10-26 18:46:40 -07:00
Hector Ramos da2a8b365c PROGRESS 2017-10-26 16:22:28 -07:00
Hector Ramos 143ecf4c62 Progress 2017-10-26 15:36:54 -07:00
Hector Ramos c8d6cb9e49 WIP{ 2017-10-26 15:20:59 -07:00
Hector Ramos 0661c6f254 WIP 2017-10-09 15:08:36 -07:00
Hector Ramos 5f4a5388ac WIP 2017-10-06 14:30:06 -07:00
Hector Ramos 445dac2743 Progress towards making single "import everything from GitHub, including every tag" script. 2017-10-05 15:36:45 -07:00
Hector Ramos 2d230bee78 Versioning WIP 2017-10-04 17:02:20 -07:00
Hector Ramos 382abb4b45 Adjust layout 2017-10-04 13:20:28 -07:00
Hector Ramos b0e4b89b58 Docs 2017-10-03 13:46:34 -07:00
Hector Ramos 0b8525847f Fix method titles in props 2017-09-29 14:41:15 -07:00
Hector Ramos 09a923599e More styling updates 2017-09-29 14:39:45 -07:00
Hector Ramos e7b7951c96 Styles for props 2017-09-29 14:39:31 -07:00
Hector Ramos a91d0d8c35 Additional css changes 2017-09-27 16:49:19 -07:00
Hector Ramos 47206fdd3c wip 2017-09-25 14:28:16 -07:00
Hector Ramos b02efd9e96 Make showcase logos square 2017-09-12 17:49:45 -07:00
Hector Ramos 31894136f4 Images and static assets 2017-09-05 09:31:56 -07:00
Hector Ramos 9b6639ad12 Fix tabs styling. 2017-09-01 14:19:26 -07:00
Hector Ramos 11f838f349 Adjust styling to match production site. 2017-09-01 13:32:38 -07:00
Hector Ramos 34787cc0eb Updated scripts. 2017-08-31 11:29:32 -07:00
Hector Ramos d40bea925f Move autodocs script to docgen/server 2017-08-31 10:41:57 -07:00
Hector Ramos 692d3f72fb Move to Docusaurus. 2017-08-31 10:38:26 -07:00
Dean G cb9b266b8e Update sectionList keyExtractor docs
Summary:
Added language to explain that you still need to add keys for each section even if you use a keyExtractor method.

No code changed; just clarified documentation.
Closes https://github.com/facebook/react-native/pull/15007

Differential Revision: D5425897

Pulled By: hramos

fbshipit-source-id: db44064a28a673feeda5a6765ea45217d3ae51e2
2017-07-14 13:23:21 -07:00
Janic Duplessis ccb4e67756 Blog - Background color is not supported by the native driver
Summary:
This was a lie, background color is not supported (yet). Sorry for the false hopes :)

Fixes #14178
Closes https://github.com/facebook/react-native/pull/15013

Differential Revision: D5424676

Pulled By: hramos

fbshipit-source-id: ea592bf633f1632c931a9f18fe2fa9ebad6136be
2017-07-14 10:19:33 -07:00
Janic Duplessis ad9b66fc6f Add myself to CODEOWNERS for animated
Summary: Closes https://github.com/facebook/react-native/pull/15014

Differential Revision: D5424672

Pulled By: hramos

fbshipit-source-id: 2da5d0eeb8c1eec07e9d1569dec034f224475e64
2017-07-14 10:19:33 -07:00
Miguel Jimenez Esun 1fe8f89bc8 Update Jest to 20.1.0, chi.1
Reviewed By: davidaurelio

Differential Revision: D5423945

fbshipit-source-id: deb58ba9288883b5d671148aeaa59da6629d0de4
2017-07-14 10:19:32 -07:00
Paco Estevez Garcia a1e053cc50 Add Framework name to Attach selection
Reviewed By: Hypuk, javache

Differential Revision: D5389047

fbshipit-source-id: 90e2a5f805561e47e7705e7935ced7556a374616
2017-07-14 07:50:40 -07:00
Brian Vaughn 221286be13 React sync for revisions cb32253...5495e49
Reviewed By: acdlite

Differential Revision: D5416055

fbshipit-source-id: c69de0d699f11dec4a71fb6e3f924ade3446bba0
2017-07-13 17:38:57 -07:00
Héctor Ramos 07972cf3bf Add gantman to contributors
Summary: Closes https://github.com/facebook/react-native/pull/15009

Differential Revision: D5420862

Pulled By: hramos

fbshipit-source-id: ecf1c7054f9b6792e606e58e37b109f0af62c9c3
2017-07-13 17:17:23 -07:00
Adam Comella 09401ed56f Android: Support setting background color on ARTSurfaceView
Summary:
This fixes support for the `backgroundColor` style prop on an `ART.Surface`.

`ARTSurfaceViewManager` inherits its `setBackgroundColor` implementation from `BaseViewManager`. This implementation broke in API 24 because API 24 removed support for `setBackgroundColor`on `TextureViews`. `ARTSurfaceView` inherits from `TextureView` so it also lost support for `setBackgroundColor`.

To fix this, the implementation of `ART.Surface's` `setBackgroundColor` was moved to the shadow node. The implementation now draws the background color on the canvas.

In a test app, verified that initializing and changing the background color on an `ART.Surface` works. Verified that the background renders as transparent when a background color isn't set. Also, this change is being used in my team's app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/14117

Differential Revision: D5419574

Pulled By: hramos

fbshipit-source-id: 022bfed553e33e2d493f68b4bf5aa16dd304934d
2017-07-13 16:18:50 -07:00
Eli White c885357cc9 Wait for packager to start
Reviewed By: shergin

Differential Revision: D5408443

fbshipit-source-id: 4a9b37822c1f5c0db3d8be71862d5049bca1ecdd
2017-07-13 15:36:12 -07:00
Miguel Jimenez Esun 6dd9d16833 Move Array<string> to $ReadOnlyArray<string>. Separate polyfill list into a file.
Summary: Move the returned type of `getPolyfills` from a standard `Array` to a read-only one, so that we make sure the array is not modified once created. Also, refactor the list of polyfills included by default to a generic, central file, then require it both from the CLI utils as well as the development server.

Reviewed By: jeanlauliac

Differential Revision: D5406553

fbshipit-source-id: ab980288bb1c625338de469da77dd6fc70bcedbc
2017-07-13 03:38:23 -07:00
Maarten Schumacher cad2d9b072 Be able to scroll to last item in list
Summary:
The invariant condition doesn't allow scrolling to the last index

Here is a simple reproduction of the problem: https://snack.expo.io/BJ59gzWrZ

Surely, if the last item is rendered, we should be able to scroll to it without an invariant failing?

Tested locally that this change fixes the issue.
Closes https://github.com/facebook/react-native/pull/14934

Differential Revision: D5414535

Pulled By: shergin

fbshipit-source-id: 38dac4c0e2ae5e1e199a67ca0e98e8f7325e77f4
2017-07-13 00:03:51 -07:00
Eli White e3cfcdfb9c Remove silly exit
Reviewed By: Yu-w

Differential Revision: D5413747

fbshipit-source-id: c3423c4bf2b60204099bd68825797d71b0c217bc
2017-07-12 23:37:27 -07:00
Christian Brevik e2c87b59be Android: Set WebViewManager methods/fields as protected instead of private
Summary:
**Motivation**

See discussion in #10946. The motivation is to make `ReactWebViewManager` more extensible.

Re-using logic from the ReactWebViewManager when implementing your own custom WebView is a pain since so much of the logic is set as `private`.

This PR makes for easier extension/overriding of behavior, and less duplication of code, since most of the methods/fields are set as `protected` instead.

I've also made some "create" methods for the `WebView` and `WebViewBridge` so they can more easily be overridden.

**Test plan**
The test plan is the same as the other PR (#10946). I've made an simple test app which extends `RCTWebViewManager`: https://github.com/cbrevik/overrideWebview

See [CustomWebViewManager.java](https://github.com/cbrevik/overrideWebview/blob/master/android/app/src/main/java/com/overridewebview/CustomWebViewManager.java) for a simple implementation.

CC shergin (https://github.com/facebook/react-native/pull/10946#issuecomment-304763562)
Closes https://github.com/facebook/react-native/pull/14261

Differential Revision: D5413922

Pulled By: shergin

fbshipit-source-id: d2f6d478f2a147e2e7b5e05c195a8b28a0a3d576
2017-07-12 21:14:32 -07:00
Eli White aafccdf622 Revert D5409825: [RN] Convert easy files to Prettier
Differential Revision: D5409825

fbshipit-source-id: f797a40b58bc6bcc6ae53ed820a10ab49d3f10f5
2017-07-12 19:23:58 -07:00
Héctor Ramos bfece1d800 Update ISSUE_TEMPLATE.md
Summary: Closes https://github.com/facebook/react-native/pull/14990

Differential Revision: D5411770

Pulled By: hramos

fbshipit-source-id: ddabba4ec7ce83a19eeadecae41ce11004e36e4e
2017-07-12 16:50:38 -07:00
Steffen Matthischke e43c061e95 Podspec: add required "DevSupport" dependency "InspectorInterfaces.{cpp,h}
Summary:
This PR fixes #14975.
* Podspec: add InspectorInterfaces.h/cpp to the "jschelpers_legacy" subspec.

1. lint the Podspecs: `./scripts/process-podspecs.sh`
2. check that an iOS project can integrate "DevSupport" via Cocoapods again. I'll already checked it on this branch of the demo project: https://github.com/HeEAaD/Demo-ReactNative-0.47.0-rc2-Podspec-issue/tree/fix
Closes https://github.com/facebook/react-native/pull/14988

Differential Revision: D5411733

Pulled By: javache

fbshipit-source-id: bb46cf3461e0857c7508264dafa204067af182c6
2017-07-12 16:27:28 -07:00
Héctor Ramos e02bafd9cf Update Releases.md
Summary:
Minor cleanup. #trivial
Closes https://github.com/facebook/react-native/pull/14987

Differential Revision: D5411371

Pulled By: hramos

fbshipit-source-id: 9ce851ba787ab8a5d334fa3cd975f86d838b9487
2017-07-12 16:08:22 -07:00
Eli White c198911561 Convert easy files to Prettier
Reviewed By: zertosh

Differential Revision: D5409825

fbshipit-source-id: 81f67be174cc8ecfcd0955dfec83955ebdc84622
2017-07-12 16:08:22 -07:00
Eli White 320aea8bca shelljs/global -> shelljs
Reviewed By: zertosh

Differential Revision: D5407207

fbshipit-source-id: df5d1a38a35d27c9c429ea972acab58322441813
2017-07-12 16:08:22 -07:00
Tieme van Veen e57655274d Fix 14436 - Docs: ios-native-ui-guide 'RNTMap' -> 'MKMapView' fix
Summary:
Quick fix for https://github.com/facebook/react-native/issues/14436
Closes https://github.com/facebook/react-native/pull/14982

Differential Revision: D5409794

Pulled By: javache

fbshipit-source-id: ea59a9a11b689459e68c05a92095fdcee1da717f
2017-07-12 14:50:32 -07:00
Tieme van Veen c41b5a02f2 Docs: ios-native-ui-guide RCTConvert categories edit
Summary:
I was struggling a bit with the [iOS Native UI Components tutorial](https://facebook.github.io/react-native/docs/native-components-ios.html#content).

As noted here it's outdated. https://github.com/facebook/react-native/issues/14436

In my opinion, these steps are more clear when the header files are also included in the example. Besides that, the tutorial can use the already existing `RCTConvert+CoreLocation` category for simplicity.
Closes https://github.com/facebook/react-native/pull/14983

Differential Revision: D5409803

Pulled By: javache

fbshipit-source-id: f7fe1d2b542e8df602dc0f0636efb4d764090811
2017-07-12 14:09:55 -07:00
Eli White d9f98191eb Removing @nolint from flow files
Reviewed By: zertosh

Differential Revision: D5407058

fbshipit-source-id: 54e9cbc1a9739bcf104752f3421cc7cba41730cc
2017-07-12 14:09:54 -07:00
Eli White fc86f25f9a Run eslint on all js files
Reviewed By: zertosh

Differential Revision: D5405047

fbshipit-source-id: 5ade9d8beb3688d8bb08a208709c0dbf1ec671b2
2017-07-12 14:09:53 -07:00
Brian Vaughn 1d353b4ef7 Try to match React DevTools theme with current Nuclide theme
Reviewed By: spicyj

Differential Revision: D5362305

fbshipit-source-id: 7d8464f768d124cbb31ba211d81a01a89d6bf692
2017-07-12 12:24:43 -07:00
Brooks Lyrette 98b925ceec Updated example 'Podfile' to consistently use single quotes.
Summary: Closes https://github.com/facebook/react-native/pull/14973

Differential Revision: D5407186

Pulled By: javache

fbshipit-source-id: 78cf68abbbb2fb97786973ce8e3e26b8afdd2a74
2017-07-12 11:18:52 -07:00
Georgiy Kassabli 820026f69b Fixing the issue with node dimensions rounding in Yoga
Reviewed By: emilsjolander

Differential Revision: D5406211

fbshipit-source-id: df1d54ed0805dfc3abbd8f0ceae30f6d8c26d61a
2017-07-12 09:30:29 -07:00
James Ide 9f87728f5d Change polyfills to getPolyfills function for more configurability
Summary:
Changing the `polyfills` option to `getPolyfills({platform})` will let us return a different set of polyfills for each platform. See https://github.com/facebook/metro-bundler/issues/25 for the motivation.
Closes https://github.com/facebook/react-native/pull/14943

Differential Revision: D5405878

Pulled By: mjesun

fbshipit-source-id: 908e49a286841f97655603d92d0fdfb000547510
2017-07-12 08:18:14 -07:00
Felix Oghina 999851a389 Update OSS Fresco dependency
Reviewed By: oprisnik

Differential Revision: D5406106

fbshipit-source-id: 3d928f431701b783fa0862d0dff818ec61d8b737
2017-07-12 07:54:09 -07:00
Pieter De Baets fc68dfbed6 Enable flow for TouchableHighlight
Reviewed By: fkgozali

Differential Revision: D5388762

fbshipit-source-id: bec790a5e2ae5dbaf0f7bd2681ef156e870ed797
2017-07-12 04:15:41 -07:00
harry-g ec8118b637 Better doc for 'data:' uri scheme & mandatory size
Summary:
It is quite confusing that the 'data:' uri scheme is not documented, but working.
It is very useful when getting e.g. an icon from a REST call.

Also, the mandatory size style for network & data images should be mentioned here, not only in the image guide.

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/14826

Differential Revision: D5401671

Pulled By: hramos

fbshipit-source-id: 8f1f28a94095eeaccae9234e059e0983ba3556b2
2017-07-11 15:33:37 -07:00
Adam Miskiewicz 8ea6cea39a MaskedViewIOS -- A way to apply alpha masks to views on iOS
Summary:
It's very important in complex UIs to be able to apply alpha channel-based masks to arbitrary content. Common use cases include adding gradient masks at the top or bottom of scroll views, creating masked text effects, feathering images, and generally just masking views while still allowing transparency of those views.

The original motivation for creating this component stemmed from work on `react-navigation`. As I tried to mimic behavior in the native iOS header, I needed to be able to achieve the effect pictured here (this is a screenshot from a native iOS application):

![iOS native navbar animation](https://slack-imgs.com/?c=1&url=https%3A%2F%2Fd3vv6lp55qjaqc.cloudfront.net%2Fitems%2F0N3g1Q3H423P3m1c1z3E%2FScreen%2520Shot%25202017-07-06%2520at%252011.57.29%2520AM.png)

In this image, there are two masks:

- A mask on the back button chevron
- A gradient mask on the right button

In addition, the underlying view in the navigation bar is intended to be a UIBlurView. Thus, alpha masking is the only way to achieve this effect.

Behind the scenes, the `maskView` property on `UIView` is used. This is a shortcut to setting the mask on the CALayer directly.

This gives us the ability to mask any view with any other view. While building this component (and testing in the context of an Expo app), I was able to use a `GLView` (a view that renders an OpenGL context) to mask a `Video` component!

I chose to implement this only on iOS right now, as the Android implementation is a) significantly more complicated and b) will most likely not be as performant (especially when trying to mask more complex views).

Review the `<MaskedViewIOS>` section in the RNTester app, observe that views are masked appropriately.

![example](https://d3vv6lp55qjaqc.cloudfront.net/items/250X092v2k3f212f3O16/Screen%20Recording%202017-07-07%20at%2012.18%20PM.gif?X-CloudApp-Visitor-Id=abb33b3e3769bbe2f7b26d13dc5d1442&v=5f9e2d4c)
Closes https://github.com/facebook/react-native/pull/14898

Differential Revision: D5398721

Pulled By: javache

fbshipit-source-id: 343af874e2d664541aca1fefe922cf7d82aea701
2017-07-11 15:05:57 -07:00
Raj Suvariya 0c44b9e9b0 Update IntegrationWithExistingApps.md
Summary:
Conflict in the project name in package.json and index.xxx.js

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/14940

Differential Revision: D5398809

Pulled By: hramos

fbshipit-source-id: 0ed12e8a39e5c477594396b4b781acd8a93f429d
2017-07-11 14:32:40 -07:00
Valentin Shergin 7cdd4d48c8 Nits: [NSNull null] was changed to (id)kCFNull`
Reviewed By: javache

Differential Revision: D5398734

fbshipit-source-id: 823e860b5da9cc9850fafa49c1d9b746580856b0
2017-07-11 12:31:15 -07:00
Héctor Ramos 18c795bfcc Update AnimatedImplementation.js
Summary:
Small sample code fix, based on #12175
Closes https://github.com/facebook/react-native/pull/14948

Differential Revision: D5399724

Pulled By: hramos

fbshipit-source-id: dd4de3b06dcec090f0c636b8d4c1f315cefc8b1b
2017-07-11 12:31:15 -07:00
gabriel 3f16aa5559 added chromium support for devTools on linux
Summary:
<details>
  Thanks for submitting a PR! Please read these instructions carefully:

  - [ ] Explain the **motivation** for making this change.
  - [ ] Provide a **test plan** demonstrating that the code is solid.
  - [ ] Match the **code formatting** of the rest of the codebase.
  - [ ] Target the `master` branch, NOT a "stable" branch.

  Please read the [Contribution Guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md) to learn more about contributing to React Native.
</details>

_What existing problem does the pull request solve?_

On Linux, the packager caught an "Google Chrome exited with error: { Error: spawn google-chrome ENOENT}" when trying to launch the devTools because google-chrome is not installed but chromium is.
Thus, this pull request maps the platform Linux with chromium for launching the debugger automatically in the packager

_A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website._

- enter on terminal
    > react-native start
- launch the app in dev mode with "Debug JS remotely" enabled
- the packager prints "Launching Dev Tools..." and launch chromium with the debugger
![screenshot](https://user-images.githubusercontent.com/13065528/27481217-ceaf5e58-581b-11e7-976f-75c107596ad3.png)
Closes https://github.com/facebook/react-native/pull/14696

Differential Revision: D5398564

Pulled By: hramos

fbshipit-source-id: 151f83b549492c8716a248eb16f7e24c5658b32e
2017-07-11 12:31:15 -07:00
Héctor Ramos a616a2d99d Add Animated to list of APIs
Summary:
Also: move `Button` down to UI, and `StyleSheet` up to Basic Components.
Closes https://github.com/facebook/react-native/pull/14405

Differential Revision: D5209838

Pulled By: hramos

fbshipit-source-id: ffcd3a146a5c277f8d7e824c9a7595d2e7b720ae
2017-07-11 11:18:57 -07:00
Liu Zhanhong 6b29fe78c4 Avoid creating a new Path instance for performance
Summary:
New a Path instance will cause a slice call to exist path.

```js
// react-native/Libraries/ART/ARTSerializablePath.js
if (path instanceof SerializablePath) {
  this.path = path.path.slice(0);
}
```

Most of d3's APIs can set context when we don't want to use d3's build-in path object. And in RN envirenment, we must use RN's path instance. So we can use RN's path as a context in d3 avoiding doing conversions from svg's path string to arrays. But with existing code, when Shape receive a `d` proprety, it new a path instance and will cause calling slice in a very large array.

Typical usage is as follows

```js
import React from 'react';
import { View, ART } from 'react-native';
import { line } from 'd3-shape';
import { scaleLinear } from 'd3-scale';

const { Path, Surface, Shape } = ART;
const width = 360;
const height = 300;
const data = [5,2,7,6,9,1,8,4,3];
const x = scaleLinear().range([0, width]).domain([0, data.length]);
const y = scaleLinear().range([height, 0]).domain([0, 9]);
const myline = line()
    .x(function(d, i) {
      return x(i);
    })
    .y(function(d) { return y(d); });

// use RN's ART Path
const path = Path();
myline.context(path)(data);

class TestArt extends React.Component {
  render() {
    return (
      <View>
        <Surface width={width} height={height}>
          <Shape
            stroke="red"
            d={
              // use RN's ART Path
              path
              // use d3's path
              // myline(data)
            }
          />
        </Surface>
      </View>
    );
  }
}
```
Closes https://github.com/facebook/react-native/pull/14551

Differential Revision: D5398653

Pulled By: javache

fbshipit-source-id: 1264acfb8844b60584604a664e0474f9e212d1d1
2017-07-11 11:18:56 -07:00
Giles Van Gruisen 5f1408858a Support additional dependency declaration format
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

Previously, `isInstalled` was somewhat naively checking for the presence
of a string in the `build.gradle` file to determine whether or not that
dependency was already linked. I.e.:

```
    compile project(':${name}')\n
```

…where `name` is replaced with the name of the dependency being checked.

This was inflexible as it only supported that particular format of
`compile` definition. Another, valid `compile` definition follows:

```
    compile(project(':example') { … }
```

However, this failed the check because it didn't _exactly_ match the
format for which the check was searching the `build.gradle` contents. As
a result, running `react-native link` would incorrectly duplicate the
dependency definition and thus cause a crash upon launching the app.

This change adds an `installPattern` to the object returned from
`makeBuildPatch`, which includes the particular dependency name and is
valid for both `compile` definition formats.

This commit adds an additional compile definition in the associated fixture,
an additional test case in `isInstalled.spec.js` to check for this additional
format, and an additional test in `makeBuildPatch.spec.js` to ensure the
object returned includes the aforementioned `installPattern` Regex pattern.

Sign the [CLA][2], if you haven't already. 

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it. 

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.

For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.

[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
Closes https://github.com/facebook/react-native/pull/14475

Differential Revision: D5398552

Pulled By: hramos

fbshipit-source-id: 1eaf84ba5bcfc43202f13c6b8fcfc68c30f36c33
2017-07-11 11:18:56 -07:00
Koen Punt 51e258e6e7 Rename _remoteNotificationCompleteCalllbackCalled to _remoteNotificationCompleteCallbackCalled
Summary:
Just noticed this typo
Closes https://github.com/facebook/react-native/pull/14886

Differential Revision: D5398308

Pulled By: hramos

fbshipit-source-id: 9ef5155fb4d8a7b44ac9ba0c3e13871391081f1a
2017-07-11 11:06:21 -07:00
Eli Perkins 78e2030e95 Clean up -[RCTRootView cancelTouches] header docs
Summary:
Just a little typo fixing and wording clean up around some header docs.
Closes https://github.com/facebook/react-native/pull/14947

Differential Revision: D5398609

Pulled By: javache

fbshipit-source-id: 3eb40ef3308130c1d28b2efc7bb64d493e98825b
2017-07-11 11:06:21 -07:00
Kathy Gray 50f200ba90 Fix RCTNetworking error message
Reviewed By: javache

Differential Revision: D5397652

fbshipit-source-id: ab081dfa5f29c0b672eda6a1a22d23e6fc0881c1
2017-07-11 09:10:20 -07:00
Miguel Jimenez Esun ad0fe15e2e Move polyfills to react-native
Summary:
React Native bundler (aka Metro Bundler) was splitted from the main codebase some time ago (now it lives [[https://github.com/facebook/metro-bundler|here]]). To make it more agnostic, polyfills will be moved out from it, so people who doesn't need them does not include them. However, RN will still need them, so the first step is to copy them back to RN so that we can provide them to Metro Bundler later.

We also include a way of passing the list of polyfills to include, as an `Array<string>`. The field is called `polyfills`, and defaults to the traditional list that is currently included in the package manager [see here](https://github.com/facebook/metro-bundler/blob/be1843cddcff78802cd774c8a75fe8647df0135d/packages/metro-bundler/src/defaults.js#L27-L37).

In future commits, `metro-bundler` will be able to manage the `polyfills` array passed to it, and use it, instead of the pre-defined ones.

Reviewed By: davidaurelio

Differential Revision: D5381614

fbshipit-source-id: 749d536b781843ecb3067803e44398cd6df941f1
2017-07-11 03:47:16 -07:00
Sean Wang 88fb45ddf9 Clarity in pagingEnabled description for ScrollView
Summary:
Current description is misleading (without looking at implementation) to believe that both horizontal and vertical pagination are supported on both platforms. This comment clarifies that vertical pagination is not supported on Android.
Closes https://github.com/facebook/react-native/pull/14844

Differential Revision: D5393488

Pulled By: hramos

fbshipit-source-id: e79246a65e1011b2667e7eea67e85e17394026a8
2017-07-10 17:46:14 -07:00
Alexander Komissarov 8f363b2c49 Converting more android support library dependencies in React Native. Now for v7
Reviewed By: achen1

Differential Revision: D5332443

fbshipit-source-id: 085be2d542feb29c3727958908648237c3ed0503
2017-07-10 17:18:11 -07:00
Christian Brevik 684e03590b Support native ViewManager inheritance on iOS
Summary:
**Motivation**
This is a re-worked version of #14260, by shergin's suggestion.

For iOS, if you want to inherit from a native ViewManagers, your custom ViewManager will not automatically export the parents' props. So the only way to do this today, is to basically copy/paste the parent ViewManager-file, and add your own custom logic.

With this PR, this is made more extensible by exporting the `baseModuleName` (i.e. the iOS `superclass` of the ViewManager), and then using that value to re-establish the inheritance relationship in `requireNativeComponent`.

**Test plan**
I've run this with a test project, and it works fine there. But needs more testing.

Opened this PR as [per shergin's suggestion](https://github.com/facebook/react-native/pull/10946#issuecomment-311860545) though, so we can discuss approach.

**Discussion**
* Android already supports inheritance, so this change should be compatible with that. But, not every prop available on `UIManager.RCTView.NativeProps` is actually exported by every ViewManager. So should `UIManager.RCTView.NativeProps` still be merged with `viewConfig.NativeProps`, even if the individual ViewManager does not export/use them to begin with?
* Does this break other platforms? [UWP](https://github.com/Microsoft/react-native-windows)?
Closes https://github.com/facebook/react-native/pull/14775

Differential Revision: D5392953

Pulled By: shergin

fbshipit-source-id: 5212da616acfba50cc285e2997d183cf8b2cd09f
2017-07-10 16:01:12 -07:00
Eli White 10230707cb Enforce Prettier for @format
Reviewed By: zertosh

Differential Revision: D5392376

fbshipit-source-id: 6f09a4d8f4542c3a74aadb8d62fd216529a4f2bc
2017-07-10 15:37:36 -07:00
Sai Grandhi d7f671135c Update copyToClipBoard.js
Summary:
Since copy to clipboard functionality is now available in Linux, the comment above `copyToClipboard` function has been updated.
Closes https://github.com/facebook/react-native/pull/14773

Differential Revision: D5392372

Pulled By: hramos

fbshipit-source-id: 6e2668e1a89d37f9d5707fa36b3639895cd5bffd
2017-07-10 15:22:50 -07:00
harry-g dfd3b22275 Better doc for 'data:' uri scheme
Summary:
It is quite confusing that the 'data:' uri scheme is not documented, but working.
It is very useful when getting e.g. an icon from a REST call.
Closes https://github.com/facebook/react-native/pull/14827

Differential Revision: D5392326

Pulled By: hramos

fbshipit-source-id: 815851c27273f99ce281fb35fc6fbcf8cf781ff9
2017-07-10 14:17:27 -07:00
Eli White 40fdd6d91c Enable eslint on circle ci
Reviewed By: zertosh

Differential Revision: D5374369

fbshipit-source-id: 5ffd246bc6fa735d781ed71cd293b7883184b786
2017-07-10 12:08:32 -07:00
Lukas Wöhrl 5da0a9909e Reset the hadOverflow flag at the beginning of the algorithm
Summary:
This fixes the case where we change the layout, so that it doesn't overflow anymore.

This also improves the readability by using `|=` instead of referencing the value twice.
Closes https://github.com/facebook/yoga/pull/587

Differential Revision: D5388657

Pulled By: emilsjolander

fbshipit-source-id: ce1b1ded1feed7314a2c16bf695f62b866c19ea0
2017-07-10 12:08:32 -07:00
Liron Yahdav dec62ffc3e Clarify JavaScript module naming edge case
Summary:
I've been burned by https://stackoverflow.com/questions/35052565/undefined-is-not-an-object-from-native-module-in-react-native/36580178 a few times, when I name a native module with RCT prefix. This will hopefully save me and others from that pain in the future.

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/14903

Differential Revision: D5390343

Pulled By: hramos

fbshipit-source-id: 73667d703b097e70e15ff42c54b7ccc6b480104f
2017-07-10 11:36:48 -07:00
Nurzhan Bakibayev c00abe53c3 Move inspector proxy out of the packager
Reviewed By: pakoito

Differential Revision: D5369099

fbshipit-source-id: ff806d784b70804181c5c54837352f66e45d1b9e
2017-07-10 06:31:23 -07:00
Pieter De Baets f1cbb11620 Replace -[RCTConvert folly_dynamic:] with direct calls to convertIdToFollyDynamic
Reviewed By: kathryngray

Differential Revision: D5355734

fbshipit-source-id: 4ba1533b75c8e271a86a2d5cc3a3354e52f83db2
2017-07-10 05:31:04 -07:00
Patrick dc97e3fb4e Fixed ImageBackground could't be wrapped by Touchable* component
Summary:
In 0.46, as warning's advice, I use `ImageBackground` to replace `Image`s which used as background image wrapper, and in some cases, I also wrap `ImageBackground` with `TouchableHighlight` to make it clickable.

But here comes an error:

> Touchable child must either be native or forward setNativeProps to a native component

![2017-07-07 3 25 19](https://user-images.githubusercontent.com/3055294/27948869-f7c5832c-632d-11e7-97ba-5074cca82961.png)

So I pick some code from `Image.ios.js` into `ImageBackground.js` to solve it.

Please help to review, thanks!
Closes https://github.com/facebook/react-native/pull/14884

Reviewed By: shergin

Differential Revision: D5380988

Pulled By: javache

fbshipit-source-id: 35fda029030a39e720b6266f5d0a27ea3ff145ef
2017-07-10 05:03:25 -07:00
Kevin Luvian e6941990ef Fixed new line and prioritise blurOnSubmit in multiline text input
Summary:
What existing problem does the pull request solve?
this fixes #13506 and #12717 where:
- there are some issues when pressing enter with some keyboard
- blurOnSubmit is not working with multiline

I think this should be in stable branch as this is pretty critical, isn't it?

- just create a TextInput with multiline and press enter with samsung keyboard
before, it won't create a new line, now it will.

- just create a TextInput with multiline and blurOnSubmit true and press enter
before, it won't blur, and wont create a new line (on some keyboard, it will create a new line), now it will blur only
Closes https://github.com/facebook/react-native/pull/13890

Reviewed By: achen1

Differential Revision: D5333464

Pulled By: shergin

fbshipit-source-id: a0597d1b1967d4de1486e728e03160e1bb15afeb
2017-07-09 15:34:10 -07:00
James Ide 1954fd4cef Remove unused npm dependencies and add missing ones
Summary:
A couple of npm dependencies are unused (grepped for them or their variants since some are Babel presets/plugins) and there were also some missing that are listed in react-native's package.json but are directly required by the website.
Closes https://github.com/facebook/react-native/pull/14880

Differential Revision: D5383816

Pulled By: hramos

fbshipit-source-id: 704cea500d92542078fddbb8777e6855d70e4659
2017-07-08 01:45:01 -07:00
Brent Vatne 2781739fbe Fix type of StatusBar backgroundColor so it is displayed correctly in docs
Summary:
![screen shot 2017-07-07 at 2 54 01 pm](https://user-images.githubusercontent.com/90494/27978425-3d4c7702-6324-11e7-8cea-0f1e121e84d6.png)

![screen shot 2017-07-07 at 2 55 08 pm](https://user-images.githubusercontent.com/90494/27978437-4943df46-6324-11e7-9a64-ad30599811f2.png)

The change that set this type to $FlowFixMe was a [massive one-year-old old commit](https://github.com/facebook/react-native/commit/a2fb703bbb988038323c55b29b40e8f5ff52966d) and I don't think it is necessary anymore (flow passes with this change). If it does, it must be something internal to Facebook, maybe we should $FlowFixIt somehow?
Closes https://github.com/facebook/react-native/pull/14895

Differential Revision: D5385198

Pulled By: hramos

fbshipit-source-id: a769f8589f4b8d7421b6445f2c0bf08857a7dd1f
2017-07-07 20:33:31 -07:00
Luke Rhodes bf1b67ee5f Support for preventing swipe left or swipe right
Summary:
The primary use case for this is disabling swipe right when using react-navigation's swipe to go back feature.
Closes https://github.com/facebook/react-native/pull/14684

Differential Revision: D5386554

Pulled By: sahrens

fbshipit-source-id: 1e7c4caaa804f86977d391c1bdb62be69342b551
2017-07-07 20:03:20 -07:00
Hector Ramos dedffdc235 Add CODEOWNERS file to automatically request reviews.
Summary:
Recently announced: https://github.com/blog/2392-introducing-code-owners

These are non-blocking for the time being.
Closes https://github.com/facebook/react-native/pull/14897

Differential Revision: D5385189

Pulled By: hramos

fbshipit-source-id: 711827573f85577b70f3627d66a1f9f00fe7f90d
2017-07-07 16:32:28 -07:00
LironErman 6db97d638d Add note to add the service to AndroidManifest
Summary:
If not you will try to start the service but nothing would happen

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/14813

Differential Revision: D5384460

Pulled By: hramos

fbshipit-source-id: 6131d7901d3324da97672141c4774b7810051526
2017-07-07 15:18:36 -07:00
Seth Fitzsimmons 9afb71fde8 Replace React.createClass with create-react-class
Summary:
This replaces all uses of `React.createClass` with `createReactClass` from the `create-react-class` package, attempting to match use of `var` and `const` according to local style.

Fixes #14620
Refs #14712
Closes https://github.com/facebook/react-native/pull/14729

Differential Revision: D5321810

Pulled By: hramos

fbshipit-source-id: ae7b40640b2773fd89c3fb727ec87f688bebf585
2017-07-07 14:36:01 -07:00
Pieter De Baets 20224b74a4 Remove deprecated RCTAssert aliases
Reviewed By: fromcelticpark

Differential Revision: D5380783

fbshipit-source-id: 790d7e1bc6d99411ecc471df88f7b1f31680e7a0
2017-07-07 12:21:59 -07:00
Pieter De Baets 8548ca09f1 Remove unused RCTDebugComponentOwnership
Reviewed By: sahrens

Differential Revision: D5380887

fbshipit-source-id: ff81324718d64d7a04ef4bd293d30dd6f3aabb2a
2017-07-07 12:04:04 -07:00
Christoph Nakazawa e0eee0bb49 Revert D5321193: BREAKING: Add regenerator-runtime on demand, based on the files
Differential Revision: D5321193

fbshipit-source-id: 9113ed78e59ae9e9f3f86ca2fda2db3bd8c0dd7c
2017-07-07 10:48:37 -07:00
David Aurelio 9b06a3193e Update throat dependency to 3.2.0
Summary: it has flow definitions now. OMG!

Reviewed By: cpojer

Differential Revision: D5381183

fbshipit-source-id: bdb3863b24da9802eeeb8a7d08f05d629f735178
2017-07-07 09:21:24 -07:00
Miguel Jimenez Esun 361f03badb BREAKING: Add regenerator-runtime on demand, based on the files
Summary:
Adding a Babel plugin that will analyze the file looking for any potential candidate to use `regenerator-runtime`, and if so, will inject dynamically the module. The module is injected per file, so we avoid polluting the global environment. The plugin is also able to inject the `require` call beforehand, so that the inliner can pick them and inline them.

The Babel plugin is part of `react-native-babel-preset`, so as long as you are using this preset you are safe. If not, you should include the specific transformer into your list of plugins, as `react-native-babel-preset/transforms/transform-regenerator-runtime-insertion.js`.

Reviewed By: davidaurelio

Differential Revision: D5321193

fbshipit-source-id: fd4805b28c8a2b986842e23570a64003370d2067
2017-07-07 07:47:13 -07:00
James Ide 3e96fb1de3 Upgrade the version of Yarn to 0.27.5 for CI
Summary:
The TravisCI tests were using an especially old version of Yarn. Upgrade to 0.27.5 so we're using a version closer to the version that more people (and especially RN maintainers) would be using.
Closes https://github.com/facebook/react-native/pull/14883

Differential Revision: D5380987

Pulled By: javache

fbshipit-source-id: d600c6c4dbf881006065d1e294226b6a2a60a70b
2017-07-07 06:24:31 -07:00
Kathy Gray 6796abbe55 Using shared bridge path for RN
Reviewed By: javache

Differential Revision: D5002111

fbshipit-source-id: 86c2856145a6595823fd027145b050a6fba3d90d
2017-07-07 05:30:38 -07:00
Pieter De Baets a8a29a92a0 Simplify macro usage in MethodInvoker
Reviewed By: kathryngray

Differential Revision: D5363934

fbshipit-source-id: a9cffb10b4d6244d1d66267f6c1e07ba69663b9c
2017-07-07 03:06:21 -07:00
Pieter De Baets 9108f98ca7 Add type for onLayout
Reviewed By: sahrens

Differential Revision: D5364203

fbshipit-source-id: ad87179422b0e595fc78db21a3108d50ba31564c
2017-07-07 03:06:21 -07:00
James Ide 6e13adbf56 Remove remnants of the packager
Summary:
There were still some references to "packager/" that are no longer used since the `packager` directory has been deleted after moving to Metro. Cleaned up the ones that were doing nothing and updated the references that are still meaningful.
Closes https://github.com/facebook/react-native/pull/14881

Reviewed By: cpojer

Differential Revision: D5380731

Pulled By: javache

fbshipit-source-id: 1355268f48db47343d0d38fae2598b64c8c01475
2017-07-07 03:06:21 -07:00
Pieter De Baets 6c2beaffdc Fix Travis podspec CI for Cxx bridge
Summary:
Fixed the test script to properly setup our third-party deps and tweaked the third-party specs a bit so they work correctly.

This currently works for projects using static libraries, but fails when using dynamic libraries (`--use-libraries`)

cc mhorowitz alloy
Closes https://github.com/facebook/react-native/pull/14100

Differential Revision: D5380728

Pulled By: javache

fbshipit-source-id: e78b6bd4466ebf2bf30b7e361eff10ec14b36a55
2017-07-07 02:32:07 -07:00
Grace Ku 79bf089bc5 Make visible to fix build when focusing on ReactKit
Reviewed By: dinhviethoa

Differential Revision: D5372827

fbshipit-source-id: 4cc718e88bc2da08b104d22ffc83691a62b1de4e
2017-07-06 19:46:45 -07:00
Marc Horowitz 26f01faf1b Make OSS CocoaPods build work with or without use_frameworks!
Reviewed By: javache

Differential Revision: D5361624

fbshipit-source-id: c2e5e8985827208a43e06932f746c6b9ccb146ad
2017-07-06 17:41:47 -07:00
Marc Horowitz 1ef21ece92 OSS build fix: use #import "..." instead of #import <RCTText/...>
Reviewed By: javache

Differential Revision: D5361615

fbshipit-source-id: 90d08eb5dea81253c1f7ea582ed2508eec1ba117
2017-07-06 17:07:28 -07:00
Spencer Ahrens 1054644631 Use fixed point in inspector
Reviewed By: achen1, TheSavior

Differential Revision: D5365796

fbshipit-source-id: 07a4de096c6b79e633c9b73d42744953396e2abe
2017-07-06 14:52:28 -07:00
Parashuram N 352c3d97b3 Updating the usage of inquirer API
Summary:
Inquirer was changed to a later version in https://github.com/facebook/react-native/commit/bada25d158e070fd683a10b8ff9cdcb8d2498b14. However, the API also needed to be updated to use a promise based version.
Closes https://github.com/facebook/react-native/pull/14848

Differential Revision: D5375663

Pulled By: javache

fbshipit-source-id: 635798a43905301c65db5f63b9cfba1c16964870
2017-07-06 14:34:45 -07:00
superyarik f8ae461bc1 Update FlatList.js
Summary:
<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/14764

Differential Revision: D5375730

Pulled By: javache

fbshipit-source-id: 776db77c4dc681edef5832552b220197225e9d3f
2017-07-06 14:34:45 -07:00
Pieter De Baets 465a68db1f Remove xcode_public_headers_symlinks from RN BUCK files
Reviewed By: dinhviethoa

Differential Revision: D5321259

fbshipit-source-id: b07ff4a01280251deb2113a62197d96d5c2e37a1
2017-07-06 12:16:20 -07:00
Valentin Shergin 2be921c88a Fixed possible inconsistency in view hierarchy caused by deleting animation
Summary:
This diff fixes a possibly inconsistent state of view hierarchy caused by async delayed deleting manipulation on UIView's tree.
Even if new approach may seem tricky, the previous one was just terribly wrong.

Reviewed By: javache

Differential Revision: D5374670

fbshipit-source-id: 36f27330aa8b0e4e00fe43739afe3bc6a8602e30
2017-07-06 12:16:20 -07:00
Spencer Ahrens 2c9e113f8e Add ListView deprecation message to docs
Summary:
Could have sworn we put this in a while ago...
Closes https://github.com/facebook/react-native/pull/14870

Differential Revision: D5376747

Pulled By: sahrens

fbshipit-source-id: d2bf3efea205defa48d6cd7f853739f17eb39ece
2017-07-06 11:51:32 -07:00
Billydubb ed04d77c2c import HashMap
Summary:
Project won't build otherwise

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/14835

Differential Revision: D5375496

Pulled By: javache

fbshipit-source-id: 415abb0fd257a4f871acbcb89be26b10b96a01c6
2017-07-06 11:51:32 -07:00
Alexander Komissarov 1ab96fd077 Converting android support library dependencies to be provided_deps in React Native.
Reviewed By: bestander

Differential Revision: D5326236

fbshipit-source-id: 3f2ca43a78c4c868ed6665b4d9f61630631f9502
2017-07-05 19:15:22 -07:00
2394 changed files with 215005 additions and 14109 deletions
+9 -1
View File
@@ -3,4 +3,12 @@
**/staticBundle.js
**/main.js
Libraries/vendor/**/*
packager/src/worker-farm/**/*
Libraries/Renderer/*
website/node_modules
pr-inactivity-bookmarklet.js
question-bookmarklet.js
flow/
website/core/metadata.js
website/core/metadata-blog.js
website/src/react-native/docs/
website/src/react-native/blog/
+17 -25
View File
@@ -1,4 +1,6 @@
{
"root": true,
"parser": "babel-eslint",
"ecmaFeatures": {
@@ -11,6 +13,8 @@
},
"plugins": [
"flowtype",
"prettier",
"react"
],
@@ -49,33 +53,17 @@
"setTimeout": false,
"window": false,
"XMLHttpRequest": false,
"pit": false,
// Flow global types.
"ReactComponent": false,
"ReactClass": false,
"ReactElement": false,
"ReactPropsCheckType": false,
"ReactPropsChainableTypeChecker": false,
"ReactPropTypes": false,
"SyntheticEvent": false,
"$Either": false,
"$All": false,
"$ArrayBufferView": false,
"$Tuple": false,
"$Supertype": false,
"$Subtype": false,
"$Shape": false,
"$Diff": false,
"$Keys": false,
"$Enum": false,
"$Exports": false,
"$FlowIssue": false,
"$FlowFixMe": false,
"$FixMe": false
"pit": false
},
"rules": {
// Flow Plugin
// The following rules are made available via `eslint-plugin-flowtype`
"flowtype/define-flow-type": 1,
"flowtype/use-flow-type": 1,
// General
"comma-dangle": 0, // disallow trailing commas in object literals
"no-cond-assign": 1, // disallow assignment in conditional expressions
"no-console": 0, // disallow use of console (off by default in the node environment)
@@ -176,6 +164,10 @@
"no-restricted-modules": 1, // restrict usage of specified node modules (off by default)
"no-sync": 0, // disallow use of synchronous methods (off by default)
// Prettier Plugin
// https://github.com/prettier/eslint-plugin-prettier
"prettier/prettier": [2, "fb", "@format"],
// Stylistic Issues
// These rules are purely matters of style and are quite subjective.
@@ -241,6 +233,6 @@
"react/prop-types": 0,
"react/react-in-jsx-scope": 1,
"react/self-closing-comp": 1,
"react/wrap-multilines": 0,
"react/wrap-multilines": 0
}
}
+9
View File
@@ -0,0 +1,9 @@
docs/* @hramos
blog/* @hramos
Libraries/Animated/* @janicduplessis
Libraries/NativeAnimation/* @janicduplessis
ReactAndroid/src/main/java/com/facebook/react/animated/* @janicduplessis
website/* @hramos
website/showcase.json @hramos
package.json @hramos @ericnakagawa
website/package.json @hramos @ericnakagawa
+9 -3
View File
@@ -45,16 +45,21 @@
Then, specify:
1. Target Platform (e.g. iOS, Android):
2. Development Operating System (e.g. macOS Sierra, Windows 10):
3. Build tools (Xcode or Android Studio version, iOS or Android SDK version, if relevant):
<!-- (What platform are you building for? Choose any from iOS, Android, AppleTV.) -->
- Target Platform:
<!-- Which operating system are you using? Specify macOS, Windows, or Linux, along with specific release versions -->
- Development Operating System:
<!-- Include any additional relevant information. Are you using Xcode or Android Studio to build native code? Is the issue specific to a particular iOS or Android SDK? -->
- Build tools:
### Steps to Reproduce
<!--
How would you describe your issue to someone who doesnt know you or your project?
Try to write a sequence of steps that anybody can repeat to see the issue.
Be specific! If the bug cannot be reproduced, your issue may be closed.
-->
(Write your steps here:)
@@ -79,6 +84,7 @@ Then, specify:
Did something go wrong?
Is something broken, or not behaving as you expected?
Describe this section in detail, and attach screenshots if possible.
Don't just say "it doesn't work"!
-->
(Write what happened. Add screenshots!)
+3
View File
@@ -57,3 +57,6 @@ node_modules
/coverage
/third-party
/website/src
/website/build
+9 -15
View File
@@ -3,25 +3,20 @@ language: objective-c
osx_image: xcode8.3
install:
- mkdir -p /Users/travis/build/facebook/.nvm
- export NVM_DIR="/Users/travis/build/facebook/.nvm"
- brew install nvm
- source $(brew --prefix nvm)/nvm.sh
# TODO npm 2 started stalling on Travis, t11852928
# Use node 6 because that is what runs on land-blocking tests
- nvm install 6
- nvm install 7
- rm -Rf "${TMPDIR}/jest_preprocess_cache"
- wget https://github.com/yarnpkg/yarn/releases/download/v0.16.0/yarn-0.16.0.js
- export yarn="node $(pwd)/yarn-0.16.0.js"
- $yarn install
- brew install yarn --ignore-dependencies
- yarn install
script:
- if [[ "$TEST_TYPE" = objc-ios ]]; then travis_retry travis_wait ./scripts/objc-test-ios.sh test; fi
- if [[ "$TEST_TYPE" = objc-tvos ]]; then travis_retry travis_wait ./scripts/objc-test-tvos.sh; fi
- if [[ "$TEST_TYPE" = objc-ios ]]; then travis_retry travis_wait 30 ./scripts/objc-test-ios.sh test; fi
- if [[ "$TEST_TYPE" = objc-tvos ]]; then travis_retry travis_wait 30 ./scripts/objc-test-tvos.sh; fi
- if [[ "$TEST_TYPE" = e2e-objc ]]; then node ./scripts/run-ci-e2e-tests.js --ios --js --retries 3; fi
- if [[ ( "$TEST_TYPE" = podspecs ) && ( "$TRAVIS_PULL_REQUEST" = "false" ) ]]; then gem install cocoapods && ./scripts/process-podspecs.sh; fi
- if [[ ( "$TEST_TYPE" = podspecs ) && ( "$TRAVIS_PULL_REQUEST" = "false" ) ]]; then gem install cocoapods && travis_wait 30 ./scripts/process-podspecs.sh; fi
cache:
- cocoapods
- yarn
matrix:
- fast_finish: true # Fail the whole build as soon as one test type fails. Should help with Travis capacity issues (very long queues).
@@ -41,7 +36,6 @@ branches:
notifications:
email:
recipients:
- mkonicek@fb.com
- douglowder@mac.com # Doug Lowder built and maintains Apple TV specific code and wants to be notified about tvOS failures.
- eloy@artsy.net # Eloy Durán maintains the podspecs test and wants to be notified about failures.
on_failure: change
+14
View File
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/Libraries/react-native/react-native-implementation.js"
}
]
}
+1 -1
View File
@@ -1,6 +1,6 @@
FROM library/node:6.9.2
ENV YARN_VERSION=0.19.1
ENV YARN_VERSION=0.27.5
# install dependencies
RUN apt-get update && apt-get install ocaml libelf-dev -y
+3 -1
View File
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var {
Image,
@@ -58,7 +59,8 @@ type State = {
containerStyle?: Style,
};
var LayoutEventsTest = React.createClass({
var LayoutEventsTest = createReactClass({
displayName: 'LayoutEventsTest',
getInitialState(): State {
return {
didAnimation: false,
@@ -10,6 +10,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter');
var Subscribable = require('Subscribable');
@@ -24,7 +25,8 @@ var reactViewHeight = 102;
var newReactViewWidth = 201;
var newReactViewHeight = 202;
var ReactContentSizeUpdateTest = React.createClass({
var ReactContentSizeUpdateTest = createReactClass({
displayName: 'ReactContentSizeUpdateTest',
mixins: [Subscribable.Mixin,
TimerMixin],
@@ -10,6 +10,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter');
var Subscribable = require('Subscribable');
@@ -22,7 +23,8 @@ var reactViewHeight = 222;
var finalState = false;
var SizeFlexibilityUpdateTest = React.createClass({
var SizeFlexibilityUpdateTest = createReactClass({
displayName: 'SizeFlexibilityUpdateTest',
mixins: [Subscribable.Mixin],
componentWillMount: function() {
+3 -1
View File
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var TimerMixin = require('react-timer-mixin');
@@ -22,7 +23,8 @@ var {
} = ReactNative;
var { TestModule } = ReactNative.NativeModules;
var TimersTest = React.createClass({
var TimersTest = createReactClass({
displayName: 'TimersTest',
mixins: [TimerMixin],
_nextTest: () => {},
+3 -2
View File
@@ -392,7 +392,7 @@ class Shape extends React.Component {
render() {
var props = this.props;
var path = props.d || childrenAsString(props.children);
var d = new Path(path).toJSON();
var d = (path instanceof Path ? path : new Path(path)).toJSON();
return (
<NativeShape
fill={extractBrush(props.fill, props)}
@@ -486,7 +486,8 @@ function extractAlignment(alignment) {
class Text extends React.Component {
render() {
var props = this.props;
var textPath = props.path ? new Path(props.path).toJSON() : null;
var path = props.path;
var textPath = path ? (path instanceof Path ? path : new Path(path)).toJSON() : null;
var textFrame = extractFontAndLines(
props.font,
childrenAsString(props.children)
@@ -2825,9 +2825,9 @@ module.exports = {
*
*```javascript
* onScroll={Animated.event(
* [{nativeEvent: {contentOffset: {x: this._scrollX}}}]
* [{nativeEvent: {contentOffset: {x: this._scrollX}}}],
* {listener}, // Optional async listener
* )
* )}
* ...
* onPanResponderMove: Animated.event([
* null, // raw event arg ignored
@@ -20,6 +20,7 @@ const StyleSheet = require('StyleSheet');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const createReactClass = require('create-react-class');
const requireNativeComponent = require('requireNativeComponent');
const GRAY = '#999999';
@@ -36,7 +37,8 @@ type DefaultProps = {
/**
* Displays a circular loading indicator.
*/
const ActivityIndicator = React.createClass({
const ActivityIndicator = createReactClass({
displayName: 'ActivityIndicator',
mixins: [NativeMethodsMixin],
propTypes: {
@@ -20,6 +20,7 @@ const StyleSheet = require('StyleSheet');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const createReactClass = require('create-react-class');
const requireNativeComponent = require('requireNativeComponent');
type DefaultProps = {
@@ -36,7 +37,8 @@ type Event = Object;
* source of truth.
*/
// $FlowFixMe(>=0.41.0)
const DatePickerIOS = React.createClass({
const DatePickerIOS = createReactClass({
displayName: 'DatePickerIOS',
// TOOD: Put a better type for _picker
_picker: (undefined: ?$FlowFixMe),
@@ -24,6 +24,7 @@ var ViewPropTypes = require('ViewPropTypes');
var DrawerConsts = UIManager.AndroidDrawerLayout.Constants;
var createReactClass = require('create-react-class');
var dismissKeyboard = require('dismissKeyboard');
var requireNativeComponent = require('requireNativeComponent');
@@ -67,7 +68,8 @@ var DRAWER_STATES = [
* },
* ```
*/
var DrawerLayoutAndroid = React.createClass({
var DrawerLayoutAndroid = createReactClass({
displayName: 'DrawerLayoutAndroid',
statics: {
positions: DrawerConsts.DrawerPosition,
},
@@ -11,6 +11,7 @@
*/
'use strict';
const createReactClass = require('create-react-class');
const Keyboard = require('Keyboard');
const LayoutAnimation = require('LayoutAnimation');
const Platform = require('Platform');
@@ -21,13 +22,8 @@ const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
import type EmitterSubscription from 'EmitterSubscription';
import type {ViewLayout, ViewLayoutEvent} from 'ViewPropTypes';
type Rect = {
x: number,
y: number,
width: number,
height: number,
};
type ScreenRect = {
screenX: number,
screenY: number,
@@ -40,11 +36,6 @@ type KeyboardChangeEvent = {
duration?: number,
easing?: string,
};
type LayoutEvent = {
nativeEvent: {
layout: Rect,
}
};
const viewRef = 'VIEW';
@@ -53,7 +44,8 @@ const viewRef = 'VIEW';
* It can automatically adjust either its position or bottom padding based on the position of the keyboard.
*/
// $FlowFixMe(>=0.41.0)
const KeyboardAvoidingView = React.createClass({
const KeyboardAvoidingView = createReactClass({
displayName: 'KeyboardAvoidingView',
mixins: [TimerMixin],
propTypes: {
@@ -85,7 +77,7 @@ const KeyboardAvoidingView = React.createClass({
},
subscriptions: ([]: Array<EmitterSubscription>),
frame: (null: ?Rect),
frame: (null: ?ViewLayout),
relativeKeyboardHeight(keyboardFrame: ScreenRect): number {
const frame = this.frame;
@@ -121,7 +113,7 @@ const KeyboardAvoidingView = React.createClass({
this.setState({bottom: height});
},
onLayout(event: LayoutEvent) {
onLayout(event: ViewLayoutEvent) {
this.frame = event.nativeEvent.layout;
},
+3 -1
View File
@@ -11,10 +11,12 @@
'use strict';
var React = require('React');
var createReactClass = require('create-react-class');
var PropTypes = require('prop-types');
var TimerMixin = require('react-timer-mixin');
var LazyRenderer = React.createClass({
var LazyRenderer = createReactClass({
displayName: 'LazyRenderer',
mixin: [TimerMixin],
propTypes: {
@@ -5,22 +5,10 @@
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule MaskedViewIOS
* @flow
*/
'use strict';
var React = require('React');
var fourOhFour = React.createClass({
render: function() {
return (
<html>
<head>
<meta httpEquiv="refresh" content="0; /react-native/docs/getting-started.html" />
</head>
<body />
</html>
);
}
});
module.exports = fourOhFour;
module.exports = require('UnimplementedView');
@@ -0,0 +1,110 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule MaskedViewIOS
* @flow
*/
const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const requireNativeComponent = require('requireNativeComponent');
const ReactPropTypes = React.PropTypes;
import type { ViewProps } from 'ViewPropTypes';
type Props = ViewProps & {
children: any,
/**
* Should be a React element to be rendered and applied as the
* mask for the child element.
*/
maskElement: React.Element<*>,
};
/**
* Renders the child view with a mask specified in the `maskElement` prop.
*
* ```
* import React from 'react';
* import { MaskedView, Text, View } from 'react-native';
*
* class MyMaskedView extends React.Component {
* render() {
* return (
* <MaskedView
* style={{ flex: 1 }}
* maskElement={
* <View style={styles.maskContainerStyle}>
* <Text style={styles.maskTextStyle}>
* Basic Mask
* </Text>
* </View>
* }
* >
* <View style={{ flex: 1, backgroundColor: 'blue' }} />
* </MaskedView>
* );
* }
* }
* ```
*
* The above example will render a view with a blue background that fills its
* parent, and then mask that view with text that says "Basic Mask".
*
* The alpha channel of the view rendered by the `maskElement` prop determines how
* much of the view's content and background shows through. Fully or partially
* opaque pixels allow the underlying content to show through but fully
* transparent pixels block that content.
*
*/
class MaskedViewIOS extends React.Component {
props: Props;
static propTypes = {
...ViewPropTypes,
maskElement: ReactPropTypes.element.isRequired,
};
_hasWarnedInvalidRenderMask = false;
render() {
const { maskElement, children, ...otherViewProps } = this.props;
if (!React.isValidElement(maskElement)) {
if (!this._hasWarnedInvalidRenderMask) {
console.warn(
'MaskedView: Invalid `maskElement` prop was passed to MaskedView. ' +
'Expected a React Element. No mask will render.'
);
this._hasWarnedInvalidRenderMask = true;
}
return <View {...otherViewProps}>{children}</View>;
}
return (
<RCTMaskedView {...otherViewProps}>
<View pointerEvents="none" style={StyleSheet.absoluteFill}>
{maskElement}
</View>
{children}
</RCTMaskedView>
);
}
}
const RCTMaskedView = requireNativeComponent('RCTMaskedView', {
name: 'RCTMaskedView',
displayName: 'RCTMaskedView',
propTypes: {
...ViewPropTypes,
},
});
module.exports = MaskedViewIOS;
@@ -23,6 +23,7 @@ var TVEventHandler = require('TVEventHandler');
var View = require('View');
var ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var invariant = require('fbjs/lib/invariant');
var logError = require('logError');
var requireNativeComponent = require('requireNativeComponent');
@@ -304,7 +305,8 @@ type Event = Object;
* is pushed.
*
*/
var NavigatorIOS = React.createClass({
var NavigatorIOS = createReactClass({
displayName: 'NavigatorIOS',
propTypes: {
+3 -1
View File
@@ -22,10 +22,12 @@ var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var processColor = require('processColor');
var createReactClass = require('create-react-class');
var itemStylePropType = StyleSheetPropType(TextStylePropTypes);
var requireNativeComponent = require('requireNativeComponent');
var PickerIOS = React.createClass({
var PickerIOS = createReactClass({
displayName: 'PickerIOS',
mixins: [NativeMethodsMixin],
propTypes: {
@@ -16,6 +16,7 @@ var PropTypes = require('prop-types');
var ViewPropTypes = require('ViewPropTypes');
var ColorPropType = require('ColorPropType');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
var STYLE_ATTRIBUTES = [
@@ -63,7 +64,8 @@ var indeterminateType = function(props, propName, componentName, ...rest) {
* },
* ```
*/
var ProgressBarAndroid = React.createClass({
var ProgressBarAndroid = createReactClass({
displayName: 'ProgressBarAndroid',
propTypes: {
...ViewPropTypes,
/**
@@ -18,13 +18,15 @@ var PropTypes = require('prop-types');
var StyleSheet = require('StyleSheet');
var ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
/**
* Use `ProgressViewIOS` to render a UIProgressView on iOS.
*/
// $FlowFixMe(>=0.41.0)
var ProgressViewIOS = React.createClass({
var ProgressViewIOS = createReactClass({
displayName: 'ProgressViewIOS',
mixins: [NativeMethodsMixin],
propTypes: {
@@ -18,6 +18,7 @@ const React = require('React');
const PropTypes = require('prop-types');
const ViewPropTypes = require('ViewPropTypes');
const createReactClass = require('create-react-class');
const requireNativeComponent = require('requireNativeComponent');
if (Platform.OS === 'android') {
@@ -72,7 +73,8 @@ if (Platform.OS === 'android') {
* in the `onRefresh` function otherwise the refresh indicator will stop immediately.
*/
// $FlowFixMe(>=0.41.0)
const RefreshControl = React.createClass({
const RefreshControl = createReactClass({
displayName: 'RefreshControl',
statics: {
SIZE: RefreshLayoutConsts.SIZE,
},
@@ -27,6 +27,7 @@ const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const ViewStylePropTypes = require('ViewStylePropTypes');
const createReactClass = require('create-react-class');
const dismissKeyboard = require('dismissKeyboard');
const flattenStyle = require('flattenStyle');
const invariant = require('fbjs/lib/invariant');
@@ -72,7 +73,8 @@ import type {NativeMethodsMixinType} from 'ReactNativeTypes';
* supports out of the box.
*/
// $FlowFixMe(>=0.41.0)
const ScrollView = React.createClass({
const ScrollView = createReactClass({
displayName: 'ScrollView',
propTypes: {
...ViewPropTypes,
/**
@@ -257,6 +259,8 @@ const ScrollView = React.createClass({
* When true, the scroll view stops on multiples of the scroll view's size
* when scrolling. This can be used for horizontal pagination. The default
* value is false.
*
* Note: Vertical pagination is not supported on Android.
*/
pagingEnabled: PropTypes.bool,
/**
@@ -17,6 +17,7 @@ var PropTypes = require('prop-types');
var StyleSheet = require('StyleSheet');
var ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
type DefaultProps = {
@@ -49,7 +50,8 @@ type Event = Object;
* ````
*/
// $FlowFixMe(>=0.41.0)
var SegmentedControlIOS = React.createClass({
var SegmentedControlIOS = createReactClass({
displayName: 'SegmentedControlIOS',
mixins: [NativeMethodsMixin],
propTypes: {
+3 -1
View File
@@ -21,6 +21,7 @@ var PropTypes = require('prop-types');
var StyleSheet = require('StyleSheet');
var ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
type Event = Object;
@@ -29,7 +30,8 @@ type Event = Object;
* A component used to select a single value from a range of values.
*/
// $FlowFixMe(>=0.41.0)
var Slider = React.createClass({
var Slider = createReactClass({
displayName: 'Slider',
mixins: [NativeMethodsMixin],
propTypes: {
+56 -35
View File
@@ -63,7 +63,10 @@ type DefaultProps = {
/**
* Merges the prop stack with the default values.
*/
function mergePropsStack(propsStack: Array<Object>, defaultValues: Object): Object {
function mergePropsStack(
propsStack: Array<Object>,
defaultValues: Object
): Object {
return propsStack.reduce((prev, cur) => {
for (const prop in cur) {
if (cur[prop] != null) {
@@ -80,20 +83,29 @@ function mergePropsStack(propsStack: Array<Object>, defaultValues: Object): Obje
*/
function createStackEntry(props: any): any {
return {
backgroundColor: props.backgroundColor != null ? {
value: props.backgroundColor,
animated: props.animated,
} : null,
barStyle: props.barStyle != null ? {
value: props.barStyle,
animated: props.animated,
} : null,
backgroundColor:
props.backgroundColor != null
? {
value: props.backgroundColor,
animated: props.animated,
}
: null,
barStyle:
props.barStyle != null
? {
value: props.barStyle,
animated: props.animated,
}
: null,
translucent: props.translucent,
hidden: props.hidden != null ? {
value: props.hidden,
animated: props.animated,
transition: props.showHideTransition,
} : null,
hidden:
props.hidden != null
? {
value: props.hidden,
animated: props.animated,
transition: props.showHideTransition,
}
: null,
networkActivityIndicatorVisible: props.networkActivityIndicatorVisible,
};
}
@@ -141,7 +153,7 @@ class StatusBar extends React.Component {
props: {
hidden?: boolean,
animated?: boolean,
backgroundColor?: $FlowFixMe,
backgroundColor?: string,
translucent?: boolean,
barStyle?: 'default' | 'light-content' | 'dark-content',
networkActivityIndicatorVisible?: boolean,
@@ -215,7 +227,9 @@ class StatusBar extends React.Component {
*/
static setNetworkActivityIndicatorVisible(visible: boolean) {
if (Platform.OS !== 'ios') {
console.warn('`setNetworkActivityIndicatorVisible` is only available on iOS');
console.warn(
'`setNetworkActivityIndicatorVisible` is only available on iOS'
);
return;
}
StatusBar._defaultProps.networkActivityIndicatorVisible = visible;
@@ -276,11 +290,7 @@ class StatusBar extends React.Component {
/**
* Sets the color of the status bar text.
*/
barStyle: PropTypes.oneOf([
'default',
'light-content',
'dark-content',
]),
barStyle: PropTypes.oneOf(['default', 'light-content', 'dark-content']),
/**
* If the network activity indicator should be visible.
*
@@ -293,10 +303,7 @@ class StatusBar extends React.Component {
*
* @platform ios
*/
showHideTransition: PropTypes.oneOf([
'fade',
'slide',
]),
showHideTransition: PropTypes.oneOf(['fade', 'slide']),
};
static defaultProps = {
@@ -343,38 +350,52 @@ class StatusBar extends React.Component {
clearImmediate(StatusBar._updateImmediate);
StatusBar._updateImmediate = setImmediate(() => {
const oldProps = StatusBar._currentValues;
const mergedProps = mergePropsStack(StatusBar._propsStack, StatusBar._defaultProps);
const mergedProps = mergePropsStack(
StatusBar._propsStack,
StatusBar._defaultProps
);
// Update the props that have changed using the merged values from the props stack.
if (Platform.OS === 'ios') {
if (!oldProps || oldProps.barStyle.value !== mergedProps.barStyle.value) {
if (
!oldProps ||
oldProps.barStyle.value !== mergedProps.barStyle.value
) {
StatusBarManager.setStyle(
mergedProps.barStyle.value,
mergedProps.barStyle.animated,
mergedProps.barStyle.animated
);
}
if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) {
StatusBarManager.setHidden(
mergedProps.hidden.value,
mergedProps.hidden.animated ?
mergedProps.hidden.transition :
'none',
mergedProps.hidden.animated ? mergedProps.hidden.transition : 'none'
);
}
if (!oldProps || oldProps.networkActivityIndicatorVisible !== mergedProps.networkActivityIndicatorVisible) {
if (
!oldProps ||
oldProps.networkActivityIndicatorVisible !==
mergedProps.networkActivityIndicatorVisible
) {
StatusBarManager.setNetworkActivityIndicatorVisible(
mergedProps.networkActivityIndicatorVisible
);
}
} else if (Platform.OS === 'android') {
if (!oldProps || oldProps.barStyle.value !== mergedProps.barStyle.value) {
if (
!oldProps ||
oldProps.barStyle.value !== mergedProps.barStyle.value
) {
StatusBarManager.setStyle(mergedProps.barStyle.value);
}
if (!oldProps || oldProps.backgroundColor.value !== mergedProps.backgroundColor.value) {
if (
!oldProps ||
oldProps.backgroundColor.value !== mergedProps.backgroundColor.value
) {
StatusBarManager.setColor(
processColor(mergedProps.backgroundColor.value),
mergedProps.backgroundColor.animated,
mergedProps.backgroundColor.animated
);
}
if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) {
+3 -1
View File
@@ -19,6 +19,7 @@ const PropTypes = require('prop-types');
var StyleSheet = require('StyleSheet');
const ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
type DefaultProps = {
@@ -38,7 +39,8 @@ type DefaultProps = {
* @keyword toggle
*/
// $FlowFixMe(>=0.41.0)
var Switch = React.createClass({
var Switch = createReactClass({
displayName: 'Switch',
propTypes: {
...ViewPropTypes,
/**
+3 -1
View File
@@ -17,6 +17,7 @@ const EventEmitter = require('EventEmitter');
const NativeMethodsMixin = require('NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const createReactClass = require('create-react-class');
const PropTypes = require('prop-types');
const ReactNative = require('ReactNative');
const StyleSheet = require('StyleSheet');
@@ -168,7 +169,8 @@ const DataDetectorTypes = [
*
*/
// $FlowFixMe(>=0.41.0)
const TextInput = React.createClass({
const TextInput = createReactClass({
displayName: 'TextInput',
statics: {
/* TODO(brentvatne) docs are needed for this */
State: TextInputState,
@@ -20,6 +20,7 @@ var UIManager = require('UIManager');
var ViewPropTypes = require('ViewPropTypes');
var ColorPropType = require('ColorPropType');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
var resolveAssetSource = require('resolveAssetSource');
@@ -65,7 +66,8 @@ var optionalImageSource = PropTypes.oneOfType([
*
* [0]: https://developer.android.com/reference/android/support/v7/widget/Toolbar.html
*/
var ToolbarAndroid = React.createClass({
var ToolbarAndroid = createReactClass({
displayName: 'ToolbarAndroid',
mixins: [NativeMethodsMixin],
propTypes: {
@@ -15,6 +15,7 @@ var Animated = require('Animated');
var EdgeInsetsPropType = require('EdgeInsetsPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var createReactClass = require('create-react-class');
var PropTypes = require('prop-types');
var Touchable = require('Touchable');
@@ -35,7 +36,8 @@ var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
* interesting interactions such as `handleTouchablePress`.
*/
// $FlowFixMe(>=0.41.0)
var TouchableBounce = React.createClass({
var TouchableBounce = createReactClass({
displayName: 'TouchableBounce',
mixins: [Touchable.Mixin, NativeMethodsMixin],
propTypes: {
@@ -7,37 +7,36 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule TouchableHighlight
* @noflow
* @flow
*/
'use strict';
// Note (avik): add @flow when Flow supports spread properties in propTypes
var ColorPropType = require('ColorPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
const ColorPropType = require('ColorPropType');
const NativeMethodsMixin = require('NativeMethodsMixin');
const PropTypes = require('prop-types');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');
var TimerMixin = require('react-timer-mixin');
var Touchable = require('Touchable');
var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
var View = require('View');
const React = require('React');
const ReactNativeViewAttributes = require('ReactNativeViewAttributes');
const StyleSheet = require('StyleSheet');
const TimerMixin = require('react-timer-mixin');
const Touchable = require('Touchable');
const TouchableWithoutFeedback = require('TouchableWithoutFeedback');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var ensureComponentIsNative = require('ensureComponentIsNative');
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
var keyOf = require('fbjs/lib/keyOf');
var merge = require('merge');
const createReactClass = require('create-react-class');
const ensureComponentIsNative = require('ensureComponentIsNative');
const ensurePositiveDelayProps = require('ensurePositiveDelayProps');
const keyOf = require('fbjs/lib/keyOf');
const merge = require('merge');
type Event = Object;
import type {Event} from 'TouchableWithoutFeedback';
var DEFAULT_PROPS = {
const DEFAULT_PROPS = {
activeOpacity: 0.85,
underlayColor: 'black',
};
var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
/**
* A wrapper for making views respond properly to touches.
@@ -68,7 +67,8 @@ var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
* ```
*/
var TouchableHighlight = React.createClass({
var TouchableHighlight = createReactClass({
displayName: 'TouchableHighlight',
propTypes: {
...TouchableWithoutFeedback.propTypes,
/**
@@ -108,7 +108,6 @@ var TouchableHighlight = React.createClass({
* @platform ios
*/
tvParallaxProperties: PropTypes.object,
},
mixins: [NativeMethodsMixin, TimerMixin, Touchable.Mixin],
@@ -18,6 +18,7 @@ var Touchable = require('Touchable');
var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
var UIManager = require('UIManager');
var createReactClass = require('create-react-class');
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
var processColor = require('processColor');
@@ -70,7 +71,8 @@ var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
* ```
*/
var TouchableNativeFeedback = React.createClass({
var TouchableNativeFeedback = createReactClass({
displayName: 'TouchableNativeFeedback',
propTypes: {
...TouchableWithoutFeedback.propTypes,
@@ -22,6 +22,7 @@ var TimerMixin = require('react-timer-mixin');
var Touchable = require('Touchable');
var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
var createReactClass = require('create-react-class');
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
var flattenStyle = require('flattenStyle');
@@ -51,7 +52,8 @@ var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
* },
* ```
*/
var TouchableOpacity = React.createClass({
var TouchableOpacity = createReactClass({
displayName: 'TouchableOpacity',
mixins: [TimerMixin, Touchable.Mixin, NativeMethodsMixin],
propTypes: {
@@ -17,6 +17,7 @@ const PropTypes = require('prop-types');
const TimerMixin = require('react-timer-mixin');
const Touchable = require('Touchable');
const createReactClass = require('create-react-class');
const ensurePositiveDelayProps = require('ensurePositiveDelayProps');
const warning = require('fbjs/lib/warning');
@@ -25,7 +26,7 @@ const {
AccessibilityTraits,
} = require('ViewAccessibility');
type Event = Object;
export type Event = Object;
const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
@@ -36,8 +37,8 @@ const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
* TouchableWithoutFeedback supports only one child.
* If you wish to have several child components, wrap them in a View.
*/
// $FlowFixMe(>=0.41.0)
const TouchableWithoutFeedback = React.createClass({
const TouchableWithoutFeedback = createReactClass({
displayName: 'TouchableWithoutFeedback',
mixins: [TimerMixin, Touchable.Mixin],
propTypes: {
@@ -88,6 +89,7 @@ const TouchableWithoutFeedback = React.createClass({
* reactivated! Move it back and forth several times while the scroll view
* is disabled. Ensure you pass in a constant to reduce memory allocations.
*/
// $FlowFixMe: Expected a React PropType instead
pressRetentionOffset: EdgeInsetsPropType,
/**
* This defines how far your touch can start away from the button. This is
@@ -97,6 +99,7 @@ const TouchableWithoutFeedback = React.createClass({
* of sibling views always takes precedence if a touch hits two overlapping
* views.
*/
// $FlowFixMe: Expected a React PropType instead
hitSlop: EdgeInsetsPropType,
},
+27 -23
View File
@@ -9,20 +9,21 @@
* @providesModule View
* @flow
*/
'use strict';
"use strict";
const NativeMethodsMixin = require('NativeMethodsMixin');
const Platform = require('Platform');
const PropTypes = require('prop-types');
const React = require('React');
const ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');
const ReactNativeViewAttributes = require('ReactNativeViewAttributes');
const ViewPropTypes = require('ViewPropTypes');
const NativeMethodsMixin = require("NativeMethodsMixin");
const Platform = require("Platform");
const PropTypes = require("prop-types");
const React = require("React");
const ReactNativeStyleAttributes = require("ReactNativeStyleAttributes");
const ReactNativeViewAttributes = require("ReactNativeViewAttributes");
const ViewPropTypes = require("ViewPropTypes");
const invariant = require('fbjs/lib/invariant');
const requireNativeComponent = require('requireNativeComponent');
const createReactClass = require("create-react-class");
const invariant = require("fbjs/lib/invariant");
const requireNativeComponent = require("requireNativeComponent");
import type {ViewProps} from 'ViewPropTypes';
import type { ViewProps } from "ViewPropTypes";
export type Props = ViewProps;
@@ -73,7 +74,8 @@ export type Props = ViewProps;
* - `touches` - Array of all current touches on the screen.
*/
// $FlowFixMe(>=0.41.0)
const View = React.createClass({
const View = createReactClass({
displayName: "View",
// TODO: We should probably expose the mixins, viewConfig, and statics publicly. For example,
// one of the props is of type AccessibilityComponentType. That is defined as a const[] above,
// but it is not rendered by the docs, since `statics` below is not rendered. So its Possible
@@ -91,42 +93,44 @@ const View = React.createClass({
* make `this` look like an actual native component class.
*/
viewConfig: {
uiViewClassName: 'RCTView',
uiViewClassName: "RCTView",
validAttributes: ReactNativeViewAttributes.RCTView
},
contextTypes: {
isInAParentText: PropTypes.bool,
isInAParentText: PropTypes.bool
},
render: function() {
invariant(
!(this.context.isInAParentText && Platform.OS === 'android'),
'Nesting of <View> within <Text> is not supported on Android.');
!(this.context.isInAParentText && Platform.OS === "android"),
"Nesting of <View> within <Text> is not supported on Android."
);
// WARNING: This method will not be used in production mode as in that mode we
// replace wrapper component View with generated native wrapper RCTView. Avoid
// adding functionality this component that you'd want to be available in both
// dev and prod modes.
return <RCTView {...this.props} />;
},
}
});
const RCTView = requireNativeComponent('RCTView', View, {
const RCTView = requireNativeComponent("RCTView", View, {
nativeOnly: {
nativeBackgroundAndroid: true,
nativeForegroundAndroid: true,
nativeForegroundAndroid: true
}
});
if (__DEV__) {
const UIManager = require('UIManager');
const viewConfig = UIManager.viewConfigs && UIManager.viewConfigs.RCTView || {};
const UIManager = require("UIManager");
const viewConfig =
(UIManager.viewConfigs && UIManager.viewConfigs.RCTView) || {};
for (const prop in viewConfig.nativeProps) {
const viewAny: any = View; // Appease flow
if (!viewAny.propTypes[prop] && !ReactNativeStyleAttributes[prop]) {
throw new Error(
'View is missing propType for native prop `' + prop + '`'
"View is missing propType for native prop `" + prop + "`"
);
}
}
@@ -138,4 +142,4 @@ if (__DEV__) {
}
// No one should depend on the DEV-mode createClass View wrapper.
module.exports = ((ViewToExport : any) : typeof RCTView);
module.exports = ((ViewToExport: any): typeof RCTView);
@@ -36,6 +36,19 @@ import type {TVViewProps} from 'TVViewPropTypes';
const stylePropType = StyleSheetPropType(ViewStylePropTypes);
export type ViewLayout = {
x: number,
y: number,
width: number,
height: number,
}
export type ViewLayoutEvent = {
nativeEvent: {
layout: ViewLayout,
}
}
// There's no easy way to create a different type if(Platform.isTVOS):
// so we must include TVViewProps
export type ViewProps = {
@@ -50,6 +63,7 @@ export type ViewProps = {
onMagicTap?: Function,
testID?: string,
nativeID?: string,
onLayout?: (event: ViewLayoutEvent) => void,
onResponderGrant?: Function,
onResponderMove?: Function,
onResponderReject?: Function,
-2
View File
@@ -216,8 +216,6 @@ if (__DEV__) {
require('setupDevtools');
}
require('RCTDebugComponentOwnership');
// Set up inspector
const JSInspector = require('JSInspector');
JSInspector.registerAgent(require('NetworkAgent'));
@@ -1,41 +0,0 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* Utility class to provide the component owner hierarchy to native code for
* debugging purposes.
*
* @providesModule RCTDebugComponentOwnership
* @flow
*/
'use strict';
var BatchedBridge = require('BatchedBridge');
var RCTDebugComponentOwnership = {
/**
* Asynchronously returns the owner hierarchy as an array of strings. Request id is
* passed along to the native module so that the native module can identify the
* particular call instance.
*
* Example returned owner hierarchy: ['RootView', 'Dialog', 'TitleView', 'Text']
*/
getOwnerHierarchy: function(requestID: number, tag: number) {
// Consider cleaning up these unused modules in a separate diff.
throw new Error(
'This seems to be unused. Will disable until it is needed again.'
);
},
};
BatchedBridge.registerCallableModule(
'RCTDebugComponentOwnership',
RCTDebugComponentOwnership
);
module.exports = RCTDebugComponentOwnership;
@@ -20,6 +20,7 @@ const StyleSheet = require('StyleSheet');
const TimerMixin = require('react-timer-mixin');
const View = require('View');
const createReactClass = require('create-react-class');
const emptyFunction = require('fbjs/lib/emptyFunction');
const IS_RTL = I18nManager.isRTL;
@@ -61,7 +62,8 @@ const RIGHT_SWIPE_THRESHOLD = 30 * SLOW_SPEED_SWIPE_FACTOR;
* used in a normal ListView. See the renderRow for SwipeableListView to see how
* to use this component separately.
*/
const SwipeableRow = React.createClass({
const SwipeableRow = createReactClass({
displayName: 'SwipeableRow',
_panResponder: {},
_previousLeft: CLOSED_LEFT_POSITION,
@@ -70,6 +72,8 @@ const SwipeableRow = React.createClass({
propTypes: {
children: PropTypes.any,
isOpen: PropTypes.bool,
preventSwipeLeft: PropTypes.bool,
preventSwipeRight: PropTypes.bool,
maxSwipeDistance: PropTypes.number.isRequired,
onOpen: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired,
@@ -106,6 +110,8 @@ const SwipeableRow = React.createClass({
getDefaultProps(): Object {
return {
isOpen: false,
preventSwipeLeft: false,
preventSwipeRight: false,
maxSwipeDistance: 0,
onOpen: emptyFunction,
onClose: emptyFunction,
@@ -333,6 +339,12 @@ const SwipeableRow = React.createClass({
// Ignore swipes due to user's finger moving slightly when tapping
_isValidSwipe(gestureState: Object): boolean {
if (this.props.preventSwipeLeft && gestureState.dx < 0) {
return false;
}
if (this.props.preventSwipeRight && gestureState.dx > 0) {
return false;
}
return Math.abs(gestureState.dx) > HORIZONTAL_SWIPE_DISTANCE_THRESHOLD;
},
+3 -1
View File
@@ -25,6 +25,7 @@ var View = require('View');
var ViewPropTypes = require('ViewPropTypes');
var ViewStylePropTypes = require('ViewStylePropTypes');
var createReactClass = require('create-react-class');
var filterObject = require('fbjs/lib/filterObject');
var flattenStyle = require('flattenStyle');
var merge = require('merge');
@@ -76,7 +77,8 @@ var ImageViewAttributes = merge(ReactNativeViewAttributes.UIView, {
var ViewStyleKeys = new Set(Object.keys(ViewStylePropTypes));
var ImageSpecificStyleKeys = new Set(Object.keys(ImageStylePropTypes).filter(x => !ViewStyleKeys.has(x)));
var Image = React.createClass({
var Image = createReactClass({
displayName: 'Image',
propTypes: {
...ViewPropTypes,
style: StyleSheetPropType(ImageStylePropTypes),
+16 -8
View File
@@ -23,6 +23,7 @@ const ReactNativeViewAttributes = require('ReactNativeViewAttributes');
const StyleSheet = require('StyleSheet');
const StyleSheetPropType = require('StyleSheetPropType');
const createReactClass = require('create-react-class');
const flattenStyle = require('flattenStyle');
const requireNativeComponent = require('requireNativeComponent');
const resolveAssetSource = require('resolveAssetSource');
@@ -34,8 +35,10 @@ const ImageViewManager = NativeModules.ImageViewManager;
* including network images, static resources, temporary local images, and
* images from local disk, such as the camera roll.
*
* This example shows both fetching and displaying an image from local
* storage as well as one from network.
* This example shows fetching and displaying an image from local storage
* as well as one from network and even from data provided in the `'data:'` uri scheme.
*
* > Note that for network and data images, you will need to manually specify the dimensions of your image!
*
* ```ReactNativeWebPlayer
* import React, { Component } from 'react';
@@ -52,6 +55,10 @@ const ImageViewManager = NativeModules.ImageViewManager;
* style={{width: 50, height: 50}}
* source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}}
* />
* <Image
* style={{width: 66, height: 58}}
* source={{uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAYAAAA6oTAqAAAAEXRFWHRTb2Z0d2FyZQBwbmdjcnVzaEB1SfMAAABQSURBVGje7dSxCQBACARB+2/ab8BEeQNhFi6WSYzYLYudDQYGBgYGBgYGBgYGBgYGBgZmcvDqYGBgmhivGQYGBgYGBgYGBgYGBgYGBgbmQw+P/eMrC5UTVAAAAABJRU5ErkJggg=='}}
* />
* </View>
* );
* }
@@ -103,17 +110,17 @@ const ImageViewManager = NativeModules.ImageViewManager;
* ```
* dependencies {
* // If your app supports Android versions before Ice Cream Sandwich (API level 14)
* compile 'com.facebook.fresco:animated-base-support:1.0.1'
* compile 'com.facebook.fresco:animated-base-support:1.3.0'
*
* // For animated GIF support
* compile 'com.facebook.fresco:animated-gif:1.0.1'
* compile 'com.facebook.fresco:animated-gif:1.3.0'
*
* // For WebP support, including animated WebP
* compile 'com.facebook.fresco:animated-webp:1.0.1'
* compile 'com.facebook.fresco:webpsupport:1.0.1'
* compile 'com.facebook.fresco:animated-webp:1.3.0'
* compile 'com.facebook.fresco:webpsupport:1.3.0'
*
* // For WebP support, without animations
* compile 'com.facebook.fresco:webpsupport:1.0.1'
* compile 'com.facebook.fresco:webpsupport:1.3.0'
* }
* ```
*
@@ -126,7 +133,8 @@ const ImageViewManager = NativeModules.ImageViewManager;
*
*/
// $FlowFixMe(>=0.41.0)
const Image = React.createClass({
const Image = createReactClass({
displayName: 'Image',
propTypes: {
/**
* > `ImageResizeMode` is an `Enum` for different image resizing modes, set via the
+20 -1
View File
@@ -17,6 +17,10 @@ const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');
const ensureComponentIsNative = require('ensureComponentIsNative');
import type {NativeMethodsMixinType} from 'ReactNativeTypes';
/**
* Very simple drop-in replacement for <Image> which supports nesting views.
*
@@ -42,11 +46,26 @@ const View = require('View');
* ```
*/
class ImageBackground extends React.Component {
setNativeProps(props: Object) {
// Work-around flow
const viewRef = this._viewRef;
if (viewRef) {
ensureComponentIsNative(viewRef);
viewRef.setNativeProps(props);
}
}
_viewRef: ?NativeMethodsMixinType = null;
_captureRef = ref => {
this._viewRef = ref;
};
render() {
const {children, style, imageStyle, imageRef, ...props} = this.props;
return (
<View style={style}>
<View style={style} ref={this._captureRef}>
<Image
{...props}
style={[
+1 -1
View File
@@ -12,7 +12,7 @@
'use strict';
// This is a stub for flow to make it understand require('./icon.png')
// See packager/src/Bundler/index.js
// See metro-bundler/src/Bundler/index.js
var AssetRegistry = require('AssetRegistry');
+2 -3
View File
@@ -35,10 +35,10 @@ class BoxInspector extends React.Component {
<BoxContainer title="padding" box={padding}>
<View>
<Text style={styles.innerText}>
({frame.left}, {frame.top})
({(frame.left || 0).toFixed(1)}, {(frame.top || 0).toFixed(1)})
</Text>
<Text style={styles.innerText}>
{frame.width} &times; {frame.height}
{(frame.width || 0).toFixed(1)} &times; {(frame.height || 0).toFixed(1)}
</Text>
</View>
</BoxContainer>
@@ -110,4 +110,3 @@ var styles = StyleSheet.create({
});
module.exports = BoxInspector;
+1 -1
View File
@@ -38,7 +38,7 @@ type RequiredProps<ItemT> = {
* onShowUnderlay={separators.highlight}
* onHideUnderlay={separators.unhighlight}>
* <View style={{backgroundColor: 'white'}}>
* <Text>{item.title}}</Text>
* <Text>{item.title}</Text>
* </View>
* </TouchableHighlight>
* )}
+9 -1
View File
@@ -25,6 +25,7 @@ var TimerMixin = require('react-timer-mixin');
var View = require('View');
var cloneReferencedElement = require('react-clone-referenced-element');
var createReactClass = require('create-react-class');
var isEmpty = require('isEmpty');
var merge = require('merge');
@@ -35,6 +36,12 @@ var DEFAULT_END_REACHED_THRESHOLD = 1000;
var DEFAULT_SCROLL_CALLBACK_THROTTLE = 50;
/**
* DEPRECATED - use one of the new list components, such as [`FlatList`](docs/flatlist.html)
* or [`SectionList`](docs/sectionlist.html) for bounded memory use, fewer bugs,
* better performance, an easier to use API, and more features. Check out this
* [blog post](https://facebook.github.io/react-native/blog/2017/03/13/better-list-views.html)
* for more details.
*
* ListView - A core component designed for efficient display of vertically
* scrolling lists of changing data. The minimal API is to create a
* [`ListView.DataSource`](docs/listviewdatasource.html), populate it with a simple
@@ -85,7 +92,8 @@ var DEFAULT_SCROLL_CALLBACK_THROTTLE = 50;
* rendering rows.
*/
var ListView = React.createClass({
var ListView = createReactClass({
displayName: 'ListView',
_childFrames: ([]: Array<Object>),
_sentEndForContentLength: (null: ?number),
_scrollComponent: (null: any),
+2 -1
View File
@@ -129,7 +129,8 @@ type OptionalProps<SectionT: SectionBase<any>> = {
/**
* Used to extract a unique key for a given item at the specified index. Key is used for caching
* and as the react key to track item re-ordering. The default extractor checks item.key, then
* falls back to using the index, like react does.
* falls back to using the index, like react does. Note that this sets keys for each item, but
* each overall section still needs its own key.
*/
keyExtractor: (item: Item, index: number) => string,
/**
+1 -1
View File
@@ -235,7 +235,7 @@ class VirtualizedList extends React.PureComponent<OptionalProps, Props, State> {
`scrollToIndex out of range: ${index} vs ${getItemCount(data) - 1}`,
);
invariant(
getItemLayout || index < this._highestMeasuredFrameIndex,
getItemLayout || index <= this._highestMeasuredFrameIndex,
'scrollToIndex should be used in conjunction with getItemLayout, ' +
'otherwise there is no way to know the location of an arbitrary index.',
);
@@ -60,9 +60,13 @@ module.exports = {
];
return (
<FlatList
renderItem={(
info, // $FlowExpectedError - bad widgetCount type 6, should be Object
) => <span>{info.item.widget.missingProp}</span>}
renderItem={info =>
<span>
{
// $FlowExpectedError - bad widgetCount type 6, should be Object
info.item.widget.missingProp
}
</span>}
data={data}
/>
);
+1 -1
View File
@@ -95,7 +95,7 @@ class RCTNetworking extends NativeEventEmitter {
if (__DEV__ && !RCTNetworkingNative) {
class MissingNativeRCTNetworkingShim extends MissingNativeEventEmitterShim {
constructor() {
super('RCTAppState', 'AppState');
super('RCTNetworking', 'Networking');
}
sendRequest(...args: Array<any>) {
+1 -1
View File
@@ -63,7 +63,7 @@ class RCTNetworking extends NativeEventEmitter {
if (__DEV__ && !RCTNetworkingNative) {
class MissingNativeRCTNetworkingShim extends MissingNativeEventEmitterShim {
constructor() {
super('RCTAppState', 'AppState');
super('RCTNetworking', 'Networking');
}
sendRequest(...args: Array<any>) {
+3 -1
View File
@@ -7,9 +7,11 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule fetch
* @nolint
*
*/
/* eslint-disable */
'use strict';
import 'whatwg-fetch';
@@ -128,7 +128,7 @@ class PushNotificationIOS {
_badgeCount: number;
_notificationId: string;
_isRemote: boolean;
_remoteNotificationCompleteCalllbackCalled: boolean;
_remoteNotificationCompleteCallbackCalled: boolean;
static FetchResult: FetchResult = {
NewData: 'UIBackgroundFetchResultNewData',
@@ -406,7 +406,7 @@ class PushNotificationIOS {
*/
constructor(nativeNotif: Object) {
this._data = {};
this._remoteNotificationCompleteCalllbackCalled = false;
this._remoteNotificationCompleteCallbackCalled = false;
this._isRemote = nativeNotif.remote;
if (this._isRemote) {
this._notificationId = nativeNotif.notificationId;
@@ -451,10 +451,10 @@ class PushNotificationIOS {
* be throttled, to read more about it see the above documentation link.
*/
finish(fetchResult: FetchResult) {
if (!this._isRemote || !this._notificationId || this._remoteNotificationCompleteCalllbackCalled) {
if (!this._isRemote || !this._notificationId || this._remoteNotificationCompleteCallbackCalled) {
return;
}
this._remoteNotificationCompleteCalllbackCalled = true;
this._remoteNotificationCompleteCallbackCalled = true;
RCTPushNotificationManager.onFinishRemoteNotification(this._notificationId, fetchResult);
}
@@ -70,13 +70,19 @@ function requireNativeComponent(
viewConfig.propTypes = null;
}
// The ViewConfig doesn't contain any props inherited from the view manager's
// superclass, so we manually merge in the RCTView ones. Other inheritance
// patterns are currenty not supported.
const nativeProps = {
...UIManager.RCTView.NativeProps,
...viewConfig.NativeProps,
};
let baseModuleName = viewConfig.baseModuleName;
let nativeProps = { ...viewConfig.NativeProps };
while (baseModuleName) {
const baseModule = UIManager[baseModuleName];
if (!baseModule) {
warning(false, 'Base module "%s" does not exist', baseModuleName);
baseModuleName = null;
} else {
nativeProps = { ...nativeProps, ...baseModule.NativeProps };
baseModuleName = baseModule.baseModuleName;
}
}
for (const key in nativeProps) {
let useAttribute = false;
const attribute = {};
+1 -1
View File
@@ -1 +1 @@
cb32253d2f0376de899edb1bc6ebbd1602eec074
5495e495de0bd15cd96a76ee0d7ca823cc09cc71
File diff suppressed because it is too large Load Diff
+175 -221
View File
@@ -1039,34 +1039,21 @@ var ReactNativeInjection = {
HighPriority: 3,
LowPriority: 4,
OffscreenPriority: 5
}, CallbackEffect = ReactTypeOfSideEffect.Callback, NoWork = ReactPriorityLevel.NoWork, SynchronousPriority = ReactPriorityLevel.SynchronousPriority, TaskPriority = ReactPriorityLevel.TaskPriority;
}, CallbackEffect = ReactTypeOfSideEffect.Callback, NoWork = ReactPriorityLevel.NoWork, SynchronousPriority = ReactPriorityLevel.SynchronousPriority, TaskPriority = ReactPriorityLevel.TaskPriority, ClassComponent = ReactTypeOfWork.ClassComponent, HostRoot = ReactTypeOfWork.HostRoot;
function comparePriority(a, b) {
return a !== TaskPriority && a !== SynchronousPriority || b !== TaskPriority && b !== SynchronousPriority ? a === NoWork && b !== NoWork ? -255 : a !== NoWork && b === NoWork ? 255 : a - b : 0;
}
function ensureUpdateQueue(fiber) {
if (null !== fiber.updateQueue) return fiber.updateQueue;
var queue = void 0;
return queue = {
function createUpdateQueue() {
return {
first: null,
last: null,
hasForceUpdate: !1,
callbackList: null
}, fiber.updateQueue = queue, queue;
};
}
function cloneUpdateQueue(current, workInProgress) {
var currentQueue = current.updateQueue;
if (null === currentQueue) return workInProgress.updateQueue = null, null;
var altQueue = null !== workInProgress.updateQueue ? workInProgress.updateQueue : {};
return altQueue.first = currentQueue.first, altQueue.last = currentQueue.last, altQueue.hasForceUpdate = !1,
altQueue.callbackList = null, altQueue.isProcessing = !1, workInProgress.updateQueue = altQueue,
altQueue;
}
var cloneUpdateQueue_1 = cloneUpdateQueue;
function cloneUpdate(update) {
return {
priorityLevel: update.priorityLevel,
@@ -1091,17 +1078,23 @@ function findInsertionPosition(queue, update) {
return insertAfter;
}
function ensureUpdateQueues(fiber) {
var alternateFiber = fiber.alternate, queue1 = fiber.updateQueue;
null === queue1 && (queue1 = fiber.updateQueue = createUpdateQueue());
var queue2 = void 0;
return null !== alternateFiber ? null === (queue2 = alternateFiber.updateQueue) && (queue2 = alternateFiber.updateQueue = createUpdateQueue()) : queue2 = null,
[ queue1, queue2 !== queue1 ? queue2 : null ];
}
function insertUpdate(fiber, update) {
var queue1 = ensureUpdateQueue(fiber), queue2 = null !== fiber.alternate ? ensureUpdateQueue(fiber.alternate) : null, insertAfter1 = findInsertionPosition(queue1, update), insertBefore1 = null !== insertAfter1 ? insertAfter1.next : queue1.first;
var _ensureUpdateQueues = ensureUpdateQueues(fiber), queue1 = _ensureUpdateQueues[0], queue2 = _ensureUpdateQueues[1], insertAfter1 = findInsertionPosition(queue1, update), insertBefore1 = null !== insertAfter1 ? insertAfter1.next : queue1.first;
if (null === queue2) return insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1),
null;
var insertAfter2 = findInsertionPosition(queue2, update), insertBefore2 = null !== insertAfter2 ? insertAfter2.next : queue2.first;
if (insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), insertBefore1 !== insertBefore2) {
var update2 = cloneUpdate(update);
return insertUpdateIntoQueue(queue2, update2, insertAfter2, insertBefore2), update2;
}
return null === insertAfter2 && (queue2.first = update), null === insertBefore2 && (queue2.last = null),
null;
if (insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), insertBefore1 === insertBefore2 && null !== insertBefore1 || insertAfter1 === insertAfter2 && null !== insertAfter1) return null === insertAfter2 && (queue2.first = update),
null === insertBefore2 && (queue2.last = null), null;
var update2 = cloneUpdate(update);
return insertUpdateIntoQueue(queue2, update2, insertAfter2, insertBefore2), update2;
}
function addUpdate(fiber, partialState, callback, priorityLevel) {
@@ -1146,11 +1139,12 @@ function addForceUpdate(fiber, callback, priorityLevel) {
var addForceUpdate_1 = addForceUpdate;
function getPendingPriority(queue) {
return null !== queue.first ? queue.first.priorityLevel : NoWork;
function getUpdatePriority(fiber) {
var updateQueue = fiber.updateQueue;
return null === updateQueue ? NoWork : fiber.tag !== ClassComponent && fiber.tag !== HostRoot ? NoWork : null !== updateQueue.first ? updateQueue.first.priorityLevel : NoWork;
}
var getPendingPriority_1 = getPendingPriority;
var getUpdatePriority_1 = getUpdatePriority;
function addTopLevelUpdate$1(fiber, partialState, callback, priorityLevel) {
var isTopLevelUnmount = null === partialState.element, update = {
@@ -1163,7 +1157,7 @@ function addTopLevelUpdate$1(fiber, partialState, callback, priorityLevel) {
next: null
}, update2 = insertUpdate(fiber, update);
if (isTopLevelUnmount) {
var queue1 = fiber.updateQueue, queue2 = null !== fiber.alternate ? fiber.alternate.updateQueue : null;
var _ensureUpdateQueues2 = ensureUpdateQueues(fiber), queue1 = _ensureUpdateQueues2[0], queue2 = _ensureUpdateQueues2[1];
null !== queue1 && null !== update.next && (update.next = null, queue1.last = update),
null !== queue2 && null !== update2 && null !== update2.next && (update2.next = null,
queue2.last = update);
@@ -1180,18 +1174,27 @@ function getStateFromUpdate(update, instance, prevState, props) {
return partialState;
}
function beginUpdateQueue(workInProgress, queue, instance, prevState, props, priorityLevel) {
queue.hasForceUpdate = !1;
for (var state = prevState, dontMutatePrevState = !0, callbackList = queue.callbackList, update = queue.first; null !== update && comparePriority(update.priorityLevel, priorityLevel) <= 0; ) {
function beginUpdateQueue(current, workInProgress, queue, instance, prevState, props, priorityLevel) {
if (null !== current && current.updateQueue === queue) {
var currentQueue = queue;
queue = workInProgress.updateQueue = {
first: currentQueue.first,
last: currentQueue.last,
callbackList: null,
hasForceUpdate: !1
};
}
for (var callbackList = queue.callbackList, hasForceUpdate = queue.hasForceUpdate, state = prevState, dontMutatePrevState = !0, update = queue.first; null !== update && comparePriority(update.priorityLevel, priorityLevel) <= 0; ) {
queue.first = update.next, null === queue.first && (queue.last = null);
var _partialState = void 0;
update.isReplace ? (state = getStateFromUpdate(update, instance, state, props),
dontMutatePrevState = !0) : (_partialState = getStateFromUpdate(update, instance, state, props)) && (state = dontMutatePrevState ? Object.assign({}, state, _partialState) : Object.assign(state, _partialState),
dontMutatePrevState = !1), update.isForced && (queue.hasForceUpdate = !0), null === update.callback || update.isTopLevelUnmount && null !== update.next || (callbackList = callbackList || [],
dontMutatePrevState = !1), update.isForced && (hasForceUpdate = !0), null === update.callback || update.isTopLevelUnmount && null !== update.next || (callbackList = null !== callbackList ? callbackList : [],
callbackList.push(update.callback), workInProgress.effectTag |= CallbackEffect),
update = update.next;
}
return queue.callbackList = callbackList, null !== queue.first || null !== callbackList || queue.hasForceUpdate || (workInProgress.updateQueue = null),
return queue.callbackList = callbackList, queue.hasForceUpdate = hasForceUpdate,
null !== queue.first || null !== callbackList || hasForceUpdate || (workInProgress.updateQueue = null),
state;
}
@@ -1199,19 +1202,21 @@ var beginUpdateQueue_1 = beginUpdateQueue;
function commitCallbacks(finishedWork, queue, context) {
var callbackList = queue.callbackList;
if (null !== callbackList) for (var i = 0; i < callbackList.length; i++) {
var _callback = callbackList[i];
invariant("function" == typeof _callback, "Invalid argument passed as callback. Expected a function. Instead " + "received: %s", _callback),
_callback.call(context);
if (null !== callbackList) {
queue.callbackList = null;
for (var i = 0; i < callbackList.length; i++) {
var _callback = callbackList[i];
invariant("function" == typeof _callback, "Invalid argument passed as callback. Expected a function. Instead " + "received: %s", _callback),
_callback.call(context);
}
}
}
var commitCallbacks_1 = commitCallbacks, ReactFiberUpdateQueue = {
cloneUpdateQueue: cloneUpdateQueue_1,
addUpdate: addUpdate_1,
addReplaceUpdate: addReplaceUpdate_1,
addForceUpdate: addForceUpdate_1,
getPendingPriority: getPendingPriority_1,
getUpdatePriority: getUpdatePriority_1,
addTopLevelUpdate: addTopLevelUpdate_1,
beginUpdateQueue: beginUpdateQueue_1,
commitCallbacks: commitCallbacks_1
@@ -1244,7 +1249,7 @@ var getComponentName_1 = getComponentName$1, ReactInstanceMap = {
}
}, ReactInstanceMap_1 = ReactInstanceMap, ReactInternals = react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactGlobalSharedState = {
ReactCurrentOwner: ReactInternals.ReactCurrentOwner
}, ReactGlobalSharedState_1 = ReactGlobalSharedState, HostRoot$1 = ReactTypeOfWork.HostRoot, HostComponent$2 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3;
}, ReactGlobalSharedState_1 = ReactGlobalSharedState, HostRoot$2 = ReactTypeOfWork.HostRoot, HostComponent$2 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3;
function isFiberMountedImpl(fiber) {
var node = fiber;
@@ -1252,7 +1257,7 @@ function isFiberMountedImpl(fiber) {
if ((node.effectTag & Placement) !== NoEffect) return MOUNTING;
for (;node.return; ) if (node = node.return, (node.effectTag & Placement) !== NoEffect) return MOUNTING;
}
return node.tag === HostRoot$1 ? MOUNTED : UNMOUNTED;
return node.tag === HostRoot$2 ? MOUNTED : UNMOUNTED;
}
var isFiberMounted$1 = function(fiber) {
@@ -1313,7 +1318,7 @@ function findCurrentFiberUsingSlowPath(fiber) {
}
invariant(a.alternate === b, "Return fibers should always be each others' alternates.");
}
return invariant(a.tag === HostRoot$1, "Unable to find node on an unmounted component."),
return invariant(a.tag === HostRoot$2, "Unable to find node on an unmounted component."),
a.stateNode.current === a ? fiber : alternate;
}
@@ -1361,7 +1366,7 @@ var findCurrentFiberUsingSlowPath_1 = findCurrentFiberUsingSlowPath, findCurrent
for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
}
return target;
}, isFiberMounted = ReactFiberTreeReflection.isFiberMounted, ClassComponent = ReactTypeOfWork.ClassComponent, HostRoot = ReactTypeOfWork.HostRoot, createCursor = ReactFiberStack.createCursor, pop = ReactFiberStack.pop, push = ReactFiberStack.push, contextStackCursor = createCursor(emptyObject), didPerformWorkStackCursor = createCursor(!1), previousContext = emptyObject;
}, isFiberMounted = ReactFiberTreeReflection.isFiberMounted, ClassComponent$1 = ReactTypeOfWork.ClassComponent, HostRoot$1 = ReactTypeOfWork.HostRoot, createCursor = ReactFiberStack.createCursor, pop = ReactFiberStack.pop, push = ReactFiberStack.push, contextStackCursor = createCursor(emptyObject), didPerformWorkStackCursor = createCursor(!1), previousContext = emptyObject;
function getUnmaskedContext(workInProgress) {
return isContextProvider$1(workInProgress) ? previousContext : contextStackCursor.current;
@@ -1387,13 +1392,13 @@ var cacheContext_1 = cacheContext, getMaskedContext = function(workInProgress, u
};
function isContextConsumer(fiber) {
return fiber.tag === ClassComponent && null != fiber.type.contextTypes;
return fiber.tag === ClassComponent$1 && null != fiber.type.contextTypes;
}
var isContextConsumer_1 = isContextConsumer;
function isContextProvider$1(fiber) {
return fiber.tag === ClassComponent && null != fiber.type.childContextTypes;
return fiber.tag === ClassComponent$1 && null != fiber.type.childContextTypes;
}
var isContextProvider_1 = isContextProvider$1;
@@ -1431,8 +1436,8 @@ var processChildContext_1 = processChildContext$1, pushContextProvider = functio
}, resetContext = function() {
previousContext = emptyObject, contextStackCursor.current = emptyObject, didPerformWorkStackCursor.current = !1;
}, findCurrentUnmaskedContext$1 = function(fiber) {
invariant(isFiberMounted(fiber) && fiber.tag === ClassComponent, "Expected subtree parent to be a mounted class component");
for (var node = fiber; node.tag !== HostRoot; ) {
invariant(isFiberMounted(fiber) && fiber.tag === ClassComponent$1, "Expected subtree parent to be a mounted class component");
for (var node = fiber; node.tag !== HostRoot$1; ) {
if (isContextProvider$1(node)) return node.stateNode.__reactInternalMemoizedMergedChildContext;
var parent = node.return;
invariant(parent, "Found unexpected detached subtree parent"), node = parent;
@@ -1455,7 +1460,7 @@ var processChildContext_1 = processChildContext$1, pushContextProvider = functio
}, ReactTypeOfInternalContext = {
NoContext: 0,
AsyncUpdates: 1
}, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostRoot$2 = ReactTypeOfWork.HostRoot, HostComponent$3 = ReactTypeOfWork.HostComponent, HostText$1 = ReactTypeOfWork.HostText, HostPortal = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent = ReactTypeOfWork.YieldComponent, Fragment = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, cloneUpdateQueue$1 = ReactFiberUpdateQueue.cloneUpdateQueue, createFiber = function(tag, key, internalContextTag) {
}, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, ClassComponent$3 = ReactTypeOfWork.ClassComponent, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$3 = ReactTypeOfWork.HostComponent, HostText$1 = ReactTypeOfWork.HostText, HostPortal = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent = ReactTypeOfWork.YieldComponent, Fragment = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, createFiber = function(tag, key, internalContextTag) {
return {
tag: tag,
key: key,
@@ -1476,10 +1481,6 @@ var processChildContext_1 = processChildContext$1, pushContextProvider = functio
firstEffect: null,
lastEffect: null,
pendingWorkPriority: NoWork$1,
progressedPriority: NoWork$1,
progressedChild: null,
progressedFirstDeletion: null,
progressedLastDeletion: null,
alternate: null
};
};
@@ -1488,18 +1489,18 @@ function shouldConstruct(Component) {
return !(!Component.prototype || !Component.prototype.isReactComponent);
}
var cloneFiber = function(fiber, priorityLevel) {
var alt = fiber.alternate;
return null !== alt ? (alt.effectTag = NoEffect$1, alt.nextEffect = null, alt.firstEffect = null,
alt.lastEffect = null) : (alt = createFiber(fiber.tag, fiber.key, fiber.internalContextTag),
alt.type = fiber.type, alt.progressedChild = fiber.progressedChild, alt.progressedPriority = fiber.progressedPriority,
alt.alternate = fiber, fiber.alternate = alt), alt.stateNode = fiber.stateNode,
alt.child = fiber.child, alt.sibling = fiber.sibling, alt.index = fiber.index, alt.ref = fiber.ref,
alt.pendingProps = fiber.pendingProps, cloneUpdateQueue$1(fiber, alt), alt.pendingWorkPriority = priorityLevel,
alt.memoizedProps = fiber.memoizedProps, alt.memoizedState = fiber.memoizedState,
alt;
var createWorkInProgress = function(current, renderPriority) {
var workInProgress = current.alternate;
return null === workInProgress ? (workInProgress = createFiber(current.tag, current.key, current.internalContextTag),
workInProgress.type = current.type, workInProgress.stateNode = current.stateNode,
workInProgress.alternate = current, current.alternate = workInProgress) : (workInProgress.effectTag = NoWork$1,
workInProgress.nextEffect = null, workInProgress.firstEffect = null, workInProgress.lastEffect = null),
workInProgress.pendingWorkPriority = renderPriority, workInProgress.child = current.child,
workInProgress.memoizedProps = current.memoizedProps, workInProgress.memoizedState = current.memoizedState,
workInProgress.updateQueue = current.updateQueue, workInProgress.sibling = current.sibling,
workInProgress.index = current.index, workInProgress.ref = current.ref, workInProgress;
}, createHostRootFiber$1 = function() {
return createFiber(HostRoot$2, null, NoContext);
return createFiber(HostRoot$3, null, NoContext);
}, createFiberFromElement = function(element, internalContextTag, priorityLevel) {
var owner = null, fiber = createFiberFromElementType(element.type, element.key, internalContextTag, owner);
return fiber.pendingProps = element.props, fiber.pendingWorkPriority = priorityLevel,
@@ -1516,7 +1517,7 @@ var cloneFiber = function(fiber, priorityLevel) {
function createFiberFromElementType(type, key, internalContextTag, debugOwner) {
var fiber = void 0;
if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$2, key, internalContextTag) : createFiber(IndeterminateComponent, key, internalContextTag),
if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$3, key, internalContextTag) : createFiber(IndeterminateComponent, key, internalContextTag),
fiber.type = type; else if ("string" == typeof type) fiber = createFiber(HostComponent$3, key, internalContextTag),
fiber.type = type; else if ("object" == typeof type && null !== type && "number" == typeof type.tag) fiber = type; else {
var info = "";
@@ -1541,8 +1542,10 @@ var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHo
containerInfo: portal.containerInfo,
implementation: portal.implementation
}, fiber;
}, largerPriority = function(p1, p2) {
return p1 !== NoWork$1 && (p2 === NoWork$1 || p2 > p1) ? p1 : p2;
}, ReactFiber = {
cloneFiber: cloneFiber,
createWorkInProgress: createWorkInProgress,
createHostRootFiber: createHostRootFiber$1,
createFiberFromElement: createFiberFromElement,
createFiberFromFragment: createFiberFromFragment,
@@ -1551,7 +1554,8 @@ var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHo
createFiberFromHostInstanceForDeletion: createFiberFromHostInstanceForDeletion,
createFiberFromCoroutine: createFiberFromCoroutine,
createFiberFromYield: createFiberFromYield,
createFiberFromPortal: createFiberFromPortal
createFiberFromPortal: createFiberFromPortal,
largerPriority: largerPriority
}, createHostRootFiber = ReactFiber.createHostRootFiber, createFiberRoot$1 = function(containerInfo) {
var uninitializedFiber = createHostRootFiber(), root = {
current: uninitializedFiber,
@@ -1564,7 +1568,7 @@ var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHo
return uninitializedFiber.stateNode = root, root;
}, ReactFiberRoot = {
createFiberRoot: createFiberRoot$1
}, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$4 = ReactTypeOfWork.ClassComponent, HostComponent$5 = ReactTypeOfWork.HostComponent;
}, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostComponent$5 = ReactTypeOfWork.HostComponent;
function describeComponentFrame(name, source, ownerName) {
return "\n in " + (name || "Unknown") + (source ? " (at " + source.fileName.replace(/^.*[\\\/]/, "") + ":" + source.lineNumber + ")" : ownerName ? " (created by " + ownerName + ")" : "");
@@ -1574,7 +1578,7 @@ function describeFiber(fiber) {
switch (fiber.tag) {
case IndeterminateComponent$1:
case FunctionalComponent:
case ClassComponent$4:
case ClassComponent$5:
case HostComponent$5:
var owner = fiber._debugOwner, source = fiber._debugSource, name = getComponentName_1(fiber), ownerName = null;
return owner && (ownerName = getComponentName_1(owner)), describeComponentFrame(name, source, ownerName);
@@ -1626,7 +1630,7 @@ var createCoroutine = function(children, handler, props) {
isYield: isYield,
REACT_YIELD_TYPE: REACT_YIELD_TYPE_1,
REACT_COROUTINE_TYPE: REACT_COROUTINE_TYPE_1
}, REACT_COROUTINE_TYPE = ReactCoroutine.REACT_COROUTINE_TYPE, REACT_YIELD_TYPE = ReactCoroutine.REACT_YIELD_TYPE, REACT_PORTAL_TYPE$1 = ReactPortal.REACT_PORTAL_TYPE, cloneFiber$2 = ReactFiber.cloneFiber, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion, ITERATOR_SYMBOL = "function" == typeof Symbol && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator", REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103;
}, REACT_COROUTINE_TYPE = ReactCoroutine.REACT_COROUTINE_TYPE, REACT_YIELD_TYPE = ReactCoroutine.REACT_YIELD_TYPE, REACT_PORTAL_TYPE$1 = ReactPortal.REACT_PORTAL_TYPE, createWorkInProgress$2 = ReactFiber.createWorkInProgress, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion, ITERATOR_SYMBOL = "function" == typeof Symbol && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator", REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103;
function getIteratorFn(maybeIterable) {
if (null === maybeIterable || void 0 === maybeIterable) return null;
@@ -1640,7 +1644,7 @@ function coerceRef(current, element) {
var owner = element._owner, inst = void 0;
if (owner) if ("number" == typeof owner.tag) {
var ownerFiber = owner;
invariant(ownerFiber.tag === ClassComponent$6, "Stateless function components cannot have refs."),
invariant(ownerFiber.tag === ClassComponent$7, "Stateless function components cannot have refs."),
inst = ownerFiber.stateNode;
} else inst = owner.getPublicInstance();
invariant(inst, "Missing owner for string ref %s. This error is likely caused by a " + "bug in React. Please file an issue.", mixedRef);
@@ -1668,8 +1672,8 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
if (null === childToDelete.alternate) return;
childToDelete = childToDelete.alternate;
}
var last = returnFiber.progressedLastDeletion;
null !== last ? (last.nextEffect = childToDelete, returnFiber.progressedLastDeletion = childToDelete) : returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete,
var last = returnFiber.lastEffect;
null !== last ? (last.nextEffect = childToDelete, returnFiber.lastEffect = childToDelete) : returnFiber.firstEffect = returnFiber.lastEffect = childToDelete,
childToDelete.nextEffect = null, childToDelete.effectTag = Deletion$1;
}
}
@@ -1686,7 +1690,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
}
function useFiber(fiber, priority) {
if (shouldClone) {
var clone = cloneFiber$2(fiber, priority);
var clone = createWorkInProgress$2(fiber, priority);
return clone.index = 0, clone.sibling = null, clone;
}
return fiber.pendingWorkPriority = priority, fiber.effectTag = NoEffect$2, fiber.index = 0,
@@ -2002,7 +2006,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, priority));
}
if (disableNewFiberFeatures) switch (returnFiber.tag) {
case ClassComponent$6:
case ClassComponent$7:
var Component = returnFiber.type;
invariant(null === newChild || !1 === newChild, "%s.render(): A valid React element (or null) must be returned. " + "You may have returned undefined, an array or some other " + "invalid object.", Component.displayName || Component.name || "Component");
break;
@@ -2015,7 +2019,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
if (isArray(newChild)) return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, priority);
if (getIteratorFn(newChild)) return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, priority);
if (isObject && throwOnInvalidObjectType(returnFiber, newChild), !disableNewFiberFeatures && void 0 === newChild) switch (returnFiber.tag) {
case ClassComponent$6:
case ClassComponent$7:
case FunctionalComponent$2:
var _Component2 = returnFiber.type;
invariant(!1, "%s(...): Nothing was returned from render. This usually means a " + "return statement is missing. Or, to render nothing, " + "return null.", _Component2.displayName || _Component2.name || "Component");
@@ -2026,14 +2030,15 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
}
var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlace$1 = ChildReconciler(!1, !0), mountChildFibersInPlace$1 = ChildReconciler(!1, !1), cloneChildFibers$1 = function(current, workInProgress) {
if (workInProgress.child) if (null !== current && workInProgress.child === current.child) {
var currentChild = workInProgress.child, newChild = cloneFiber$2(currentChild, currentChild.pendingWorkPriority);
for (workInProgress.child = newChild, newChild.return = workInProgress; null !== currentChild.sibling; ) currentChild = currentChild.sibling,
newChild = newChild.sibling = cloneFiber$2(currentChild, currentChild.pendingWorkPriority),
newChild.return = workInProgress;
if (invariant(null === current || workInProgress.child === current.child, "Resuming work not yet implemented."),
null !== workInProgress.child) {
var currentChild = workInProgress.child, newChild = createWorkInProgress$2(currentChild, currentChild.pendingWorkPriority);
for (newChild.pendingProps = currentChild.pendingProps, workInProgress.child = newChild,
newChild.return = workInProgress; null !== currentChild.sibling; ) currentChild = currentChild.sibling,
newChild = newChild.sibling = createWorkInProgress$2(currentChild, currentChild.pendingWorkPriority),
newChild.pendingProps = currentChild.pendingProps, newChild.return = workInProgress;
newChild.sibling = null;
} else for (var child = workInProgress.child; null !== child; ) child.return = workInProgress,
child = child.sibling;
}
}, ReactChildFiber = {
reconcileChildFibers: reconcileChildFibers$1,
reconcileChildFibersInPlace: reconcileChildFibersInPlace$1,
@@ -2086,7 +2091,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
instance.componentWillReceiveProps(newProps, newContext), instance.state !== oldState && updater.enqueueReplaceState(instance, instance.state, null);
}
function mountClassInstance(workInProgress, priorityLevel) {
var instance = workInProgress.stateNode, state = instance.state || null, props = workInProgress.pendingProps;
var current = workInProgress.alternate, instance = workInProgress.stateNode, state = instance.state || null, props = workInProgress.pendingProps;
invariant(props, "There must be pending props for an initial mount. This error is " + "likely caused by a bug in React. Please file an issue.");
var unmaskedContext = getUnmaskedContext$2(workInProgress);
if (instance.props = props, instance.state = state, instance.refs = emptyObject,
@@ -2094,30 +2099,10 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
"function" == typeof instance.componentWillMount) {
callComponentWillMount(workInProgress, instance);
var updateQueue = workInProgress.updateQueue;
null !== updateQueue && (instance.state = beginUpdateQueue$2(workInProgress, updateQueue, instance, state, props, priorityLevel));
null !== updateQueue && (instance.state = beginUpdateQueue$2(current, workInProgress, updateQueue, instance, state, props, priorityLevel));
}
"function" == typeof instance.componentDidMount && (workInProgress.effectTag |= Update$1);
}
function resumeMountClassInstance(workInProgress, priorityLevel) {
var instance = workInProgress.stateNode;
resetInputPointers(workInProgress, instance);
var newState = workInProgress.memoizedState, newProps = workInProgress.pendingProps;
newProps || (newProps = workInProgress.memoizedProps, invariant(null != newProps, "There should always be pending or memoized props. This error is " + "likely caused by a bug in React. Please file an issue."));
var newUnmaskedContext = getUnmaskedContext$2(workInProgress), newContext = getMaskedContext$2(workInProgress, newUnmaskedContext), oldContext = instance.context, oldProps = workInProgress.memoizedProps;
"function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === newContext || callComponentWillReceiveProps(workInProgress, instance, newProps, newContext);
var updateQueue = workInProgress.updateQueue;
if (null !== updateQueue && (newState = beginUpdateQueue$2(workInProgress, updateQueue, instance, newState, newProps, priorityLevel)),
!checkShouldComponentUpdate(workInProgress, workInProgress.memoizedProps, newProps, workInProgress.memoizedState, newState, newContext)) return instance.props = newProps,
instance.state = newState, instance.context = newContext, !1;
if (instance.props = newProps, instance.state = newState, instance.context = newContext,
"function" == typeof instance.componentWillMount) {
callComponentWillMount(workInProgress, instance);
var newUpdateQueue = workInProgress.updateQueue;
null !== newUpdateQueue && (newState = beginUpdateQueue$2(workInProgress, newUpdateQueue, instance, newState, newProps, priorityLevel));
}
return "function" == typeof instance.componentDidMount && (workInProgress.effectTag |= Update$1),
instance.state = newState, !0;
}
function updateClassInstance(current, workInProgress, priorityLevel) {
var instance = workInProgress.stateNode;
resetInputPointers(workInProgress, instance);
@@ -2125,9 +2110,9 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
newProps || (newProps = oldProps, invariant(null != newProps, "There should always be pending or memoized props. This error is " + "likely caused by a bug in React. Please file an issue."));
var oldContext = instance.context, newUnmaskedContext = getUnmaskedContext$2(workInProgress), newContext = getMaskedContext$2(workInProgress, newUnmaskedContext);
"function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === newContext || callComponentWillReceiveProps(workInProgress, instance, newProps, newContext);
var updateQueue = workInProgress.updateQueue, oldState = workInProgress.memoizedState, newState = void 0;
if (newState = null !== updateQueue ? beginUpdateQueue$2(workInProgress, updateQueue, instance, oldState, newProps, priorityLevel) : oldState,
!(oldProps !== newProps || oldState !== newState || hasContextChanged$2() || null !== updateQueue && updateQueue.hasForceUpdate)) return "function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)),
var oldState = workInProgress.memoizedState, newState = void 0;
if (newState = null !== workInProgress.updateQueue ? beginUpdateQueue$2(current, workInProgress, workInProgress.updateQueue, instance, oldState, newProps, priorityLevel) : oldState,
!(oldProps !== newProps || oldState !== newState || hasContextChanged$2() || null !== workInProgress.updateQueue && workInProgress.updateQueue.hasForceUpdate)) return "function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)),
!1;
var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext);
return shouldUpdate ? ("function" == typeof instance.componentWillUpdate && instance.componentWillUpdate(newProps, newState, newContext),
@@ -2140,29 +2125,15 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
adoptClassInstance: adoptClassInstance,
constructClassInstance: constructClassInstance,
mountClassInstance: mountClassInstance,
resumeMountClassInstance: resumeMountClassInstance,
updateClassInstance: updateClassInstance
};
}, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$2 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, PerformedWork$1 = ReactTypeOfSideEffect.PerformedWork, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) {
var shouldSetTextContent = config.shouldSetTextContent, useSyncScheduling = config.useSyncScheduling, shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree, pushHostContext = hostContext.pushHostContext, pushHostContainer = hostContext.pushHostContainer, enterHydrationState = hydrationContext.enterHydrationState, resetHydrationState = hydrationContext.resetHydrationState, tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance, _ReactFiberClassCompo = ReactFiberClassComponent(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState), adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, constructClassInstance = _ReactFiberClassCompo.constructClassInstance, mountClassInstance = _ReactFiberClassCompo.mountClassInstance, resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance, updateClassInstance = _ReactFiberClassCompo.updateClassInstance;
function markChildAsProgressed(current, workInProgress, priorityLevel) {
workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel,
null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority);
}
function clearDeletions(workInProgress) {
workInProgress.progressedFirstDeletion = workInProgress.progressedLastDeletion = null;
}
function transferDeletions(workInProgress) {
workInProgress.firstEffect = workInProgress.progressedFirstDeletion, workInProgress.lastEffect = workInProgress.progressedLastDeletion;
}
}, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$2 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, PerformedWork$1 = ReactTypeOfSideEffect.PerformedWork, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) {
var shouldSetTextContent = config.shouldSetTextContent, useSyncScheduling = config.useSyncScheduling, shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree, pushHostContext = hostContext.pushHostContext, pushHostContainer = hostContext.pushHostContainer, enterHydrationState = hydrationContext.enterHydrationState, resetHydrationState = hydrationContext.resetHydrationState, tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance, _ReactFiberClassCompo = ReactFiberClassComponent(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState), adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, constructClassInstance = _ReactFiberClassCompo.constructClassInstance, mountClassInstance = _ReactFiberClassCompo.mountClassInstance, updateClassInstance = _ReactFiberClassCompo.updateClassInstance;
function reconcileChildren(current, workInProgress, nextChildren) {
reconcileChildrenAtPriority(current, workInProgress, nextChildren, workInProgress.pendingWorkPriority);
}
function reconcileChildrenAtPriority(current, workInProgress, nextChildren, priorityLevel) {
workInProgress.memoizedProps = null, null === current ? workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress),
workInProgress.child = reconcileChildFibers(workInProgress, workInProgress.child, nextChildren, priorityLevel),
transferDeletions(workInProgress)) : (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel),
transferDeletions(workInProgress)), markChildAsProgressed(current, workInProgress, priorityLevel);
null === current ? workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel) : current.child === workInProgress.child ? workInProgress.child = reconcileChildFibers(workInProgress, workInProgress.child, nextChildren, priorityLevel) : workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel);
}
function updateFragment(current, workInProgress) {
var nextChildren = workInProgress.pendingProps;
@@ -2188,7 +2159,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
}
function updateClassComponent(current, workInProgress, priorityLevel) {
var hasContext = pushContextProvider$1(workInProgress), shouldUpdate = void 0;
return null === current ? workInProgress.stateNode ? shouldUpdate = resumeMountClassInstance(workInProgress, priorityLevel) : (constructClassInstance(workInProgress, workInProgress.pendingProps),
return null === current ? workInProgress.stateNode ? invariant(!1, "Resuming work not yet implemented.") : (constructClassInstance(workInProgress, workInProgress.pendingProps),
mountClassInstance(workInProgress, priorityLevel), shouldUpdate = !0) : shouldUpdate = updateClassInstance(current, workInProgress, priorityLevel),
finishClassComponent(current, workInProgress, shouldUpdate, hasContext);
}
@@ -2208,40 +2179,27 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
pushHostContainer(workInProgress, root.containerInfo);
var updateQueue = workInProgress.updateQueue;
if (null !== updateQueue) {
var prevState = workInProgress.memoizedState, state = beginUpdateQueue$1(workInProgress, updateQueue, null, prevState, null, priorityLevel);
var prevState = workInProgress.memoizedState, state = beginUpdateQueue$1(current, workInProgress, updateQueue, null, prevState, null, priorityLevel);
if (prevState === state) return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress);
var element = state.element;
return null !== current && null !== current.child || !enterHydrationState(workInProgress) ? (resetHydrationState(),
reconcileChildren(current, workInProgress, element)) : (workInProgress.effectTag |= Placement$2,
workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel),
markChildAsProgressed(current, workInProgress, priorityLevel)), memoizeState(workInProgress, state),
workInProgress.child;
workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel)),
memoizeState(workInProgress, state), workInProgress.child;
}
return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress);
}
function updateHostComponent(current, workInProgress) {
function updateHostComponent(current, workInProgress, renderPriority) {
pushHostContext(workInProgress), null === current && tryToClaimNextHydratableInstance(workInProgress);
var nextProps = workInProgress.pendingProps, type = workInProgress.type, prevProps = null !== current ? current.memoizedProps : null, memoizedProps = workInProgress.memoizedProps;
if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps, invariant(null !== nextProps, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextProps || memoizedProps === nextProps) {
if (!useSyncScheduling && shouldDeprioritizeSubtree(type, memoizedProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) {
for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority = OffscreenPriority$1,
child = child.sibling;
return null;
}
return bailoutOnAlreadyFinishedWork(current, workInProgress);
}
var type = workInProgress.type, memoizedProps = workInProgress.memoizedProps, nextProps = workInProgress.pendingProps;
null === nextProps && (nextProps = memoizedProps, invariant(null !== nextProps, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue."));
var prevProps = null !== current ? current.memoizedProps : null;
if (hasContextChanged$1()) ; else if (null === nextProps || memoizedProps === nextProps) return bailoutOnAlreadyFinishedWork(current, workInProgress);
var nextChildren = nextProps.children;
if (shouldSetTextContent(type, nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(type, prevProps) && (workInProgress.effectTag |= ContentReset$1),
markRef(current, workInProgress), !useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, nextProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) {
if (workInProgress.progressedPriority === OffscreenPriority$1 && (workInProgress.child = workInProgress.progressedChild),
reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority$1),
memoizeProps(workInProgress, nextProps), workInProgress.child = null !== current ? current.child : null,
null === current) for (var _child = workInProgress.progressedChild; null !== _child; ) _child.effectTag = Placement$2,
_child = _child.sibling;
return null;
}
return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps),
workInProgress.child;
return shouldSetTextContent(type, nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(type, prevProps) && (workInProgress.effectTag |= ContentReset$1),
markRef(current, workInProgress), renderPriority !== OffscreenPriority$1 && !useSyncScheduling && shouldDeprioritizeSubtree(type, nextProps) ? (workInProgress.pendingWorkPriority = OffscreenPriority$1,
null) : (reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps),
workInProgress.child);
}
function updateHostText(current, workInProgress) {
null === current && tryToClaimNextHydratableInstance(workInProgress);
@@ -2253,7 +2211,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
invariant(null === current, "An indeterminate component should never have mounted. This error is " + "likely caused by a bug in React. Please file an issue.");
var value, fn = workInProgress.type, props = workInProgress.pendingProps, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext);
if (value = fn(props, context), workInProgress.effectTag |= PerformedWork$1, "object" == typeof value && null !== value && "function" == typeof value.render) {
workInProgress.tag = ClassComponent$5;
workInProgress.tag = ClassComponent$6;
var hasContext = pushContextProvider$1(workInProgress);
return adoptClassInstance(workInProgress, value), mountClassInstance(workInProgress, priorityLevel),
finishClassComponent(current, workInProgress, !0, hasContext);
@@ -2266,11 +2224,8 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
hasContextChanged$1() ? null === nextCoroutine && (nextCoroutine = current && current.memoizedProps,
invariant(null !== nextCoroutine, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")) : null !== nextCoroutine && workInProgress.memoizedProps !== nextCoroutine || (nextCoroutine = workInProgress.memoizedProps);
var nextChildren = nextCoroutine.children, priorityLevel = workInProgress.pendingWorkPriority;
return workInProgress.memoizedProps = null, null === current ? workInProgress.stateNode = mountChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress),
workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel),
transferDeletions(workInProgress)) : (workInProgress.stateNode = reconcileChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel),
transferDeletions(workInProgress)), memoizeProps(workInProgress, nextCoroutine),
workInProgress.stateNode;
return null === current ? workInProgress.stateNode = mountChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel) : current.child === workInProgress.child ? workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel) : workInProgress.stateNode = reconcileChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel),
memoizeProps(workInProgress, nextCoroutine), workInProgress.stateNode;
}
function updatePortalComponent(current, workInProgress) {
pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
@@ -2278,18 +2233,15 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
if (hasContextChanged$1()) null === nextChildren && (nextChildren = current && current.memoizedProps,
invariant(null != nextChildren, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextChildren || workInProgress.memoizedProps === nextChildren) return bailoutOnAlreadyFinishedWork(current, workInProgress);
return null === current ? (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel),
memoizeProps(workInProgress, nextChildren), markChildAsProgressed(current, workInProgress, priorityLevel)) : (reconcileChildren(current, workInProgress, nextChildren),
memoizeProps(workInProgress, nextChildren)) : (reconcileChildren(current, workInProgress, nextChildren),
memoizeProps(workInProgress, nextChildren)), workInProgress.child;
}
function bailoutOnAlreadyFinishedWork(current, workInProgress) {
var priorityLevel = workInProgress.pendingWorkPriority;
return current && workInProgress.child === current.child && clearDeletions(workInProgress),
cloneChildFibers(current, workInProgress), markChildAsProgressed(current, workInProgress, priorityLevel),
workInProgress.child;
return cloneChildFibers(current, workInProgress), workInProgress.child;
}
function bailoutOnLowPriority(current, workInProgress) {
switch (workInProgress.tag) {
case ClassComponent$5:
case ClassComponent$6:
pushContextProvider$1(workInProgress);
break;
@@ -2299,29 +2251,28 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
return null;
}
function memoizeProps(workInProgress, nextProps) {
workInProgress.memoizedProps = nextProps, workInProgress.pendingProps = null;
workInProgress.memoizedProps = nextProps;
}
function memoizeState(workInProgress, nextState) {
workInProgress.memoizedState = nextState;
}
function beginWork(current, workInProgress, priorityLevel) {
if (workInProgress.pendingWorkPriority === NoWork$3 || workInProgress.pendingWorkPriority > priorityLevel) return bailoutOnLowPriority(current, workInProgress);
switch (workInProgress.firstEffect = null, workInProgress.lastEffect = null, workInProgress.progressedPriority === priorityLevel && (workInProgress.child = workInProgress.progressedChild),
workInProgress.tag) {
switch (workInProgress.tag) {
case IndeterminateComponent$2:
return mountIndeterminateComponent(current, workInProgress, priorityLevel);
case FunctionalComponent$1:
return updateFunctionalComponent(current, workInProgress);
case ClassComponent$5:
case ClassComponent$6:
return updateClassComponent(current, workInProgress, priorityLevel);
case HostRoot$4:
case HostRoot$5:
return updateHostRoot(current, workInProgress, priorityLevel);
case HostComponent$6:
return updateHostComponent(current, workInProgress);
return updateHostComponent(current, workInProgress, priorityLevel);
case HostText$2:
return updateHostText(current, workInProgress);
@@ -2346,13 +2297,13 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
}
}
function beginFailedWork(current, workInProgress, priorityLevel) {
if (invariant(workInProgress.tag === ClassComponent$5 || workInProgress.tag === HostRoot$4, "Invalid type of work. This error is likely caused by a bug in React. " + "Please file an issue."),
workInProgress.effectTag |= Err$1, workInProgress.pendingWorkPriority === NoWork$3 || workInProgress.pendingWorkPriority > priorityLevel) return bailoutOnLowPriority(current, workInProgress);
if (workInProgress.firstEffect = null, workInProgress.lastEffect = null, reconcileChildren(current, workInProgress, null),
workInProgress.tag === ClassComponent$5) {
if (invariant(workInProgress.tag === ClassComponent$6 || workInProgress.tag === HostRoot$5, "Invalid type of work. This error is likely caused by a bug in React. " + "Please file an issue."),
workInProgress.effectTag |= Err$1, null === current ? workInProgress.child = null : workInProgress.child !== current.child && (workInProgress.child = current.child),
workInProgress.pendingWorkPriority === NoWork$3 || workInProgress.pendingWorkPriority > priorityLevel) return bailoutOnLowPriority(current, workInProgress);
if (workInProgress.firstEffect = null, workInProgress.lastEffect = null, reconcileChildrenAtPriority(current, workInProgress, null, priorityLevel),
workInProgress.tag === ClassComponent$6) {
var instance = workInProgress.stateNode;
workInProgress.memoizedProps = instance.props, workInProgress.memoizedState = instance.state,
workInProgress.pendingProps = null;
workInProgress.memoizedProps = instance.props, workInProgress.memoizedState = instance.state;
}
return workInProgress.child;
}
@@ -2360,12 +2311,8 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
beginWork: beginWork,
beginFailedWork: beginFailedWork
};
}, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) {
}, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, OffscreenPriority$2 = ReactPriorityLevel.OffscreenPriority, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) {
var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, finalizeInitialChildren = config.finalizeInitialChildren, prepareUpdate = config.prepareUpdate, getRootHostContainer = hostContext.getRootHostContainer, popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer, prepareToHydrateHostInstance = hydrationContext.prepareToHydrateHostInstance, prepareToHydrateHostTextInstance = hydrationContext.prepareToHydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState;
function markChildAsProgressed(current, workInProgress, priorityLevel) {
workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel,
null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority);
}
function markUpdate(workInProgress) {
workInProgress.effectTag |= Update$2;
}
@@ -2394,7 +2341,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
appendAllYields(yields, workInProgress);
var fn = coroutine.handler, props = coroutine.props, nextChildren = fn(props, yields), currentFirstChild = null !== current ? current.child : null, priority = workInProgress.pendingWorkPriority;
return workInProgress.child = reconcileChildFibers$2(workInProgress, currentFirstChild, nextChildren, priority),
markChildAsProgressed(current, workInProgress, priority), workInProgress.child;
workInProgress.child;
}
function appendAllChildren(parent, workInProgress) {
for (var node = workInProgress.child; null !== node; ) {
@@ -2410,15 +2357,17 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
node = node.sibling;
}
}
function completeWork(current, workInProgress) {
switch (workInProgress.tag) {
function completeWork(current, workInProgress, renderPriority) {
var newProps = workInProgress.pendingProps;
switch (null === newProps ? newProps = workInProgress.memoizedProps : workInProgress.pendingWorkPriority === OffscreenPriority$2 && renderPriority !== OffscreenPriority$2 || (workInProgress.pendingProps = null),
workInProgress.tag) {
case FunctionalComponent$3:
return null;
case ClassComponent$7:
case ClassComponent$8:
return popContextProvider$2(workInProgress), null;
case HostRoot$5:
case HostRoot$6:
var fiberRoot = workInProgress.stateNode;
return fiberRoot.pendingContext && (fiberRoot.context = fiberRoot.pendingContext,
fiberRoot.pendingContext = null), null !== current && null !== current.child || (popHydrationState(workInProgress),
@@ -2426,7 +2375,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
case HostComponent$7:
popHostContext(workInProgress);
var rootContainerInstance = getRootHostContainer(), type = workInProgress.type, newProps = workInProgress.memoizedProps;
var rootContainerInstance = getRootHostContainer(), type = workInProgress.type;
if (null !== current && null != workInProgress.stateNode) {
var oldProps = current.memoizedProps, instance = workInProgress.stateNode, currentHostContext = getHostContext(), updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
workInProgress.updateQueue = updatePayload, updatePayload && markUpdate(workInProgress),
@@ -2445,7 +2394,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
return null;
case HostText$4:
var newText = workInProgress.memoizedProps;
var newText = newProps;
if (current && null != workInProgress.stateNode) {
current.memoizedProps !== newText && markUpdate(workInProgress);
} else {
@@ -2500,7 +2449,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
injectInternals: injectInternals_1,
onCommitRoot: onCommitRoot_1,
onCommitUnmount: onCommitUnmount_1
}, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$8 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, ReactFiberCommitWork = function(config, captureError) {
}, ClassComponent$9 = ReactTypeOfWork.ClassComponent, HostRoot$7 = ReactTypeOfWork.HostRoot, HostComponent$8 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, ReactFiberCommitWork = function(config, captureError) {
var commitMount = config.commitMount, commitUpdate = config.commitUpdate, resetTextContent = config.resetTextContent, commitTextUpdate = config.commitTextUpdate, appendChild = config.appendChild, appendChildToContainer = config.appendChildToContainer, insertBefore = config.insertBefore, insertInContainerBefore = config.insertInContainerBefore, removeChild = config.removeChild, removeChildFromContainer = config.removeChildFromContainer, getPublicInstance = config.getPublicInstance;
function safelyCallComponentWillUnmount(current, instance) {
try {
@@ -2527,7 +2476,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
invariant(!1, "Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue.");
}
function isHostParent(fiber) {
return fiber.tag === HostComponent$8 || fiber.tag === HostRoot$6 || fiber.tag === HostPortal$5;
return fiber.tag === HostComponent$8 || fiber.tag === HostRoot$7 || fiber.tag === HostPortal$5;
}
function getHostSibling(fiber) {
var node = fiber;
@@ -2551,7 +2500,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
parent = parentFiber.stateNode, isContainer = !1;
break;
case HostRoot$6:
case HostRoot$7:
case HostPortal$5:
parent = parentFiber.stateNode.containerInfo, isContainer = !0;
break;
@@ -2594,7 +2543,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
currentParent = parent.stateNode, currentParentIsContainer = !1;
break findParent;
case HostRoot$6:
case HostRoot$7:
case HostPortal$5:
currentParent = parent.stateNode.containerInfo, currentParentIsContainer = !0;
break findParent;
@@ -2627,7 +2576,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
}
function commitUnmount(current) {
switch ("function" == typeof onCommitUnmount && onCommitUnmount(current), current.tag) {
case ClassComponent$8:
case ClassComponent$9:
safelyDetachRef(current);
var instance = current.stateNode;
return void ("function" == typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(current, instance));
@@ -2644,7 +2593,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
}
function commitWork(current, finishedWork) {
switch (finishedWork.tag) {
case ClassComponent$8:
case ClassComponent$9:
return;
case HostComponent$8:
@@ -2660,7 +2609,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
var textInstance = finishedWork.stateNode, newText = finishedWork.memoizedProps, oldText = null !== current ? current.memoizedProps : newText;
return void commitTextUpdate(textInstance, oldText, newText);
case HostRoot$6:
case HostRoot$7:
case HostPortal$5:
return;
@@ -2670,7 +2619,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
}
function commitLifeCycles(current, finishedWork) {
switch (finishedWork.tag) {
case ClassComponent$8:
case ClassComponent$9:
var instance = finishedWork.stateNode;
if (finishedWork.effectTag & Update$3) if (null === current) instance.componentDidMount(); else {
var prevProps = current.memoizedProps, prevState = current.memoizedState;
@@ -2678,7 +2627,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
}
return void (finishedWork.effectTag & Callback$1 && null !== finishedWork.updateQueue && commitCallbacks$1(finishedWork, finishedWork.updateQueue, instance));
case HostRoot$6:
case HostRoot$7:
var updateQueue = finishedWork.updateQueue;
if (null !== updateQueue) {
var _instance = finishedWork.child && finishedWork.child.stateNode;
@@ -2768,9 +2717,9 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
pushHostContext: pushHostContext,
resetHostContainer: resetHostContainer
};
}, HostComponent$9 = ReactTypeOfWork.HostComponent, HostText$6 = ReactTypeOfWork.HostText, HostRoot$7 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) {
var shouldSetTextContent = config.shouldSetTextContent, canHydrateInstance = config.canHydrateInstance, canHydrateTextInstance = config.canHydrateTextInstance, getNextHydratableSibling = config.getNextHydratableSibling, getFirstHydratableChild = config.getFirstHydratableChild, hydrateInstance = config.hydrateInstance, hydrateTextInstance = config.hydrateTextInstance;
if (!(canHydrateInstance && canHydrateTextInstance && getNextHydratableSibling && getFirstHydratableChild && hydrateInstance && hydrateTextInstance)) return {
}, HostComponent$9 = ReactTypeOfWork.HostComponent, HostText$6 = ReactTypeOfWork.HostText, HostRoot$8 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) {
var shouldSetTextContent = config.shouldSetTextContent, canHydrateInstance = config.canHydrateInstance, canHydrateTextInstance = config.canHydrateTextInstance, getNextHydratableSibling = config.getNextHydratableSibling, getFirstHydratableChild = config.getFirstHydratableChild, hydrateInstance = config.hydrateInstance, hydrateTextInstance = config.hydrateTextInstance, didNotHydrateInstance = config.didNotHydrateInstance, didNotFindHydratableInstance = config.didNotFindHydratableInstance, didNotFindHydratableTextInstance = config.didNotFindHydratableTextInstance;
if (!(canHydrateInstance && canHydrateTextInstance && getNextHydratableSibling && getFirstHydratableChild && hydrateInstance && hydrateTextInstance && didNotHydrateInstance && didNotFindHydratableInstance && didNotFindHydratableTextInstance)) return {
enterHydrationState: function() {
return !1;
},
@@ -2798,14 +2747,18 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
null !== returnFiber.lastEffect ? (returnFiber.lastEffect.nextEffect = childToDelete,
returnFiber.lastEffect = childToDelete) : returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
}
function insertNonHydratedInstance(returnFiber, fiber) {
fiber.effectTag |= Placement$6;
}
function canHydrate(fiber, nextInstance) {
switch (fiber.tag) {
case HostComponent$9:
var type = fiber.type, props = fiber.memoizedProps;
var type = fiber.type, props = fiber.pendingProps;
return canHydrateInstance(nextInstance, type, props);
case HostText$6:
return canHydrateTextInstance(nextInstance);
var text = fiber.pendingProps;
return canHydrateTextInstance(nextInstance, text);
default:
return !1;
@@ -2814,9 +2767,10 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
function tryToClaimNextHydratableInstance(fiber) {
if (isHydrating) {
var nextInstance = nextHydratableInstance;
if (!nextInstance) return fiber.effectTag |= Placement$6, isHydrating = !1, void (hydrationParentFiber = fiber);
if (!nextInstance) return insertNonHydratedInstance(hydrationParentFiber, fiber),
isHydrating = !1, void (hydrationParentFiber = fiber);
if (!canHydrate(fiber, nextInstance)) {
if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrate(fiber, nextInstance)) return fiber.effectTag |= Placement$6,
if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrate(fiber, nextInstance)) return insertNonHydratedInstance(hydrationParentFiber, fiber),
isHydrating = !1, void (hydrationParentFiber = fiber);
deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance);
}
@@ -2832,7 +2786,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
return hydrateTextInstance(textInstance, fiber.memoizedProps, fiber);
}
function popToNextHostParent(fiber) {
for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$9 && parent.tag !== HostRoot$7; ) parent = parent.return;
for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$9 && parent.tag !== HostRoot$8; ) parent = parent.return;
hydrationParentFiber = parent;
}
function popHydrationState(fiber) {
@@ -2855,7 +2809,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance,
popHydrationState: popHydrationState
};
}, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, PerformedWork = ReactTypeOfSideEffect.PerformedWork, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$4 = ReactTypeOfWork.HostComponent, HostPortal$1 = ReactTypeOfWork.HostPortal, ClassComponent$3 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, ReactFiberInstrumentation$1, timeHeuristicForUnitOfWork = 1, ReactFiberScheduler = function(config) {
}, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, createWorkInProgress$1 = ReactFiber.createWorkInProgress, largerPriority$1 = ReactFiber.largerPriority, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, PerformedWork = ReactTypeOfSideEffect.PerformedWork, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$4 = ReactTypeOfWork.HostComponent, HostPortal$1 = ReactTypeOfWork.HostPortal, ClassComponent$4 = ReactTypeOfWork.ClassComponent, getUpdatePriority$1 = ReactFiberUpdateQueue.getUpdatePriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, ReactFiberInstrumentation$1, timeHeuristicForUnitOfWork = 1, ReactFiberScheduler = function(config) {
var hostContext = ReactFiberHostContext(config), hydrationContext = ReactFiberHydrationContext(config), popHostContainer = hostContext.popHostContainer, popHostContext = hostContext.popHostContext, resetHostContainer = hostContext.resetHostContainer, _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext), beginWork = _ReactFiberBeginWork.beginWork, beginFailedWork = _ReactFiberBeginWork.beginFailedWork, _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext), completeWork = _ReactFiberCompleteWo.completeWork, _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError), commitPlacement = _ReactFiberCommitWork.commitPlacement, commitDeletion = _ReactFiberCommitWork.commitDeletion, commitWork = _ReactFiberCommitWork.commitWork, commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles, commitAttachRef = _ReactFiberCommitWork.commitAttachRef, commitDetachRef = _ReactFiberCommitWork.commitDetachRef, scheduleDeferredCallback = config.scheduleDeferredCallback, useSyncScheduling = config.useSyncScheduling, prepareForCommit = config.prepareForCommit, resetAfterCommit = config.resetAfterCommit, priorityContext = NoWork$2, priorityContextBeforeReconciliation = NoWork$2, isPerformingWork = !1, deadlineHasExpired = !1, isBatchingUpdates = !1, isUnbatchingUpdates = !1, nextUnitOfWork = null, nextPriorityLevel = NoWork$2, nextEffect = null, pendingCommit = null, nextScheduledRoot = null, lastScheduledRoot = null, isCallbackScheduled = !1, capturedErrors = null, failedBoundaries = null, commitPhaseBoundaries = null, firstUncaughtError = null, fatalError = null, isCommitting = !1, isUnmounting = !1;
function resetContextStack() {
reset$1(), resetContext$1(), resetHostContainer();
@@ -2871,7 +2825,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
for (var root = nextScheduledRoot, highestPriorityRoot = null, highestPriorityLevel = NoWork$2; null !== root; ) root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority) && (highestPriorityLevel = root.current.pendingWorkPriority,
highestPriorityRoot = root), root = root.nextScheduledRoot;
return null !== highestPriorityRoot ? (nextPriorityLevel = highestPriorityLevel,
priorityContext = nextPriorityLevel, resetContextStack(), cloneFiber$1(highestPriorityRoot.current, highestPriorityLevel)) : (nextPriorityLevel = NoWork$2,
priorityContext = nextPriorityLevel, resetContextStack(), createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel)) : (nextPriorityLevel = NoWork$2,
null);
}
function commitAllHostEffects() {
@@ -2950,17 +2904,17 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
commitPhaseBoundaries && (commitPhaseBoundaries.forEach(scheduleErrorRecovery),
commitPhaseBoundaries = null), priorityContext = previousPriorityContext;
}
function resetWorkPriority(workInProgress) {
var newPriority = NoWork$2, queue = workInProgress.updateQueue, tag = workInProgress.tag;
null === queue || tag !== ClassComponent$3 && tag !== HostRoot$3 || (newPriority = getPendingPriority$1(queue));
for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority !== NoWork$2 && (newPriority === NoWork$2 || newPriority > child.pendingWorkPriority) && (newPriority = child.pendingWorkPriority),
child = child.sibling;
workInProgress.pendingWorkPriority = newPriority;
function resetWorkPriority(workInProgress, renderPriority) {
if (!(workInProgress.pendingWorkPriority !== NoWork$2 && workInProgress.pendingWorkPriority > renderPriority)) {
for (var newPriority = getUpdatePriority$1(workInProgress), child = workInProgress.child; null !== child; ) newPriority = largerPriority$1(newPriority, child.pendingWorkPriority),
child = child.sibling;
workInProgress.pendingWorkPriority = newPriority;
}
}
function completeUnitOfWork(workInProgress) {
for (;!0; ) {
var current = workInProgress.alternate, next = completeWork(current, workInProgress), returnFiber = workInProgress.return, siblingFiber = workInProgress.sibling;
if (resetWorkPriority(workInProgress), null !== next) return !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress),
var current = workInProgress.alternate, next = completeWork(current, workInProgress, nextPriorityLevel), returnFiber = workInProgress.return, siblingFiber = workInProgress.sibling;
if (resetWorkPriority(workInProgress, nextPriorityLevel), null !== next) return !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress),
next;
if (null !== returnFiber) {
null === returnFiber.firstEffect && (returnFiber.firstEffect = workInProgress.firstEffect),
@@ -3065,12 +3019,12 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
function captureError(failedWork, error) {
ReactCurrentOwner$1.current = null, nextUnitOfWork = null;
var boundary = null, errorBoundaryFound = !1, willRetry = !1, errorBoundaryName = null;
if (failedWork.tag === HostRoot$3) boundary = failedWork, isFailedBoundary(failedWork) && (fatalError = error); else for (var node = failedWork.return; null !== node && null === boundary; ) {
if (node.tag === ClassComponent$3) {
if (failedWork.tag === HostRoot$4) boundary = failedWork, isFailedBoundary(failedWork) && (fatalError = error); else for (var node = failedWork.return; null !== node && null === boundary; ) {
if (node.tag === ClassComponent$4) {
var instance = node.stateNode;
"function" == typeof instance.unstable_handleError && (errorBoundaryFound = !0,
errorBoundaryName = getComponentName_1(node), boundary = node, willRetry = !0);
} else node.tag === HostRoot$3 && (boundary = node);
} else node.tag === HostRoot$4 && (boundary = node);
if (isFailedBoundary(node)) {
if (isUnmounting) return null;
if (null !== commitPhaseBoundaries && (commitPhaseBoundaries.has(node) || null !== node.alternate && commitPhaseBoundaries.has(node.alternate))) return null;
@@ -3113,13 +3067,13 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
console.error(e);
}
switch (effectfulFiber.tag) {
case ClassComponent$3:
case ClassComponent$4:
var instance = effectfulFiber.stateNode, info = {
componentStack: capturedError.componentStack
};
return void instance.unstable_handleError(error, info);
case HostRoot$3:
case HostRoot$4:
return void (null === firstUncaughtError && (firstUncaughtError = error));
default:
@@ -3129,7 +3083,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
function unwindContexts(from, to) {
for (var node = from; null !== node && node !== to && node.alternate !== to; ) {
switch (node.tag) {
case ClassComponent$3:
case ClassComponent$4:
popContextProvider$1(node);
break;
@@ -3137,7 +3091,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
popHostContext(node);
break;
case HostRoot$3:
case HostRoot$4:
case HostPortal$1:
popHostContainer(node);
}
@@ -3154,7 +3108,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
if (shouldContinue = !1, (node.pendingWorkPriority === NoWork$2 || node.pendingWorkPriority > priorityLevel) && (shouldContinue = !0,
node.pendingWorkPriority = priorityLevel), null !== node.alternate && (node.alternate.pendingWorkPriority === NoWork$2 || node.alternate.pendingWorkPriority > priorityLevel) && (shouldContinue = !0,
node.alternate.pendingWorkPriority = priorityLevel), null === node.return) {
if (node.tag !== HostRoot$3) return;
if (node.tag !== HostRoot$4) return;
if (scheduleRoot(node.stateNode, priorityLevel), !isPerformingWork) switch (priorityLevel) {
case SynchronousPriority$1:
isUnbatchingUpdates ? performWork(SynchronousPriority$1, null) : performWork(TaskPriority$1, null);
File diff suppressed because it is too large Load Diff
+5 -6
View File
@@ -1718,19 +1718,18 @@ function _classCallCheck(instance, Constructor) {
}
var CallbackQueue = function() {
function CallbackQueue(arg) {
_classCallCheck(this, CallbackQueue), this._callbacks = null, this._contexts = null,
this._arg = arg;
function CallbackQueue() {
_classCallCheck(this, CallbackQueue), this._callbacks = null, this._contexts = null;
}
return CallbackQueue.prototype.enqueue = function(callback, context) {
this._callbacks = this._callbacks || [], this._callbacks.push(callback), this._contexts = this._contexts || [],
this._contexts.push(context);
}, CallbackQueue.prototype.notifyAll = function() {
var callbacks = this._callbacks, contexts = this._contexts, arg = this._arg;
var callbacks = this._callbacks, contexts = this._contexts;
if (callbacks && contexts) {
invariant(callbacks.length === contexts.length, "Mismatched list of contexts in callback queue"),
this._callbacks = null, this._contexts = null;
for (var i = 0; i < callbacks.length; i++) validateCallback_1(callbacks[i]), callbacks[i].call(contexts[i], arg);
for (var i = 0; i < callbacks.length; i++) validateCallback_1(callbacks[i]), callbacks[i].call(contexts[i]);
callbacks.length = 0, contexts.length = 0;
}
}, CallbackQueue.prototype.checkpoint = function() {
@@ -1752,7 +1751,7 @@ var CallbackQueue = function() {
}, TRANSACTION_WRAPPERS$2 = [ ON_DOM_READY_QUEUEING ];
function ReactNativeReconcileTransaction() {
this.reinitializeTransaction(), this.reactMountReady = CallbackQueue_1.getPooled(null);
this.reinitializeTransaction(), this.reactMountReady = CallbackQueue_1.getPooled();
}
var Mixin = {
+3 -3
View File
@@ -11,11 +11,11 @@
*/
'use strict';
var PropTypes = require('prop-types');
const PropTypes = require('prop-types');
var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');
const createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');
var EdgeInsetsPropType = createStrictShapeTypeChecker({
const EdgeInsetsPropType = createStrictShapeTypeChecker({
top: PropTypes.number,
left: PropTypes.number,
bottom: PropTypes.number,
+2 -1
View File
@@ -9,10 +9,11 @@
#import <UIKit/UIKit.h>
#import <RCTText/RCTTextInput.h>
#import <React/RCTComponent.h>
#import <React/RCTView.h>
#import "RCTTextInput.h"
@class RCTUITextField;
@interface RCTTextField : RCTTextInput
+2 -1
View File
@@ -9,9 +9,10 @@
#import <UIKit/UIKit.h>
#import <RCTText/RCTBackedTextInputViewProtocol.h>
#import <React/RCTView.h>
#import "RCTBackedTextInputViewProtocol.h"
@class RCTBridge;
@class RCTEventDispatcher;
+2 -1
View File
@@ -9,10 +9,11 @@
#import <UIKit/UIKit.h>
#import <RCTText/RCTTextInput.h>
#import <React/RCTView.h>
#import <React/UIView+React.h>
#import "RCTTextInput.h"
@class RCTBridge;
@interface RCTTextView : RCTTextInput <UITextViewDelegate>
+1 -1
View File
@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
#import <RCTText/RCTBackedTextInputViewProtocol.h>
#import "RCTBackedTextInputViewProtocol.h"
NS_ASSUME_NONNULL_BEGIN
+1 -1
View File
@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
#import <RCTText/RCTBackedTextInputViewProtocol.h>
#import "RCTBackedTextInputViewProtocol.h"
NS_ASSUME_NONNULL_BEGIN
+3 -1
View File
@@ -22,6 +22,7 @@ const StyleSheetPropType = require('StyleSheetPropType');
const TextStylePropTypes = require('TextStylePropTypes');
const Touchable = require('Touchable');
const createReactClass = require('create-react-class');
const createReactNativeComponentClass = require('createReactNativeComponentClass');
const mergeFast = require('mergeFast');
const processColor = require('processColor');
@@ -96,7 +97,8 @@ const viewConfig = {
*/
// $FlowFixMe(>=0.41.0)
const Text = React.createClass({
const Text = createReactClass({
displayName: 'Text',
propTypes: {
/**
* When `numberOfLines` is set, this prop defines how text will be truncated.
+3 -1
View File
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var TimerMixin = require('react-timer-mixin');
var {
@@ -22,7 +23,8 @@ var {
var TestManager = NativeModules.TestManager || NativeModules.SnapshotTestManager;
var TextUpdateTest = React.createClass({
var TextUpdateTest = createReactClass({
displayName: 'TextUpdateTest',
mixins: [TimerMixin],
getInitialState: function() {
return {seeMore: true};
+86
View File
@@ -0,0 +1,86 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @polyfill
*/
/* eslint-disable */
/**
* Creates an array from array like objects.
*
* https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from
*/
if (!Array.from) {
Array.from = function(arrayLike /*, mapFn, thisArg */) {
if (arrayLike == null) {
throw new TypeError('Object is null or undefined');
}
// Optional args.
var mapFn = arguments[1];
var thisArg = arguments[2];
var C = this;
var items = Object(arrayLike);
var symbolIterator = typeof Symbol === 'function'
? Symbol.iterator
: '@@iterator';
var mapping = typeof mapFn === 'function';
var usingIterator = typeof items[symbolIterator] === 'function';
var key = 0;
var ret;
var value;
if (usingIterator) {
ret = typeof C === 'function'
? new C()
: [];
var it = items[symbolIterator]();
var next;
while (!(next = it.next()).done) {
value = next.value;
if (mapping) {
value = mapFn.call(thisArg, value, key);
}
ret[key] = value;
key += 1;
}
ret.length = key;
return ret;
}
var len = items.length;
if (isNaN(len) || len < 0) {
len = 0;
}
ret = typeof C === 'function'
? new C(len)
: new Array(len);
while (key < len) {
value = items[key];
if (mapping) {
value = mapFn.call(thisArg, value, key);
}
ret[key] = value;
key += 1;
}
ret.length = key;
return ret;
};
}
@@ -0,0 +1,95 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @polyfill
*/
/* eslint-disable */
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex
function findIndex(predicate, context) {
if (this == null) {
throw new TypeError(
'Array.prototype.findIndex called on null or undefined'
);
}
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
}
var list = Object(this);
var length = list.length >>> 0;
for (var i = 0; i < length; i++) {
if (predicate.call(context, list[i], i, list)) {
return i;
}
}
return -1;
}
if (!Array.prototype.findIndex) {
Object.defineProperty(Array.prototype, 'findIndex', {
enumerable: false,
writable: true,
configurable: true,
value: findIndex
});
}
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
if (!Array.prototype.find) {
Object.defineProperty(Array.prototype, 'find', {
enumerable: false,
writable: true,
configurable: true,
value: function(predicate, context) {
if (this == null) {
throw new TypeError(
'Array.prototype.find called on null or undefined'
);
}
var index = findIndex.call(this, predicate, context);
return index === -1 ? undefined : this[index];
}
});
}
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
if (!Array.prototype.includes) {
Object.defineProperty(Array.prototype, 'includes', {
enumerable: false,
writable: true,
configurable: true,
value: function (searchElement) {
var O = Object(this);
var len = parseInt(O.length) || 0;
if (len === 0) {
return false;
}
var n = parseInt(arguments[1]) || 0;
var k;
if (n >= 0) {
k = n;
} else {
k = len + n;
if (k < 0) {
k = 0;
}
}
var currentElement;
while (k < len) {
currentElement = O[k];
if (searchElement === currentElement ||
(searchElement !== searchElement && currentElement !== currentElement)) {
return true;
}
k++;
}
return false;
}
});
}
+41
View File
@@ -0,0 +1,41 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @polyfill
*/
/* eslint-disable strict */
if (Number.EPSILON === undefined) {
Object.defineProperty(Number, 'EPSILON', {
value: Math.pow(2, -52),
});
}
if (Number.MAX_SAFE_INTEGER === undefined) {
Object.defineProperty(Number, 'MAX_SAFE_INTEGER', {
value: Math.pow(2, 53) - 1,
});
}
if (Number.MIN_SAFE_INTEGER === undefined) {
Object.defineProperty(Number, 'MIN_SAFE_INTEGER', {
value: -(Math.pow(2, 53) - 1),
});
}
if (!Number.isNaN) {
// eslint-disable-next-line max-len
// https://github.com/dherman/tc39-codex-wiki/blob/master/data/es6/number/index.md#polyfill-for-numberisnan
const globalIsNaN = global.isNaN;
Object.defineProperty(Number, 'isNaN', {
configurable: true,
enumerable: false,
value: function isNaN(value) {
return typeof value === 'number' && globalIsNaN(value);
},
writable: true,
});
}
+68
View File
@@ -0,0 +1,68 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @polyfill
*/
/* eslint-disable strict */
// WARNING: This is an optimized version that fails on hasOwnProperty checks
// and non objects. It's not spec-compliant. It's a perf optimization.
// This is only needed for iOS 8 and current Android JSC.
Object.assign = function(target, sources) {
if (__DEV__) {
if (target == null) {
throw new TypeError('Object.assign target cannot be null or undefined');
}
if (typeof target !== 'object' && typeof target !== 'function') {
throw new TypeError(
'In this environment the target of assign MUST be an object.' +
'This error is a performance optimization and not spec compliant.'
);
}
}
for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {
var nextSource = arguments[nextIndex];
if (nextSource == null) {
continue;
}
if (__DEV__) {
if (typeof nextSource !== 'object' &&
typeof nextSource !== 'function') {
throw new TypeError(
'In this environment the sources for assign MUST be an object.' +
'This error is a performance optimization and not spec compliant.'
);
}
}
// We don't currently support accessors nor proxies. Therefore this
// copy cannot throw. If we ever supported this then we must handle
// exceptions and side-effects.
for (var key in nextSource) {
if (__DEV__) {
var hasOwnProperty = Object.prototype.hasOwnProperty;
if (!hasOwnProperty.call(nextSource, key)) {
throw new TypeError(
'One of the sources for assign has an enumerable key on the ' +
'prototype chain. Are you trying to assign a prototype property? ' +
'We don\'t allow it, as this is an edge case that we do not support. ' +
'This error is a performance optimization and not spec compliant.'
);
}
}
target[key] = nextSource[key];
}
}
return target;
};
+59
View File
@@ -0,0 +1,59 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @polyfill
*/
(function() {
'use strict';
const hasOwnProperty = Object.prototype.hasOwnProperty;
/**
* Returns an array of the given object's own enumerable entries.
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
*/
if (typeof Object.entries !== 'function') {
Object.entries = function(object) {
// `null` and `undefined` values are not allowed.
if (object == null) {
throw new TypeError('Object.entries called on non-object');
}
const entries = [];
for (const key in object) {
if (hasOwnProperty.call(object, key)) {
entries.push([key, object[key]]);
}
}
return entries;
};
}
/**
* Returns an array of the given object's own enumerable entries.
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values
*/
if (typeof Object.values !== 'function') {
Object.values = function(object) {
// `null` and `undefined` values are not allowed.
if (object == null) {
throw new TypeError('Object.values called on non-object');
}
const values = [];
for (const key in object) {
if (hasOwnProperty.call(object, key)) {
values.push(object[key]);
}
}
return values;
};
}
})();
@@ -0,0 +1,92 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @polyfill
*/
/* eslint-disable strict, no-extend-native, no-bitwise */
/*
* NOTE: We use (Number(x) || 0) to replace NaN values with zero.
*/
if (!String.prototype.startsWith) {
String.prototype.startsWith = function(search) {
'use strict';
if (this == null) {
throw TypeError();
}
var string = String(this);
var pos = arguments.length > 1 ?
(Number(arguments[1]) || 0) : 0;
var start = Math.min(Math.max(pos, 0), string.length);
return string.indexOf(String(search), pos) === start;
};
}
if (!String.prototype.endsWith) {
String.prototype.endsWith = function(search) {
'use strict';
if (this == null) {
throw TypeError();
}
var string = String(this);
var stringLength = string.length;
var searchString = String(search);
var pos = arguments.length > 1 ?
(Number(arguments[1]) || 0) : stringLength;
var end = Math.min(Math.max(pos, 0), stringLength);
var start = end - searchString.length;
if (start < 0) {
return false;
}
return string.lastIndexOf(searchString, start) === start;
};
}
if (!String.prototype.repeat) {
String.prototype.repeat = function(count) {
'use strict';
if (this == null) {
throw TypeError();
}
var string = String(this);
count = Number(count) || 0;
if (count < 0 || count === Infinity) {
throw RangeError();
}
if (count === 1) {
return string;
}
var result = '';
while (count) {
if (count & 1) {
result += string;
}
if ((count >>= 1)) {
string += string;
}
}
return result;
};
}
if (!String.prototype.includes) {
String.prototype.includes = function(search, start) {
'use strict';
if (typeof start !== 'number') {
start = 0;
}
if (start + search.length > this.length) {
return false;
} else {
return this.indexOf(search, start) !== -1;
}
};
}
@@ -0,0 +1,125 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @emails oncall+jsinfra
*/
/* eslint-disable fb-www/object-create-only-one-param */
'use strict';
describe('Object (ES7)', () => {
beforeEach(() => {
delete Object.entries;
delete Object.values;
jest.resetModules();
require('../Object.es7');
});
describe('Object.entries', () => {
it('should have a length of 1', () => {
expect(Object.entries.length).toBe(1);
});
it('should check for type', () => {
expect(Object.entries.bind(null, null)).toThrow(TypeError(
'Object.entries called on non-object'
));
expect(Object.entries.bind(null, undefined)).toThrow(TypeError(
'Object.entries called on non-object'
));
expect(Object.entries.bind(null, [])).not.toThrow();
expect(Object.entries.bind(null, () => {})).not.toThrow();
expect(Object.entries.bind(null, {})).not.toThrow();
expect(Object.entries.bind(null, 'abc')).not.toThrow();
});
it('should return enumerable entries', () => {
const foo = Object.defineProperties({}, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
expect(Object.entries(foo)).toEqual([['x', 10]]);
const bar = {x: 10, y: 20};
expect(Object.entries(bar)).toEqual([['x', 10], ['y', 20]]);
});
it('should work with proto-less objects', () => {
const foo = Object.create(null, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
expect(Object.entries(foo)).toEqual([['x', 10]]);
});
it('should return only own entries', () => {
const foo = Object.create({z: 30}, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
expect(Object.entries(foo)).toEqual([['x', 10]]);
});
it('should convert to object primitive string', () => {
expect(Object.entries('ab')).toEqual([['0', 'a'], ['1', 'b']]);
});
});
describe('Object.values', () => {
it('should have a length of 1', () => {
expect(Object.values.length).toBe(1);
});
it('should check for type', () => {
expect(Object.values.bind(null, null)).toThrow(TypeError(
'Object.values called on non-object'
));
expect(Object.values.bind(null, [])).not.toThrow();
expect(Object.values.bind(null, () => {})).not.toThrow();
expect(Object.values.bind(null, {})).not.toThrow();
});
it('should return enumerable values', () => {
const foo = Object.defineProperties({}, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
expect(Object.values(foo)).toEqual([10]);
const bar = {x: 10, y: 20};
expect(Object.values(bar)).toEqual([10, 20]);
});
it('should work with proto-less objects', () => {
const foo = Object.create(null, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
expect(Object.values(foo)).toEqual([10]);
});
it('should return only own values', () => {
const foo = Object.create({z: 30}, {
x: {value: 10, enumerable: true},
y: {value: 20},
});
expect(Object.values(foo)).toEqual([10]);
});
it('should convert to object primitive string', () => {
expect(Object.values('ab')).toEqual(['a', 'b']);
});
});
});
+247
View File
@@ -0,0 +1,247 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @polyfill
*/
/* eslint-disable */
// Created by running:
// require('babel-core').buildExternalHelpers('_extends classCallCheck createClass createRawReactElement defineProperty get inherits interopRequireDefault interopRequireWildcard objectWithoutProperties possibleConstructorReturn slicedToArray taggedTemplateLiteral toArray toConsumableArray '.split(' '))
// then replacing the `global` reference in the last line to also use `this`.
//
// actually, that's a lie, because babel6 omits _extends and createRawReactElement
var babelHelpers = global.babelHelpers = {};
babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
babelHelpers.createRawReactElement = (function () {
var REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol.for && Symbol.for("react.element") || 0xeac7;
return function createRawReactElement(type, key, props) {
return {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
ref: null,
props: props,
_owner: null
};
};
})();
babelHelpers.classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
babelHelpers.createClass = (function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
})();
babelHelpers.defineEnumerableProperties = function(obj, descs) {
for (var key in descs) {
var desc = descs[key];
desc.configurable = (desc.enumerable = true);
if ('value' in desc) desc.writable = true;
Object.defineProperty(obj, key, desc);
}
return obj;
};
babelHelpers.defineProperty = function (obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
};
babelHelpers._extends = babelHelpers.extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
babelHelpers.get = function get(object, property, receiver) {
if (object === null) object = Function.prototype;
var desc = Object.getOwnPropertyDescriptor(object, property);
if (desc === undefined) {
var parent = Object.getPrototypeOf(object);
if (parent === null) {
return undefined;
} else {
return get(parent, property, receiver);
}
} else if ("value" in desc) {
return desc.value;
} else {
var getter = desc.get;
if (getter === undefined) {
return undefined;
}
return getter.call(receiver);
}
};
babelHelpers.inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};
babelHelpers.interopRequireDefault = function (obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
};
babelHelpers.interopRequireWildcard = function (obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
}
}
newObj.default = obj;
return newObj;
}
};
babelHelpers.objectWithoutProperties = function (obj, keys) {
var target = {};
for (var i in obj) {
if (keys.indexOf(i) >= 0) continue;
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
target[i] = obj[i];
}
return target;
};
babelHelpers.possibleConstructorReturn = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && (typeof call === "object" || typeof call === "function") ? call : self;
};
babelHelpers.slicedToArray = (function () {
function sliceIterator(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"]) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function (arr, i) {
if (Array.isArray(arr)) {
return arr;
} else if (Symbol.iterator in Object(arr)) {
return sliceIterator(arr, i);
} else {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
};
})();
babelHelpers.taggedTemplateLiteral = function (strings, raw) {
return Object.freeze(Object.defineProperties(strings, {
raw: {
value: Object.freeze(raw)
}
}));
};
babelHelpers.toArray = function (arr) {
return Array.isArray(arr) ? arr : Array.from(arr);
};
babelHelpers.toConsumableArray = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
} else {
return Array.from(arr);
}
};
+515
View File
@@ -0,0 +1,515 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @polyfill
* @nolint
*/
/* eslint-disable */
/**
* This pipes all of our console logging functions to native logging so that
* JavaScript errors in required modules show up in Xcode via NSLog.
*/
const inspect = (function() {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// https://github.com/joyent/node/blob/master/lib/util.js
function inspect(obj, opts) {
var ctx = {
seen: [],
stylize: stylizeNoColor
};
return formatValue(ctx, obj, opts.depth);
}
function stylizeNoColor(str, styleType) {
return str;
}
function arrayToHash(array) {
var hash = {};
array.forEach(function(val, idx) {
hash[val] = true;
});
return hash;
}
function formatValue(ctx, value, recurseTimes) {
// Primitive types cannot have properties
var primitive = formatPrimitive(ctx, value);
if (primitive) {
return primitive;
}
// Look up the keys of the object.
var keys = Object.keys(value);
var visibleKeys = arrayToHash(keys);
// IE doesn't make error fields non-enumerable
// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
if (isError(value)
&& (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
return formatError(value);
}
// Some type of object without properties can be shortcutted.
if (keys.length === 0) {
if (isFunction(value)) {
var name = value.name ? ': ' + value.name : '';
return ctx.stylize('[Function' + name + ']', 'special');
}
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
}
if (isDate(value)) {
return ctx.stylize(Date.prototype.toString.call(value), 'date');
}
if (isError(value)) {
return formatError(value);
}
}
var base = '', array = false, braces = ['{', '}'];
// Make Array say that they are Array
if (isArray(value)) {
array = true;
braces = ['[', ']'];
}
// Make functions say that they are functions
if (isFunction(value)) {
var n = value.name ? ': ' + value.name : '';
base = ' [Function' + n + ']';
}
// Make RegExps say that they are RegExps
if (isRegExp(value)) {
base = ' ' + RegExp.prototype.toString.call(value);
}
// Make dates with properties first say the date
if (isDate(value)) {
base = ' ' + Date.prototype.toUTCString.call(value);
}
// Make error with message first say the error
if (isError(value)) {
base = ' ' + formatError(value);
}
if (keys.length === 0 && (!array || value.length == 0)) {
return braces[0] + base + braces[1];
}
if (recurseTimes < 0) {
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
} else {
return ctx.stylize('[Object]', 'special');
}
}
ctx.seen.push(value);
var output;
if (array) {
output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
} else {
output = keys.map(function(key) {
return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
});
}
ctx.seen.pop();
return reduceToSingleString(output, base, braces);
}
function formatPrimitive(ctx, value) {
if (isUndefined(value))
return ctx.stylize('undefined', 'undefined');
if (isString(value)) {
var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
.replace(/'/g, "\\'")
.replace(/\\"/g, '"') + '\'';
return ctx.stylize(simple, 'string');
}
if (isNumber(value))
return ctx.stylize('' + value, 'number');
if (isBoolean(value))
return ctx.stylize('' + value, 'boolean');
// For some reason typeof null is "object", so special case here.
if (isNull(value))
return ctx.stylize('null', 'null');
}
function formatError(value) {
return '[' + Error.prototype.toString.call(value) + ']';
}
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
var output = [];
for (var i = 0, l = value.length; i < l; ++i) {
if (hasOwnProperty(value, String(i))) {
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
String(i), true));
} else {
output.push('');
}
}
keys.forEach(function(key) {
if (!key.match(/^\d+$/)) {
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
key, true));
}
});
return output;
}
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
var name, str, desc;
desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
if (desc.get) {
if (desc.set) {
str = ctx.stylize('[Getter/Setter]', 'special');
} else {
str = ctx.stylize('[Getter]', 'special');
}
} else {
if (desc.set) {
str = ctx.stylize('[Setter]', 'special');
}
}
if (!hasOwnProperty(visibleKeys, key)) {
name = '[' + key + ']';
}
if (!str) {
if (ctx.seen.indexOf(desc.value) < 0) {
if (isNull(recurseTimes)) {
str = formatValue(ctx, desc.value, null);
} else {
str = formatValue(ctx, desc.value, recurseTimes - 1);
}
if (str.indexOf('\n') > -1) {
if (array) {
str = str.split('\n').map(function(line) {
return ' ' + line;
}).join('\n').substr(2);
} else {
str = '\n' + str.split('\n').map(function(line) {
return ' ' + line;
}).join('\n');
}
}
} else {
str = ctx.stylize('[Circular]', 'special');
}
}
if (isUndefined(name)) {
if (array && key.match(/^\d+$/)) {
return str;
}
name = JSON.stringify('' + key);
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
name = name.substr(1, name.length - 2);
name = ctx.stylize(name, 'name');
} else {
name = name.replace(/'/g, "\\'")
.replace(/\\"/g, '"')
.replace(/(^"|"$)/g, "'");
name = ctx.stylize(name, 'string');
}
}
return name + ': ' + str;
}
function reduceToSingleString(output, base, braces) {
var numLinesEst = 0;
var length = output.reduce(function(prev, cur) {
numLinesEst++;
if (cur.indexOf('\n') >= 0) numLinesEst++;
return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
}, 0);
if (length > 60) {
return braces[0] +
(base === '' ? '' : base + '\n ') +
' ' +
output.join(',\n ') +
' ' +
braces[1];
}
return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
}
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) {
return Array.isArray(ar);
}
function isBoolean(arg) {
return typeof arg === 'boolean';
}
function isNull(arg) {
return arg === null;
}
function isNullOrUndefined(arg) {
return arg == null;
}
function isNumber(arg) {
return typeof arg === 'number';
}
function isString(arg) {
return typeof arg === 'string';
}
function isSymbol(arg) {
return typeof arg === 'symbol';
}
function isUndefined(arg) {
return arg === void 0;
}
function isRegExp(re) {
return isObject(re) && objectToString(re) === '[object RegExp]';
}
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
function isDate(d) {
return isObject(d) && objectToString(d) === '[object Date]';
}
function isError(e) {
return isObject(e) &&
(objectToString(e) === '[object Error]' || e instanceof Error);
}
function isFunction(arg) {
return typeof arg === 'function';
}
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
}
function objectToString(o) {
return Object.prototype.toString.call(o);
}
function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
return inspect;
})();
const OBJECT_COLUMN_NAME = '(index)';
const LOG_LEVELS = {
trace: 0,
info: 1,
warn: 2,
error: 3
};
const INSPECTOR_LEVELS = [];
INSPECTOR_LEVELS[LOG_LEVELS.trace] = 'debug';
INSPECTOR_LEVELS[LOG_LEVELS.info] = 'log';
INSPECTOR_LEVELS[LOG_LEVELS.warn] = 'warning';
INSPECTOR_LEVELS[LOG_LEVELS.error] = 'error';
// Strip the inner function in getNativeLogFunction(), if in dev also
// strip method printing to originalConsole.
const INSPECTOR_FRAMES_TO_SKIP = __DEV__ ? 2 : 1;
if (global.nativeLoggingHook) {
function getNativeLogFunction(level) {
return function() {
let str;
if (arguments.length === 1 && typeof arguments[0] === 'string') {
str = arguments[0];
} else {
str = Array.prototype.map.call(arguments, function(arg) {
return inspect(arg, {depth: 10});
}).join(', ');
}
let logLevel = level;
if (str.slice(0, 9) === 'Warning: ' && logLevel >= LOG_LEVELS.error) {
// React warnings use console.error so that a stack trace is shown,
// but we don't (currently) want these to show a redbox
// (Note: Logic duplicated in ExceptionsManager.js.)
logLevel = LOG_LEVELS.warn;
}
if (global.__inspectorLog) {
global.__inspectorLog(
INSPECTOR_LEVELS[logLevel],
str,
[].slice.call(arguments),
INSPECTOR_FRAMES_TO_SKIP);
}
global.nativeLoggingHook(str, logLevel);
};
}
function repeat(element, n) {
return Array.apply(null, Array(n)).map(function() { return element; });
};
function consoleTablePolyfill(rows) {
// convert object -> array
if (!Array.isArray(rows)) {
var data = rows;
rows = [];
for (var key in data) {
if (data.hasOwnProperty(key)) {
var row = data[key];
row[OBJECT_COLUMN_NAME] = key;
rows.push(row);
}
}
}
if (rows.length === 0) {
global.nativeLoggingHook('', LOG_LEVELS.info);
return;
}
var columns = Object.keys(rows[0]).sort();
var stringRows = [];
var columnWidths = [];
// Convert each cell to a string. Also
// figure out max cell width for each column
columns.forEach(function(k, i) {
columnWidths[i] = k.length;
for (var j = 0; j < rows.length; j++) {
var cellStr = (rows[j][k] || '?').toString();
stringRows[j] = stringRows[j] || [];
stringRows[j][i] = cellStr;
columnWidths[i] = Math.max(columnWidths[i], cellStr.length);
}
});
// Join all elements in the row into a single string with | separators
// (appends extra spaces to each cell to make separators | alligned)
function joinRow(row, space) {
var cells = row.map(function(cell, i) {
var extraSpaces = repeat(' ', columnWidths[i] - cell.length).join('');
return cell + extraSpaces;
});
space = space || ' ';
return cells.join(space + '|' + space);
};
var separators = columnWidths.map(function(columnWidth) {
return repeat('-', columnWidth).join('');
});
var separatorRow = joinRow(separators, '-');
var header = joinRow(columns);
var table = [header, separatorRow];
for (var i = 0; i < rows.length; i++) {
table.push(joinRow(stringRows[i]));
}
// Notice extra empty line at the beginning.
// Native logging hook adds "RCTLog >" at the front of every
// logged string, which would shift the header and screw up
// the table
global.nativeLoggingHook('\n' + table.join('\n'), LOG_LEVELS.info);
}
const originalConsole = global.console;
global.console = {
error: getNativeLogFunction(LOG_LEVELS.error),
info: getNativeLogFunction(LOG_LEVELS.info),
log: getNativeLogFunction(LOG_LEVELS.info),
warn: getNativeLogFunction(LOG_LEVELS.warn),
trace: getNativeLogFunction(LOG_LEVELS.trace),
debug: getNativeLogFunction(LOG_LEVELS.trace),
table: consoleTablePolyfill
};
// If available, also call the original `console` method since that is
// sometimes useful. Ex: on OS X, this will let you see rich output in
// the Safari Web Inspector console.
if (__DEV__ && originalConsole) {
// Preserve the original `console` as `originalConsole`
const descriptor = Object.getOwnPropertyDescriptor(global, 'console');
if (descriptor) {
Object.defineProperty(global, 'originalConsole', descriptor);
}
Object.keys(console).forEach(methodName => {
const reactNativeMethod = console[methodName];
if (originalConsole[methodName]) {
console[methodName] = function() {
originalConsole[methodName](...arguments);
reactNativeMethod.apply(console, arguments);
};
}
});
}
} else if (!global.console) {
function consoleLoggingStub() {};
global.console = {
error: consoleLoggingStub,
info: consoleLoggingStub,
log: consoleLoggingStub,
warn: consoleLoggingStub,
trace: consoleLoggingStub,
debug: consoleLoggingStub,
table: consoleLoggingStub
};
}
+90
View File
@@ -0,0 +1,90 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @polyfill
*/
/* eslint-disable strict */
let _inGuard = 0;
/**
* This is the error handler that is called when we encounter an exception
* when loading a module. This will report any errors encountered before
* ExceptionsManager is configured.
*/
let _globalHandler = function onError(e) {
throw e;
};
/**
* The particular require runtime that we are using looks for a global
* `ErrorUtils` object and if it exists, then it requires modules with the
* error handler specified via ErrorUtils.setGlobalHandler by calling the
* require function with applyWithGuard. Since the require module is loaded
* before any of the modules, this ErrorUtils must be defined (and the handler
* set) globally before requiring anything.
*/
const ErrorUtils = {
setGlobalHandler(fun) {
_globalHandler = fun;
},
getGlobalHandler() {
return _globalHandler;
},
reportError(error) {
_globalHandler && _globalHandler(error);
},
reportFatalError(error) {
_globalHandler && _globalHandler(error, true);
},
applyWithGuard(fun, context, args) {
try {
_inGuard++;
return fun.apply(context, args);
} catch (e) {
ErrorUtils.reportError(e);
} finally {
_inGuard--;
}
return null;
},
applyWithGuardIfNeeded(fun, context, args) {
if (ErrorUtils.inGuard()) {
return fun.apply(context, args);
} else {
ErrorUtils.applyWithGuard(fun, context, args);
}
return null;
},
inGuard() {
return _inGuard;
},
guard(fun, name, context) {
if (typeof fun !== 'function') {
console.warn('A function must be passed to ErrorUtils.guard, got ', fun);
return null;
}
name = name || fun.name || '<generated guard>';
function guarded() {
return (
ErrorUtils.applyWithGuard(
fun,
context || this,
arguments,
null,
name
)
);
}
return guarded;
},
};
global.ErrorUtils = ErrorUtils;
+1
View File
@@ -29,6 +29,7 @@ const ReactNative = {
get ImageStore() { return require('ImageStore'); },
get KeyboardAvoidingView() { return require('KeyboardAvoidingView'); },
get ListView() { return require('ListView'); },
get MaskedViewIOS() { return require('MaskedViewIOS'); },
get Modal() { return require('Modal'); },
get NavigatorIOS() { return require('NavigatorIOS'); },
get Picker() { return require('Picker'); },
+1
View File
@@ -15,6 +15,7 @@ android_library(
deps = [
":res",
react_native_dep("third-party/android/support/v4:lib-support-v4"),
react_native_dep("third-party/android/support/v7/appcompat-orig:appcompat"),
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_target("java/com/facebook/react:react"),
react_native_target("java/com/facebook/react/modules/core:core"),
+3 -1
View File
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
const PropTypes = require('prop-types');
var ReactNative = require('react-native');
var {
@@ -71,7 +72,8 @@ var propTypes = {
};
var CameraRollView = React.createClass({
var CameraRollView = createReactClass({
displayName: 'CameraRollView',
// $FlowFixMe(>=0.41.0)
propTypes: propTypes,
+6 -4
View File
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var {
ActivityIndicator,
@@ -29,7 +30,8 @@ var ImageCapInsetsExample = require('./ImageCapInsetsExample');
const IMAGE_PREFETCH_URL = 'http://origami.design/public/images/bird-logo.png?r=1&t=' + Date.now();
var prefetchTask = Image.prefetch(IMAGE_PREFETCH_URL);
var NetworkImageCallbackExample = React.createClass({
var NetworkImageCallbackExample = createReactClass({
displayName: 'NetworkImageCallbackExample',
getInitialState: function() {
return {
events: [],
@@ -102,7 +104,7 @@ var NetworkImageCallbackExample = React.createClass({
}
});
var NetworkImageExample = React.createClass({
var NetworkImageExample = createReactClass({
getInitialState: function() {
return {
error: false,
@@ -130,7 +132,7 @@ var NetworkImageExample = React.createClass({
}
});
var ImageSizeExample = React.createClass({
var ImageSizeExample = createReactClass({
getInitialState: function() {
return {
width: 0,
@@ -162,7 +164,7 @@ var ImageSizeExample = React.createClass({
},
});
var MultipleSourcesExample = React.createClass({
var MultipleSourcesExample = createReactClass({
getInitialState: function() {
return {
width: 30,
+7 -18
View File
@@ -21,25 +21,14 @@ var {
View,
} = ReactNative;
type Layout = {
x: number;
y: number;
width: number;
height: number;
};
type LayoutEvent = {
nativeEvent: {
layout: Layout,
};
};
import type {ViewLayout, ViewLayoutEvent} from 'ViewPropTypes';
type State = {
containerStyle?: { width: number },
extraText?: string,
imageLayout?: Layout,
textLayout?: Layout,
viewLayout?: Layout,
imageLayout?: ViewLayout,
textLayout?: ViewLayout,
viewLayout?: ViewLayout,
viewStyle: { margin: number },
};
@@ -76,17 +65,17 @@ class LayoutEventExample extends React.Component {
this.setState({containerStyle: {width: 280}});
};
onViewLayout = (e: LayoutEvent) => {
onViewLayout = (e: ViewLayoutEvent) => {
console.log('received view layout event\n', e.nativeEvent);
this.setState({viewLayout: e.nativeEvent.layout});
};
onTextLayout = (e: LayoutEvent) => {
onTextLayout = (e: ViewLayoutEvent) => {
console.log('received text layout event\n', e.nativeEvent);
this.setState({textLayout: e.nativeEvent.layout});
};
onImageLayout = (e: LayoutEvent) => {
onImageLayout = (e: ViewLayoutEvent) => {
console.log('received image layout event\n', e.nativeEvent);
this.setState({imageLayout: e.nativeEvent.layout});
};
+3 -1
View File
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var {
Image,
@@ -24,7 +25,8 @@ var {
var RNTesterPage = require('./RNTesterPage');
var ListViewSimpleExample = React.createClass({
var ListViewSimpleExample = createReactClass({
displayName: 'ListViewSimpleExample',
statics: {
title: '<ListView>',
description: 'Performant, scrollable list of data.'
+3 -1
View File
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var {
Image,
@@ -37,7 +38,8 @@ var THUMB_URLS = [
require('./Thumbnails/victory.png'),
];
var ListViewGridLayoutExample = React.createClass({
var ListViewGridLayoutExample = createReactClass({
displayName: 'ListViewGridLayoutExample',
statics: {
title: '<ListView> - Grid Layout',
+196
View File
@@ -0,0 +1,196 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
* @providesModule MaskedViewExample
*/
'use strict';
const React = require('react');
const RNTesterBlock = require('RNTesterBlock');
const RNTesterPage = require('RNTesterPage');
const {
Animated,
Image,
MaskedViewIOS,
StyleSheet,
Text,
View,
} = require('react-native');
class MaskedViewExample extends React.Component {
static title = '<MaskedViewIOS>';
static description = 'Renders the child view with a mask specified in the `renderMask` prop.';
state = {
alternateChildren: true,
};
_maskRotateAnimatedValue = new Animated.Value(0);
_maskScaleAnimatedValue = new Animated.Value(1);
componentDidMount() {
setInterval(() => {
this.setState(state => ({
alternateChildren: !state.alternateChildren,
}));
}, 1000);
Animated.loop(
Animated.sequence([
Animated.timing(this._maskScaleAnimatedValue, {
toValue: 1.3,
timing: 750,
useNativeDriver: true,
}),
Animated.timing(this._maskScaleAnimatedValue, {
toValue: 1,
timing: 750,
useNativeDriver: true,
}),
])
).start();
Animated.loop(
Animated.timing(this._maskRotateAnimatedValue, {
toValue: 360,
timing: 2000,
useNativeDriver: true,
})
).start();
}
render() {
return (
<RNTesterPage title="<MaskedViewIOS>">
<RNTesterBlock title="Basic Mask">
<View style={{ width: 300, height: 300, alignSelf: 'center' }}>
<MaskedViewIOS
style={{ flex: 1 }}
maskElement={
<View style={styles.maskContainerStyle}>
<Text style={styles.maskTextStyle}>
Basic Mask
</Text>
</View>
}>
<View style={{ flex: 1, backgroundColor: 'blue' }} />
<View style={{ flex: 1, backgroundColor: 'red' }} />
</MaskedViewIOS>
</View>
</RNTesterBlock>
<RNTesterBlock title="Image Mask">
<View
style={{
width: 300,
height: 300,
alignSelf: 'center',
backgroundColor: '#eeeeee',
}}>
<MaskedViewIOS
style={{ flex: 1 }}
maskElement={
<View style={styles.maskContainerStyle}>
<Image
style={{ height: 200, width: 200 }}
source={require('./imageMask.png')}
/>
</View>
}>
<View style={styles.maskContainerStyle}>
<Image
resizeMode="cover"
style={{ width: 200, height: 200 }}
source={{
uri:
'https://38.media.tumblr.com/9e9bd08c6e2d10561dd1fb4197df4c4e/tumblr_mfqekpMktw1rn90umo1_500.gif',
}}
/>
</View>
</MaskedViewIOS>
</View>
</RNTesterBlock>
<RNTesterBlock title="Animated Mask">
<View style={{ width: 300, height: 300, alignSelf: 'center' }}>
<MaskedViewIOS
style={{ flex: 1 }}
maskElement={
<Animated.View
style={[
styles.maskContainerStyle,
{ transform: [{ scale: this._maskScaleAnimatedValue }] },
]}>
<Text style={styles.maskTextStyle}>
Basic Mask
</Text>
</Animated.View>
}>
<Animated.View
style={{
flex: 1,
transform: [
{
rotate: this._maskRotateAnimatedValue.interpolate({
inputRange: [0, 360],
outputRange: ['0deg', '360deg'],
}),
},
],
}}>
<View style={{ flex: 1, backgroundColor: 'blue' }} />
<View style={{ flex: 1, backgroundColor: 'red' }} />
</Animated.View>
</MaskedViewIOS>
</View>
</RNTesterBlock>
<RNTesterBlock title="Mask w/ Changing Children">
<View style={{ width: 300, height: 300, alignSelf: 'center' }}>
<MaskedViewIOS
style={{ flex: 1 }}
maskElement={
<View style={styles.maskContainerStyle}>
<Text style={styles.maskTextStyle}>
Basic Mask
</Text>
</View>
}>
{this.state.alternateChildren
? [
<View
key={1}
style={{ flex: 1, backgroundColor: 'blue' }}
/>,
<View
key={2}
style={{ flex: 1, backgroundColor: 'red' }}
/>,
]
: null}
</MaskedViewIOS>
</View>
</RNTesterBlock>
</RNTesterPage>
);
}
}
const styles = StyleSheet.create({
maskContainerStyle: {
flex: 1,
backgroundColor: 'transparent',
justifyContent: 'center',
alignItems: 'center',
},
maskTextStyle: {
backgroundColor: 'transparent',
fontSize: 40,
fontWeight: 'bold',
},
});
module.exports = MaskedViewExample;
+3 -1
View File
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var {
PanResponder,
@@ -21,7 +22,8 @@ var {
var CIRCLE_SIZE = 80;
var PanResponderExample = React.createClass({
var PanResponderExample = createReactClass({
displayName: 'PanResponderExample',
statics: {
title: 'PanResponder Sample',
@@ -13,12 +13,14 @@
var ProgressBar = require('ProgressBarAndroid');
var React = require('React');
var createReactClass = require('create-react-class');
var RNTesterBlock = require('RNTesterBlock');
var RNTesterPage = require('RNTesterPage');
var TimerMixin = require('react-timer-mixin');
var MovingBar = React.createClass({
var MovingBar = createReactClass({
displayName: 'MovingBar',
mixins: [TimerMixin],
getInitialState: function() {
+3 -1
View File
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var {
ProgressViewIOS,
@@ -20,7 +21,8 @@ var {
} = ReactNative;
var TimerMixin = require('react-timer-mixin');
var ProgressViewExample = React.createClass({
var ProgressViewExample = createReactClass({
displayName: 'ProgressViewExample',
mixins: [TimerMixin],
getInitialState() {
+5
View File
@@ -73,6 +73,11 @@ const ComponentExamples: Array<RNTesterExample> = [
module: require('./ListViewPagingExample'),
supportsTVOS: true,
},
{
key: 'MaskedViewExample',
module: require('./MaskedViewExample'),
supportsTVOS: true,
},
{
key: 'ModalExample',
module: require('./ModalExample'),
+3 -1
View File
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var {
Image,
@@ -25,7 +26,8 @@ var {
var RNTesterPage = require('./RNTesterPage');
var SwipeableListViewSimpleExample = React.createClass({
var SwipeableListViewSimpleExample = createReactClass({
displayName: 'SwipeableListViewSimpleExample',
statics: {
title: '<SwipeableListView>',
description: 'Performant, scrollable, swipeable list of data.'
+3 -1
View File
@@ -13,6 +13,7 @@
const Platform = require('Platform');
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var {
Image,
@@ -72,7 +73,8 @@ class AttributeToggler extends React.Component {
}
}
var AdjustingFontSize = React.createClass({
var AdjustingFontSize = createReactClass({
displayName: 'AdjustingFontSize',
getInitialState: function() {
return {dynamicText:'', shouldRender: true,};
},
+3 -1
View File
@@ -12,6 +12,7 @@
'use strict';
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
var {
AlertIOS,
@@ -111,7 +112,8 @@ class RequestIdleCallbackTester extends React.Component {
};
}
var TimerTester = React.createClass({
var TimerTester = createReactClass({
displayName: 'TimerTester',
mixins: [TimerMixin],
_ii: 0,
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

+19 -4
View File
@@ -44,7 +44,16 @@ Pod::Spec.new do |s|
s.subspec "Core" do |ss|
ss.dependency "Yoga", "#{package["version"]}.React"
ss.source_files = "React/**/*.{c,h,m,mm,S}"
ss.exclude_files = "**/__tests__/*", "IntegrationTests/*", "React/DevSupport/*", "React/**/RCTTVView.*", "ReactCommon/yoga/*", "React/Cxx*/*", "React/Base/RCTBatchedBridge.mm", "React/Executors/*"
ss.exclude_files = "**/__tests__/*",
"IntegrationTests/*",
"React/DevSupport/*",
"React/Inspector/*",
"React/**/RCTTVView.*",
"ReactCommon/yoga/*",
"React/Cxx*/*",
"React/Base/RCTBatchedBridge.mm",
"React/Executors/*"
ss.header_dir = "React"
ss.framework = "JavaScriptCore"
ss.libraries = "stdc++"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"" }
@@ -68,7 +77,8 @@ Pod::Spec.new do |s|
s.subspec "DevSupport" do |ss|
ss.dependency "React/Core"
ss.dependency "React/RCTWebSocket"
ss.source_files = "React/DevSupport/*"
ss.source_files = "React/DevSupport/*",
"React/Inspector/*"
end
s.subspec "tvOS" do |ss|
@@ -77,8 +87,8 @@ Pod::Spec.new do |s|
end
s.subspec "jschelpers_legacy" do |ss|
ss.source_files = "ReactCommon/jschelpers/{JavaScriptCore,JSCWrapper}.{cpp,h}", "ReactCommon/jschelpers/systemJSCWrapper.cpp"
ss.private_header_files = "ReactCommon/jschelpers/{JavaScriptCore,JSCWrapper}.h"
ss.source_files = "ReactCommon/jschelpers/{JavaScriptCore,JSCWrapper,InspectorInterfaces}.{cpp,h}", "ReactCommon/jschelpers/systemJSCWrapper.cpp"
ss.private_header_files = "ReactCommon/jschelpers/{JavaScriptCore,JSCWrapper,InspectorInterfaces}.h"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"" }
ss.framework = "JavaScriptCore"
end
@@ -188,4 +198,9 @@ Pod::Spec.new do |s|
ss.source_files = "Libraries/RCTTest/**/*.{h,m}"
ss.frameworks = "XCTest"
end
s.subspec "_ignore_me_subspec_for_linting_" do |ss|
ss.dependency "React/Core"
ss.dependency "React/CxxBridge"
end
end
-6
View File
@@ -93,12 +93,6 @@ typedef void (^RCTFatalHandler)(NSError *error);
#define RCTAssertNotMainQueue() RCTAssert(!RCTIsMainQueue(), \
@"This function must not be called on the main queue")
/**
* Deprecated, do not use
*/
#define RCTAssertMainThread() RCTAssertMainQueue()
#define RCTAssertNotMainThread() RCTAssertNotMainQueue()
/**
* These methods get and set the current assert function called by the RCTAssert
* macros. You can use these to replace the standard behavior with custom assert
+2 -2
View File
@@ -112,8 +112,8 @@ extern NSString *const RCTContentDidAppearNotification;
/**
* Calling this will result in emitting a "touches cancelled" event to js,
* which effectively cancels all js "gesture recognizers" such as as touchable
* (unless they explicitely ignore cancellation events, but noone should do that).
* which effectively cancels all js "gesture recognizers" such as touchable components
* (unless they explicitely ignore cancellation events, but no one should do that).
*
* This API is exposed for integration purposes where you embed RN rootView
* in a native view with a native gesture recognizer,

Some files were not shown because too many files have changed in this diff Show More