Skip to content

Commit

Permalink
Merge pull request facebook#26 from Expensify/Rory-SyncWithUpstream
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham authored Aug 17, 2022
2 parents 546c4b4 + 07ea97c commit f204f5d
Show file tree
Hide file tree
Showing 526 changed files with 20,566 additions and 5,060 deletions.
224 changes: 101 additions & 123 deletions .circleci/config.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
bots/node_modules
docs/generatedComponentApiDocs.js
flow/
flow-typed/
Libraries/Renderer/*
Libraries/vendor/**/*
node_modules/
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
module.exports = {
root: true,

extends: ['./packages/eslint-config-react-native-community/index.js'],
extends: ['@react-native-community'],

plugins: ['@react-native/eslint-plugin-specs'],

Expand Down
4 changes: 2 additions & 2 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FlowFixMeEmpty

experimental.env_mode=resolved
inference_mode=constrain_writes

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

[version]
^0.183.0
^0.184.0
4 changes: 2 additions & 2 deletions .flowconfig.android
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FlowFixMeEmpty

experimental.env_mode=resolved
inference_mode=constrain_writes

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

[version]
^0.183.0
^0.184.0
19 changes: 19 additions & 0 deletions .github/workflows/autorebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Automatic Rebase
on:
issue_comment:
types: [created]
jobs:
rebase:
name: Rebase
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 14 additions & 6 deletions .github/workflows/danger_pr.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
name: Run Danger on PR

on:
pull_request:
pull_request_target:
types: [opened, edited, reopened, synchronize]

permissions:
contents: read
actions: write
checks: write
contents: write
issues: write
pull-requests: write
statuses: write

jobs:
danger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: yarn install
- name: Run Yarn Install on Root
run: yarn install
working-directory: .
- name: Run Yarn Install inside Bots
run: yarn install
working-directory: bots
- name: Danger
run: DANGER_GITHUB_API_TOKEN="$PUBLIC_PULLBOT_GITHUB_TOKEN_A""$PUBLIC_PULLBOT_GITHUB_TOKEN_B" yarn danger ci --use-github-checks --failOnErrors --id danger_pr
run: yarn danger ci --use-github-checks --failOnErrors
working-directory: bots
env:
PUBLIC_PULLBOT_GITHUB_TOKEN_A: a6edf8e8d40ce4e8b11a
PUBLIC_PULLBOT_GITHUB_TOKEN_B: 150e1341f4dd9c944d2a
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 1 addition & 3 deletions BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ rn_xplat_cxx_library2(
":RCTCxxUtils",
":ReactInternal",
"//fbobjc/Libraries/FBReactKit:RCTFBSystrace",
"//xplat/folly:molly",
react_native_root_target("React/CoreModules:CoreModules"),
react_native_xplat_target("cxxreact:bridge"),
react_native_xplat_target("cxxreact:jsbigstring"),
Expand Down Expand Up @@ -164,7 +163,6 @@ rn_xplat_cxx_library2(
":RCTCxxUtils",
":ReactInternal",
"//xplat/fbsystrace:fbsystrace",
"//xplat/folly:headers_only_do_not_use",
react_native_xplat_target("cxxreact:module"),
react_native_xplat_target("cxxreact:bridge"),
react_native_xplat_target("reactperflogger:reactperflogger"),
Expand Down Expand Up @@ -201,7 +199,7 @@ rn_xplat_cxx_library2(
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
visibility = ["PUBLIC"],
deps = [
"//xplat/folly:molly",
"//xplat/folly:dynamic",
],
)

Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## v0.69.4

### Changed

- Upgrade RN CLI to v8.0.4 ([66c68c37ce](https://github.com/facebook/react-native/commit/66c68c37ce94f6c1160e7f260c0d1887539c6605) by [@thymikee](https://github.com/thymikee))

#### Android specific

- Modified **getDefaultJSExecutorFactory** method ([87cfd386cb](https://github.com/facebook/react-native/commit/87cfd386cb2e02bfa440c94706d9d0274f83070c) by [@KunalFarmah98](https://github.com/KunalFarmah98))

## v0.69.3

### Fixed
Expand Down Expand Up @@ -250,6 +260,22 @@

- Encode URL params in URLSearchParams.toString() ([1042a8012f](https://github.com/facebook/react-native/commit/1042a8012fb472bd5c882b469fe507dd6279d562) by [@sshic](https://github.com/sshic))

## v0.68.3

### Changed

#### Android specific

- Let's not build reactnativeutilsjni shared library ([af9225ec5f](https://github.com/facebook/react-native/commit/af9225ec5fd22da802e3da4d786fa7f6ec956b0f) by [@SparshaSaha](https://github.com/SparshaSaha))
- Modified **getDefaultJSExecutorFactory** method ([87cfd386cb](https://github.com/facebook/react-native/commit/87cfd386cb2e02bfa440c94706d9d0274f83070c) by [@KunalFarmah98](https://github.com/KunalFarmah98))

### Fixed

- Use monotonic clock for performance.now() ([114d31feee](https://github.com/facebook/react-native/commit/114d31feeeb47f5a57419e5088c3cbe9340f757a))

#### Android specific

- Logging a soft error when ReactRootView has an id other than -1 instead of crashing the app in hybrid apps ([1ca2c24930](https://github.com/facebook/react-native/commit/1ca2c2493027c1b027146cd41e17dd8a4fc33a41) by [@Kunal-Airtel2022](https://github.com/Kunal-Airtel2022))

## v0.68.2

Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/AccessibilityManagerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as React from 'react';
const {TestModule} = NativeModules;

class AccessibilityManagerTest extends React.Component<{...}> {
componentDidMount() {
componentDidMount(): void {
invariant(
NativeAccessibilityManager,
"NativeAccessibilityManager doesn't exist",
Expand Down
1 change: 0 additions & 1 deletion IntegrationTests/AppEventsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class AppEventsTest extends React.Component<{...}, State> {
NativeAppEventEmitter.addListener('testEvent', this.receiveEvent);
const event = {data: TEST_PAYLOAD, ts: Date.now()};
TestModule.sendAppEvent('testEvent', event);
// eslint-disable-next-line react/no-did-mount-set-state
this.setState({sent: event});
}

Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/GlobalEvalWithSourceUrlTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const {View} = ReactNative;
const {TestModule} = ReactNative.NativeModules;

class GlobalEvalWithSourceUrlTest extends React.Component<{...}> {
componentDidMount() {
componentDidMount(): void {
if (typeof global.globalEvalWithSourceUrl !== 'function') {
throw new Error(
'Expected to find globalEvalWithSourceUrl function on global object but found ' +
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/ImageSnapshotTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const {Image} = ReactNative;
const {TestModule} = ReactNative.NativeModules;

class ImageSnapshotTest extends React.Component<{...}> {
componentDidMount() {
componentDidMount(): void {
if (!TestModule.verifySnapshot) {
throw new Error('TestModule.verifySnapshot not defined.');
}
Expand Down
4 changes: 2 additions & 2 deletions IntegrationTests/IntegrationTestsApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ require('./LoggingTestModule');
type Test = any;

class IntegrationTestsApp extends React.Component<{...}, $FlowFixMeState> {
state = {
state: {test: ?Test} = {
test: (null: ?Test),
};

render() {
render(): React.Node {
if (this.state.test) {
return (
<ScrollView>
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/SimpleSnapshotTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const {StyleSheet, View} = ReactNative;
const {TestModule} = ReactNative.NativeModules;

class SimpleSnapshotTest extends React.Component<{...}> {
componentDidMount() {
componentDidMount(): void {
if (!TestModule.verifySnapshot) {
throw new Error('TestModule.verifySnapshot not defined.');
}
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/SyncMethodTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const {View} = ReactNative;
const {TestModule, RNTesterTestModule} = ReactNative.NativeModules;

class SyncMethodTest extends React.Component<{...}> {
componentDidMount() {
componentDidMount(): void {
if (
RNTesterTestModule.echoString('test string value') !== 'test string value'
) {
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/TimersTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class TimersTest extends React.Component<Props, State> {
);
}

_incrementInterval() {
_incrementInterval(): void {
if (this.state.count > 3) {
throw new Error('interval incremented past end.');
}
Expand Down
6 changes: 3 additions & 3 deletions IntegrationTests/WebSocketTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ class WebSocketTest extends React.Component<{...}, State> {
});
};

_socketIsConnected = () => {
_socketIsConnected = (): boolean => {
return this.state.socketState === 1; //'OPEN'
};

_socketIsDisconnected = () => {
_socketIsDisconnected = (): boolean => {
return this.state.socketState === 3; //'CLOSED'
};

Expand Down Expand Up @@ -106,7 +106,7 @@ class WebSocketTest extends React.Component<{...}, State> {
this._sendText(this.state.testMessage);
};

_receivedTestExpectedResponse = () => {
_receivedTestExpectedResponse = (): boolean => {
return this.state.lastMessage === this.state.testExpectedResponse;
};

Expand Down
4 changes: 2 additions & 2 deletions Libraries/Animated/AnimatedEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class AnimatedEvent {
this._listeners = this._listeners.filter(listener => listener !== callback);
}

__attach(viewRef: any, eventName: string) {
__attach(viewRef: any, eventName: string): void {
invariant(
this.__isNative,
'Only native driven events need to be attached.',
Expand All @@ -191,7 +191,7 @@ class AnimatedEvent {
);
}

__detach(viewTag: any, eventName: string) {
__detach(viewTag: any, eventName: string): void {
invariant(
this.__isNative,
'Only native driven events need to be detached.',
Expand Down
7 changes: 4 additions & 3 deletions Libraries/Animated/animations/SpringAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

'use strict';

const AnimatedValue = require('../nodes/AnimatedValue');
const AnimatedValueXY = require('../nodes/AnimatedValueXY');
const AnimatedInterpolation = require('../nodes/AnimatedInterpolation');
import type AnimatedValue from '../nodes/AnimatedValue';
import type AnimatedValueXY from '../nodes/AnimatedValueXY';
import type AnimatedInterpolation from '../nodes/AnimatedInterpolation';

const Animation = require('./Animation');
const SpringConfig = require('../SpringConfig');

Expand Down
7 changes: 4 additions & 3 deletions Libraries/Animated/animations/TimingAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

'use strict';

const AnimatedValue = require('../nodes/AnimatedValue');
const AnimatedValueXY = require('../nodes/AnimatedValueXY');
const AnimatedInterpolation = require('../nodes/AnimatedInterpolation');
import type AnimatedValue from '../nodes/AnimatedValue';
import type AnimatedValueXY from '../nodes/AnimatedValueXY';
import type AnimatedInterpolation from '../nodes/AnimatedInterpolation';

const Animation = require('./Animation');

const {shouldUseNativeDriver} = require('../NativeAnimatedHelper');
Expand Down
6 changes: 3 additions & 3 deletions Libraries/Animated/createAnimatedComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
// components. If you want to animate a composite component, you need to
// re-render it. In this case, we have a fallback that uses forceUpdate.
// This fallback is also called in Fabric.
_animatedPropsCallback = () => {
_animatedPropsCallback = (): void => {
if (this._component == null) {
// AnimatedProps is created in will-mount because it's used in render.
// But this callback may be invoked before mount in async mode,
Expand Down Expand Up @@ -192,15 +192,15 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
}
}

_setComponentRef = setAndForwardRef({
_setComponentRef: (ref: React.ElementRef<any>) => void = setAndForwardRef({
getForwardedRef: () => this.props.forwardedRef,
setLocalRef: ref => {
this._prevComponent = this._component;
this._component = ref;
},
});

render() {
render(): React.Node {
const animatedProps =
this._propsAnimated.__getValue(this._initialAnimatedProps) || {};
const {style = {}, ...props} = animatedProps;
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Animated/nodes/AnimatedAddition.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

'use strict';

import type AnimatedNode from './AnimatedNode';

const AnimatedInterpolation = require('./AnimatedInterpolation');
const AnimatedNode = require('./AnimatedNode');
const AnimatedValue = require('./AnimatedValue');
const AnimatedWithChildren = require('./AnimatedWithChildren');

Expand Down
3 changes: 2 additions & 1 deletion Libraries/Animated/nodes/AnimatedDiffClamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

'use strict';

import type AnimatedNode from './AnimatedNode';

const AnimatedInterpolation = require('./AnimatedInterpolation');
const AnimatedNode = require('./AnimatedNode');
const AnimatedWithChildren = require('./AnimatedWithChildren');

import type {InterpolationConfigType} from './AnimatedInterpolation';
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Animated/nodes/AnimatedInterpolation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

'use strict';

const AnimatedNode = require('./AnimatedNode');
import type AnimatedNode from './AnimatedNode';

const AnimatedWithChildren = require('./AnimatedWithChildren');
const NativeAnimatedHelper = require('../NativeAnimatedHelper');

Expand Down
3 changes: 2 additions & 1 deletion Libraries/Animated/nodes/AnimatedModulo.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

'use strict';

import type AnimatedNode from './AnimatedNode';

const AnimatedInterpolation = require('./AnimatedInterpolation');
const AnimatedNode = require('./AnimatedNode');
const AnimatedWithChildren = require('./AnimatedWithChildren');

import type {InterpolationConfigType} from './AnimatedInterpolation';
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Animated/nodes/AnimatedMultiplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

'use strict';

import type AnimatedNode from './AnimatedNode';

const AnimatedInterpolation = require('./AnimatedInterpolation');
const AnimatedNode = require('./AnimatedNode');
const AnimatedValue = require('./AnimatedValue');
const AnimatedWithChildren = require('./AnimatedWithChildren');

Expand Down
Loading

0 comments on commit f204f5d

Please sign in to comment.