Skip to content

Commit ab92cb5

Browse files
Merge branch 'master' into unvendor-fetch
2 parents cac4dab + f81d77c commit ab92cb5

File tree

245 files changed

+18465
-10296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+18465
-10296
lines changed

.circleci/config.yml

+15-6
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ jobs:
266266
- run:
267267
name: Lint code
268268
command: scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ~/react-native/reports/junit/eslint/results.xml
269+
when: always
269270

270271
- run:
271272
name: Check for errors in code using Flow (iOS)
@@ -284,6 +285,11 @@ jobs:
284285
./scripts/circleci/validate_yarn_lockfile.sh
285286
when: always
286287

288+
- run:
289+
name: Check formatting
290+
command: yarn run format-check
291+
when: always
292+
287293
- store_test_results:
288294
path: ~/react-native/reports/junit
289295
- store_artifacts:
@@ -299,11 +305,13 @@ jobs:
299305
- attach_workspace:
300306
at: ~/react-native
301307

302-
- run: *run-js-tests
308+
- run:
309+
name: JavaScript Test Suite
310+
command: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2
303311

304312
- run:
305313
name: JavaScript End-to-End Test Suite
306-
command: node ./scripts/run-ci-e2e-tests.js --js --retries 3;
314+
command: node ./scripts/run-ci-e2e-tests.js --js --retries 3
307315

308316
- store_test_results:
309317
path: ~/react-native/reports/junit
@@ -319,9 +327,9 @@ jobs:
319327

320328
- run: *yarn
321329

322-
- run: *run-js-tests
323-
324-
- run: yarn run format-check
330+
- run:
331+
name: JavaScript Test Suite
332+
command: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2
325333

326334
- store_test_results:
327335
path: ~/react-native/reports/junit
@@ -608,7 +616,8 @@ workflows:
608616
- test_android: *run-after-checkout
609617
- test_ios: *run-after-checkout
610618
- test_detox_end_to_end: *run-after-checkout
611-
- test_docker_build
619+
- test_docker_build:
620+
filters: *filter-ignore-gh-pages
612621

613622
releases:
614623
jobs:

.flowconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@ untyped-import
103103
untyped-type-import
104104

105105
[version]
106-
^0.96.0
106+
^0.97.0

.flowconfig.android

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@ untyped-import
103103
untyped-type-import
104104

105105
[version]
106-
^0.96.0
106+
^0.97.0

