Skip to content

Commit

Permalink
Merge branch 'master' into fix/keyboardDidShowHeight
Browse files Browse the repository at this point in the history
  • Loading branch information
fabOnReact committed Mar 30, 2021
2 parents 951018d + 72d45de commit 63e8942
Show file tree
Hide file tree
Showing 556 changed files with 31,485 additions and 20,420 deletions.
2 changes: 1 addition & 1 deletion .buckconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[android]
target = android-29
target = android-30

[download]
max_number_of_retries = 3
Expand Down
2 changes: 1 addition & 1 deletion .circleci/Dockerfiles/Dockerfile.android
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# and build a Android application that can be used to run the
# tests specified in the scripts/ directory.
#
FROM reactnativecommunity/react-native-android:2.1
FROM reactnativecommunity/react-native-android:3.2

LABEL Description="React Native Android Test Image"
LABEL maintainer="Héctor Ramos <hector@fb.com>"
Expand Down
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ executors:
reactnativeandroid:
<<: *defaults
docker:
- image: reactnativecommunity/react-native-android:2.1
- image: reactnativecommunity/react-native-android:3.2
resource_class: "large"
environment:
- TERM: "dumb"
Expand Down Expand Up @@ -617,7 +617,7 @@ jobs:
environment:
- ANDROID_HOME: "C:\\Android\\android-sdk"
- ANDROID_NDK: "C:\\Android\\android-sdk\\ndk\\20.1.5948944"
- ANDROID_BUILD_VERSION: 28
- ANDROID_BUILD_VERSION: 30
- ANDROID_TOOLS_VERSION: 29.0.3
- GRADLE_OPTS: -Dorg.gradle.daemon=false
- NDK_VERSION: 20.1.5948944
Expand Down
4 changes: 1 addition & 3 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FlowFixMeEmpty

experimental.abstract_locations=true

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
Expand All @@ -70,4 +68,4 @@ untyped-import
untyped-type-import

[version]
^0.144.0
^0.147.0
4 changes: 1 addition & 3 deletions .flowconfig.android
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FlowFixMeEmpty

experimental.abstract_locations=true

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
Expand All @@ -70,4 +68,4 @@ untyped-import
untyped-type-import

[version]
^0.144.0
^0.147.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Configuration for Label Actions - https://github.com/marketplace/actions/label-actions
# Configuration for Respond To Issue Based on Label https://github.com/marketplace/actions/respond-to-issue-based-on-label

"Type: Invalid":
close: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Label Actions
name: On Issue Labeled
# This workflow is triggered when a label is added to an issue.
on:
issues:
types: labeled

jobs:
processLabelAction:
name: Process Label Action
respondToIssueBasedOnLabel:
name: Respond to Issue Based on Label
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Process Label Action
uses: hramos/label-actions@v1
- name: Respond to Issue Based on Label
uses: hramos/respond-to-issue-based-on-label@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ project.xcworkspace
/build/
/packages/react-native-codegen/android/build/
/packages/react-native-codegen/android/gradlePlugin-build/gradlePlugin/build
/packages/react-native-gradle-plugin/build/
/packages/rn-tester/android/app/.cxx/
/packages/rn-tester/android/app/build/
/packages/rn-tester/android/app/gradle/
Expand Down
6 changes: 3 additions & 3 deletions Libraries/Alert/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
*/

import Platform from '../Utilities/Platform';
import NativeDialogManagerAndroid, {
type DialogOptions,
} from '../NativeModules/specs/NativeDialogManagerAndroid';
import type {DialogOptions} from '../NativeModules/specs/NativeDialogManagerAndroid';
import RCTAlertManager from './RCTAlertManager';

export type AlertType =
Expand Down Expand Up @@ -48,6 +46,8 @@ class Alert {
if (Platform.OS === 'ios') {
Alert.prompt(title, message, buttons, 'default');
} else if (Platform.OS === 'android') {
const NativeDialogManagerAndroid = require('../NativeModules/specs/NativeDialogManagerAndroid')
.default;
if (!NativeDialogManagerAndroid) {
return;
}
Expand Down
20 changes: 19 additions & 1 deletion Libraries/Animated/createAnimatedComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
// When called during the first render, `_component` is always null.
// Therefore, even if a component is rendered in Fabric, we can't detect
// that until ref is set, which happens sometime after the first render.
// In cases where this value switching between "false" and "true" on Fabric
// causes issues, add an additional check for _component nullity.
if (this._component == null) {
return false;
}
Expand Down Expand Up @@ -221,10 +223,24 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
const {style: passthruStyle = {}, ...passthruProps} =
this.props.passthroughAnimatedPropExplicitValues || {};
const mergedStyle = {...style, ...passthruStyle};

// On Fabric, we always want to ensure the container Animated View is *not*
// flattened.
// Because we do not get a host component ref immediately and thus cannot
// do a proper Fabric vs non-Fabric detection immediately, we default to assuming
// that Fabric *is* enabled until we know otherwise.
// Thus, in Fabric, this view will never be flattened. In non-Fabric, the view will
// not be flattened during the initial render but may be flattened in the second render
// and onwards.
const forceNativeIdFabric =
(this._component == null &&
(options?.collapsable === false || props.collapsable !== true)) ||
this._isFabric();

const forceNativeId =
props.collapsable ??
(this._propsAnimated.__isNative ||
this._isFabric() ||
forceNativeIdFabric ||
options?.collapsable === false);
// 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 Expand Up @@ -283,6 +299,8 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
this._propsAnimated && this._propsAnimated.__detach();
this._detachNativeEvents();
this._markUpdateComplete();
this._component = null;
this._prevComponent = null;
}
}

