Skip to content

Commit

Permalink
Merge branch 'master' into feat/disable_buttons_action_sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewalczak authored Sep 29, 2020
2 parents f0ffb09 + 29f5dc2 commit 873d154
Show file tree
Hide file tree
Showing 452 changed files with 8,330 additions and 6,297 deletions.
2 changes: 1 addition & 1 deletion .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
jcenter = https://jcenter.bintray.com/

[alias]
rntester = //RNTester/android/app:app
rntester = //packages/rn-tester/android/app:app
5 changes: 0 additions & 5 deletions .circleci/Dockerfiles/scripts/run-ci-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ while :; do
shift
;;

--tvos)
RUN_IOS=1
shift
;;

*)
break
esac
Expand Down
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ executors:
reactnativeios:
<<: *defaults
macos:
xcode: &_XCODE_VERSION "11.3.1"
xcode: &_XCODE_VERSION "11.6.0"

# -------------------------
# COMMANDS
Expand Down Expand Up @@ -133,13 +133,13 @@ commands:
steps:
- restore_cache:
keys:
- v3-brew
- v4-brew
- steps: << parameters.steps >>
- save_cache:
paths:
- /usr/local/Homebrew
- ~/Library/Caches/Homebrew
key: v3-brew
key: v4-brew

with_rntester_pods_cache_span:
parameters:
Expand Down
21 changes: 13 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@
"./packages/eslint-config-react-native-community/index.js"
],

"plugins": [
"@react-native/eslint-plugin-codegen"
],

"overrides": [
{
"files": [
"Libraries/**/*.js",
],
rules: {
'@react-native-community/no-haste-imports': 2,
'@react-native-community/error-subclass-name': 2,
'@react-native-community/platform-colors': 2,
"rules": {
"@react-native-community/no-haste-imports": 2,
"@react-native-community/error-subclass-name": 2,
"@react-native-community/platform-colors": 2,
"@react-native/codegen/react-native-modules": 2
}
},
{
Expand All @@ -40,8 +45,8 @@
],
"env": {
"jasmine": true,
"jest": true,
},
},
],
"jest": true
}
}
]
}
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ untyped-import
untyped-type-import

[version]
^0.132.0
^0.134.0
2 changes: 1 addition & 1 deletion .flowconfig.android
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ untyped-import
untyped-type-import

[version]
^0.132.0
^0.134.0
6 changes: 0 additions & 6 deletions .gitattributes

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ project.xcworkspace