ECOSYSTEM.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# The React Native Ecosystem
2+
3+
We aim to build a vibrant and inclusive ecosystem of partners, core contributors, and community that goes beyond the main React Native GitHub repository. This document explains the roles and responsibilities of various stakeholders and provides guidelines for the community organization. The structure outlined in this document has been in place for a while but hadn't been written down before.
4+
5+
There are three types of stakeholders:
6+
7+
* **Partners:** Companies that are significantly invested in React Native and have been for years.
8+
* **Core Contributors:** Individual people who contribute to the React Native project.
9+
* **Community Contributors:** Individuals who support projects in the [react-native-community](https://github.com/react-native-community) organization.
10+
11+
## Partners
12+
13+
Partners are companies that are significantly invested in React Native and have been for years. Informed by their use of React Native, they push for improvements of the core and/or the ecosystem around it. Facebook's partners think of React Native as a product: they understand the trade offs that the project makes as well as future plans and goals. Together we shape the vision for React Native to make it the best way to build applications.
14+
15+
Our current set of partners include Callstack, Expo, Infinite Red, Microsoft and Software Mansion. Many engineers from these companies are core contributors, and their partner responsibilities also include:
16+
17+
* **[Callstack](https://callstack.com/):** Manages releases, maintains the [React Native CLI](https://github.com/react-native-community/react-native-cli) and organizes [React Native EU](https://react-native.eu/)
18+
* **[Expo](https://expo.io/):** Builds [expo](https://github.com/expo/expo) on top of React Native to simplify app development
19+
* **[Infinite Red](https://infinite.red/):** Maintains the [ignite cli/boilerplate](https://github.com/infinitered/ignite), organizes [Chain React Conf](https://infinite.red/ChainReactConf)
20+
* **[Microsoft](https://www.microsoft.com/en-gb/):** Develops [React Native Windows](https://github.com/Microsoft/react-native-windows) for the Universal Windows Platform (UWP)
21+
* **[Software Mansion](https://swmansion.com/):** Maintain core infrastructure including JSC, Animated, and other popular third-party plugins.
22+
23+
In terms of open source work, pull requests from partners are commonly prioritized. When you are contributing to React Native, you'll most likely meet somebody who works at one of the partner companies and who is a core contributor:
24+
25+
## Core Contributors
26+
27+
Core contributors are individuals who contribute to the React Native project. A core contributor is somebody who displayed a lasting commitment to the evolution and maintenance of React Native. The work done by core contributors includes responsibilities mentioned in the “Partners” section above, and concretely means that they:
28+
29+
* Consistently contribute high quality changes, fixes and improvements
30+
* Actively review changes and provide quality feedback to contributors
31+
* Manage the release process of React Native by maintaining release branches, communicating changes to users and publishing releases
32+
* Love to help out other users with issues on GitHub
33+
* Mentor and encourage first time contributors
34+
* Identify React Native community members who could be effective core contributors
35+
* Help build an inclusive community with people from all backgrounds
36+
* Are great at communicating with other contributors and the community in general
37+
38+
These are behaviors we have observed in our existing core contributors. They aren't strict rules but rather outline their usual responsibilities. We do not expect every core contributor to do all of the above things all the time. Most importantly, we want to create a supportive and friendly environment that fosters collaboration. Above all else, **we are always polite and friendly.**
39+
40+
Core contributor status is attained after consistently contributing and taking on the responsibilities outlined above and granted by other core contributors. Similarly, after a long period of inactivity, a core contributor may be removed.
41+
42+
We aim to make contributing to React Native as easy and transparent as possible. All important topics are handled through a [discussion or RFC process on GitHub](https://github.com/react-native-community/discussions-and-proposals). We are always looking for active, enthusiastic members of the React Native community to become core contributors.
43+
44+
## Community Contributors
45+
46+
Community contributors are individuals who support projects in the [react-native-community](https://github.com/react-native-community) organization. This organization exists as an incubator for high quality components that extend the capabilities of React Native with functionality that many but not all applications require. Facebook engineers will provide guidance to help build a vibrant community of people and components that make React Native better.
47+
48+
This structure has multiple benefits:
49+
50+
* Keep the core of React Native small, which improves performance and reduces the surface area
51+
* Provide visibility to projects through shared representation, for example on the React Native website or on Twitter
52+
* Ensure a consistent and high standard for code, documentation, user experience, stability and contributions for third-party components
53+
* Upgrade the most important components right away when we make breaking changes and move the ecosystem forward at a fast pace
54+
* Find new maintainers for projects that are important but were abandoned by previous owners
55+
56+
Additionally, some companies may choose to sponsor the development of one or many of the packages that are part of the community organization. They will commit to maintain projects, triage issues, fix bugs and develop features. In turn, they will be able to gain visibility for their work, for example through a mention of active maintainers in the README of individual projects after a consistent period of contributions. Such a mention may be removed if maintainers abandon the project.
57+
58+
If you are working on a popular component and would like to move it to the React Native community, please create an issue on the [discussions-and-proposals repository](https://github.com/react-native-community/discussions-and-proposals).

Libraries/AppState/AppState.js

+38-22
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
'use strict';
1212

13-
const MissingNativeEventEmitterShim = require('MissingNativeEventEmitterShim');
13+
const EventEmitter = require('EventEmitter');
1414
const NativeEventEmitter = require('NativeEventEmitter');
1515
const NativeModules = require('NativeModules');
1616
const RCTAppState = NativeModules.AppState;
@@ -27,7 +27,7 @@ const invariant = require('invariant');
2727
class AppState extends NativeEventEmitter {
2828
_eventHandlers: Object;
2929
currentState: ?string;
30-
isAvailable: boolean = true;
30+
isAvailable: boolean;
3131

3232
constructor() {
3333
super(RCTAppState);
@@ -114,32 +114,48 @@ class AppState extends NativeEventEmitter {
114114
}
115115
}
116116

117-
if (__DEV__ && !RCTAppState) {
118-
class MissingNativeAppStateShim extends MissingNativeEventEmitterShim {
119-
constructor() {
120-
super('RCTAppState', 'AppState');
121-
}
117+
function throwMissingNativeModule() {
118+
invariant(
119+
false,
120+
'Cannot use AppState module when native RCTAppState is not included in the build.\n' +
121+
'Either include it, or check AppState.isAvailable before calling any methods.',
122+
);
123+
}
122124

123-
get currentState(): ?string {
124-
this.throwMissingNativeModule();
125-
}
125+
class MissingNativeAppStateShim extends EventEmitter {
126+
// AppState
127+
isAvailable: boolean = false;
128+
currentState: ?string = null;
126129

127-
addEventListener(...args: Array<any>) {
128-
this.throwMissingNativeModule();
129-
}
130+
addEventListener() {
131+
throwMissingNativeModule();
132+
}
130133

131-
removeEventListener(...args: Array<any>) {
132-
this.throwMissingNativeModule();
133-
}
134+
removeEventListener() {
135+
throwMissingNativeModule();
134136
}
135137

136-
// This module depends on the native `RCTAppState` module. If you don't
137-
// include it, `AppState.isAvailable` will return `false`, and any method
138-
// calls will throw. We reassign the class variable to keep the autodoc
139-
// generator happy.
140-
AppState = new MissingNativeAppStateShim();
141-
} else {
138+
// EventEmitter
139+
addListener() {
140+
throwMissingNativeModule();
141+
}
142+
143+
removeAllListeners() {
144+
throwMissingNativeModule();
145+
}
146+
147+
removeSubscription() {
148+
throwMissingNativeModule();
149+
}
150+
}
151+
152+
// This module depends on the native `RCTAppState` module. If you don't include it,
153+
// `AppState.isAvailable` will return `false`, and any method calls will throw.
154+
// We reassign the class variable to keep the autodoc generator happy.
155+
if (RCTAppState) {
142156
AppState = new AppState();
157+
} else {
158+
AppState = new MissingNativeAppStateShim();
143159
}
144160

145161
module.exports = AppState;

Libraries/Components/ScrollView/ScrollView.js

+7
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,13 @@ export type Props = $ReadOnly<{|
368368
* ```
369369
*/
370370
contentContainerStyle?: ?ViewStyleProp,
371+
/**
372+
* When true, the scroll view stops on the next index (in relation to scroll
373+
* position at release) regardless of how fast the gesture is. This can be
374+
* used for horizontal pagination when the page is less than the width of
375+
* the ScrollView. The default value is false.
376+
*/
377+
disableIntervalMomentum?: ?boolean,
371378
/**
372379
* A floating-point number that determines how quickly the scroll view
373380
* decelerates after the user lifts their finger. You may also use string

Libraries/Components/Touchable/TouchableBounce.js

+6
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ const TouchableBounce = ((createReactClass({
184184
nativeID={this.props.nativeID}
185185
testID={this.props.testID}
186186
hitSlop={this.props.hitSlop}
187+
clickable={
188+
this.props.clickable !== false &&
189+
this.props.onPress !== undefined &&
190+
!this.props.disabled
191+
}
192+
onClick={this.touchableHandlePress}
187193
onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
188194
onResponderTerminationRequest={
189195
this.touchableHandleResponderTerminationRequest

Libraries/Components/Touchable/TouchableHighlight.js

+4
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,10 @@ const TouchableHighlight = ((createReactClass({
422422
nextFocusLeft={this.props.nextFocusLeft}
423423
nextFocusRight={this.props.nextFocusRight}
424424
nextFocusUp={this.props.nextFocusUp}
425+
clickable={
426+
this.props.clickable !== false && this.props.onPress !== undefined
427+
}
428+
onClick={this.touchableHandlePress}
425429
onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
426430
onResponderTerminationRequest={
427431
this.touchableHandleResponderTerminationRequest

Libraries/Components/Touchable/TouchableNativeFeedback.android.js

+5
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ const TouchableNativeFeedback = createReactClass({
325325
nextFocusRight: this.props.nextFocusRight,
326326
nextFocusUp: this.props.nextFocusUp,
327327
hasTVPreferredFocus: this.props.hasTVPreferredFocus,
328+
clickable:
329+
this.props.clickable !== false &&
330+
this.props.onPress !== undefined &&
331+
!this.props.disabled,
332+
onClick: this.touchableHandlePress,
328333
onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,
329334
onResponderTerminationRequest: this
330335
.touchableHandleResponderTerminationRequest,

Libraries/Components/Touchable/TouchableOpacity.js

+4
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ const TouchableOpacity = ((createReactClass({
324324
hasTVPreferredFocus={this.props.hasTVPreferredFocus}
325325
tvParallaxProperties={this.props.tvParallaxProperties}
326326
hitSlop={this.props.hitSlop}
327+
clickable={
328+
this.props.clickable !== false && this.props.onPress !== undefined
329+
}
330+
onClick={this.touchableHandlePress}
327331
onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}
328332
onResponderTerminationRequest={
329333
this.touchableHandleResponderTerminationRequest

Libraries/Components/Touchable/TouchableWithoutFeedback.js

+4-19
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,13 @@ const createReactClass = require('create-react-class');
2020
const ensurePositiveDelayProps = require('ensurePositiveDelayProps');
2121

2222
const {
23-
DeprecatedAccessibilityComponentTypes,
2423
DeprecatedAccessibilityRoles,
2524
DeprecatedAccessibilityStates,
26-
DeprecatedAccessibilityTraits,
2725
} = require('DeprecatedViewAccessibility');
2826

2927
import type {SyntheticEvent, LayoutEvent, PressEvent} from 'CoreEventTypes';
3028
import type {EdgeInsetsProp} from 'EdgeInsetsPropType';
31-
import type {
32-
AccessibilityComponentType,
33-
AccessibilityRole,
34-
AccessibilityStates,
35-
AccessibilityTraits,
36-
} from 'ViewAccessibility';
29+
import type {AccessibilityRole, AccessibilityStates} from 'ViewAccessibility';
3730

3831
type TargetEvent = SyntheticEvent<
3932
$ReadOnly<{|
@@ -47,13 +40,11 @@ type FocusEvent = TargetEvent;
4740
const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
4841

4942
const OVERRIDE_PROPS = [
50-
'accessibilityComponentType',
5143
'accessibilityLabel',
5244
'accessibilityHint',
5345
'accessibilityIgnoresInvertColors',
5446
'accessibilityRole',
5547
'accessibilityStates',
56-
'accessibilityTraits',
5748
'hitSlop',
5849
'nativeID',
5950
'onBlur',
@@ -64,13 +55,11 @@ const OVERRIDE_PROPS = [
6455

6556
export type Props = $ReadOnly<{|
6657
accessible?: ?boolean,
67-
accessibilityComponentType?: ?AccessibilityComponentType,
6858
accessibilityLabel?: ?Stringish,
6959
accessibilityHint?: ?Stringish,
7060
accessibilityIgnoresInvertColors?: ?boolean,
7161
accessibilityRole?: ?AccessibilityRole,
7262
accessibilityStates?: ?AccessibilityStates,
73-
accessibilityTraits?: ?AccessibilityTraits,
7463
children?: ?React.Node,
7564
delayLongPress?: ?number,
7665
delayPressIn?: ?number,
@@ -105,18 +94,11 @@ const TouchableWithoutFeedback = ((createReactClass({
10594
accessible: PropTypes.bool,
10695
accessibilityLabel: PropTypes.node,
10796
accessibilityHint: PropTypes.string,
108-
accessibilityComponentType: PropTypes.oneOf(
109-
DeprecatedAccessibilityComponentTypes,
110-
),
11197
accessibilityIgnoresInvertColors: PropTypes.bool,
11298
accessibilityRole: PropTypes.oneOf(DeprecatedAccessibilityRoles),
11399
accessibilityStates: PropTypes.arrayOf(
114100
PropTypes.oneOf(DeprecatedAccessibilityStates),
115101
),
116-
accessibilityTraits: PropTypes.oneOfType([
117-
PropTypes.oneOf(DeprecatedAccessibilityTraits),
118-
PropTypes.arrayOf(PropTypes.oneOf(DeprecatedAccessibilityTraits)),
119-
]),
120102
/**
121103
* When `accessible` is true (which is the default) this may be called when
122104
* the OS-specific concept of "focus" occurs. Some platforms may not have
@@ -267,6 +249,9 @@ const TouchableWithoutFeedback = ((createReactClass({
267249
return (React: any).cloneElement(child, {
268250
...overrides,
269251
accessible: this.props.accessible !== false,
252+
clickable:
253+
this.props.clickable !== false && this.props.onPress !== undefined,
254+
onClick: this.touchableHandlePress,
270255
onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,
271256
onResponderTerminationRequest: this
272257
.touchableHandleResponderTerminationRequest,

Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap

+2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
exports[`TouchableHighlight renders correctly 1`] = `
44
<View
55
accessible={true}
6+
clickable={false}
67
isTVSelectable={true}
8+
onClick={[Function]}
79
onResponderGrant={[Function]}
810
onResponderMove={[Function]}
911
onResponderRelease={[Function]}

Libraries/Components/View/ReactNativeViewAttributes.js

-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ ReactNativeViewAttributes.UIView = {
1919
accessible: true,
2020
accessibilityActions: true,
2121
accessibilityLabel: true,
22-
accessibilityComponentType: true,
2322
accessibilityLiveRegion: true,
2423
accessibilityRole: true,
2524
accessibilityStates: true,
26-
accessibilityTraits: true,
2725
accessibilityHint: true,
2826
importantForAccessibility: true,
2927
nativeID: true,

0 commit comments

Comments
 (0)