Expand Down
33 changes: 33 additions & 0 deletions Libraries/AppState/AppState.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,39 @@ class AppState {
}
throw new Error('Trying to subscribe to unknown event: ' + type);
}

/**
* @deprecated Use `remove` on the EventSubscription from `addEventListener`.
*/
removeEventListener<K: $Keys<AppStateEventDefinitions>>(
type: K,
listener: (...$ElementType<AppStateEventDefinitions, K>) => mixed,
): void {
const emitter = this._emitter;
if (emitter == null) {
throw new Error('Cannot use AppState when `isAvailable` is false.');
}
// NOTE: This will report a deprecation notice via `console.error`.
switch (type) {
case 'change':
// $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type
// $FlowIssue[incompatible-call]
emitter.removeListener('appStateDidChange', listener);
return;
case 'memoryWarning':
// $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type
// $FlowIssue[incompatible-call]
emitter.removeListener('memoryWarning', listener);
return;
case 'blur':
case 'focus':
// $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type
// $FlowIssue[incompatible-call]
emitter.addListener('appStateFocusChange', listener);
return;
}
throw new Error('Trying to unsubscribe from unknown event: ' + type);
}
}

module.exports = (new AppState(): AppState);
6 changes: 3 additions & 3 deletions Libraries/BatchedBridge/MessageQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ class MessageQueue {
this._lazyCallableModules[name] = () => module;
}

registerLazyCallableModule(name: string, factory: void => {...}) {
let module: {...};
let getValue: ?(void) => {...} = factory;
registerLazyCallableModule(name: string, factory: void => interface {}) {
let module: interface {};
let getValue: ?(void) => interface {} = factory;
this._lazyCallableModules[name] = () => {
if (getValue) {
module = getValue();
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Blob/React-RCTBlob.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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" }
s.platforms = { :ios => "11.0" }
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.source = source
s.source_files = "*.{h,m,mm}"
Expand Down
32 changes: 16 additions & 16 deletions Libraries/Blob/URL.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,27 @@ export class URLSearchParams {
}

delete(name) {
throw new Error('not implemented');
throw new Error('URLSearchParams.delete is not implemented');
}

get(name) {
throw new Error('not implemented');
throw new Error('URLSearchParams.get is not implemented');
}

getAll(name) {
throw new Error('not implemented');
throw new Error('URLSearchParams.getAll is not implemented');
}

has(name) {
throw new Error('not implemented');
throw new Error('URLSearchParams.has is not implemented');
}

set(name, value) {
throw new Error('not implemented');
throw new Error('URLSearchParams.set is not implemented');
}

sort() {
throw new Error('not implemented');
throw new Error('URLSearchParams.sort is not implemented');
}

[Symbol.iterator]() {
Expand Down Expand Up @@ -154,43 +154,43 @@ export class URL {
}

get hash() {
throw new Error('not implemented');
throw new Error('URL.hash is not implemented');
}

get host() {
throw new Error('not implemented');
throw new Error('URL.host is not implemented');
}

get hostname() {
throw new Error('not implemented');
throw new Error('URL.hostname is not implemented');
}

get href(): string {
return this.toString();
}

get origin() {
throw new Error('not implemented');
throw new Error('URL.origin is not implemented');
}

get password() {
throw new Error('not implemented');
throw new Error('URL.password is not implemented');
}

get pathname() {
throw new Error('not implemented');
throw new Error('URL.pathname not implemented');
}

get port() {
throw new Error('not implemented');
throw new Error('URL.port is not implemented');
}

get protocol() {
throw new Error('not implemented');
throw new Error('URL.protocol is not implemented');
}

get search() {
throw new Error('not implemented');
throw new Error('URL.search is not implemented');
}

get searchParams(): URLSearchParams {
Expand All @@ -213,6 +213,6 @@ export class URL {
}

get username() {
throw new Error('not implemented');
throw new Error('URL.username is not implemented');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type AccessibilityEventDefinitions = {
change: [boolean],
};

type AccessibilityEventTypes = 'focus';
type AccessibilityEventTypes = 'focus' | 'click';

const _subscriptions = new Map();

Expand Down Expand Up @@ -162,7 +162,12 @@ const AccessibilityInfo = {
eventType: AccessibilityEventTypes,
) {
// route through React renderer to distinguish between Fabric and non-Fabric handles
sendAccessibilityEvent(handle, eventType);
// iOS only supports 'focus' event types
if (eventType === 'focus') {
sendAccessibilityEvent(handle, eventType);
} else if (eventType === 'click') {
// Do nothing!
}
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ type AccessibilityEventDefinitions = {
],
};

type AccessibilityEventTypes = 'focus';
// 'click' event type is not implemented in iOS. It's declared here to avoid flow type errors
type AccessibilityEventTypes = 'focus' | 'click';

const _subscriptions = new Map();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ function legacySendAccessibilityEvent(
UIManager.getConstants().AccessibilityEventTypes.typeViewFocused,
);
}
if (eventType === 'click') {
UIManager.sendAccessibilityEvent(
reactTag,
UIManager.getConstants().AccessibilityEventTypes.typeViewClicked,
);
}
}

module.exports = legacySendAccessibilityEvent;
Loading

0 comments on commit 63e8942

Please sign in to comment.