mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0aa7743b5f | ||
|
|
048a5fd57c | ||
|
|
9194b9da80 | ||
|
|
07de8556a5 | ||
|
|
48a537ca70 | ||
|
|
db9c84480e | ||
|
|
e0fe9ea97d | ||
|
|
26208b0e68 | ||
|
|
87f699dc76 | ||
|
|
e681f30080 | ||
|
|
5c9cf44556 | ||
|
|
3bc500f021 | ||
|
|
5f8c3e0291 | ||
|
|
d2cb63dbc8 | ||
|
|
cc4fadac5f | ||
|
|
0877f2c4de | ||
|
|
5470bb2c30 | ||
|
|
8373e630c9 |
@@ -16,20 +16,20 @@
|
||||
If you answered "No":
|
||||
|
||||
We use GitHub Issues exclusively for tracking bugs in React Native. If you're looking for help,
|
||||
check out the How to Get In Touch section of the following guide:
|
||||
https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#how-to-get-in-touch
|
||||
check out the How to Get In Touch section of the following guide:
|
||||
https://facebook.github.io/react-native/docs/contributing.html#how-to-get-in-touch
|
||||
|
||||
Now scroll below!
|
||||
-->
|
||||
|
||||
|
||||
### Have you read the Bugs section of the Contributing to React Native Guide?
|
||||
### Have you read the Bugs section of the How to Contribute guide?
|
||||
|
||||
(Write your answer here.)
|
||||
|
||||
<!--
|
||||
Please read through the bug reporting guidelines thoroughly:
|
||||
https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#bugs
|
||||
https://facebook.github.io/react-native/docs/contributing.html#bugs
|
||||
-->
|
||||
|
||||
### Environment
|
||||
@@ -41,20 +41,25 @@
|
||||
1. `react-native -v`:
|
||||
2. `node -v`:
|
||||
3. `npm -v`:
|
||||
4. `yarn --version` (if you use Yarn):
|
||||
4. `yarn --version`<!-- (if you use Yarn) -->:
|
||||
|
||||
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 doesn’t 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!)
|
||||
|
||||
+7
-12
@@ -3,25 +3,21 @@ 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
|
||||
|
||||
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 +37,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
|
||||
|
||||
+2
-193
@@ -1,196 +1,5 @@
|
||||
# Contributing to React Native
|
||||
|
||||
React Native is one of Facebook's first open source projects that is both under very active development and is also being used to ship code to everybody on https://facebook.com. We're still working out the kinks to make contributing to this project as easy and transparent as possible, but we're not quite there yet. Hopefully this document makes the process for contributing clear and preempts some questions you may have.
|
||||
Want to contribute to React Native? There are a few things you need to know.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read [the full text](https://code.facebook.com/codeofconduct) so that you can understand what actions will and will not be tolerated.
|
||||
|
||||
## Our Development Process
|
||||
|
||||
Some of the core team will be working directly on [GitHub](https://github.com/facebook/react-native). These changes will be public from the beginning. Other changesets will come via a bridge with Facebook's internal source control. This is a necessity as it allows engineers at Facebook outside of the core team to move fast and contribute from an environment they are comfortable in.
|
||||
|
||||
## Branch Organization
|
||||
|
||||
We will do our best to keep `master` in good shape, with tests passing at all times. But in order to move fast, we will make API changes that your application might not be compatible with. We will do our best to [communicate these changes](https://github.com/facebook/react-native/releases) and version appropriately so you can lock into a specific version if need be.
|
||||
|
||||
To see what changes are coming and provide better feedback to React Native contributors, use the [latest release candidate](http://facebook.github.io/react-native/versions.html) when possible. By the time a release candidate is released, the changes it contains will have been shipped in production Facebook apps for over two weeks.
|
||||
|
||||
## Bugs
|
||||
|
||||
#### Where to Find Known Issues
|
||||
|
||||
We are using [GitHub Issues](https://github.com/facebook/react-native/issues) for our public bugs. Before filing a new task, try to make sure your problem doesn't already exist.
|
||||
|
||||
Questions and feature requests are tracked elsewhere:
|
||||
|
||||
- Have a question? [Ask on Stack Overflow](http://stackoverflow.com/questions/tagged/react-native).
|
||||
- If you have a question regarding future plans, check out the [roadmap](https://github.com/facebook/react-native/wiki/Roadmap).
|
||||
- Have a feature request that is not covered in the roadmap? [Add it here](https://react-native.canny.io/feature-requests).
|
||||
|
||||
#### Reporting New Issues
|
||||
|
||||
The best way to get your bug fixed is to provide a reduced test case. Please provide either a [Sketch](https://sketch.expo.io/) or a public repository with a runnable example.
|
||||
|
||||
Please report a single bug per issue. Always provide reproduction steps. You can use Snack in many cases to demonstrate an issue: https://snack.expo.io/. If the bug cannot be reproduced using Snack, verify that the issue can be reproduced locally by targeting the latest release candidate. Ideally, check if the issue is present in master as well.
|
||||
|
||||
Do not forget to include sample code that reproduces the issue. Only open issues for bugs affecting either the latest stable release, or the current release candidate, or master (see http://facebook.github.io/react-native/versions.html). If it is not clear from your report that the issue can be reproduced in one of these releases, your issue will be closed.
|
||||
|
||||
We're not able to provide support through GitHub Issues. If you're looking for help with your code, consider asking on Stack Overflow: http://stackoverflow.com/questions/tagged/react-native
|
||||
|
||||
#### Security Bugs
|
||||
|
||||
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. With that in mind, please do not file public issues; go through the process outlined on that page.
|
||||
|
||||
## How to Get in Touch
|
||||
|
||||
Many React Native users are active on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native).
|
||||
|
||||
If you want to get a general sense of what React Native folks talk about, check out the [React Native Community](https://www.facebook.com/groups/react.native.community) Facebook group.
|
||||
|
||||
There is also [an active community of React and React Native users on the Discord chat platform](https://discord.gg/0ZcbPKXt5bZjGY5n) in case you need help.
|
||||
|
||||
The React Native team sends out periodical updates through the following channels:
|
||||
|
||||
* [Blog](https://facebook.github.io/react-native/blog/)
|
||||
* [Twitter](https://www.twitter.com/reactnative)
|
||||
|
||||
Core contributors to React Native meet monthly and post their meeting notes on the React Native blog. You can also find ad hoc discussions in the [React Native Core Contributors](https://www.facebook.com/groups/reactnativeoss/) Facebook group.
|
||||
|
||||
## Proposing a Change
|
||||
|
||||
If you intend to change the public API, or make any non-trivial changes to the implementation, we recommend [filing an issue](https://github.com/facebook/react-native/issues/new). This lets us reach an agreement on your proposal before you put significant effort into it.
|
||||
|
||||
If you're only fixing a bug, it's fine to submit a pull request right away but we still recommend to file an issue detailing what you're fixing. This is helpful in case we don't accept that specific fix but want to keep track of the issue.
|
||||
|
||||
## Pull Requests
|
||||
|
||||
If you send a pull request, please do it against the master branch. We maintain stable branches for stable releases separately but we don't accept pull requests to them directly. Instead, we cherry-pick non-breaking changes from master to the latest stable version.
|
||||
|
||||
The core team will be monitoring for pull requests. When we get one, we'll run some Facebook-specific integration tests on it first. From here, we'll need to get another person to sign off on the changes and then merge the pull request. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process.
|
||||
|
||||
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.
|
||||
|
||||
*Before* submitting a pull request, please make sure the following is done…
|
||||
|
||||
1. Fork the repo and create your branch from `master`.
|
||||
2. Add the copyright notice to the top of any new files you've added.
|
||||
3. Describe your **test plan** in your commit.
|
||||
4. Ensure **tests pass** on Travis and Circle CI.
|
||||
5. Make sure your code lints (`node linter.js <files touched>`).
|
||||
6. If you haven't already, sign the CLA: https://code.facebook.com/cla
|
||||
7. Squash your commits (`git rebase -i`).
|
||||
One intent alongside one commit makes it clearer for people to review and easier to understand your intention.
|
||||
|
||||
> **Note:** It is not necessary to keep clicking `Merge master to your branch` on the PR page. You would want to merge master if there are conflicts or tests are failing. The Facebook-GitHub-Bot ultimately squashes all commits to a single one before merging your PR.
|
||||
|
||||
#### Test plan
|
||||
|
||||
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.
|
||||
|
||||
- If you've added code that should be tested, add tests!
|
||||
- If you've changed APIs, update the documentation.
|
||||
- If you've updated the docs, verify the website locally and submit screenshots if applicable (see `website/README.md`)
|
||||
|
||||
See "What is a Test Plan?" to learn more:
|
||||
https://medium.com/@martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
|
||||
|
||||
#### Continuous integration tests
|
||||
|
||||
Make sure all **tests pass** on both [Travis][travis] and [Circle CI][circle]. PRs that break tests are unlikely to be merged.
|
||||
|
||||
You can learn more about running tests and contributing to React Native here: https://facebook.github.io/react-native/docs/testing.html
|
||||
|
||||
[travis]: https://travis-ci.org/facebook/react-native
|
||||
[circle]: http://circleci.com/gh/facebook/react-native
|
||||
|
||||
#### Breaking changes
|
||||
|
||||
When adding a new breaking change, follow this template in your pull request:
|
||||
|
||||
```
|
||||
### New breaking change here
|
||||
|
||||
- **Who does this affect**:
|
||||
- **How to migrate**:
|
||||
- **Why make this breaking change**:
|
||||
- **Severity (number of people affected x effort)**:
|
||||
```
|
||||
|
||||
If your pull request is merged, a core contributor will update the [list of breaking changes](https://github.com/facebook/react-native/wiki/Breaking-Changes) which is then used to populate the release notes.
|
||||
|
||||
#### Copyright Notice for files
|
||||
|
||||
Copy and paste this to the top of your new file(s):
|
||||
|
||||
```JS
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
```
|
||||
|
||||
If you've added a new module, add a `@providesModule <moduleName>` at the end of the comment. This will allow the haste package manager to find it.
|
||||
|
||||
### Contributor License Agreement (CLA)
|
||||
|
||||
In order to accept your pull request, we need you to submit a CLA. You only need to do this once, so if you've done this for another Facebook open source project, you're good to go. If you are submitting a pull request for the first time, just let us know that you have completed the CLA and we can cross-check with your GitHub username.
|
||||
|
||||
Complete your CLA here: https://code.facebook.com/cla
|
||||
|
||||
## Style Guide
|
||||
|
||||
Our linter will catch most styling issues that may exist in your code. You can check the status of your code styling by simply running `node linter.js <files touched>`.
|
||||
|
||||
However, there are still some styles that the linter cannot pick up.
|
||||
|
||||
### Code Conventions
|
||||
|
||||
#### General
|
||||
|
||||
* **Most important: Look around.** Match the style you see used in the rest of the project. This includes formatting, naming things in code, naming things in documentation.
|
||||
* Add trailing commas,
|
||||
* 2 spaces for indentation (no tabs)
|
||||
* "Attractive"
|
||||
|
||||
#### JavaScript
|
||||
|
||||
* Use semicolons;
|
||||
* `'use strict';`
|
||||
* Prefer `'` over `"`
|
||||
* Do not use the optional parameters of `setTimeout` and `setInterval`
|
||||
* 80 character line length
|
||||
|
||||
#### JSX
|
||||
|
||||
* Prefer `"` over `'` for string literal props
|
||||
* When wrapping opening tags over multiple lines, place one prop per line
|
||||
* `{}` of props should hug their values (no spaces)
|
||||
* Place the closing `>` of opening tags on the same line as the last prop
|
||||
* Place the closing `/>` of self-closing tags on their own line and left-align them with the opening `<`
|
||||
|
||||
#### Objective-C
|
||||
|
||||
* Space after `@property` declarations
|
||||
* Brackets on *every* `if`, on the *same* line
|
||||
* `- method`, `@interface`, and `@implementation` brackets on the following line
|
||||
* *Try* to keep it around 80 characters line length (sometimes it's just not possible...)
|
||||
* `*` operator goes with the variable name (e.g. `NSObject *variableName;`)
|
||||
|
||||
#### Java
|
||||
|
||||
* If a method call spans multiple lines closing bracket is on the same line as the last argument.
|
||||
* If a method header doesn't fit on one line each argument goes on a separate line.
|
||||
* 100 character line length
|
||||
|
||||
### Documentation
|
||||
|
||||
* Do not wrap lines at 80 characters - configure your editor to soft-wrap when editing documentation.
|
||||
|
||||
## License
|
||||
|
||||
By contributing to React Native, you agree that your contributions will be licensed under its BSD license.
|
||||
We wrote a [contribution guide](https://facebook.github.io/react-native/docs/contributing.html) to help you get started.
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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: () => {},
|
||||
|
||||
@@ -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');
|
||||
@@ -53,7 +54,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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
|
||||
@@ -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,
|
||||
/**
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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,
|
||||
/**
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -25,6 +25,7 @@ var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
|
||||
var View = require('View');
|
||||
const ViewPropTypes = require('ViewPropTypes');
|
||||
|
||||
var createReactClass = require('create-react-class');
|
||||
var ensureComponentIsNative = require('ensureComponentIsNative');
|
||||
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
|
||||
var keyOf = require('fbjs/lib/keyOf');
|
||||
@@ -68,7 +69,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,
|
||||
/**
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -37,7 +38,8 @@ const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
|
||||
* 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: {
|
||||
|
||||
@@ -19,6 +19,7 @@ const ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');
|
||||
const ReactNativeViewAttributes = require('ReactNativeViewAttributes');
|
||||
const ViewPropTypes = require('ViewPropTypes');
|
||||
|
||||
const createReactClass = require('create-react-class');
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
const requireNativeComponent = require('requireNativeComponent');
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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');
|
||||
@@ -126,7 +127,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
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -85,7 +86,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),
|
||||
|
||||
@@ -1 +1 @@
|
||||
cb32253d2f0376de899edb1bc6ebbd1602eec074
|
||||
5495e495de0bd15cd96a76ee0d7ca823cc09cc71
|
||||
+4508
-4277
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
|
||||
+3181
-2921
File diff suppressed because it is too large
Load Diff
@@ -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 = {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import <RCTText/RCTBackedTextInputViewProtocol.h>
|
||||
#import <React/RCTView.h>
|
||||
|
||||
#import "RCTBackedTextInputViewProtocol.h"
|
||||
|
||||
@class RCTBridge;
|
||||
@class RCTEventDispatcher;
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import <RCTText/RCTBackedTextInputViewProtocol.h>
|
||||
#import "RCTBackedTextInputViewProtocol.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import <RCTText/RCTBackedTextInputViewProtocol.h>
|
||||
#import "RCTBackedTextInputViewProtocol.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -1,40 +1,33 @@
|
||||
# React Native [](https://travis-ci.org/facebook/react-native) [](https://circleci.com/gh/facebook/react-native) [](https://badge.fury.io/js/react-native)
|
||||
# [React Native](https://facebook.github.io/react-native/) · [](https://travis-ci.org/facebook/react-native) [](https://circleci.com/gh/facebook/react-native) [](https://badge.fury.io/js/react-native) [](CONTRIBUTING.md#pull-requests)
|
||||
|
||||
React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and [React](https://facebook.github.io/react). The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native.
|
||||
Learn once, write anywhere: Build mobile apps with React.
|
||||
|
||||
- **Build native mobile apps using JavaScript and React:** React Native lets you build mobile apps using only JavaScript. It uses the same design as [React](https://facebook.github.io/react), letting you compose a rich mobile UI from declarative components.
|
||||
- **A React Native app is a real mobile app:** With React Native, you don't build a "mobile web app", an "HTML5 app", or a "hybrid app". You build a real mobile app that's indistinguishable from an app built using Objective-C, Java, or Swift. React Native uses the same fundamental UI building blocks as regular iOS and Android apps. You just put those building blocks together using JavaScript and React.
|
||||
- **Don't waste time recompiling:** React Native lets you build your app faster. Instead of recompiling, you can reload your app instantly. With hot reloading, you can even run new code while retaining your application state. Give it a try - it's a magical experience.
|
||||
- **Use native code when you need to:** React Native combines smoothly with components written in Objective-C, Java, or Swift. It's simple to drop down to native code if you need to optimize a few aspects of your application. It's also easy to build part of your app in React Native, and part of your app using native code directly - that's how the Facebook app works.
|
||||
|
||||
The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native.
|
||||
|
||||
See the official [React Native website](https://facebook.github.io/react-native/) for an introduction to React Native.
|
||||
|
||||
Supported operating systems are >= Android 4.1 (API 16) and >= iOS 8.0.
|
||||
|
||||
- [Getting Started](#getting-started)
|
||||
- [Getting Help](#getting-help)
|
||||
- [Documentation](#documentation)
|
||||
- [Examples](#examples)
|
||||
- [Extending React Native](#extending-react-native)
|
||||
- [Upgrading](#upgrading)
|
||||
- [Opening Issues](#opening-issues)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
|
||||
## Introduction
|
||||
|
||||
See the official [React Native website](https://facebook.github.io/react-native/) for an introduction to React Native.
|
||||
|
||||
## Getting Started
|
||||
|
||||
- Follow the [Getting Started guide](https://facebook.github.io/react-native/docs/getting-started.html) to install React Native and its dependencies.
|
||||
- [Open the RNTester app](#examples) to see a list of components that ship with React Native.
|
||||
- Install the React Developer Tools for [Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi) or [Firefox](https://addons.mozilla.org/firefox/addon/react-devtools/) for better debugging [(read more)](https://facebook.github.io/react-native/docs/debugging.html).
|
||||
- Try out apps from the [Showcase](https://facebook.github.io/react-native/showcase.html) to see what React Native is capable of!
|
||||
Follow the [Getting Started guide](https://facebook.github.io/react-native/docs/getting-started.html). The recommended way to install React Native depends on your project. Here you can find short guides for the most common scenarios:
|
||||
|
||||
## Getting Help
|
||||
|
||||
Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests and have limited bandwidth to address them.
|
||||
|
||||
- Ask a question on [StackOverflow](https://stackoverflow.com/) and tag it with `react-native`
|
||||
- Chat with us on [Reactiflux](https://discord.gg/0ZcbPKXt5bWJVmUY) in #react-native
|
||||
- Articulate your feature request or upvote existing ones on [Canny](https://react-native.canny.io/feature-requests)
|
||||
- Start a thread on the [React Discussion Board](https://discuss.reactjs.org/)
|
||||
- Join #reactnative on IRC: chat.freenode.net
|
||||
- If it turns out that you may have found a bug, please [open an issue](#opening-issues)
|
||||
- [Trying out React Native](https://snack.expo.io/BJ-uC-nrb)
|
||||
- [Creating a New Application](http://facebook.github.io/react-native/docs/getting-started.html)
|
||||
- [Adding React Native to an Existing Application](http://facebook.github.io/react-native/docs/integration-with-existing-apps.html)
|
||||
|
||||
## Documentation
|
||||
|
||||
@@ -48,54 +41,28 @@ Another great way to learn more about the components and APIs included with Reac
|
||||
|
||||
The React Native documentation only discusses the components, APIs and topics specific to React Native (React on iOS and Android). For further documentation on the React API that is shared between React Native and React DOM, refer to the [React documentation](https://facebook.github.io/react/).
|
||||
|
||||
## Examples
|
||||
|
||||
- `git clone https://github.com/facebook/react-native.git`
|
||||
- `cd react-native && npm install`
|
||||
|
||||
### Running the RNTester app on iOS
|
||||
|
||||
Now open `RNTester/RNTester.xcodeproj` and hit Run in Xcode.
|
||||
|
||||
### Running the RNTester app on Android
|
||||
|
||||
Note that you'll need the Android NDK installed, see [prerequisites](https://github.com/facebook/react-native/blob/master/ReactAndroid/README.md#prerequisites).
|
||||
|
||||
```bash
|
||||
./gradlew :RNTester:android:app:installDebug
|
||||
# Start the packager in a separate shell (make sure you ran npm install):
|
||||
./scripts/packager.sh
|
||||
```
|
||||
|
||||
## Extending React Native
|
||||
|
||||
- Looking for a component? [JS.coach](https://js.coach/react-native)
|
||||
- Fellow developers write and publish React Native modules to npm and open source them on GitHub.
|
||||
- Making modules helps grow the React Native ecosystem and community. We recommend writing modules for your use cases and sharing them on npm.
|
||||
- Read the guides on Native Modules ([iOS](https://facebook.github.io/react-native/docs/native-modules-ios.html), [Android](https://facebook.github.io/react-native/docs/native-modules-android.html)) and Native UI Components ([iOS](https://facebook.github.io/react-native/docs/native-components-ios.html), [Android](https://facebook.github.io/react-native/docs/native-components-android.html)) if you are interested in extending native functionality.
|
||||
|
||||
## Upgrading
|
||||
|
||||
React Native is under active development. See the guide on [upgrading React Native](https://facebook.github.io/react-native/docs/upgrading.html) to keep your project up-to-date.
|
||||
|
||||
## Opening Issues
|
||||
|
||||
If you encounter a bug with React Native we would like to hear about it. Search the [existing issues](https://github.com/facebook/react-native/issues) and try to make sure your problem doesn’t already exist before opening a new issue. It’s helpful if you include the version of React Native and OS you’re using. Please include a stack trace and reduced repro case when appropriate, too.
|
||||
|
||||
The GitHub issues are intended for bug reports and feature requests. For help and questions with using React Native please make use of the resources listed in the [Getting Help](#getting-help) section. [Canny](https://react-native.canny.io/feature-requests) in particular is a good way to signal your interest in a feature or issue. There are limited resources available for handling issues and by keeping the list of open issues lean we can respond in a timely manner.
|
||||
|
||||
## Contributing
|
||||
|
||||
For more information about contributing PRs and issues, see our [Contribution Guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md).
|
||||
Read below to learn how you can take part in improving React Native.
|
||||
|
||||
[Good First Task](https://github.com/facebook/react-native/labels/Good%20First%20Task) is a great starting point for PRs.
|
||||
### [Code of Conduct](https://code.facebook.com/codeofconduct)
|
||||
|
||||
We encourage the community to ask and answer questions on Stack Overflow with [the react-native tag](https://stackoverflow.com/questions/tagged/react-native). It's a great way to help out and be involved!
|
||||
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read [the full text](https://code.facebook.com/codeofconduct) so that you can understand what actions will and will not be tolerated.
|
||||
|
||||
### Contributing Guide
|
||||
|
||||
Read our [contributing guide](https://facebook.github.io/react-native/docs/contributing.html) to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes to React Native.
|
||||
|
||||
### Beginner Friendly Bugs
|
||||
|
||||
We have a list of [beginner friendly issues](https://github.com/facebook/react-native/labels/Good%20First%20Task) to help you get your feet wet in the React Native codebase and familiar with our contribution process. This is a great place to get started.
|
||||
|
||||
## License
|
||||
|
||||
React is [BSD licensed](./LICENSE). We also provide an additional [patent grant](./PATENTS).
|
||||
|
||||
React documentation is [Creative Commons licensed](./LICENSE-docs).
|
||||
|
||||
Examples provided in this repository and in the documentation are [separately licensed](./LICENSE-examples), as are some of the [custom components](./LICENSE-CustomComponents).
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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.'
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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.'
|
||||
|
||||
@@ -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,};
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
|
||||
+19
-4
@@ -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
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#import "RCTBridge+Private.h"
|
||||
#import "RCTBridgeModule.h"
|
||||
#import "RCTEventDispatcher.h"
|
||||
#import "RCTInspectorDevServerHelper.h"
|
||||
#import "RCTJSCSamplingProfiler.h"
|
||||
#import "RCTJSEnvironment.h"
|
||||
#import "RCTLog.h"
|
||||
@@ -44,6 +43,12 @@ NSString *const kRCTDevSettingsUserDefaultsKey = @"RCTDevMenu";
|
||||
#import "RCTPackagerConnection.h"
|
||||
#endif
|
||||
|
||||
#define ENABLE_INSPECTOR RCT_DEV && __has_include("RCTInspectorDevServerHelper")
|
||||
|
||||
#if ENABLE_INSPECTOR
|
||||
#import "RCTInspectorDevServerHelper.h"
|
||||
#endif
|
||||
|
||||
#if RCT_DEV
|
||||
|
||||
@interface RCTDevSettingsUserDefaultsDataSource : NSObject <RCTDevSettingsDataSource>
|
||||
@@ -162,7 +167,7 @@ RCT_EXPORT_MODULE()
|
||||
_bridge = bridge;
|
||||
[self _configurePackagerConnection];
|
||||
|
||||
#if RCT_DEV
|
||||
#if ENABLE_INSPECTOR
|
||||
// we need this dispatch back to the main thread because even though this
|
||||
// is executed on the main thread, at this point the bridge is not yet
|
||||
// finished with its initialisation. But it does finish by the time it
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=1000.0.0-master
|
||||
VERSION_NAME=0.47.0-rc.5
|
||||
GROUP=com.facebook.react
|
||||
|
||||
POM_NAME=ReactNative
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
var BatchedBridge = require('BatchedBridge');
|
||||
var React = require('React');
|
||||
var createReactClass = require('create-react-class');
|
||||
var View = require('View');
|
||||
var ScrollView = require('ScrollView');
|
||||
var Text = require('Text');
|
||||
@@ -64,7 +65,8 @@ var onItemPress = function(itemNumber) {
|
||||
ScrollListener.onItemPress(itemNumber);
|
||||
};
|
||||
|
||||
var ScrollViewTestApp = React.createClass({
|
||||
var ScrollViewTestApp = createReactClass({
|
||||
displayName: 'ScrollViewTestApp',
|
||||
getInitialState: getInitialState,
|
||||
onScroll: onScroll,
|
||||
onItemPress: onItemPress,
|
||||
@@ -90,7 +92,8 @@ var ScrollViewTestApp = React.createClass({
|
||||
},
|
||||
});
|
||||
|
||||
var HorizontalScrollViewTestApp = React.createClass({
|
||||
var HorizontalScrollViewTestApp = createReactClass({
|
||||
displayName: 'HorizontalScrollViewTestApp',
|
||||
getInitialState: getInitialState,
|
||||
onScroll: onScroll,
|
||||
onItemPress: onItemPress,
|
||||
|
||||
@@ -17,9 +17,11 @@ var StyleSheet = require('StyleSheet');
|
||||
var View = require('View');
|
||||
var Text = require('Text');
|
||||
|
||||
var createReactClass = require('create-react-class');
|
||||
var renderApplication = require('renderApplication');
|
||||
|
||||
var FlexTestApp = React.createClass({
|
||||
var FlexTestApp = createReactClass({
|
||||
displayName: 'FlexTestApp',
|
||||
_styles: StyleSheet.create({
|
||||
container: {
|
||||
width: 200,
|
||||
@@ -47,7 +49,8 @@ var FlexTestApp = React.createClass({
|
||||
}
|
||||
});
|
||||
|
||||
var FlexWithText = React.createClass({
|
||||
var FlexWithText = createReactClass({
|
||||
displayName: 'FlexWithText',
|
||||
_styles: StyleSheet.create({
|
||||
container: {
|
||||
flexDirection: 'column',
|
||||
@@ -75,7 +78,8 @@ var FlexWithText = React.createClass({
|
||||
}
|
||||
});
|
||||
|
||||
var AbsolutePositionTestApp = React.createClass({
|
||||
var AbsolutePositionTestApp = createReactClass({
|
||||
displayName: 'AbsolutePositionTestApp',
|
||||
_styles: StyleSheet.create({
|
||||
absolute: {
|
||||
position: 'absolute',
|
||||
@@ -90,7 +94,8 @@ var AbsolutePositionTestApp = React.createClass({
|
||||
}
|
||||
});
|
||||
|
||||
var AbsolutePositionBottomRightTestApp = React.createClass({
|
||||
var AbsolutePositionBottomRightTestApp = createReactClass({
|
||||
displayName: 'AbsolutePositionBottomRightTestApp',
|
||||
_styles: StyleSheet.create({
|
||||
container: {
|
||||
width: 100,
|
||||
@@ -113,7 +118,8 @@ var AbsolutePositionBottomRightTestApp = React.createClass({
|
||||
}
|
||||
});
|
||||
|
||||
var CenteredTextView = React.createClass({
|
||||
var CenteredTextView = createReactClass({
|
||||
displayName: 'CenteredTextView',
|
||||
_styles: StyleSheet.create({
|
||||
parent: {
|
||||
width: 200,
|
||||
@@ -139,7 +145,8 @@ var CenteredTextView = React.createClass({
|
||||
});
|
||||
|
||||
var flushUpdatePositionInList = null;
|
||||
var UpdatePositionInListTestApp = React.createClass({
|
||||
var UpdatePositionInListTestApp = createReactClass({
|
||||
displayName: 'UpdatePositionInListTestApp',
|
||||
_styles: StyleSheet.create({
|
||||
element: {
|
||||
height: 10,
|
||||
|
||||
+1
-1
@@ -159,7 +159,7 @@ public class WebSocketModule extends ReactContextBaseJavaModule {
|
||||
|
||||
@Override
|
||||
public void onMessage(WebSocket webSocket, ByteString bytes) {
|
||||
String text = bytes.utf8();
|
||||
String text = bytes.base64();
|
||||
WritableMap params = Arguments.createMap();
|
||||
params.putInt("id", id);
|
||||
params.putString("data", text);
|
||||
|
||||
+26
-10
@@ -1,19 +1,19 @@
|
||||
React Native GitHub Issue Task Force: AndrewJack, astreet, bestander, brentvatne, browniefed, cancan101, charpeni, chirag04, christopherdro, corbt, cosmith, damusnet, DanielMSchmidt, davidaurelio, dmmiller, dsibiski, foghina, frantic, geirman, grabbou, gre, ide, janicduplessis, javache, jaygarcia, jsierles, kmagiera, knowbody, kmagiera, Kureev, lelandrichardson, martinbigio, melihmucuk, mkonicek, ncuillery, rmevans9, rt2zz, ryankask, satya164, skevy, vjeux
|
||||
React Native GitHub Issue Task Force: AndrewJack, astreet, bestander, brentvatne, browniefed, cancan101, charpeni, chirag04, christopherdro, corbt, cosmith, damusnet, DanielMSchmidt, davidaurelio, dmmiller, dsibiski, foghina, frantic, gantman, geirman, grabbou, gre, ide, janicduplessis, javache, jaygarcia, jsierles, kmagiera, knowbody, kmagiera, Kureev, lelandrichardson, martinbigio, melihmucuk, mkonicek, ncuillery, rmevans9, rt2zz, ryankask, satya164, skevy, tabrindle, vjeux
|
||||
|
||||
@facebook-github-bot answered
|
||||
comment Closing this issue as {author} says the question asked has been answered. Please help us by asking questions on [StackOverflow](http://stackoverflow.com/questions/tagged/react-native). StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.
|
||||
comment Closing this issue as {author} says the question asked has been answered.
|
||||
close
|
||||
|
||||
@facebook-github-bot duplicate (#[0-9]+)
|
||||
comment {author} tells me this issue is a duplicate of {match0}. Let's discuss there, closing this one.
|
||||
comment Duplicate of {match0}
|
||||
close
|
||||
|
||||
@facebook-github-bot expected
|
||||
comment The comment above tells me this is expected behavior. Closing this as we'd like to use the GitHub issue tracker for bugs. If you'd like to change how this feature works please post a feature request on [Canny](https://react-native.canny.io/feature-requests) so that other people can vote on it.
|
||||
comment The comment above tells me this is expected behavior. If you'd like to change how this feature works, please submit a feature request on [Canny](https://react-native.canny.io/feature-requests) so that other people can vote on it.
|
||||
close
|
||||
|
||||
@facebook-github-bot stack-overflow
|
||||
comment Hey {issue_author} and thanks for posting this! {author} tells me this issue looks like a question that would be best asked on [StackOverflow](http://stackoverflow.com/questions/tagged/react-native). StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only. Will close this as this is really a question that should be asked on SO.
|
||||
comment Hey {issue_author}, thanks for posting this! {author} tells me this issue looks like a question that would be best asked on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native). Stack Overflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.
|
||||
add-label For Stack Overflow
|
||||
close
|
||||
|
||||
@@ -21,28 +21,44 @@ close
|
||||
add-label {match0}
|
||||
|
||||
@facebook-github-bot no-reply
|
||||
comment Closing this issue as more information is needed to debug this and we haven't heard back from the author. Once there's more information we can reopen the issue.
|
||||
comment Closing this issue as more information is needed to debug this and we haven't heard back from the author.
|
||||
add-label Needs Response from Author
|
||||
close
|
||||
|
||||
@facebook-github-bot no-template
|
||||
comment Hey, thanks for reporting this issue! It looks like your description is missing some necessary information, or the list of reproduction steps is not complete. Can you please add all the details specified in the [Issue Template](https://raw.githubusercontent.com/facebook/react-native/master/.github/ISSUE_TEMPLATE.md)? This is necessary for people to be able to understand and reproduce the issue being reported. I am going to close this, but feel free to open a new issue with the additional information provided. Thanks!
|
||||
add-label Needs more information
|
||||
close
|
||||
|
||||
@facebook-github-bot close
|
||||
comment {author} tells me to close this issue. If you think it should still be opened let us know why.
|
||||
comment {author} has closed this issue. If you think it should remain open, let us know why.
|
||||
close
|
||||
|
||||
@facebook-github-bot bugfix
|
||||
comment Hey {issue_author}, we're a small team and rely on the community to fix issues that don't affect fb apps. If you're sure this is a bug can you send a pull request with a fix?
|
||||
comment Hey {issue_author}, if you're sure this is a bug, can you send a pull request with a fix?
|
||||
add-label Help Wanted
|
||||
|
||||
@facebook-github-bot needs-repro
|
||||
comment Can you reproduce the issue using [Snack](http://snack.expo.io)? This step is necessary for people to be able to see and debug the issue being reported.
|
||||
add-label Needs more information
|
||||
|
||||
@facebook-github-bot cannot-repro
|
||||
comment Thanks for opening the issue! It does not appear like a community member will be able to reliably reproduce this issue. This may be for several reasons; perhaps it affects a particular app but a minimal repro has not been provided, or the issue may be sporadic. As it happens, we need a concrete set of steps that can demonstrably reproduce the issue as this will allow your fellow community members to validate a fix. We'll close the issue for now, but feel free to submit a new issue once you're able to reliably reproduce the issue locally. Thanks for your understanding!
|
||||
close
|
||||
|
||||
@facebook-github-bot reopen
|
||||
comment Okay, reopening this issue.
|
||||
reopen
|
||||
|
||||
@facebook-github-bot feature
|
||||
comment Hey {issue_author}! Thanks for opening the issue, however it looks like a feature request. As noted in the [Issue template](https://github.com/facebook/react-native/blob/master/.github/ISSUE_TEMPLATE.md) we'd like to use the GitHub issues to track bugs only. Can you implement the feature as a standalone npm module? If not consider sending a pull request or a create an entry on [Canny](https://react-native.canny.io/feature-requests/). It has a voting system and if the feature gets upvoted enough it might get implemented. Closing this now, thanks for understanding!
|
||||
comment Hey {issue_author}! Thanks for opening the issue, however it looks like a feature request. As noted in the [Issue template](https://raw.githubusercontent.com/facebook/react-native/master/.github/ISSUE_TEMPLATE.md) we'd like to use the GitHub issues to track bugs only. Can you implement the feature as a standalone npm module? If not, consider sending a pull request or a creating an entry on [Canny](https://react-native.canny.io/feature-requests/). It has a voting system and if the feature gets upvoted enough it might get implemented. Closing this now, thanks for understanding!
|
||||
add-label Feature Request
|
||||
close
|
||||
|
||||
@facebook-github-bot cla
|
||||
comment Hey {issue_author}! Thanks for sending this pull request! We would love to review your changes however it looks like you haven't signed the CLA yet. You can do so at https://code.facebook.com/cla.
|
||||
|
||||
@facebook-github-bot icebox
|
||||
comment {author} tells me to close this issue because it has been inactive for a while. If you think it should still be opened let us know why.
|
||||
comment {author} tells me to close this issue because it has been inactive for a while. It's possible that the bug has been fixed since this issue was originally submitted, or perhaps it is not affecting a great amount of people, or a workaround has been provided. Either way, we're going to close this in order to allow the community to focus on more pressing issues. If you strongly believe this issue should remain open, please let us know why.
|
||||
add-label Icebox
|
||||
close
|
||||
|
||||
@@ -0,0 +1,372 @@
|
||||
---
|
||||
id: contributing
|
||||
title: How to Contribute
|
||||
layout: docs
|
||||
category: Guides
|
||||
permalink: docs/contributing.html
|
||||
next: testing
|
||||
previous: upgrading
|
||||
---
|
||||
|
||||
React Native is one of Facebook's first open source projects that is both under very active development and is also being used to ship code to everybody using Facebook's mobile apps. We're still working out the kinks to make contributing to this project as easy and transparent as possible, but we're not quite there yet. Hopefully this document makes the process for contributing clear and preempts some questions you may have.
|
||||
|
||||
- [Code of Conduct](docs/contributing.html#code-of-conduct)
|
||||
- [Development Process](docs/contributing.html#our-development-process)
|
||||
- [Branch Organization](docs/contributing.html#branch-organization)
|
||||
- [How to Get in Touch](docs/contributing.html#how-to-get-in-touch)
|
||||
- [Bugs](docs/contributing.html#bugs)
|
||||
- [Pull Requests](docs/contributing.html#pull-requests)
|
||||
- [Triaging Issues and Pull Requests](docs/contributing.html#triaging-issues-and-pull-requests)
|
||||
- [Style Guide](docs/contributing.html#style-guide)
|
||||
- [License](docs/contributing.html#license)
|
||||
|
||||
## [Code of Conduct](https://code.facebook.com/codeofconduct)
|
||||
|
||||
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read [the full text](https://code.facebook.com/codeofconduct) so that you can understand what actions will and will not be tolerated.
|
||||
|
||||
## Our Development Process
|
||||
|
||||
Some of the core team will be working directly on [GitHub](https://github.com/facebook/react-native). These changes will be public from the beginning. Other changesets will come via a bridge with Facebook's internal source control. This is a necessity as it allows engineers at Facebook outside of the core team to move fast and contribute from an environment they are comfortable in.
|
||||
|
||||
## Branch Organization
|
||||
|
||||
We will do our best to keep `master` in good shape, with tests passing at all times. But in order to move fast, we will make API changes that your application might not be compatible with. We will do our best to [communicate these changes](https://github.com/facebook/react-native/releases) and version appropriately so you can lock into a specific version if need be.
|
||||
|
||||
To see what changes are coming and provide better feedback to React Native contributors, use the [latest release candidate](http://facebook.github.io/react-native/versions.html) when possible. By the time a release candidate is released, the changes it contains will have been shipped in production Facebook apps for over two weeks.
|
||||
|
||||
## How to Get in Touch
|
||||
|
||||
Many React Native users are active on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native). If you want to get a general sense of what React Native folks talk about, check out the [React Native Community](https://www.facebook.com/groups/react.native.community) Facebook group. There is also [an active community of React and React Native users on the Discord chat platform](https://discord.gg/0ZcbPKXt5bZjGY5n) in case you need help.
|
||||
|
||||
The React Native team sends out periodical updates through the following channels:
|
||||
|
||||
* [React Native Blog](https://facebook.github.io/react-native/blog/)
|
||||
* [@ReactNative on Twitter](https://www.twitter.com/reactnative)
|
||||
|
||||
Core contributors to React Native meet monthly and post their meeting notes on the React Native blog. You can also find ad hoc discussions in the [React Native Core Contributors](https://www.facebook.com/groups/reactnativeoss/) Facebook group.
|
||||
|
||||
## Bugs
|
||||
|
||||
### Where to Find Known Issues
|
||||
|
||||
We are using [GitHub Issues](https://github.com/facebook/react-native/issues) for our public bugs. Before filing a new task, try to make sure your problem doesn't already exist.
|
||||
|
||||
Questions and feature requests are tracked elsewhere:
|
||||
|
||||
- Have a question? [Ask on Stack Overflow](http://stackoverflow.com/questions/tagged/react-native).
|
||||
- If you have a question regarding future plans, check out the [roadmap](https://github.com/facebook/react-native/wiki/Roadmap).
|
||||
- Have a feature request that is not covered in the roadmap? [Add it here](https://react-native.canny.io/feature-requests).
|
||||
|
||||
### Reporting New Issues
|
||||
|
||||
When [opening a new issue](https://github.com/facebook/react-native/issues/new), always make sure to fill out the [issue template](https://raw.githubusercontent.com/facebook/react-native/master/.github/ISSUE_TEMPLATE.md). **This step is very important!** Not doing so may result in your issue getting closed. Don't take this personally if this happens, and feel free to open a new issue once you've gathered all the information required by the template.
|
||||
|
||||
- **One issue, one bug:** Please report a single bug per issue.
|
||||
- **Provide a Snack:** The best way to get attention on your issue is to provide a reduced test case. You can use [Snack](https://snack.expo.io/) to demonstrate the issue.
|
||||
- **Provide reproduction steps:** List all the steps necessary to reproduce the issue. Provide a Snack or upload a sample project to GitHub. The person reading your bug report should be able to follow these steps to reproduce your issue with minimal effort.
|
||||
- **Try out the latest version:** Verify that the issue can be reproduced locally by updating your project to use [React Native from `master`](http://facebook.github.io/react-native/versions.html). The bug may have already been fixed!
|
||||
|
||||
We're not able to provide support through GitHub Issues. If you're looking for help with your code, consider asking on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native) or reaching out to the community through [other channels](docs/contributing.html#how-to-get-in-touch).
|
||||
|
||||
### Security Bugs
|
||||
|
||||
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. With that in mind, please do not file public issues; go through the process outlined on that page.
|
||||
|
||||
## Pull Requests
|
||||
|
||||
### Your First Pull Request
|
||||
|
||||
Working on your first Pull Request? You can learn how from this free video series:
|
||||
|
||||
[**How to Contribute to an Open Source Project on GitHub**](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)
|
||||
|
||||
We have a list of [beginner friendly issues](https://github.com/facebook/react-native/labels/Good%20First%20Task) to help you get your feet wet in the React Native codebase and familiar with our contribution process. This is a great place to get started.
|
||||
|
||||
If you decide to fix an issue, please be sure to check the comment thread in case somebody is already working on a fix. If nobody is working on it at the moment, please leave a comment stating that you intend to work on it so other people don't accidentally duplicate your effort.
|
||||
|
||||
If somebody claims an issue but doesn't follow up for more than two weeks, it's fine to take over it but you should still leave a comment.
|
||||
|
||||
### Sending a Pull Request
|
||||
|
||||
If you send a pull request, please do it against the master branch. We maintain stable branches for stable releases separately but we don't accept pull requests to them directly. Instead, we cherry-pick non-breaking changes from master to the latest stable version.
|
||||
|
||||
The core team will be monitoring for pull requests. When we get one, we'll run some Facebook-specific integration tests on it first. From here, we'll need to get another person to sign off on the changes and then merge the pull request. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process.
|
||||
|
||||
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.
|
||||
|
||||
**Before submitting a pull request**, please make sure the following is done…
|
||||
|
||||
1. Fork [the repository](https://github.com/facebook/react-native) and create your branch from `master`.
|
||||
2. Add the copyright notice to the top of any new files you've added.
|
||||
3. Describe your **test plan** in your commit.
|
||||
4. Ensure **tests pass** on both Travis and Circle CI.
|
||||
5. Make sure your code lints (`npm run lint`).
|
||||
6. If you haven't already, [sign the CLA](https://code.facebook.com/cla).
|
||||
|
||||
> **Note:** It is not necessary to keep clicking `Merge master to your branch` on the PR page. You would want to merge master if there are conflicts or tests are failing. The Facebook-GitHub-Bot ultimately squashes all commits to a single one before merging your PR.
|
||||
|
||||
#### Test plan
|
||||
|
||||
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.
|
||||
|
||||
- If you've added code that should be tested, add tests!
|
||||
- If you've changed APIs, update the documentation.
|
||||
- If you've updated the docs, verify the website locally and submit screenshots if applicable (see [website/README.md](https://github.com/facebook/react-native/blob/master/website/README.md))
|
||||
|
||||
See [What is a Test Plan?](https://medium.com/@martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9) to learn more.
|
||||
|
||||
#### Continuous integration tests
|
||||
|
||||
Make sure all **tests pass** on both [Travis][travis] and [Circle CI][circle]. PRs that break tests are unlikely to be merged.
|
||||
|
||||
You can learn more about running tests and contributing to React Native [next](docs/testing.html).
|
||||
|
||||
[travis]: https://travis-ci.org/facebook/react-native
|
||||
[circle]: http://circleci.com/gh/facebook/react-native
|
||||
|
||||
#### Breaking changes
|
||||
|
||||
When adding a new breaking change, follow this template in your pull request:
|
||||
|
||||
```
|
||||
### New breaking change here
|
||||
|
||||
- **Who does this affect**:
|
||||
- **How to migrate**:
|
||||
- **Why make this breaking change**:
|
||||
- **Severity (number of people affected x effort)**:
|
||||
```
|
||||
|
||||
If your pull request is merged, a core contributor will update the [list of breaking changes](https://github.com/facebook/react-native/wiki/Breaking-Changes) which is then used to populate the release notes.
|
||||
|
||||
#### Copyright Notice for files
|
||||
|
||||
Copy and paste this to the top of your new file(s):
|
||||
|
||||
```JS
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
```
|
||||
|
||||
If you've added a new module, add a `@providesModule <moduleName>` at the end of the comment. This will allow the haste package manager to find it.
|
||||
|
||||
### Contributor License Agreement (CLA)
|
||||
|
||||
In order to accept your pull request, we need you to submit a CLA. You only need to do this once, so if you've done this for another Facebook open source project, you're good to go. If you are submitting a pull request for the first time, just let us know that you have completed the CLA and we can cross-check with your GitHub username.
|
||||
|
||||
Complete your CLA here: https://code.facebook.com/cla
|
||||
|
||||
### Proposing a change
|
||||
|
||||
If you intend to change the public API, or make any non-trivial changes to the implementation, we recommend [filing an issue](https://github.com/facebook/react-native/issues/new). This lets us reach an agreement on your proposal before you put significant effort into it.
|
||||
|
||||
If you're only fixing a bug, it's fine to submit a pull request right away but we still recommend to file an issue detailing what you're fixing. This is helpful in case we don't accept that specific fix but want to keep track of the issue.
|
||||
|
||||
## Triaging Issues and Pull Requests
|
||||
|
||||
One great way you can contribute to the project without writing any code is to help triage issues and pull requests as they come in. Ask for more information if the issue does not provide all the details required by the template. Suggest [labels](https://github.com/facebook/react-native/labels). Flag issues that are stale or that should be closed. Ask for test plans and review code.
|
||||
|
||||
Adding labels, closing and reopening issues, and merging pull requests is, as you may expect, limited to a subset of contributors. Simply commenting on the issue or pull request can still go a long way towards helping us keep the number of outstanding issues under control.
|
||||
|
||||
### Using the Facebook GitHub Bot
|
||||
|
||||
The Facebook GitHub Bot allows certain active members of the community to perform administrative actions such as labeling and closing issues. The list of community members with this kind of access can be found at the top of [IssueCommands.txt](https://github.com/facebook/react-native/blob/master/bots/IssueCommands.txt). The bot can be triggered by adding any of the following commands as a standalone comment on an issue:
|
||||
|
||||
<div class="props">
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> no-template
|
||||
</h4>
|
||||
<div><p>
|
||||
Use this when more information is needed, especially if the issue does not adhere to the <a href="https://raw.githubusercontent.com/facebook/react-native/master/.github/ISSUE_TEMPLATE.md">issue template</a>. The bot will <strong>close</strong> the issue after adding the "Needs more information" label.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> stack-overflow
|
||||
</h4>
|
||||
<div><p>
|
||||
Mark issues that do not belong in the bug tracker, and redirect to Stack Overflow. The bot will <strong>close</strong> the issue after adding the "For Stack Overflow" label.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> needs-repro
|
||||
</h4>
|
||||
<div><p>
|
||||
Prompts the author to provide a reproducible example or <a href="http://snack.expo.io">Snack</a>. The bot will apply the "Needs more information" label.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> cannot-repro
|
||||
</h4>
|
||||
<div><p>
|
||||
Use this when the issue cannot be reproduced, either because it affects a particular app but no minimal repro was provided, or the issue describes something sporadic that is unlikely to be reproduced by a community member. The bot will <strong>close</strong> the issue.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> duplicate <span class="methodType">(#[0-9]+)</span>
|
||||
</h4>
|
||||
<div><p>
|
||||
Marks an issue as a duplicate. Requires a issue number to be provided. The bot will <strong>close</strong> the issue.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> label <span class="methodType">(.*)</span>
|
||||
</h4>
|
||||
<div><p>
|
||||
Use this command to add a <a href="https://github.com/facebook/react-native/labels">label</a>, such as "iOS" or "Android", to an issue.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> feature
|
||||
</h4>
|
||||
<div><p>
|
||||
Use this when an issue describes a feature request, as opposed to a reproducible bug. The bot will point the author to the feature request tracker, add the "Feature Request" label, then <strong>close</strong> the issue.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> expected
|
||||
</h4>
|
||||
<div><p>
|
||||
Use this when an issue describes a type of expected behavior. The bot will <strong>close</strong> the issue.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> answered
|
||||
</h4>
|
||||
<div><p>
|
||||
Use this when an issue appears to be a question that has already been answered by someone on the thread. The bot will <strong>close</strong> the issue.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> close
|
||||
</h4>
|
||||
<div><p>
|
||||
<strong>Closes</strong> an issue without providing a particular explanation.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> reopen
|
||||
</h4>
|
||||
<div><p>
|
||||
<strong>Re-opens</strong> a previously closed issue.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> bugfix
|
||||
</h4>
|
||||
<div><p>
|
||||
Mark issues that describe a reproducible bug and encourage the author to send a pull request. The bot will add the "Help Wanted" label.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> no-reply
|
||||
</h4>
|
||||
<div><p>
|
||||
Use this when an issue requires more information from the author but they have not added a comment in a while. The bot will <strong>close</strong> the issue.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> icebox
|
||||
</h4>
|
||||
<div><p>
|
||||
Use this when an issue has been open for over 30 days with no activity and no community member has volunteered to work on a fix. The bot will <strong>close</strong> the issue after adding the "Icebox" label.
|
||||
</p></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Additionally, the following commands can be used on a pull request:
|
||||
|
||||
<div class="props">
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> cla
|
||||
</h4>
|
||||
<div><p>
|
||||
Remind the author that the CLA needs to be signed.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="prop">
|
||||
<h4 class="methodTitle">
|
||||
<span class="methodType">@facebook-github-bot</span> shipit
|
||||
</h4>
|
||||
<div><p>
|
||||
Flag the PR for merging. If used by a core contributor, the bot will attempt to import the pull request. In general, core contributors are those who have consistently submitted high quality contributions to the project.
|
||||
</p></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
## Style Guide
|
||||
|
||||
Our linter will catch most styling issues that may exist in your code. You can check the status of your code styling by simply running `npm run lint`.
|
||||
|
||||
However, there are still some styles that the linter cannot pick up.
|
||||
|
||||
### Code Conventions
|
||||
|
||||
#### General
|
||||
|
||||
* **Most important: Look around.** Match the style you see used in the rest of the project. This includes formatting, naming things in code, naming things in documentation.
|
||||
* Add trailing commas,
|
||||
* 2 spaces for indentation (no tabs)
|
||||
* "Attractive"
|
||||
|
||||
#### JavaScript
|
||||
|
||||
* Use semicolons;
|
||||
* `'use strict';`
|
||||
* Prefer `'` over `"`
|
||||
* Do not use the optional parameters of `setTimeout` and `setInterval`
|
||||
* 80 character line length
|
||||
|
||||
#### JSX
|
||||
|
||||
* Prefer `"` over `'` for string literal props
|
||||
* When wrapping opening tags over multiple lines, place one prop per line
|
||||
* `{}` of props should hug their values (no spaces)
|
||||
* Place the closing `>` of opening tags on the same line as the last prop
|
||||
* Place the closing `/>` of self-closing tags on their own line and left-align them with the opening `<`
|
||||
|
||||
#### Objective-C
|
||||
|
||||
* Space after `@property` declarations
|
||||
* Brackets on *every* `if`, on the *same* line
|
||||
* `- method`, `@interface`, and `@implementation` brackets on the following line
|
||||
* *Try* to keep it around 80 characters line length (sometimes it's just not possible...)
|
||||
* `*` operator goes with the variable name (e.g. `NSObject *variableName;`)
|
||||
|
||||
#### Java
|
||||
|
||||
* If a method call spans multiple lines closing bracket is on the same line as the last argument.
|
||||
* If a method header doesn't fit on one line each argument goes on a separate line.
|
||||
* 100 character line length
|
||||
|
||||
### Documentation
|
||||
|
||||
* Do not wrap lines at 80 characters - configure your editor to soft-wrap when editing documentation.
|
||||
|
||||
## License
|
||||
|
||||
By contributing to React Native, you agree that your contributions will be licensed under its BSD license.
|
||||
|
||||
## What Next?
|
||||
|
||||
Read the [next section](docs/testing.html) to learn how to test your changes.
|
||||
@@ -123,7 +123,7 @@ If you run this you will immediately see this error: `Touchable child
|
||||
must either be native or forward setNativeProps to a native component`.
|
||||
This occurs because `MyButton` isn't directly backed by a native view
|
||||
whose opacity should be set. You can think about it like this: if you
|
||||
define a component with `React.createClass` you would not expect to be
|
||||
define a component with `createReactClass` you would not expect to be
|
||||
able to set a style prop on it and have that work - you would need to
|
||||
pass the style prop down to a child, unless you are wrapping a native
|
||||
component. Similarly, we are going to forward `setNativeProps` to a
|
||||
|
||||
@@ -244,6 +244,7 @@ target 'swift-2048' do
|
||||
# but if not, adjust the `:path` accordingly
|
||||
pod 'React', :path => '../node_modules/react-native', :subspecs => [
|
||||
'Core',
|
||||
'CxxBridge', # Include this for RN >= 0.47
|
||||
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
|
||||
'RCTText',
|
||||
'RCTNetwork',
|
||||
|
||||
+13
-3
@@ -18,15 +18,23 @@ One common question is how to handle the "state" of your React Native applicatio
|
||||
|
||||
If you're looking for a library that does a specific thing, check out [Awesome React Native](http://www.awesome-react-native.com/), a curated list of components that also has demos, articles, and other stuff.
|
||||
|
||||
## Example Apps
|
||||
## Examples
|
||||
|
||||
There are some [example apps on GitHub](https://github.com/ReactNativeNews/React-Native-Apps). You can run the apps on a simulator or device, and you can see the source code for these apps, which is neat.
|
||||
Try out apps from the [Showcase](https://facebook.github.io/react-native/showcase.html) to see what React Native is capable of! There are also some [example apps on GitHub](https://github.com/ReactNativeNews/React-Native-Apps). You can run the apps on a simulator or device, and you can see the source code for these apps, which is neat.
|
||||
|
||||
The folks who built the app for Facebook's F8 conference in 2016 also [open-sourced the code](https://github.com/fbsamples/f8app) and wrote up a [detailed series of tutorials](http://makeitopen.com/tutorials/building-the-f8-app/planning/). This is useful if you want a more in-depth example that's more realistic than most sample apps out there.
|
||||
|
||||
## Extending React Native
|
||||
|
||||
- Looking for a component? [JS.coach](https://js.coach/react-native)
|
||||
- Fellow developers write and publish React Native modules to npm and open source them on GitHub.
|
||||
- Making modules helps grow the React Native ecosystem and community. We recommend writing modules for your use cases and sharing them on npm.
|
||||
- Read the guides on Native Modules ([iOS](https://facebook.github.io/react-native/docs/native-modules-ios.html), [Android](https://facebook.github.io/react-native/docs/native-modules-android.html)) and Native UI Components ([iOS](https://facebook.github.io/react-native/docs/native-components-ios.html), [Android](https://facebook.github.io/react-native/docs/native-components-android.html)) if you are interested in extending native functionality.
|
||||
|
||||
|
||||
## Development Tools
|
||||
|
||||
[Nuclide](https://nuclide.io/) is the IDE that Facebook uses internally for React Native development. The killer feature of Nuclide is its debugging ability. It also has great inline Flow support.
|
||||
[Nuclide](https://nuclide.io/) is the IDE that Facebook uses internally for JavaScript development. The killer feature of Nuclide is its debugging ability. It also has great inline Flow support. [VS Code](https://code.visualstudio.com/) is another IDE that is popular with JavaScript developers.
|
||||
|
||||
[Ignite](https://github.com/infinitered/ignite) is a starter kit that uses Redux and a few different common UI libraries. It has a CLI to generate apps, components, and containers. If you like all of the individual tech choices, Ignite could be perfect for you.
|
||||
|
||||
@@ -34,6 +42,8 @@ The folks who built the app for Facebook's F8 conference in 2016 also [open-sour
|
||||
|
||||
[Expo](https://docs.expo.io) is a development environment plus application that focuses on letting you build React Native apps in the Expo development environment, without ever touching Xcode or Android Studio. If you wish React Native was even more JavaScripty and webby, check out Expo.
|
||||
|
||||
The [React Developer Tools](docs/debugging.html#react-developer-tools) are great for debugging React and React Native apps.
|
||||
|
||||
## Where React Native People Hang Out
|
||||
|
||||
The [React Native Community](https://www.facebook.com/groups/react.native.community) Facebook group has thousands of developers, and it's pretty active. Come there to show off your project, or ask how other people solved similar problems.
|
||||
|
||||
@@ -6,7 +6,7 @@ category: Guides (iOS)
|
||||
permalink: docs/native-modules-ios.html
|
||||
banner: ejected
|
||||
next: native-components-ios
|
||||
previous: upgrading
|
||||
previous: testing
|
||||
---
|
||||
|
||||
Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.
|
||||
|
||||
+12
-5
@@ -1,20 +1,27 @@
|
||||
---
|
||||
id: testing
|
||||
title: Running Tests and Contributing
|
||||
title: Testing your Changes
|
||||
layout: docs
|
||||
category: Guides
|
||||
permalink: docs/testing.html
|
||||
next: understanding-cli
|
||||
previous: upgrading
|
||||
previous: contributing
|
||||
---
|
||||
|
||||
This document is about running tests on React Native itself. If you're interested in testing a React Native app, check out the [React Native Tutorial](http://facebook.github.io/jest/docs/tutorial-react-native.html) on the Jest website.
|
||||
This document is about testing your changes to React Native as a [contributor](docs/contributing.html). If you're interested in testing a React Native app, check out the [React Native Tutorial](http://facebook.github.io/jest/docs/tutorial-react-native.html) on the Jest website.
|
||||
|
||||
The React Native repo has several tests you can run to verify you haven't caused a regression with your PR. These tests are run with the [Travis](https://travis-ci.org/facebook/react-native/builds) and [CircleCI](https://circleci.com/gh/facebook/react-native) continuous integration systems, which will automatically annotate pull requests with the test results.
|
||||
The React Native repo has several tests you can run to verify you haven't caused a regression with your PR. These tests are run with the [Travis](https://travis-ci.org/facebook/react-native/builds) and [Circle](https://circleci.com/gh/facebook/react-native) continuous integration systems, which will automatically annotate pull requests with the test results.
|
||||
|
||||
Whenever you are fixing a bug or adding new functionality to React Native, you should add a test that covers it. Depending on the change you're making, there are different types of tests that may be appropriate.
|
||||
|
||||
## JavaScript Tests
|
||||
- [JavaScript](docs/testing.html#javascript)
|
||||
- [Android](docs/testing.html#android)
|
||||
- [iOS](docs/testing.html#ios)
|
||||
- [Apple TV](docs/testing.html#apple-tv)
|
||||
- [End-to-end tests](docs/testing.html#end-to-end-tests)
|
||||
- [Website](docs/testing.html#website)
|
||||
|
||||
## JavaScript
|
||||
|
||||
### Jest
|
||||
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ This library does not ship with React Native - in order to use it on your projec
|
||||
```javascript
|
||||
import TimerMixin from 'react-timer-mixin';
|
||||
|
||||
var Component = React.createClass({
|
||||
var Component = createReactClass({
|
||||
mixins: [TimerMixin],
|
||||
componentDidMount: function() {
|
||||
this.setTimeout(
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ title: Upgrading to new React Native versions
|
||||
layout: docs
|
||||
category: Guides
|
||||
permalink: docs/upgrading.html
|
||||
next: testing
|
||||
next: contributing
|
||||
previous: running-on-device
|
||||
---
|
||||
|
||||
|
||||
@@ -158,6 +158,7 @@ function getPackagerServer(args, config) {
|
||||
assetExts: defaultAssetExts.concat(args.assetExts),
|
||||
blacklistRE: config.getBlacklistRE(),
|
||||
cacheVersion: '3',
|
||||
enableBabelRCLookup: config.getEnableBabelRCLookup(),
|
||||
extraNodeModules: config.extraNodeModules,
|
||||
getTransformOptions: config.getTransformOptions,
|
||||
hasteImpl: config.hasteImpl,
|
||||
|
||||
@@ -49,6 +49,13 @@ export type ConfigT = {
|
||||
*/
|
||||
getBlacklistRE(): RegExp,
|
||||
|
||||
/**
|
||||
* Specify whether or not to enable Babel's behavior for looking up .babelrc
|
||||
* files. If false, only the .babelrc file (if one exists) in the main project
|
||||
* root is used.
|
||||
*/
|
||||
getEnableBabelRCLookup(): boolean,
|
||||
|
||||
/**
|
||||
* Specify any additional polyfill modules that should be processed
|
||||
* before regular module loading.
|
||||
@@ -158,6 +165,7 @@ const Config = {
|
||||
extraNodeModules: Object.create(null),
|
||||
getAssetExts: () => [],
|
||||
getBlacklistRE: () => blacklist(),
|
||||
getEnableBabelRCLookup: () => true,
|
||||
getPlatforms: () => [],
|
||||
getPolyfillModuleNames: () => [],
|
||||
getProjectRoots: () => {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native",
|
||||
"version": "1000.0.0",
|
||||
"version": "0.47.0-rc.5",
|
||||
"description": "A framework for building native apps using React",
|
||||
"license": "BSD-3-Clause",
|
||||
"repository": {
|
||||
@@ -237,4 +237,4 @@
|
||||
"shelljs": "0.6.0",
|
||||
"sinon": "^2.2.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ cd "$ROOT"
|
||||
|
||||
SCHEME="RNTester"
|
||||
SDK="iphonesimulator"
|
||||
DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=10.1"
|
||||
DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=10.3.1"
|
||||
|
||||
# If there is a "test" argument, pass it to the test script.
|
||||
# If there's a "test" argument, pass it to the test script.
|
||||
. ./scripts/objc-test.sh $1
|
||||
|
||||
@@ -15,7 +15,7 @@ cd "$ROOT"
|
||||
|
||||
SCHEME="RNTester-tvOS"
|
||||
SDK="appletvsimulator"
|
||||
DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p,OS=10.1"
|
||||
DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p,OS=10.2"
|
||||
|
||||
# If there's a "test" argument, pass it to the test script.
|
||||
. ./scripts/objc-test.sh $1
|
||||
|
||||
+19
-10
@@ -3,7 +3,6 @@ set -ex
|
||||
|
||||
SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
ROOT=$(dirname $SCRIPTS)
|
||||
YOGA_ROOT="$ROOT/ReactCommon/yoga"
|
||||
|
||||
# Specify `SPEC_REPO` as an env variable if you want to push to a specific spec repo.
|
||||
# Defaults to `react-test`, which is meant to be a dummy repo used to test that the specs fully lint.
|
||||
@@ -14,17 +13,17 @@ SPEC_REPO_DIR="$HOME/.cocoapods/repos/$SPEC_REPO"
|
||||
if ! [ -d "$SPEC_REPO_DIR" ]; then
|
||||
mkdir -p "$SPEC_REPO_DIR"
|
||||
cd "$SPEC_REPO_DIR"
|
||||
echo "testing" > .gitkeep
|
||||
touch .gitkeep
|
||||
git init
|
||||
git add .gitkeep
|
||||
git add .
|
||||
git commit -m "init"
|
||||
git remote add origin "https://example.com/$SPEC_REPO.git"
|
||||
fi
|
||||
|
||||
cd "$SPEC_REPO_DIR"
|
||||
SPEC_REPO_REMOTE=$(git remote get-url origin)
|
||||
SPEC_REPOS="$(git remote get-url origin),https://github.com/CocoaPods/Specs.git"
|
||||
|
||||
POD_LINT_OPT="--verbose --allow-warnings --fail-fast --private --swift-version=3.0 --sources=$SPEC_REPO_REMOTE"
|
||||
POD_LINT_OPT="--verbose --allow-warnings --fail-fast --private --swift-version=3.0 --sources=$SPEC_REPOS"
|
||||
|
||||
# Get the version from a podspec.
|
||||
version() {
|
||||
@@ -33,8 +32,12 @@ version() {
|
||||
|
||||
# Lint both framework and static library builds.
|
||||
lint() {
|
||||
pod lib lint $POD_LINT_OPT
|
||||
pod lib lint $POD_LINT_OPT --use-libraries
|
||||
local SUBSPEC=$1
|
||||
if [ "${SUBSPEC:-}" ]; then
|
||||
local SUBSPEC_OPT="--subspec=$SUBSPEC"
|
||||
fi
|
||||
pod lib lint $SUBSPEC_OPT $POD_LINT_OPT
|
||||
pod lib lint $SUBSPEC_OPT $POD_LINT_OPT --use-libraries
|
||||
}
|
||||
|
||||
# Push the spec in arg `$1`, which is expected to be in the cwd, to the `SPEC_REPO` in JSON format.
|
||||
@@ -52,11 +55,17 @@ push() {
|
||||
process() {
|
||||
cd $1
|
||||
if [ -z "$SKIP_LINT" ]; then
|
||||
lint
|
||||
lint $2
|
||||
fi
|
||||
local SPEC_NAME=(*.podspec)
|
||||
push $SPEC_NAME
|
||||
}
|
||||
|
||||
process $YOGA_ROOT
|
||||
process $ROOT
|
||||
# Make third-party deps accessible
|
||||
cd "$ROOT/third-party-podspecs"
|
||||
push Folly.podspec
|
||||
push DoubleConversion.podspec
|
||||
push GLog.podspec
|
||||
|
||||
process "$ROOT/ReactCommon/yoga"
|
||||
process "$ROOT" _ignore_me_subspec_for_linting_
|
||||
|
||||
@@ -38,35 +38,6 @@ success "Generated artifacts for Maven"
|
||||
|
||||
npm install
|
||||
|
||||
success "Killing any running packagers"
|
||||
lsof -i :8081 | grep LISTEN
|
||||
lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill
|
||||
|
||||
info "Start the packager in another terminal by running 'npm start' from the root"
|
||||
info "and then press any key."
|
||||
info ""
|
||||
read -n 1
|
||||
|
||||
./gradlew :RNTester:android:app:installDebug || error "Couln't build RNTester Android"
|
||||
|
||||
info "Press any key to run RNTester in an already running Android emulator/device"
|
||||
info ""
|
||||
read -n 1
|
||||
adb shell am start -n com.facebook.react.uiapp/.RNTesterActivity
|
||||
|
||||
info "Press any key to open the project in Xcode, then build and test manually."
|
||||
info ""
|
||||
read -n 1
|
||||
open "RNTester/RNTester.xcodeproj"
|
||||
|
||||
info "When done testing RNTester app on iOS and Android press any key to continue."
|
||||
info ""
|
||||
read -n 1
|
||||
|
||||
success "Killing packager"
|
||||
lsof -i :8081 | grep LISTEN
|
||||
lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill
|
||||
|
||||
npm pack
|
||||
|
||||
PACKAGE=$(pwd)/react-native-$PACKAGE_VERSION.tgz
|
||||
|
||||
@@ -12,16 +12,19 @@ Pod::Spec.new do |spec|
|
||||
spec.dependency 'DoubleConversion'
|
||||
spec.dependency 'GLog'
|
||||
spec.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
|
||||
spec.header_mappings_dir = 'folly'
|
||||
spec.source_files = 'folly/Bits.cpp',
|
||||
'folly/Conv.cpp',
|
||||
'folly/Demangle.cpp',
|
||||
'folly/StringBase.cpp',
|
||||
'folly/Unicode.cpp',
|
||||
'folly/dynamic.cpp',
|
||||
'folly/json.cpp'
|
||||
'folly/json.cpp',
|
||||
'folly/portability/BitsFunctexcept.cpp',
|
||||
'folly/detail/MallocImpl.cpp'
|
||||
# workaround for https://github.com/facebook/react-native/issues/14326
|
||||
spec.preserve_paths = 'folly/*.h'
|
||||
spec.preserve_paths = 'folly/*.h',
|
||||
'folly/detail/*.h',
|
||||
'folly/portability/*.h'
|
||||
spec.libraries = "stdc++"
|
||||
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
|
||||
@@ -29,17 +32,4 @@ Pod::Spec.new do |spec|
|
||||
|
||||
# Pinning to the same version as React.podspec.
|
||||
spec.platform = :ios, '8.0'
|
||||
|
||||
spec.subspec "detail" do |ss|
|
||||
ss.header_dir = 'folly/detail'
|
||||
ss.source_files = 'folly/detail/*.h',
|
||||
'folly/detail/MallocImpl.cpp'
|
||||
end
|
||||
|
||||
spec.subspec "portability" do |ss|
|
||||
ss.header_dir = 'folly/portability'
|
||||
ss.source_files = 'folly/portability/*.h',
|
||||
'folly/portability/BitsFunctexcept.cpp'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"optimist": "0.6.0",
|
||||
"prop-types": "^15.5.8",
|
||||
"react": "~0.13.0",
|
||||
"react-docgen": "3.0.0-beta2",
|
||||
"react-docgen": "3.0.0-beta5",
|
||||
"react-page-middleware": "0.4.1",
|
||||
"remove-markdown": "^0.1.0",
|
||||
"request": "^2.69.0",
|
||||
|
||||
-3
@@ -226,9 +226,6 @@
|
||||
var parent = hashLinks[i].parentElement;
|
||||
while (parent) {
|
||||
if (parent.tagName === 'BLOCK') {
|
||||
var gettingStartedGuideType = null;
|
||||
var devOS = null;
|
||||
var targetPlatform = null;
|
||||
// Could be more than one target os and dev platform, but just choose some sort of order
|
||||
// of priority here.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user