# Gradle
/build/
/packages/react-native-codegen/android/build/
/packages/react-native-codegen/android/gradlePlugin-build/gradlePlugin/build
/packages/rn-tester/android/app/.cxx/
/packages/rn-tester/android/app/build/
/packages/rn-tester/android/app/gradle/
/packages/rn-tester/android/app/gradlew
Expand Down
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false,
"jsxBracketSameLine": true
"jsxBracketSameLine": true,
"arrowParens": "avoid"
}
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ We recommend referring to the [CONTRIBUTING](https://github.com/facebook/react-n

## Contributing Code

Code-level contributions to React Native generally come in the form of [pull requests](https://help.github.com/en/articles/about-pull-requests). These are done by forking the repo and making changes locally. Directly in the repo, there is the [`RNTester` app](/RNTester) that you can install on your device (or simulators) and use to test the changes you're making to React Native sources.
Code-level contributions to React Native generally come in the form of [pull requests](https://help.github.com/en/articles/about-pull-requests). These are done by forking the repo and making changes locally. Directly in the repo, there is the [`rn-tester` app](/packages/rn-tester) that you can install on your device (or simulators) and use to test the changes you're making to React Native sources.

The process of proposing a change to React Native can be summarized as follows:

1. Fork the React Native repository and create your branch from `master`.
2. Make the desired changes to React Native sources. Use the `RNTester` app to test them out.
2. Make the desired changes to React Native sources. Use the `packages/rn-tester` app to test them out.
3. If you've added code that should be tested, add tests.
4. If you've changed APIs, update the documentation, which lives in [another repo](https://github.com/facebook/react-native-website/).
5. Ensure the test suite passes, either locally or on CI once you opened a pull request.
Expand Down
4 changes: 2 additions & 2 deletions Libraries/ActionSheetIOS/ActionSheetIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const ActionSheetIOS = {
'Options must be a valid object',
);
invariant(typeof callback === 'function', 'Must provide a valid callback');
invariant(RCTActionSheetManager, "ActionSheetManager does't exist");
invariant(RCTActionSheetManager, "ActionSheetManager doesn't exist");

const {tintColor, destructiveButtonIndex, ...remainingOptions} = options;
let destructiveButtonIndices = null;
Expand Down Expand Up @@ -125,7 +125,7 @@ const ActionSheetIOS = {
typeof successCallback === 'function',
'Must provide a valid successCallback',
);
invariant(RCTActionSheetManager, "ActionSheetManager does't exist");
invariant(RCTActionSheetManager, "ActionSheetManager doesn't exist");
RCTActionSheetManager.showShareActionSheetWithOptions(
{...options, tintColor: processColor(options.tintColor)},
failureCallback,
Expand Down
4 changes: 2 additions & 2 deletions Libraries/ActionSheetIOS/React-RCTActionSheet.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ Pod::Spec.new do |s|
s.documentation_url = "https://reactnative.dev/docs/actionsheetios"
s.license = package["license"]
s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "10.0", :tvos => "10.0" }
s.platforms = { :ios => "10.0" }
s.source = source
s.source_files = "*.{m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "RCTActionSheet"

s.dependency "React-Core/RCTActionSheetHeaders", version
Expand Down
1 change: 1 addition & 0 deletions Libraries/Alert/NativeAlertManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type Args = {|

export interface Spec extends TurboModule {
+alertWithArgs: (
// eslint-disable-next-line @react-native/codegen/react-native-modules
args: Args,
callback: (id: number, value: string) => void,
) => void;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Animated/NativeAnimatedModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type AnimatingNodeConfig = Object;
export interface Spec extends TurboModule {
+startOperationBatch: () => void;
+finishOperationBatch: () => void;

// eslint-disable-next-line @react-native/codegen/react-native-modules
+createAnimatedNode: (tag: number, config: AnimatedNodeConfig) => void;
+getValue: (tag: number, saveValueCallback: SaveValueCallback) => void;
+startListeningToAnimatedNodeValue: (tag: number) => void;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Animated/NativeAnimatedTurboModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type AnimatingNodeConfig = Object;
export interface Spec extends TurboModule {
+startOperationBatch: () => void;
+finishOperationBatch: () => void;

// eslint-disable-next-line @react-native/codegen/react-native-modules
+createAnimatedNode: (tag: number, config: AnimatedNodeConfig) => void;
+getValue: (tag: number, saveValueCallback: SaveValueCallback) => void;
+startListeningToAnimatedNodeValue: (tag: number) => void;
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Animated/createAnimatedComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
style={mergedStyle}
ref={this._setComponentRef}
nativeID={
this._isFabric() ? 'animatedComponent' : undefined
props.nativeID ??
(this._isFabric() ? 'animatedComponent' : undefined)
} /* TODO: T68258846. */
// The native driver updates views directly through the UI thread so we
// have to make sure the view doesn't get optimized away because it cannot
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Animated/nodes/AnimatedDivision.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AnimatedDivision extends AnimatedWithChildren {

constructor(a: AnimatedNode | number, b: AnimatedNode | number) {
super();
if (b === 0) {
if (b === 0 || (b instanceof AnimatedNode && b.__getValue() === 0)) {
console.error('Detected potential division by zero in AnimatedDivision');
}
this._a = typeof a === 'number' ? new AnimatedValue(a) : a;
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Blob/React-RCTBlob.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Pod::Spec.new do |s|
s.homepage = "https://reactnative.dev/"
s.license = package["license"]
s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "10.0", :tvos => "10.0" }
s.platforms = { :ios => "10.0" }
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.source = source
s.source_files = "*.{m,mm}"
s.source_files = "*.{h,m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "RCTBlob"
s.pod_target_xcconfig = {
Expand Down
51 changes: 0 additions & 51 deletions Libraries/Components/AppleTV/TVEventHandler.js

This file was deleted.

22 changes: 17 additions & 5 deletions Libraries/Components/Pressable/Pressable.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ type Props = $ReadOnly<{|
* Used only for documentation or testing (e.g. snapshot testing).
*/
testOnly_pressed?: ?boolean,

/**
* Duration to wait after press down before calling `onPressIn`.
*/
unstable_pressDelay?: ?number,
|}>;

/**
Expand All @@ -152,6 +157,7 @@ function Pressable(props: Props, forwardedRef): React.Node {
pressRetentionOffset,
style,
testOnly_pressed,
unstable_pressDelay,
...restProps
} = props;

Expand All @@ -164,13 +170,22 @@ function Pressable(props: Props, forwardedRef): React.Node {

const hitSlop = normalizeRect(props.hitSlop);

const restPropsWithDefaults: React.ElementConfig<typeof View> = {
...restProps,
...android_rippleConfig?.viewProps,
accessible: accessible !== false,
focusable: focusable !== false,
hitSlop,
};

const config = useMemo(
() => ({
disabled,
hitSlop,
pressRectOffset: pressRetentionOffset,
android_disableSound,
delayLongPress,
delayPressIn: unstable_pressDelay,
onLongPress,
onPress,
onPressIn(event: PressEvent): void {
Expand Down Expand Up @@ -205,18 +220,15 @@ function Pressable(props: Props, forwardedRef): React.Node {
onPressOut,
pressRetentionOffset,
setPressed,
unstable_pressDelay,
],
);
const eventHandlers = usePressability(config);

return (
<View
{...restProps}
{...restPropsWithDefaults}
{...eventHandlers}
{...android_rippleConfig?.viewProps}
accessible={accessible !== false}
focusable={focusable !== false}
hitSlop={hitSlop}
ref={viewRef}
style={typeof style === 'function' ? style({pressed}) : style}
collapsable={false}>
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Components/ScrollResponder.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ const ScrollResponderMixin = {
// and a new touch starts with a non-textinput target (in which case the
// first tap should be sent to the scroll view and dismiss the keyboard,
// then the second tap goes to the actual interior view)
const currentlyFocusedTextInput = TextInputState.currentlyFocusedInput();
const {keyboardShouldPersistTaps} = this.props;
const keyboardNeverPersistTaps =
!keyboardShouldPersistTaps || keyboardShouldPersistTaps === 'never';
Expand All @@ -239,7 +240,7 @@ const ScrollResponderMixin = {

if (
keyboardNeverPersistTaps &&
this.keyboardWillOpenTo !== null &&
currentlyFocusedTextInput != null &&
e.target != null &&
!TextInputState.isTextInput(e.target)
) {
Expand Down
3 changes: 1 addition & 2 deletions Libraries/Components/ScrollView/ScrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,13 +1206,12 @@ class ScrollView extends React.Component<Props, State> {
if (refreshControl) {
if (Platform.OS === 'ios') {
// On iOS the RefreshControl is a child of the ScrollView.
// tvOS lacks native support for RefreshControl, so don't include it in that case
return (
/* $FlowFixMe(>=0.117.0 site=react_native_fb) This comment suppresses
* an error found when Flow v0.117 was deployed. To see the error,
* delete this comment and run Flow. */
<ScrollViewClass {...props} ref={this._setNativeRef}>
{Platform.isTV ? null : refreshControl}
{refreshControl}
{contentContainer}
</ScrollViewClass>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface Spec extends TurboModule {
* - 'default'
* - 'dark-content'
*/
// eslint-disable-next-line @react-native/codegen/react-native-modules
+setStyle: (statusBarStyle?: ?string) => void;
+setHidden: (hidden: boolean) => void;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface Spec extends TurboModule {
* - 'dark-content'
* - 'light-content'
*/
// eslint-disable-next-line @react-native/codegen/react-native-modules
+setStyle: (statusBarStyle?: ?string, animated: boolean) => void;
/**
* - withAnimation can be: 'none' | 'fade' | 'slide'
Expand Down
Loading

0 comments on commit 873d154

Please sign in to comment.