From 400874b97207581a808c346ec5f1ebf5c628dec3 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Tue, 2 Aug 2022 11:28:54 +0530 Subject: [PATCH 01/33] make shouldDelayFocus android only --- ios/NewExpensify.xcodeproj/project.pbxproj | 4 +- ios/Podfile.lock | 44 ++--- src/components/IOUConfirmationList.js | 1 - .../BaseOptionsSelector.js} | 153 +++--------------- .../OptionsSelector/index.android.js | 18 +++ src/components/OptionsSelector/index.js | 17 ++ .../optionsSelectorPropTypes.js | 125 ++++++++++++++ src/pages/NewChatPage.js | 1 - src/pages/SearchPage.js | 1 - src/pages/iou/IOUCurrencySelection.js | 1 - .../IOUParticipantsRequest.js | 1 - .../IOUParticipantsSplit.js | 1 - 12 files changed, 205 insertions(+), 162 deletions(-) rename src/components/{OptionsSelector.js => OptionsSelector/BaseOptionsSelector.js} (70%) create mode 100644 src/components/OptionsSelector/index.android.js create mode 100644 src/components/OptionsSelector/index.js create mode 100644 src/components/OptionsSelector/optionsSelectorPropTypes.js diff --git a/ios/NewExpensify.xcodeproj/project.pbxproj b/ios/NewExpensify.xcodeproj/project.pbxproj index a9fad31433f7..abfa05936a94 100644 --- a/ios/NewExpensify.xcodeproj/project.pbxproj +++ b/ios/NewExpensify.xcodeproj/project.pbxproj @@ -940,7 +940,7 @@ COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386"; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1001,7 +1001,7 @@ COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386"; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 1aea6abedf1a..a47bc084c600 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -443,7 +443,7 @@ PODS: - React-Core - react-native-document-picker (8.0.0): - React-Core - - react-native-flipper (0.117.0): + - react-native-flipper (0.146.1): - React-Core - react-native-image-picker (4.7.3): - React-Core @@ -916,9 +916,9 @@ SPEC CHECKSUMS: Onfido: a1645279c7b6ca8de5bb95d27af53c523ffd731c onfido-react-native-sdk: cfdfd1d4acf53e469a82b9684f92982d39744bb8 OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b - Permission-LocationAccuracy: e8adff9ede1b23b43b7054a4500113d515fc87a8 - Permission-LocationAlways: 7f7f373d086af7a81b2f4f20d65d29266ca2043b - Permission-LocationWhenInUse: 3ae82a9feb5da4e94e386dba17c7dd3531af9feb + Permission-LocationAccuracy: 76669f87b4c276f5ae803cc0ddd1862a4c0e9dd8 + Permission-LocationAlways: a274bc04bb386068782468dbdaca3859f51634ca + Permission-LocationWhenInUse: 3a2b0dbc167d79e8e920a4377ff9520cdc108407 Plaid: 4d8d4ff0a6d627f5faf3055a9cba8890ea6b5076 PromisesObjC: 99b6f43f9e1044bd87a95a60beff28c2c44ddb72 Protobuf: 9e88c1e667d75aa2491d211f26ccddde4e8ad4cf @@ -935,19 +935,19 @@ SPEC CHECKSUMS: React-jsiexecutor: 94ce921e1d8ce7023366873ec371f3441383b396 React-jsinspector: d0374f7509d407d2264168b6d0fad0b54e300b85 React-logger: 933f80c97c633ee8965d609876848148e3fef438 - react-native-cameraroll: 60ac50a5209777cbccfe8d7a62d0743a9da87060 + react-native-cameraroll: 2957f2bce63ae896a848fbe0d5352c1bd4d20866 react-native-config: 6502b1879f97ed5ac570a029961fc35ea606cd14 - react-native-document-picker: 772d04a4bc5c35da9abe27b08ac271420ae3f9ef - react-native-flipper: cd9eabd8917104c1bbdca2621717cdca3b2addef - react-native-image-picker: ae1202414bd5c37c00b2a701daa5b6194a06b7d9 - react-native-netinfo: ebbcd8fbe1a0ce7035e43cd18c5a545dcb93dd08 + react-native-document-picker: 429972f7ece4463aa5bcdd789622b3a674a3c5d1 + react-native-flipper: 4bfe0a324e663f1ae2f76ad0da75673de6895efe + react-native-image-picker: 4e6008ad8c2321622affa2c85432a5ebd02d480c + react-native-netinfo: 3671b091c4843fda5e153612866ef4024b8f5d62 react-native-pdf: 4b5a9e4465a6a3b399e91dc4838eb44ddf716d1f - react-native-performance: 8edfa2bbc9a2af4a02f01d342118e413a95145e0 - react-native-plaid-link-sdk: 9e0ebdaed648a237b36d5f6f6292b5147af92da7 - react-native-progress-bar-android: ce95a69f11ac580799021633071368d08aaf9ad8 - react-native-progress-view: 5816e8a6be812c2b122c6225a2a3db82d9008640 - react-native-safe-area-context: 01158a92c300895d79dee447e980672dc3fb85a6 - react-native-webview: 77ee909f73e1fcab76380f7dcc3344771fe61bd8 + react-native-performance: 6bd6cfac80594775fb782405fceaaf206becf53b + react-native-plaid-link-sdk: 6ce5b2453b6a09ba3e975975c6a3fc7013a064fe + react-native-progress-bar-android: be43138ab7da30d51fc038bafa98e9ed594d0c40 + react-native-progress-view: 21b1e29e70c7559c16c9e0a04c4adc19fce6ede2 + react-native-safe-area-context: 79fea126c6830c85f65947c223a5e3058a666937 + react-native-webview: 380c1a03ec94b7ed764dac8db1e7c9952d08c93a React-perflogger: 93075d8931c32cd1fce8a98c15d2d5ccc4d891bd React-RCTActionSheet: 7d3041e6761b4f3044a37079ddcb156575fb6d89 React-RCTAnimation: 743e88b55ac62511ae5c2e22803d4f503f2a3a13 @@ -961,28 +961,28 @@ SPEC CHECKSUMS: React-runtimeexecutor: dec32ee6f2e2a26e13e58152271535fadff5455a ReactCommon: 57b69f6383eafcbd7da625bfa6003810332313c4 rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba - RNCAsyncStorage: 8324611026e8dc3706f829953aa6e3899f581589 - RNCClipboard: 5e299c6df8e0c98f3d7416b86ae563d3a9f768a3 - RNCMaskedView: 138134c4d8a9421b4f2bf39055a79aa05c2d47b1 + RNCAsyncStorage: 56a3355a10b5d660c48c6e37325ac85ebfd09885 + RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495 + RNCMaskedView: fc29d354a40316a990e8fb46391f08aea829c3aa RNCPicker: f6c760d4b314585ff35165d8640d7917ae30afb1 - RNDateTimePicker: c9911be59b1f8670b9f244b85af3a7c295e175ed + RNDateTimePicker: 7658208086d86d09e1627b5c34ba0cf237c60140 RNFastImage: 1f2cab428712a4baaf78d6169eaec7f622556dd7 RNFBAnalytics: 8ba84c2d31c64374d054c8621b998f25145ffddc RNFBApp: 64c90ab78b6010ed5c3ade026dfe5ff6442c21fd RNFBCrashlytics: 1de18b8cc36d9bcf86407c4a354399228cc84a61 RNFBPerf: e3a7269f573a4787810a32de51647cdcbe08dfb4 RNGestureHandler: 9b7e605a741412e20e13c512738a31bd1611759b - RNPermissions: eb94f9fdc0a8ecd02fcce0676d56ffb1395d41e1 + RNPermissions: 4c8a37b4dde50f1f152bf8cd08c4a43d2355829e RNReactNativeHapticFeedback: b83bfb4b537bdd78eb4f6ffe63c6884f7b049ead RNReanimated: da3860204e5660c0dd66739936732197d359d753 RNScreens: 522705f2e5c9d27efb17f24aceb2bf8335bc7b8e RNSVG: ce9d996113475209013317e48b05c21ee988d42e SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d - urbanairship-react-native: 60b4b4235838ff109a2639b639e2ef01d54ad455 + urbanairship-react-native: ee53526e1f81c5170863dd3e039df7f98730ef53 Yoga: e7dc4e71caba6472ff48ad7d234389b91dadc280 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a PODFILE CHECKSUM: 431123d7514c52fa4516724b89c20d02c87ad8c8 -COCOAPODS: 1.11.2 +COCOAPODS: 1.11.3 diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js index 32c7ee6531c6..24f1210d5761 100755 --- a/src/components/IOUConfirmationList.js +++ b/src/components/IOUConfirmationList.js @@ -349,7 +349,6 @@ class IOUConfirmationList extends Component { hideAdditionalOptionStates forceTextUnreadStyle autoFocus - shouldDelayFocus shouldTextInputAppearBelowOptions shouldShowOfflineMessage optionHoveredStyle={canModifyParticipants ? styles.hoveredComponentBG : {}} diff --git a/src/components/OptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js similarity index 70% rename from src/components/OptionsSelector.js rename to src/components/OptionsSelector/BaseOptionsSelector.js index 2f113f58dd03..7935e78f396e 100755 --- a/src/components/OptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -4,145 +4,34 @@ import React, {Component} from 'react'; import PropTypes from 'prop-types'; import {View, findNodeHandle} from 'react-native'; import {withOnyx} from 'react-native-onyx'; -import Button from './Button'; -import FixedFooter from './FixedFooter'; -import OptionsList from './OptionsList'; -import Text from './Text'; -import compose from '../libs/compose'; -import CONST from '../CONST'; -import styles from '../styles/styles'; -import optionPropTypes from './optionPropTypes'; -import withLocalize, {withLocalizePropTypes} from './withLocalize'; -import TextInput from './TextInput'; -import ArrowKeyFocusManager from './ArrowKeyFocusManager'; -import KeyboardShortcut from '../libs/KeyboardShortcut'; -import ONYXKEYS from '../ONYXKEYS'; -import FullScreenLoadingIndicator from './FullscreenLoadingIndicator'; +import Button from '../Button'; +import FixedFooter from '../FixedFooter'; +import OptionsList from '../OptionsList'; +import Text from '../Text'; +import compose from '../../libs/compose'; +import CONST from '../../CONST'; +import styles from '../../styles/styles'; +import withLocalize from '../withLocalize'; +import TextInput from '../TextInput'; +import ArrowKeyFocusManager from '../ArrowKeyFocusManager'; +import KeyboardShortcut from '../../libs/KeyboardShortcut'; +import ONYXKEYS from '../../ONYXKEYS'; +import FullScreenLoadingIndicator from '../FullscreenLoadingIndicator'; +import {propTypes as optionsSelectorPropTypes, defaultProps as optionsSelectorDefaultProps} from './optionsSelectorPropTypes'; const propTypes = { - /** Whether we should wait before focusing the TextInput, useful when using transitions */ + /** Whether we should wait before focusing the TextInput, useful when using transitions on Android */ shouldDelayFocus: PropTypes.bool, - /** Callback to fire when a row is tapped */ - onSelectRow: PropTypes.func, - - /** Sections for the section list */ - sections: PropTypes.arrayOf(PropTypes.shape({ - /** Title of the section */ - title: PropTypes.string, - - /** The initial index of this section given the total number of options in each section's data array */ - indexOffset: PropTypes.number, - - /** Array of options */ - data: PropTypes.arrayOf(optionPropTypes), - - /** Whether this section should show or not */ - shouldShow: PropTypes.bool, - - /** Whether this section items disabled for selection */ - isDisabled: PropTypes.bool, - })).isRequired, - - /** Value in the search input field */ - value: PropTypes.string.isRequired, - - /** Callback fired when text changes */ - onChangeText: PropTypes.func.isRequired, - - /** Label to display for the text input */ - textInputLabel: PropTypes.string, - - /** Optional placeholder text for the selector */ - placeholderText: PropTypes.string, - - /** Options that have already been selected */ - selectedOptions: PropTypes.arrayOf(optionPropTypes), - - /** Optional header message */ - headerMessage: PropTypes.string, - - /** Whether we can select multiple options */ - canSelectMultipleOptions: PropTypes.bool, - - /** Whether any section headers should be visible */ - hideSectionHeaders: PropTypes.bool, - - /** Whether to allow arrow key actions on the list */ - disableArrowKeysActions: PropTypes.bool, - - /** Whether to disable interactivity of option rows */ - isDisabled: PropTypes.bool, - - /** A flag to indicate whether to show additional optional states, such as pin and draft icons */ - hideAdditionalOptionStates: PropTypes.bool, - - /** Force the text style to be the unread style on all rows */ - forceTextUnreadStyle: PropTypes.bool, - - /** Whether to show the title tooltip */ - showTitleTooltip: PropTypes.bool, - - /** Whether to focus the textinput after an option is selected */ - shouldFocusOnSelectRow: PropTypes.bool, - - /** Whether to autofocus the search input on mount */ - autoFocus: PropTypes.bool, - - /** Should a button be shown if a selection is made (only relevant if canSelectMultipleOptions is true) */ - shouldShowConfirmButton: PropTypes.bool, - - /** Text to show in the confirm button (only visible if multiple options are selected) */ - confirmButtonText: PropTypes.string, - - /** Function to execute if the confirm button is pressed */ - onConfirmSelection: PropTypes.func, - - /** If true, the text input will be below the options in the selector, not above. */ - shouldTextInputAppearBelowOptions: PropTypes.bool, - - /** If true, a message will display in the footer if the app is offline. */ - shouldShowOfflineMessage: PropTypes.bool, - - /** Custom content to display in the footer instead of the default button. */ - footerContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]), - - /** Hover style for options in the OptionsList */ - optionHoveredStyle: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]), - - /** Whether to show options list */ - shouldShowOptions: PropTypes.bool, - - ...withLocalizePropTypes, + ...optionsSelectorPropTypes, }; const defaultProps = { shouldDelayFocus: false, - onSelectRow: () => {}, - textInputLabel: '', - placeholderText: '', - selectedOptions: [], - headerMessage: '', - canSelectMultipleOptions: false, - hideSectionHeaders: false, - hideAdditionalOptionStates: false, - forceTextUnreadStyle: false, - showTitleTooltip: false, - shouldFocusOnSelectRow: false, - autoFocus: true, - shouldShowConfirmButton: false, - confirmButtonText: undefined, - onConfirmSelection: () => {}, - shouldTextInputAppearBelowOptions: false, - shouldShowOfflineMessage: false, - footerContent: undefined, - optionHoveredStyle: styles.hoveredComponentBG, - shouldShowOptions: true, - disableArrowKeysActions: false, - isDisabled: false, + ...optionsSelectorDefaultProps, }; -class OptionsSelector extends Component { +class BaseOptionsSelector extends Component { constructor(props) { super(props); @@ -427,8 +316,8 @@ class OptionsSelector extends Component { } } -OptionsSelector.defaultProps = defaultProps; -OptionsSelector.propTypes = propTypes; +BaseOptionsSelector.defaultProps = defaultProps; +BaseOptionsSelector.propTypes = propTypes; export default compose( withLocalize, withOnyx({ @@ -436,4 +325,4 @@ export default compose( key: ONYXKEYS.NETWORK, }, }), -)(OptionsSelector); +)(BaseOptionsSelector); diff --git a/src/components/OptionsSelector/index.android.js b/src/components/OptionsSelector/index.android.js new file mode 100644 index 000000000000..4daf25deee2b --- /dev/null +++ b/src/components/OptionsSelector/index.android.js @@ -0,0 +1,18 @@ +import React, {forwardRef} from 'react'; +import BaseOptionsSelector from './BaseOptionsSelector'; +import {propTypes, defaultProps} from './optionsSelectorPropTypes'; + +const OptionsSelector = forwardRef((props, ref) => ( + +)); + +OptionsSelector.propTypes = propTypes; +OptionsSelector.defaultProps = defaultProps; +OptionsSelector.displayName = 'OptionsSelector'; + +export default OptionsSelector; diff --git a/src/components/OptionsSelector/index.js b/src/components/OptionsSelector/index.js new file mode 100644 index 000000000000..14495ecae24d --- /dev/null +++ b/src/components/OptionsSelector/index.js @@ -0,0 +1,17 @@ +import React, {forwardRef} from 'react'; +import BaseOptionsSelector from './BaseOptionsSelector'; +import {propTypes, defaultProps} from './optionsSelectorPropTypes'; + +const OptionsSelector = forwardRef((props, ref) => ( + +)); + +OptionsSelector.propTypes = propTypes; +OptionsSelector.defaultProps = defaultProps; +OptionsSelector.displayName = 'OptionsSelector'; + +export default OptionsSelector; diff --git a/src/components/OptionsSelector/optionsSelectorPropTypes.js b/src/components/OptionsSelector/optionsSelectorPropTypes.js new file mode 100644 index 000000000000..ece04dad7530 --- /dev/null +++ b/src/components/OptionsSelector/optionsSelectorPropTypes.js @@ -0,0 +1,125 @@ +import PropTypes from 'prop-types'; +import optionPropTypes from '../optionPropTypes'; +import {withLocalizePropTypes} from '../withLocalize'; +import styles from '../../styles/styles'; + +const propTypes = { + /** Callback to fire when a row is tapped */ + onSelectRow: PropTypes.func, + + /** Sections for the section list */ + sections: PropTypes.arrayOf(PropTypes.shape({ + /** Title of the section */ + title: PropTypes.string, + + /** The initial index of this section given the total number of options in each section's data array */ + indexOffset: PropTypes.number, + + /** Array of options */ + data: PropTypes.arrayOf(optionPropTypes), + + /** Whether this section should show or not */ + shouldShow: PropTypes.bool, + + /** Whether this section items disabled for selection */ + isDisabled: PropTypes.bool, + })).isRequired, + + /** Value in the search input field */ + value: PropTypes.string.isRequired, + + /** Callback fired when text changes */ + onChangeText: PropTypes.func.isRequired, + + /** Label to display for the text input */ + textInputLabel: PropTypes.string, + + /** Optional placeholder text for the selector */ + placeholderText: PropTypes.string, + + /** Options that have already been selected */ + selectedOptions: PropTypes.arrayOf(optionPropTypes), + + /** Optional header message */ + headerMessage: PropTypes.string, + + /** Whether we can select multiple options */ + canSelectMultipleOptions: PropTypes.bool, + + /** Whether any section headers should be visible */ + hideSectionHeaders: PropTypes.bool, + + /** Whether to allow arrow key actions on the list */ + disableArrowKeysActions: PropTypes.bool, + + /** Whether to disable interactivity of option rows */ + isDisabled: PropTypes.bool, + + /** A flag to indicate whether to show additional optional states, such as pin and draft icons */ + hideAdditionalOptionStates: PropTypes.bool, + + /** Force the text style to be the unread style on all rows */ + forceTextUnreadStyle: PropTypes.bool, + + /** Whether to show the title tooltip */ + showTitleTooltip: PropTypes.bool, + + /** Whether to focus the textinput after an option is selected */ + shouldFocusOnSelectRow: PropTypes.bool, + + /** Whether to autofocus the search input on mount */ + autoFocus: PropTypes.bool, + + /** Should a button be shown if a selection is made (only relevant if canSelectMultipleOptions is true) */ + shouldShowConfirmButton: PropTypes.bool, + + /** Text to show in the confirm button (only visible if multiple options are selected) */ + confirmButtonText: PropTypes.string, + + /** Function to execute if the confirm button is pressed */ + onConfirmSelection: PropTypes.func, + + /** If true, the text input will be below the options in the selector, not above. */ + shouldTextInputAppearBelowOptions: PropTypes.bool, + + /** If true, a message will display in the footer if the app is offline. */ + shouldShowOfflineMessage: PropTypes.bool, + + /** Custom content to display in the footer instead of the default button. */ + footerContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]), + + /** Hover style for options in the OptionsList */ + optionHoveredStyle: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]), + + /** Whether to show options list */ + shouldShowOptions: PropTypes.bool, + + ...withLocalizePropTypes, +}; + +const defaultProps = { + onSelectRow: () => {}, + textInputLabel: '', + placeholderText: '', + selectedOptions: [], + headerMessage: '', + canSelectMultipleOptions: false, + hideSectionHeaders: false, + hideAdditionalOptionStates: false, + forceTextUnreadStyle: false, + showTitleTooltip: false, + shouldFocusOnSelectRow: false, + autoFocus: true, + shouldShowConfirmButton: false, + confirmButtonText: undefined, + onConfirmSelection: () => {}, + shouldTextInputAppearBelowOptions: false, + shouldShowOfflineMessage: false, + footerContent: undefined, + optionHoveredStyle: styles.hoveredComponentBG, + shouldShowOptions: true, + disableArrowKeysActions: false, + isDisabled: false, +}; + +export {propTypes, defaultProps}; diff --git a/src/pages/NewChatPage.js b/src/pages/NewChatPage.js index 0e55bdbccfbc..610782ba0d33 100755 --- a/src/pages/NewChatPage.js +++ b/src/pages/NewChatPage.js @@ -224,7 +224,6 @@ class NewChatPage extends Component { {!didScreenTransitionEnd && } {didScreenTransitionEnd && ( diff --git a/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js b/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js index 23453ecf9690..a1e8b0d3bee6 100755 --- a/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js +++ b/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsRequest.js @@ -138,7 +138,6 @@ class IOUParticipantsRequest extends Component { headerMessage={headerMessage} hideAdditionalOptionStates forceTextUnreadStyle - shouldDelayFocus /> ); } diff --git a/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsSplit.js b/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsSplit.js index ca503ce24f6b..273061aa4e3c 100755 --- a/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsSplit.js +++ b/src/pages/iou/steps/IOUParticipantsPage/IOUParticipantsSplit.js @@ -226,7 +226,6 @@ class IOUParticipantsSplit extends Component { headerMessage={headerMessage} hideAdditionalOptionStates forceTextUnreadStyle - shouldDelayFocus shouldShowConfirmButton confirmButtonText={this.props.translate('common.next')} onConfirmSelection={this.finalizeParticipants} From eab4c308819822e7dad8f4b8bb0b6d3405b6cbf2 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Tue, 2 Aug 2022 14:22:55 +0530 Subject: [PATCH 02/33] rm unnecessary podfile changes --- ios/NewExpensify.xcodeproj/project.pbxproj | 4 +- ios/Podfile.lock | 44 +++++++++++----------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ios/NewExpensify.xcodeproj/project.pbxproj b/ios/NewExpensify.xcodeproj/project.pbxproj index abfa05936a94..a9fad31433f7 100644 --- a/ios/NewExpensify.xcodeproj/project.pbxproj +++ b/ios/NewExpensify.xcodeproj/project.pbxproj @@ -940,7 +940,7 @@ COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1001,7 +1001,7 @@ COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a47bc084c600..1aea6abedf1a 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -443,7 +443,7 @@ PODS: - React-Core - react-native-document-picker (8.0.0): - React-Core - - react-native-flipper (0.146.1): + - react-native-flipper (0.117.0): - React-Core - react-native-image-picker (4.7.3): - React-Core @@ -916,9 +916,9 @@ SPEC CHECKSUMS: Onfido: a1645279c7b6ca8de5bb95d27af53c523ffd731c onfido-react-native-sdk: cfdfd1d4acf53e469a82b9684f92982d39744bb8 OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b - Permission-LocationAccuracy: 76669f87b4c276f5ae803cc0ddd1862a4c0e9dd8 - Permission-LocationAlways: a274bc04bb386068782468dbdaca3859f51634ca - Permission-LocationWhenInUse: 3a2b0dbc167d79e8e920a4377ff9520cdc108407 + Permission-LocationAccuracy: e8adff9ede1b23b43b7054a4500113d515fc87a8 + Permission-LocationAlways: 7f7f373d086af7a81b2f4f20d65d29266ca2043b + Permission-LocationWhenInUse: 3ae82a9feb5da4e94e386dba17c7dd3531af9feb Plaid: 4d8d4ff0a6d627f5faf3055a9cba8890ea6b5076 PromisesObjC: 99b6f43f9e1044bd87a95a60beff28c2c44ddb72 Protobuf: 9e88c1e667d75aa2491d211f26ccddde4e8ad4cf @@ -935,19 +935,19 @@ SPEC CHECKSUMS: React-jsiexecutor: 94ce921e1d8ce7023366873ec371f3441383b396 React-jsinspector: d0374f7509d407d2264168b6d0fad0b54e300b85 React-logger: 933f80c97c633ee8965d609876848148e3fef438 - react-native-cameraroll: 2957f2bce63ae896a848fbe0d5352c1bd4d20866 + react-native-cameraroll: 60ac50a5209777cbccfe8d7a62d0743a9da87060 react-native-config: 6502b1879f97ed5ac570a029961fc35ea606cd14 - react-native-document-picker: 429972f7ece4463aa5bcdd789622b3a674a3c5d1 - react-native-flipper: 4bfe0a324e663f1ae2f76ad0da75673de6895efe - react-native-image-picker: 4e6008ad8c2321622affa2c85432a5ebd02d480c - react-native-netinfo: 3671b091c4843fda5e153612866ef4024b8f5d62 + react-native-document-picker: 772d04a4bc5c35da9abe27b08ac271420ae3f9ef + react-native-flipper: cd9eabd8917104c1bbdca2621717cdca3b2addef + react-native-image-picker: ae1202414bd5c37c00b2a701daa5b6194a06b7d9 + react-native-netinfo: ebbcd8fbe1a0ce7035e43cd18c5a545dcb93dd08 react-native-pdf: 4b5a9e4465a6a3b399e91dc4838eb44ddf716d1f - react-native-performance: 6bd6cfac80594775fb782405fceaaf206becf53b - react-native-plaid-link-sdk: 6ce5b2453b6a09ba3e975975c6a3fc7013a064fe - react-native-progress-bar-android: be43138ab7da30d51fc038bafa98e9ed594d0c40 - react-native-progress-view: 21b1e29e70c7559c16c9e0a04c4adc19fce6ede2 - react-native-safe-area-context: 79fea126c6830c85f65947c223a5e3058a666937 - react-native-webview: 380c1a03ec94b7ed764dac8db1e7c9952d08c93a + react-native-performance: 8edfa2bbc9a2af4a02f01d342118e413a95145e0 + react-native-plaid-link-sdk: 9e0ebdaed648a237b36d5f6f6292b5147af92da7 + react-native-progress-bar-android: ce95a69f11ac580799021633071368d08aaf9ad8 + react-native-progress-view: 5816e8a6be812c2b122c6225a2a3db82d9008640 + react-native-safe-area-context: 01158a92c300895d79dee447e980672dc3fb85a6 + react-native-webview: 77ee909f73e1fcab76380f7dcc3344771fe61bd8 React-perflogger: 93075d8931c32cd1fce8a98c15d2d5ccc4d891bd React-RCTActionSheet: 7d3041e6761b4f3044a37079ddcb156575fb6d89 React-RCTAnimation: 743e88b55ac62511ae5c2e22803d4f503f2a3a13 @@ -961,28 +961,28 @@ SPEC CHECKSUMS: React-runtimeexecutor: dec32ee6f2e2a26e13e58152271535fadff5455a ReactCommon: 57b69f6383eafcbd7da625bfa6003810332313c4 rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba - RNCAsyncStorage: 56a3355a10b5d660c48c6e37325ac85ebfd09885 - RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495 - RNCMaskedView: fc29d354a40316a990e8fb46391f08aea829c3aa + RNCAsyncStorage: 8324611026e8dc3706f829953aa6e3899f581589 + RNCClipboard: 5e299c6df8e0c98f3d7416b86ae563d3a9f768a3 + RNCMaskedView: 138134c4d8a9421b4f2bf39055a79aa05c2d47b1 RNCPicker: f6c760d4b314585ff35165d8640d7917ae30afb1 - RNDateTimePicker: 7658208086d86d09e1627b5c34ba0cf237c60140 + RNDateTimePicker: c9911be59b1f8670b9f244b85af3a7c295e175ed RNFastImage: 1f2cab428712a4baaf78d6169eaec7f622556dd7 RNFBAnalytics: 8ba84c2d31c64374d054c8621b998f25145ffddc RNFBApp: 64c90ab78b6010ed5c3ade026dfe5ff6442c21fd RNFBCrashlytics: 1de18b8cc36d9bcf86407c4a354399228cc84a61 RNFBPerf: e3a7269f573a4787810a32de51647cdcbe08dfb4 RNGestureHandler: 9b7e605a741412e20e13c512738a31bd1611759b - RNPermissions: 4c8a37b4dde50f1f152bf8cd08c4a43d2355829e + RNPermissions: eb94f9fdc0a8ecd02fcce0676d56ffb1395d41e1 RNReactNativeHapticFeedback: b83bfb4b537bdd78eb4f6ffe63c6884f7b049ead RNReanimated: da3860204e5660c0dd66739936732197d359d753 RNScreens: 522705f2e5c9d27efb17f24aceb2bf8335bc7b8e RNSVG: ce9d996113475209013317e48b05c21ee988d42e SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d - urbanairship-react-native: ee53526e1f81c5170863dd3e039df7f98730ef53 + urbanairship-react-native: 60b4b4235838ff109a2639b639e2ef01d54ad455 Yoga: e7dc4e71caba6472ff48ad7d234389b91dadc280 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a PODFILE CHECKSUM: 431123d7514c52fa4516724b89c20d02c87ad8c8 -COCOAPODS: 1.11.3 +COCOAPODS: 1.11.2 From 76c92a6c5b9f8cd5055924280274008fb7633910 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Tue, 2 Aug 2022 14:24:41 +0530 Subject: [PATCH 03/33] formatting --- src/components/OptionsSelector/BaseOptionsSelector.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js index 7935e78f396e..fa4cf7f37378 100755 --- a/src/components/OptionsSelector/BaseOptionsSelector.js +++ b/src/components/OptionsSelector/BaseOptionsSelector.js @@ -318,6 +318,7 @@ class BaseOptionsSelector extends Component { BaseOptionsSelector.defaultProps = defaultProps; BaseOptionsSelector.propTypes = propTypes; + export default compose( withLocalize, withOnyx({ From ddc7a04f370dd4029364d8a1dc725ac272cf8d31 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Wed, 3 Aug 2022 12:48:37 +0200 Subject: [PATCH 04/33] Retry undim animation --- src/components/OpacityView.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/components/OpacityView.js b/src/components/OpacityView.js index 162aa6fa585e..66d99dc99bcd 100644 --- a/src/components/OpacityView.js +++ b/src/components/OpacityView.js @@ -21,6 +21,7 @@ class OpacityView extends React.Component { constructor(props) { super(props); this.opacity = new Animated.Value(1); + this.undim = this.undim.bind(this); } componentDidUpdate(prevProps) { @@ -33,14 +34,25 @@ class OpacityView extends React.Component { } if (prevProps.shouldDim && !this.props.shouldDim) { - Animated.timing(this.opacity, { - toValue: 1, - duration: 50, - useNativeDriver: true, - }).start(); + this.undim() } } + undim() { + Animated.timing(this.opacity, { + toValue: 1, + duration: 50, + useNativeDriver: true, + }).start(({finished}) => { + // If animation doesn't finish because Animation.stop was called + // (e.g. because it was interrupted by a gesture or another animation), + // restart animation so we always make sure the component gets completely shown. + if (!finished) { + this.undim(); + } + }); + } + render() { return ( Date: Wed, 3 Aug 2022 12:48:56 +0200 Subject: [PATCH 05/33] Add semicolon --- src/components/OpacityView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/OpacityView.js b/src/components/OpacityView.js index 66d99dc99bcd..867d936631e8 100644 --- a/src/components/OpacityView.js +++ b/src/components/OpacityView.js @@ -34,7 +34,7 @@ class OpacityView extends React.Component { } if (prevProps.shouldDim && !this.props.shouldDim) { - this.undim() + this.undim(); } } From b216e4dc3bc6fdc272088bf17f9143d434afaf5c Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Wed, 3 Aug 2022 12:49:22 +0200 Subject: [PATCH 06/33] Prefer early return --- src/components/OpacityView.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/OpacityView.js b/src/components/OpacityView.js index 867d936631e8..9b6ebcc018b4 100644 --- a/src/components/OpacityView.js +++ b/src/components/OpacityView.js @@ -47,9 +47,10 @@ class OpacityView extends React.Component { // If animation doesn't finish because Animation.stop was called // (e.g. because it was interrupted by a gesture or another animation), // restart animation so we always make sure the component gets completely shown. - if (!finished) { - this.undim(); + if (finished) { + return; } + this.undim(); }); } From ee8a2f35c595af80e2f287b33cc0e78a3f2aa292 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 3 Aug 2022 09:02:41 -1000 Subject: [PATCH 07/33] Fix only reference in shouldComponentUpdate --- src/pages/home/report/ReportActionsView.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index ed80f0235ae7..8dcba0311a84 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -156,11 +156,11 @@ class ReportActionsView extends React.Component { } // If the new marker has changed places, update the component. - if (nextProps.report.newMarkerSequenceNumber !== this.props.report.newMarkerSequenceNumber) { + if (lodashGet(nextProps.report, 'newMarkerSequenceNumber') !== lodashGet(this.props.report, 'newMarkerSequenceNumber')) { return true; } - if (nextProps.network.isOffline !== this.props.network.isOffline) { + if (lodashGet(nextProps.network, 'isOffline') !== lodashGet(this.props.network, 'isOffline')) { return true; } @@ -188,7 +188,7 @@ class ReportActionsView extends React.Component { return true; } - if (this.props.report.hasOutstandingIOU !== nextProps.report.hasOutstandingIOU) { + if (lodashGet(this.props.report, 'hasOutstandingIOU') !== lodashGet(nextProps.report, 'hasOutstandingIOU')) { return true; } From 7581104180437e6782132dbeab7e4ced77ea6d78 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 3 Aug 2022 14:25:31 -1000 Subject: [PATCH 08/33] Fix some propTypes errors --- src/libs/OptionsListUtils.js | 57 ++++++++++++------- src/libs/actions/App.js | 8 ++- src/pages/home/ReportScreen.js | 3 +- .../sidebar/SidebarScreen/sidebarPropTypes.js | 6 +- 4 files changed, 50 insertions(+), 24 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index ad98e8fac8f5..fe4f67d5c954 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -3,6 +3,7 @@ import _ from 'underscore'; import Onyx from 'react-native-onyx'; import lodashGet from 'lodash/get'; import lodashOrderBy from 'lodash/orderBy'; +import lodashMemoize from 'lodash/memoize'; import Str from 'expensify-common/lib/str'; import ONYXKEYS from '../ONYXKEYS'; import CONST from '../CONST'; @@ -11,6 +12,8 @@ import * as Localize from './Localize'; import Permissions from './Permissions'; import * as CollectionUtils from './CollectionUtils'; +const memoizedOrderBy = lodashMemoize(lodashOrderBy); + /** * OptionsListUtils is used to build a list options passed to the OptionsList component. Several different UI views can * be configured to display different results based on the options passed to the private getOptions() method. Public @@ -154,6 +157,8 @@ function getParticipantNames(personalDetailList) { return participantNames; } +const getMemoizedParticipantNames = _.memoize(getParticipantNames); + /** * Returns a string with all relevant search terms. * Default should be serachable by policy/domain name but not by participants. @@ -212,7 +217,7 @@ function hasReportDraftComment(report) { * @param {Boolean} [options.forcePolicyNamePreview] * @returns {Object} */ -function createOption(logins, personalDetails, report, { +function generateOption(logins, personalDetails, report, { showChatPreviewLine = false, forcePolicyNamePreview = false, }) { const isChatRoom = ReportUtils.isChatRoom(report); @@ -289,6 +294,8 @@ function createOption(logins, personalDetails, report, { }; } +const createOption = lodashMemoize(generateOption); + /** * Searches for a match when provided with a value * @@ -342,6 +349,8 @@ function isCurrentUser(userDetails) { return result; } +const loginArrayMap = {}; + /** * Build the options * @@ -390,8 +399,9 @@ function getOptions(reports, personalDetails, activeReportID, { if (sortByAlphaAsc) { sortProperty = ['reportName']; } + const sortDirection = [sortByAlphaAsc ? 'asc' : 'desc']; - let orderedReports = lodashOrderBy(reports, sortProperty, sortDirection); + let orderedReports = memoizedOrderBy(reports, sortProperty, sortDirection); // Move the archived Rooms to the last orderedReports = _.sortBy(orderedReports, report => ReportUtils.isArchivedRoom(report)); @@ -462,16 +472,19 @@ function getOptions(reports, personalDetails, activeReportID, { })); }); - let allPersonalDetailsOptions = _.map(personalDetails, personalDetail => ( - createOption([personalDetail.login], personalDetails, reportMapForLogins[personalDetail.login], { + let allPersonalDetailsOptions = _.map(personalDetails, (personalDetail) => { + if (!loginArrayMap[personalDetail.login]) { + loginArrayMap[personalDetail.login] = [personalDetail.login]; + } + return createOption(loginArrayMap[personalDetail.login], personalDetails, reportMapForLogins[personalDetail.login], { showChatPreviewLine, forcePolicyNamePreview, - }) - )); + }); + }); if (sortPersonalDetailsByAlphaAsc) { // PersonalDetails should be ordered Alphabetically by default - https://github.com/Expensify/App/issues/8220#issuecomment-1104009435 - allPersonalDetailsOptions = lodashOrderBy(allPersonalDetailsOptions, [personalDetail => personalDetail.text.toLowerCase()], 'asc'); + allPersonalDetailsOptions = memoizedOrderBy(allPersonalDetailsOptions, [personalDetail => personalDetail.text.toLowerCase()], 'asc'); } // Always exclude already selected options and the currently logged in user @@ -502,7 +515,7 @@ function getOptions(reports, personalDetails, activeReportID, { // Finally check to see if this option is a match for the provided search string if we have one const {searchText, participantsList, isChatRoom} = reportOption; - const participantNames = getParticipantNames(participantsList); + const participantNames = getMemoizedParticipantNames(participantsList); if (searchValue && !isSearchStringMatch(searchValue, searchText, participantNames, isChatRoom)) { continue; } @@ -529,20 +542,20 @@ function getOptions(reports, personalDetails, activeReportID, { // If we are prioritizing reports with draft comments, add them before the normal recent report options // and sort them by report name. if (prioritizeReportsWithDraftComments) { - const sortedDraftReports = lodashOrderBy(draftReportOptions, ['text'], ['asc']); + const sortedDraftReports = memoizedOrderBy(draftReportOptions, ['text'], ['asc']); recentReportOptions = sortedDraftReports.concat(recentReportOptions); } // If we are prioritizing IOUs the user owes, add them before the normal recent report options and reports // with draft comments. if (prioritizeIOUDebts) { - const sortedIOUReports = lodashOrderBy(iouDebtReportOptions, ['iouReportAmount'], ['desc']); + const sortedIOUReports = memoizedOrderBy(iouDebtReportOptions, ['iouReportAmount'], ['desc']); recentReportOptions = sortedIOUReports.concat(recentReportOptions); } // If we are prioritizing our pinned reports then shift them to the front and sort them by report name if (prioritizePinnedReports) { - const sortedPinnedReports = lodashOrderBy(pinnedReportOptions, ['text'], ['asc']); + const sortedPinnedReports = memoizedOrderBy(pinnedReportOptions, ['text'], ['asc']); recentReportOptions = sortedPinnedReports.concat(recentReportOptions); } @@ -561,7 +574,7 @@ function getOptions(reports, personalDetails, activeReportID, { return; } const {searchText, participantsList, isChatRoom} = personalDetailOption; - const participantNames = getParticipantNames(participantsList); + const participantNames = getMemoizedParticipantNames(participantsList); if (searchValue && !isSearchStringMatch(searchValue, searchText, participantNames, isChatRoom)) { return; } @@ -595,7 +608,7 @@ function getOptions(reports, personalDetails, activeReportID, { // When sortByReportTypeInSearch is true, recentReports will be returned with all the reports including personalDetailsOptions in the correct Order. recentReportOptions.push(...personalDetailsOptions); personalDetailsOptions = []; - recentReportOptions = lodashOrderBy(recentReportOptions, [(option) => { + recentReportOptions = memoizedOrderBy(recentReportOptions, [(option) => { if (option.isChatRoom || option.isArchivedRoom) { return 3; } @@ -748,13 +761,15 @@ function getMemberInviteOptions( * @param {Array} betas * @returns {Object} */ -function getSidebarOptions( - reports, - personalDetails, - activeReportID, - priorityMode, - betas, -) { +function calculateSidebarOptions(...args) { + const { + reports, + personalDetails, + activeReportID, + priorityMode, + betas, + } = args; + let sideBarOptions = { prioritizeIOUDebts: true, prioritizeReportsWithDraftComments: true, @@ -777,6 +792,8 @@ function getSidebarOptions( }); } +const getSidebarOptions = lodashMemoize(calculateSidebarOptions); + /** * Helper method that returns the text to be used for the header's message and title (if any) * diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index b36edc546300..07b225d65244 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -39,7 +39,13 @@ Onyx.connect({ let myPersonalDetails; Onyx.connect({ key: ONYXKEYS.PERSONAL_DETAILS, - callback: val => myPersonalDetails = val[currentUserEmail], + callback: (val) => { + if (!val || !currentUserEmail) { + return; + } + + myPersonalDetails = val[currentUserEmail]; + }, }); const allPolicies = {}; diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 045cf3af9271..5a27c0836144 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -79,7 +79,7 @@ const propTypes = { /** The type of the policy */ type: PropTypes.string, - })).isRequired, + })), /** Information about the network */ network: networkPropTypes.isRequired, @@ -99,6 +99,7 @@ const defaultProps = { isComposerFullSize: false, betas: [], isLoadingInitialReportActions: false, + policies: {}, }; /** diff --git a/src/pages/home/sidebar/SidebarScreen/sidebarPropTypes.js b/src/pages/home/sidebar/SidebarScreen/sidebarPropTypes.js index de78dfcb03ff..f6f0c5242a07 100644 --- a/src/pages/home/sidebar/SidebarScreen/sidebarPropTypes.js +++ b/src/pages/home/sidebar/SidebarScreen/sidebarPropTypes.js @@ -8,10 +8,10 @@ const sidebarPropTypes = { allPolicies: PropTypes.shape({ /** The policy name */ name: PropTypes.string, - }).isRequired, + }), /* Beta features list */ - betas: PropTypes.arrayOf(PropTypes.string).isRequired, + betas: PropTypes.arrayOf(PropTypes.string), /* Is workspace is being created by the user? */ isCreatingWorkspace: PropTypes.bool, @@ -23,6 +23,8 @@ const sidebarPropTypes = { const sidebarDefaultProps = { isCreatingWorkspace: false, + allPolicies: {}, + betas: [], }; export {sidebarPropTypes, sidebarDefaultProps}; From 59aaced7cee5caedbbc1672bc4c2880c0c42c5e5 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 3 Aug 2022 14:43:41 -1000 Subject: [PATCH 09/33] remove unneeded --- src/libs/OptionsListUtils.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index fe4f67d5c954..ffc9c2c8f899 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -157,8 +157,6 @@ function getParticipantNames(personalDetailList) { return participantNames; } -const getMemoizedParticipantNames = _.memoize(getParticipantNames); - /** * Returns a string with all relevant search terms. * Default should be serachable by policy/domain name but not by participants. @@ -515,7 +513,7 @@ function getOptions(reports, personalDetails, activeReportID, { // Finally check to see if this option is a match for the provided search string if we have one const {searchText, participantsList, isChatRoom} = reportOption; - const participantNames = getMemoizedParticipantNames(participantsList); + const participantNames = getParticipantNames(participantsList); if (searchValue && !isSearchStringMatch(searchValue, searchText, participantNames, isChatRoom)) { continue; } @@ -574,7 +572,7 @@ function getOptions(reports, personalDetails, activeReportID, { return; } const {searchText, participantsList, isChatRoom} = personalDetailOption; - const participantNames = getMemoizedParticipantNames(participantsList); + const participantNames = getParticipantNames(participantsList); if (searchValue && !isSearchStringMatch(searchValue, searchText, participantNames, isChatRoom)) { return; } @@ -761,15 +759,7 @@ function getMemberInviteOptions( * @param {Array} betas * @returns {Object} */ -function calculateSidebarOptions(...args) { - const { - reports, - personalDetails, - activeReportID, - priorityMode, - betas, - } = args; - +function calculateSidebarOptions(reports, personalDetails, activeReportID, priorityMode, betas) { let sideBarOptions = { prioritizeIOUDebts: true, prioritizeReportsWithDraftComments: true, From 1445833de8e70be7e2c54b0c9b02d2129b0c212a Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Wed, 3 Aug 2022 15:33:35 -1000 Subject: [PATCH 10/33] Add some comments to explain what is happening --- src/libs/OptionsListUtils.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index ffc9c2c8f899..2adaf3066006 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -12,6 +12,7 @@ import * as Localize from './Localize'; import Permissions from './Permissions'; import * as CollectionUtils from './CollectionUtils'; +// We are memoizing some slow functions to make refreshing the options more performant const memoizedOrderBy = lodashMemoize(lodashOrderBy); /** @@ -215,7 +216,7 @@ function hasReportDraftComment(report) { * @param {Boolean} [options.forcePolicyNamePreview] * @returns {Object} */ -function generateOption(logins, personalDetails, report, { +function createOption(logins, personalDetails, report, { showChatPreviewLine = false, forcePolicyNamePreview = false, }) { const isChatRoom = ReportUtils.isChatRoom(report); @@ -292,7 +293,8 @@ function generateOption(logins, personalDetails, report, { }; } -const createOption = lodashMemoize(generateOption); +// We are memoizing this to increase the performance when recalculating options +const memoizedCreateOption = lodashMemoize(createOption); /** * Searches for a match when provided with a value @@ -347,6 +349,8 @@ function isCurrentUser(userDetails) { return result; } +// We are storing a map of logins in the format {[login]: [login]} so that the memoized functions looking for an array with a login in it +// treat this like the same argument (because it will use the same reference). Memoization for personalDetails won't work properly without this. const loginArrayMap = {}; /** @@ -464,17 +468,19 @@ function getOptions(reports, personalDetails, activeReportID, { reportMapForLogins[logins[0]] = report; } const isSearchingSomeonesPolicyExpenseChat = !report.isOwnPolicyExpenseChat && searchValue !== ''; - allReportOptions.push(createOption(logins, personalDetails, report, { + allReportOptions.push(memoizedCreateOption(logins, personalDetails, report, { showChatPreviewLine, forcePolicyNamePreview: isPolicyExpenseChat ? isSearchingSomeonesPolicyExpenseChat : forcePolicyNamePreview, })); }); let allPersonalDetailsOptions = _.map(personalDetails, (personalDetail) => { + // We want to use the same argument reference when creating the personalDetails option as memoization won't work properly + // if we passed [personalDetail.login] directly (that would be a new argument since we'd initialize a new array) if (!loginArrayMap[personalDetail.login]) { loginArrayMap[personalDetail.login] = [personalDetail.login]; } - return createOption(loginArrayMap[personalDetail.login], personalDetails, reportMapForLogins[personalDetail.login], { + return memoizedCreateOption(loginArrayMap[personalDetail.login], personalDetails, reportMapForLogins[personalDetail.login], { showChatPreviewLine, forcePolicyNamePreview, }); @@ -595,7 +601,7 @@ function getOptions(reports, personalDetails, activeReportID, { const login = (Str.isValidPhone(searchValue) && !searchValue.includes('+')) ? `+${countryCodeByIP}${searchValue}` : searchValue; - userToInvite = createOption([login], personalDetails, null, { + userToInvite = memoizedCreateOption([login], personalDetails, null, { showChatPreviewLine, }); userToInvite.icons = [ReportUtils.getDefaultAvatar(login)]; From 4a601ac9e4b8eff88091ad3c1116bc2be0fd2e7d Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Thu, 4 Aug 2022 08:25:40 -1000 Subject: [PATCH 11/33] Add memoize-one as lodash doesnt work correctly --- package-lock.json | 163 +++++++++++++------------ package.json | 3 +- src/libs/OptionsListUtils.js | 61 +++++---- src/pages/home/sidebar/SidebarLinks.js | 1 + tests/unit/OptionsListUtilsTest.js | 25 ++-- 5 files changed, 134 insertions(+), 119 deletions(-) diff --git a/package-lock.json b/package-lock.json index 391e624dad25..dde2d9a15881 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21848,7 +21848,7 @@ "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, "@types/lodash": { @@ -22655,7 +22655,7 @@ "absolute-path": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/absolute-path/-/absolute-path-0.0.0.tgz", - "integrity": "sha512-HQiug4c+/s3WOvEnDRxXVmNtSG5s2gJM9r19BTcqjp7BWcE48PB+Y2G6jE65kqI0LpsQeMZygt/b60Gi4KxGyA==" + "integrity": "sha1-p4di+9rftSl76ZsV01p4Wy8JW/c=" }, "accepts": { "version": "1.3.7", @@ -22674,7 +22674,7 @@ "acorn-dynamic-import": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz", - "integrity": "sha512-GKp5tQ8h0KMPWIYGRHHXI1s5tUpZixZ3IHF2jAu42wSCf6In/G873s6/y4DdKdhWvzhu1T6mE1JgvnhAKqyYYQ==", + "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=", "requires": { "acorn": "^4.0.3" }, @@ -22682,7 +22682,7 @@ "acorn": { "version": "4.0.13", "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha512-fu2ygVGuMmlzG8ZeRJ0bvR41nsAkxxhbyk8bZ1SS521Z7vmgJFTQQlfz/Mp/nJexGBz+v8sC9bM6+lNgskt4Ug==" + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=" } } }, @@ -22825,7 +22825,7 @@ "align-text": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha512-GrTZLRpmp6wIC2ztrWW9MjjTgSKccffgFagbNDOX95/dcjEcYZibYTeaOntySQLcdw1ztBoFkviiUvTMbb9MYg==", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -23172,7 +23172,7 @@ "app-root-dir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/app-root-dir/-/app-root-dir-1.0.2.tgz", - "integrity": "sha512-jlpIfsOoNoafl92Sz//64uQHGSyMrD2vYG5d8o2a4qGvyNCvXur7bzIsWtAC/6flI2RYAp3kv8rsfBtaLm7w0g==", + "integrity": "sha1-OBh+wt6nV3//Az/8sSFyaS/24Rg=", "dev": true }, "appdirsjs": { @@ -23220,7 +23220,7 @@ "aria-query": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-3.0.0.tgz", - "integrity": "sha512-majUxHgLehQTeSA+hClx+DY09OVUqG3GtezWkF1krgLGNdlDu9l9V8DaqNMWbq4Eddc8wsyDA0hpDUtnYxQEXw==", + "integrity": "sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w=", "dev": true, "requires": { "ast-types-flow": "0.0.7", @@ -23230,7 +23230,7 @@ "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==" + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" }, "arr-flatten": { "version": "1.1.0", @@ -23240,12 +23240,12 @@ "arr-union": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==" + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" }, "array-filter": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", - "integrity": "sha512-VW0FpCIhjZdarWjIz8Vpva7U95fl2Jn+b+mmFFMLn8PIVscOQcAgEznwUzTEuUHuqZqIxwzRlcaN/urTFFQoiw==" + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=" }, "array-find-index": { "version": "1.0.2", @@ -23295,17 +23295,17 @@ "array-map": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", - "integrity": "sha512-123XMszMB01QKVptpDQ7x1m1pP5NmJIG1kbl0JSPPRezvwQChxAN0Gvzo7rvR1IZ2tOL2tmiy7kY/KKgnpVVpg==" + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=" }, "array-reduce": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", - "integrity": "sha512-8jR+StqaC636u7h3ye1co3lQRefgVVUQUhuAmRbDqIMeR2yuXzRvkCNQiQ5J/wbREmoBLNtp13dhaaVpZQDRUw==" + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=" }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { "array-uniq": "^1.0.1" @@ -23314,13 +23314,13 @@ "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", "dev": true }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==" + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" }, "array.prototype.flat": { "version": "1.2.5", @@ -23933,7 +23933,7 @@ "asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" }, "asar": { "version": "3.0.3", @@ -24015,13 +24015,13 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true }, "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==" + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" }, "ast-types": { "version": "0.14.2", @@ -24041,7 +24041,7 @@ "ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", - "integrity": "sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==", + "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", "dev": true }, "async": { @@ -24071,7 +24071,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, "at-least-node": { @@ -24135,7 +24135,7 @@ "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { "chalk": "^1.1.3", @@ -24146,19 +24146,19 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { "ansi-styles": "^2.2.1", @@ -24213,7 +24213,7 @@ "babel-helper-function-name": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha512-Oo6+e2iX+o9eVvJ9Y5eKL5iryeRdsIkwRYheCuhYdVHsdEQysbc2z2QkqCLIYnNxkT5Ss3ggrHdXiDI7Dhrn4Q==", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", "dev": true, "requires": { "babel-helper-get-function-arity": "^6.24.1", @@ -24226,7 +24226,7 @@ "babel-helper-get-function-arity": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha512-WfgKFX6swFB1jS2vo+DwivRN4NB8XUdM3ij0Y1gnC21y1tdBoe6xjVnd7NSI6alv+gZXCtJqvrTeMW3fR/c0ng==", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", "dev": true, "requires": { "babel-runtime": "^6.22.0", @@ -24598,7 +24598,7 @@ "babel-messages": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha512-Bl3ZiA+LjqaMtNYopA9TYE9HP1tQ+E5dLxE0XrAzcIJeK2UqF0/EaqXwBn9esd4UmTfEab+P+UYQ1GnioFIb/w==", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "dev": true, "requires": { "babel-runtime": "^6.22.0" @@ -24607,7 +24607,7 @@ "babel-plugin-add-react-displayname": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/babel-plugin-add-react-displayname/-/babel-plugin-add-react-displayname-0.0.5.tgz", - "integrity": "sha512-LY3+Y0XVDYcShHHorshrDbt4KFWL4bSeniCtl4SYZbask+Syngk1uMPCeN9+nSiZo6zX5s0RTq/J9Pnaaf/KHw==", + "integrity": "sha1-M51M3be2X9YtHfnbn+BN4TQSK9U=", "dev": true }, "babel-plugin-apply-mdx-type-prop": { @@ -25110,7 +25110,7 @@ "babel-plugin-syntax-class-properties": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", - "integrity": "sha512-chI3Rt9T1AbrQD1s+vxw3KcwC9yHtF621/MacuItITfZX344uhQoANjpoSJZleAmW2tjlolqB/f+h7jIqXa7pA==", + "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", "dev": true }, "babel-plugin-syntax-trailing-function-commas": { @@ -25121,7 +25121,7 @@ "babel-plugin-transform-class-properties": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", - "integrity": "sha512-n4jtBA3OYBdvG5PRMKsMXJXHfLYw/ZOmtxCLOOwz6Ro5XlrColkStLnz1AS1L2yfPA9BKJ1ZNlmVCLjAL9DSIg==", + "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", "dev": true, "requires": { "babel-helper-function-name": "^6.24.1", @@ -25133,7 +25133,7 @@ "babel-plugin-transform-remove-console": { "version": "6.9.4", "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz", - "integrity": "sha512-88blrUrMX3SPiGkT1GnvVY8E/7A+k6oj3MNvUtTIxJflFzXTw1bHkuJ/y039ouhFMp2prRn5cQGzokViYi1dsg==" + "integrity": "sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=" }, "babel-preset-current-node-syntax": { "version": "1.0.1", @@ -25202,7 +25202,7 @@ "babel-runtime": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { "core-js": "^2.4.0", @@ -25220,7 +25220,7 @@ "babel-template": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha512-PCOcLFW7/eazGUKIoqH97sO9A2UYMahsn/yRQ7uOk37iutwjq7ODtcTNF+iFDSHNfkctqsLRjLP7URnOx0T1fg==", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", "dev": true, "requires": { "babel-runtime": "^6.26.0", @@ -25233,7 +25233,7 @@ "babel-traverse": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha512-iSxeXx7apsjCHe9c7n8VtRXGzI2Bk1rBSOJgCCjfyXb6v1aCqE1KSEpq/8SXuVN8Ka/Rh1WDTF0MDzkvTA4MIA==", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", "dev": true, "requires": { "babel-code-frame": "^6.26.0", @@ -25273,7 +25273,7 @@ "babel-types": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g==", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "dev": true, "requires": { "babel-runtime": "^6.26.0", @@ -25360,7 +25360,7 @@ "base-64": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", - "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==" + "integrity": "sha1-eAqZyE59YAJgNhURxId2E78k9rs=" }, "base64-js": { "version": "1.3.1", @@ -25370,13 +25370,13 @@ "batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", "dev": true }, "batch-processor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/batch-processor/-/batch-processor-1.0.0.tgz", - "integrity": "sha512-xoLQD8gmmR32MeuBHgH0Tzd5PuSZx71ZsbhVxOCRbgktZEPe4SQy7s9Z50uPp0F/f7iw2XmkHN2xkgbMfckMDA==", + "integrity": "sha1-dclcMrdI4IUNEMKxaPa9vpiRrOg=", "dev": true }, "bcrypt-pbkdf": { @@ -25544,7 +25544,7 @@ "bonjour": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz", - "integrity": "sha512-RaVTblr+OnEli0r/ud8InrU7D+G0y6aJhlxaLa6Pwty4+xoxboF1BsUI45tujvRpbj9dQVoglChqonGAsjEBYg==", + "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", "dev": true, "requires": { "array-flatten": "^2.1.0", @@ -25558,7 +25558,7 @@ "boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" }, "boolean": { "version": "3.2.0", @@ -25695,7 +25695,7 @@ "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, "browser-process-hrtime": { "version": "1.0.0", @@ -25852,13 +25852,13 @@ "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", "dev": true }, "buffer-fill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==", + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", "dev": true }, "buffer-from": { @@ -25875,7 +25875,7 @@ "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, "builder-util": { "version": "22.13.1", @@ -26022,12 +26022,12 @@ "builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==" + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" }, "bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==" + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, "c8": { "version": "7.11.3", @@ -26305,13 +26305,13 @@ "call-me-maybe": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", "dev": true }, "caller-callsite": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", - "integrity": "sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ==", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", "requires": { "callsites": "^2.0.0" } @@ -26319,7 +26319,7 @@ "caller-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", - "integrity": "sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", "requires": { "caller-callsite": "^2.0.0" } @@ -26327,7 +26327,7 @@ "callsites": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==" + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=" }, "camel-case": { "version": "4.1.1", @@ -26373,7 +26373,7 @@ "camelize": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", - "integrity": "sha512-W2lPwkBkMZwFlPCXhIlYgxu+7gC/NUlCtdK652DAJ1JdgV0sTrvuPFshNPrFa1TY2JOkLhgdeEBplB4ezEa+xg==" + "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" }, "caniuse-lite": { "version": "1.0.30001252", @@ -26410,7 +26410,7 @@ "center-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha512-Baz3aNe2gd2LP2qk5U+sDk/m4oSuwSDcBfayTCTBoWpfIGO5XFxPmjILQII4NGiZjD6DoDI6kf7gKaxkf7s3VQ==", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", "requires": { "align-text": "^0.1.3", "lazy-cache": "^1.0.3" @@ -26544,7 +26544,7 @@ "chromium-pickle-js": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", - "integrity": "sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==", + "integrity": "sha1-BKEGZywYsIWrd02YPfo+oTjyIgU=", "dev": true }, "ci-info": { @@ -26634,7 +26634,7 @@ "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "requires": { "restore-cursor": "^2.0.0" } @@ -30323,7 +30323,7 @@ "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { "locate-path": "^2.0.0" @@ -30332,7 +30332,7 @@ "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { "p-locate": "^2.0.0", @@ -30351,7 +30351,7 @@ "p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { "p-limit": "^1.1.0" @@ -30360,13 +30360,13 @@ "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true } } @@ -31534,7 +31534,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } } @@ -31721,7 +31721,7 @@ "fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", "dev": true, "requires": { "pend": "~1.2.0" @@ -31846,7 +31846,7 @@ "filter-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", - "integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs=" + "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==" }, "finalhandler": { "version": "1.1.2", @@ -32817,7 +32817,7 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true } } @@ -38514,6 +38514,11 @@ "fs-monkey": "1.0.3" } }, + "memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" + }, "memoizerific": { "version": "1.11.3", "resolved": "https://registry.npmjs.org/memoizerific/-/memoizerific-1.11.3.tgz", @@ -41386,7 +41391,7 @@ "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true, "optional": true } @@ -42195,7 +42200,7 @@ "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", "dev": true }, "performance-now": { @@ -43140,7 +43145,7 @@ "proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", "dev": true, "optional": true }, @@ -43901,9 +43906,9 @@ } }, "react-native-onyx": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.10.tgz", - "integrity": "sha512-cWKb/LEDtVCeVoYP8OIbb2Xz4aYjqtRaDxHrWmSB5TtSeEQa0JztJzJt9EnTQ0+Xbc2VE0eHBBvBbWUrPQVsVg==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.12.tgz", + "integrity": "sha512-hSjJvZ7tz827xhUJcAV4FtUUm+BqKM4Pbp4HD0Y+GBSexFCsf9DgmjI6rEEkonruqksz88hYs1ptxO31G5Ub6Q==", "requires": { "ascii-table": "0.0.9", "lodash": "^4.17.21", @@ -44299,7 +44304,7 @@ "ajv": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha512-I/bSHSNEcFFqXLf91nchoNB9D1Kie3QKcWdchYUaoIg1+1bdWDkdfdlvdIOJbi9U8xR0y+MWc5D+won9v95WlQ==", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "requires": { "co": "^4.6.0", "json-stable-stringify": "^1.0.1" @@ -44308,12 +44313,12 @@ "ajv-keywords": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha512-vuBv+fm2s6cqUyey2A7qYcvsik+GMDJsw8BARP2sDE76cqmaZVarsvHf7Vx6VJ0Xk8gLl+u3MoAPf6gKzJefeA==" + "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=" }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "big.js": { "version": "3.2.0", @@ -44323,7 +44328,7 @@ "camelcase": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g==" + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" }, "cliui": { "version": "2.1.0", @@ -44508,7 +44513,7 @@ "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==" + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" }, "cliui": { "version": "3.2.0", @@ -44533,7 +44538,7 @@ "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==" + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" } } } @@ -45699,7 +45704,7 @@ "semver-compare": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", "dev": true, "optional": true }, @@ -46018,7 +46023,7 @@ "simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", "requires": { "is-arrayish": "^0.3.1" }, @@ -46594,7 +46599,7 @@ "strict-uri-encode": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=" + "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==" }, "string-hash-64": { "version": "1.0.3", @@ -50664,7 +50669,7 @@ "yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", "dev": true, "requires": { "buffer-crc32": "~0.2.3", diff --git a/package.json b/package.json index f283e12576bb..57e62357b16b 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "htmlparser2": "^7.2.0", "localforage": "^1.10.0", "lodash": "4.17.21", + "memoize-one": "^6.0.0", "metro-config": "^0.64.0", "moment": "^2.29.4", "moment-timezone": "^0.5.31", @@ -92,7 +93,7 @@ "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-keyboard-spacer": "^0.4.1", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.10", + "react-native-onyx": "1.0.12", "react-native-pdf": "^6.2.2", "react-native-performance": "^2.0.0", "react-native-permissions": "^3.0.1", diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 2adaf3066006..99897f502ca1 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -3,7 +3,7 @@ import _ from 'underscore'; import Onyx from 'react-native-onyx'; import lodashGet from 'lodash/get'; import lodashOrderBy from 'lodash/orderBy'; -import lodashMemoize from 'lodash/memoize'; +import memoizeOne from 'memoize-one'; import Str from 'expensify-common/lib/str'; import ONYXKEYS from '../ONYXKEYS'; import CONST from '../CONST'; @@ -12,8 +12,7 @@ import * as Localize from './Localize'; import Permissions from './Permissions'; import * as CollectionUtils from './CollectionUtils'; -// We are memoizing some slow functions to make refreshing the options more performant -const memoizedOrderBy = lodashMemoize(lodashOrderBy); +const memoizedOrderBy = memoizeOne(lodashOrderBy); /** * OptionsListUtils is used to build a list options passed to the OptionsList component. Several different UI views can @@ -45,18 +44,6 @@ Onyx.connect({ callback: val => preferredLocale = val || CONST.DEFAULT_LOCALE, }); -const reportsWithDraft = {}; -Onyx.connect({ - key: ONYXKEYS.COLLECTION.REPORTS_WITH_DRAFT, - callback: (hasDraft, key) => { - if (!key) { - return; - } - - reportsWithDraft[key] = hasDraft; - }, -}); - const policies = {}; Onyx.connect({ key: ONYXKEYS.COLLECTION.POLICY, @@ -197,11 +184,11 @@ function getSearchText(report, reportName, personalDetailList, isChatRoomOrPolic * Determines whether a report has a draft comment. * * @param {Object} report + * @param {Object} reportsWithDraft * @return {Boolean} */ -function hasReportDraftComment(report) { +function hasReportDraftComment(report, reportsWithDraft = {}) { return report - && reportsWithDraft && lodashGet(reportsWithDraft, `${ONYXKEYS.COLLECTION.REPORTS_WITH_DRAFT}${report.reportID}`, false); } @@ -211,13 +198,15 @@ function hasReportDraftComment(report) { * @param {Array} logins * @param {Object} personalDetails * @param {Object} report + * @param {Object} reportsWithDraft * @param {Object} options * @param {Boolean} [options.showChatPreviewLine] * @param {Boolean} [options.forcePolicyNamePreview] * @returns {Object} */ -function createOption(logins, personalDetails, report, { - showChatPreviewLine = false, forcePolicyNamePreview = false, +function createOption(logins, personalDetails, report, reportsWithDraft, { + showChatPreviewLine = false, + forcePolicyNamePreview = false, }) { const isChatRoom = ReportUtils.isChatRoom(report); const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(report); @@ -226,7 +215,7 @@ function createOption(logins, personalDetails, report, { const isArchivedRoom = ReportUtils.isArchivedRoom(report); const hasMultipleParticipants = personalDetailList.length > 1 || isChatRoom || isPolicyExpenseChat; const personalDetail = personalDetailList[0]; - const hasDraftComment = hasReportDraftComment(report); + const hasDraftComment = hasReportDraftComment(report, reportsWithDraft); const hasOutstandingIOU = lodashGet(report, 'hasOutstandingIOU', false); const iouReport = hasOutstandingIOU ? lodashGet(iouReports, `${ONYXKEYS.COLLECTION.REPORT_IOUS}${report.iouReportID}`, {}) @@ -293,8 +282,7 @@ function createOption(logins, personalDetails, report, { }; } -// We are memoizing this to increase the performance when recalculating options -const memoizedCreateOption = lodashMemoize(createOption); +const memoizedCreateOption = memoizeOne(createOption); /** * Searches for a match when provided with a value @@ -364,6 +352,7 @@ const loginArrayMap = {}; * @private */ function getOptions(reports, personalDetails, activeReportID, { + reportsWithDraft = {}, betas = [], selectedOptions = [], maxRecentReportsToShow = 0, @@ -421,7 +410,7 @@ function getOptions(reports, personalDetails, activeReportID, { return; } - const hasDraftComment = hasReportDraftComment(report); + const hasDraftComment = hasReportDraftComment(report, reportsWithDraft); const iouReportOwner = lodashGet(report, 'hasOutstandingIOU', false) ? lodashGet(iouReports, [`${ONYXKEYS.COLLECTION.REPORT_IOUS}${report.iouReportID}`, 'ownerEmail'], '') : ''; @@ -468,7 +457,7 @@ function getOptions(reports, personalDetails, activeReportID, { reportMapForLogins[logins[0]] = report; } const isSearchingSomeonesPolicyExpenseChat = !report.isOwnPolicyExpenseChat && searchValue !== ''; - allReportOptions.push(memoizedCreateOption(logins, personalDetails, report, { + allReportOptions.push(memoizedCreateOption(logins, personalDetails, report, reportsWithDraft, { showChatPreviewLine, forcePolicyNamePreview: isPolicyExpenseChat ? isSearchingSomeonesPolicyExpenseChat : forcePolicyNamePreview, })); @@ -480,10 +469,17 @@ function getOptions(reports, personalDetails, activeReportID, { if (!loginArrayMap[personalDetail.login]) { loginArrayMap[personalDetail.login] = [personalDetail.login]; } - return memoizedCreateOption(loginArrayMap[personalDetail.login], personalDetails, reportMapForLogins[personalDetail.login], { - showChatPreviewLine, - forcePolicyNamePreview, - }); + return memoizedCreateOption( + loginArrayMap[personalDetail.login], + personalDetails, + reportMapForLogins[personalDetail.login], + reportsWithDraft, + { + showChatPreviewLine, + forcePolicyNamePreview, + reportsWithDraft, + }, + ); }); if (sortPersonalDetailsByAlphaAsc) { @@ -601,8 +597,9 @@ function getOptions(reports, personalDetails, activeReportID, { const login = (Str.isValidPhone(searchValue) && !searchValue.includes('+')) ? `+${countryCodeByIP}${searchValue}` : searchValue; - userToInvite = memoizedCreateOption([login], personalDetails, null, { + userToInvite = memoizedCreateOption([login], personalDetails, null, reportsWithDraft, { showChatPreviewLine, + reportsWithDraft, }); userToInvite.icons = [ReportUtils.getDefaultAvatar(login)]; } @@ -763,9 +760,10 @@ function getMemberInviteOptions( * @param {Number} activeReportID * @param {String} priorityMode * @param {Array} betas + * @param {Object} reportsWithDraft * @returns {Object} */ -function calculateSidebarOptions(reports, personalDetails, activeReportID, priorityMode, betas) { +function calculateSidebarOptions(reports, personalDetails, activeReportID, priorityMode, betas, reportsWithDraft) { let sideBarOptions = { prioritizeIOUDebts: true, prioritizeReportsWithDraftComments: true, @@ -785,10 +783,11 @@ function calculateSidebarOptions(reports, personalDetails, activeReportID, prior showChatPreviewLine: true, prioritizePinnedReports: true, ...sideBarOptions, + reportsWithDraft, }); } -const getSidebarOptions = lodashMemoize(calculateSidebarOptions); +const getSidebarOptions = memoizeOne(calculateSidebarOptions); /** * Helper method that returns the text to be used for the header's message and title (if any) diff --git a/src/pages/home/sidebar/SidebarLinks.js b/src/pages/home/sidebar/SidebarLinks.js index 6e2f425d303b..1fc25521cb80 100644 --- a/src/pages/home/sidebar/SidebarLinks.js +++ b/src/pages/home/sidebar/SidebarLinks.js @@ -110,6 +110,7 @@ class SidebarLinks extends React.Component { activeReportID, props.priorityMode, props.betas, + props.reportsWithDraft, ); return sidebarOptions.recentReports; } diff --git a/tests/unit/OptionsListUtilsTest.js b/tests/unit/OptionsListUtilsTest.js index dd2cc07922e2..00968b3def26 100644 --- a/tests/unit/OptionsListUtilsTest.js +++ b/tests/unit/OptionsListUtilsTest.js @@ -683,6 +683,8 @@ describe('OptionsListUtils', () => { personalDetailsWithNewParticipant, 0, CONST.PRIORITY_MODE.DEFAULT, + [], + {[`${ONYXKEYS.COLLECTION.REPORTS_WITH_DRAFT}${1}`]: true}, ); // Then expect all of the reports to be shown both multiple and single participant except the @@ -696,19 +698,17 @@ describe('OptionsListUtils', () => { expect(results.personalDetails.length).toBe(0); // And the most recent pinned report is first in the list of reports - let index = 0; - expect(results.recentReports[index].text).toBe('Captain Britain'); - expect(results.recentReports[index].login).toBe('captain_britain@expensify.com'); + expect(results.recentReports[0].text).toBe('Captain Britain'); + expect(results.recentReports[0].login).toBe('captain_britain@expensify.com'); // And the third report is the report with an IOU debt - index += 2; - expect(results.recentReports[index].login).toBe('mistersinister@marauders.com'); + expect(results.recentReports[2].login).toBe('mistersinister@marauders.com'); // And the fourth report is the report with a draft comment - expect(results.recentReports[++index].text).toBe('Iron Man, Mister Fantastic'); + expect(results.recentReports[3].text).toBe('Iron Man, Mister Fantastic'); // And the fifth report is the report with the lastMessage timestamp - expect(results.recentReports[++index].login).toBe('steverogers@expensify.com'); + expect(results.recentReports[4].login).toBe('steverogers@expensify.com'); expect(_.last(results.recentReports).text).toBe("SHIELD's workspace"); }); @@ -718,7 +718,14 @@ describe('OptionsListUtils', () => { () => Report.setReportWithDraft(1, true) .then(() => { // When we call getSidebarOptions() with no search value - const results = OptionsListUtils.getSidebarOptions(REPORTS_WITH_MORE_PINS, PERSONAL_DETAILS, 0, CONST.PRIORITY_MODE.GSD); + const results = OptionsListUtils.getSidebarOptions( + REPORTS_WITH_MORE_PINS, + PERSONAL_DETAILS, + 0, + CONST.PRIORITY_MODE.GSD, + [], + {[`${ONYXKEYS.COLLECTION.REPORTS_WITH_DRAFT}${1}`]: true}, + ); // Then expect all of the reports to be shown both multiple and single participant except the // report that has no lastMessageTimestamp and the chat with Thor who's message is read @@ -836,6 +843,8 @@ describe('OptionsListUtils', () => { PERSONAL_DETAILS, 0, CONST.PRIORITY_MODE.DEFAULT, + [], + {}, ); // Then expect all of the reports to be shown except the archived policyExpenseChats and defaultRooms From d1e4e918812c53bbe84516b2e11b73fd7f1e79cf Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Thu, 4 Aug 2022 09:03:38 -1000 Subject: [PATCH 12/33] Memoize a few more things --- src/libs/OptionsListUtils.js | 8 +++-- src/pages/home/sidebar/SidebarLinks.js | 47 +++++++++++++++++--------- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 99897f502ca1..70919f79fd52 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -117,6 +117,8 @@ function getPersonalDetailsForLogins(logins, personalDetails) { return personalDetailsForLogins; } +const memoizedGetPersonalDetailsForLogins = memoizeOne(getPersonalDetailsForLogins); + /** * Constructs a Set with all possible names (displayName, firstName, lastName, email) for all participants in a report, * to be used in isSearchStringMatch. @@ -180,6 +182,8 @@ function getSearchText(report, reportName, personalDetailList, isChatRoomOrPolic return _.unique(searchTerms).join(' '); } +const memoizedGetSearchText = memoizeOne(getSearchText); + /** * Determines whether a report has a draft comment. * @@ -210,7 +214,7 @@ function createOption(logins, personalDetails, report, reportsWithDraft, { }) { const isChatRoom = ReportUtils.isChatRoom(report); const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(report); - const personalDetailMap = getPersonalDetailsForLogins(logins, personalDetails); + const personalDetailMap = memoizedGetPersonalDetailsForLogins(logins, personalDetails); const personalDetailList = _.values(personalDetailMap); const isArchivedRoom = ReportUtils.isArchivedRoom(report); const hasMultipleParticipants = personalDetailList.length > 1 || isChatRoom || isPolicyExpenseChat; @@ -269,7 +273,7 @@ function createOption(logins, personalDetails, report, reportsWithDraft, { isUnread: report ? report.unreadActionCount > 0 : null, hasDraftComment, keyForList: report ? String(report.reportID) : personalDetail.login, - searchText: getSearchText(report, reportName, personalDetailList, isChatRoom || isPolicyExpenseChat), + searchText: memoizedGetSearchText(report, reportName, personalDetailList, isChatRoom || isPolicyExpenseChat), isPinned: lodashGet(report, 'isPinned', false), hasOutstandingIOU, iouReportID: lodashGet(report, 'iouReportID'), diff --git a/src/pages/home/sidebar/SidebarLinks.js b/src/pages/home/sidebar/SidebarLinks.js index 1fc25521cb80..18c4703da0c3 100644 --- a/src/pages/home/sidebar/SidebarLinks.js +++ b/src/pages/home/sidebar/SidebarLinks.js @@ -4,6 +4,7 @@ import _ from 'underscore'; import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; import lodashGet from 'lodash/get'; +import memoizeOne from 'memoize-one'; import styles from '../../../styles/styles'; import * as StyleUtils from '../../../styles/StyleUtils'; import ONYXKEYS from '../../../ONYXKEYS'; @@ -101,6 +102,32 @@ const defaultProps = { isSyncingData: false, }; +/** + * @param {Object} nextUnreadReports + * @param {Object} unreadReports + * @returns {Boolean} + */ +function checkForNewUnreadReports(nextUnreadReports, unreadReports) { + return nextUnreadReports.length > 0 + && _.some(nextUnreadReports, + nextUnreadReport => !_.some(unreadReports, unreadReport => unreadReport.reportID === nextUnreadReport.reportID)); +} +const getHasNewUnreadReports = memoizeOne(checkForNewUnreadReports); + +/** + * @param {Object} reportsObject + * @returns {Array} + */ +function getUnreadReports(reportsObject) { + const reports = _.values(reportsObject); + if (reports.length === 0) { + return []; + } + const unreadReports = _.filter(reports, report => report && report.unreadActionCount > 0); + return unreadReports; +} +const memoizeGetUnreadReports = memoizeOne(getUnreadReports); + class SidebarLinks extends React.Component { static getRecentReports(props) { const activeReportID = parseInt(props.currentlyViewedReportID, 10); @@ -115,15 +142,6 @@ class SidebarLinks extends React.Component { return sidebarOptions.recentReports; } - static getUnreadReports(reportsObject) { - const reports = _.values(reportsObject); - if (reports.length === 0) { - return []; - } - const unreadReports = _.filter(reports, report => report && report.unreadActionCount > 0); - return unreadReports; - } - /** * Returns true if the sidebar list should be re-ordered * @@ -156,11 +174,8 @@ class SidebarLinks extends React.Component { } // If any reports have new unread messages, re-order the list - const nextUnreadReports = SidebarLinks.getUnreadReports(nextProps.reports || {}); - const hasNewUnreadReports = nextUnreadReports.length > 0 - && _.some(nextUnreadReports, - nextUnreadReport => !_.some(unreadReports, unreadReport => unreadReport.reportID === nextUnreadReport.reportID)); - if (hasNewUnreadReports) { + const nextUnreadReports = memoizeGetUnreadReports(nextProps.reports || {}); + if (getHasNewUnreadReports(nextUnreadReports, unreadReports)) { return true; } @@ -183,7 +198,7 @@ class SidebarLinks extends React.Component { }, orderedReports: [], priorityMode: props.priorityMode, - unreadReports: SidebarLinks.getUnreadReports(props.reports || {}), + unreadReports: memoizeGetUnreadReports(props.reports || {}), }; } @@ -233,7 +248,7 @@ class SidebarLinks extends React.Component { hasDraftHistory, lastMessageTimestamp, }, - unreadReports: SidebarLinks.getUnreadReports(nextProps.reports || {}), + unreadReports: memoizeGetUnreadReports(nextProps.reports || {}), }; } From d817478f4d69e05b2e1825ffb6a83a6d77539472 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 5 Aug 2022 07:36:59 -1000 Subject: [PATCH 13/33] just leftover code --- src/libs/OptionsListUtils.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 70919f79fd52..e18cdb7632e5 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -481,7 +481,6 @@ function getOptions(reports, personalDetails, activeReportID, { { showChatPreviewLine, forcePolicyNamePreview, - reportsWithDraft, }, ); }); @@ -603,7 +602,6 @@ function getOptions(reports, personalDetails, activeReportID, { : searchValue; userToInvite = memoizedCreateOption([login], personalDetails, null, reportsWithDraft, { showChatPreviewLine, - reportsWithDraft, }); userToInvite.icons = [ReportUtils.getDefaultAvatar(login)]; } From 9f912f291eacfab398f901ac9e6f472684007a96 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 5 Aug 2022 07:41:07 -1000 Subject: [PATCH 14/33] Fix variable name --- src/pages/home/sidebar/SidebarLinks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/sidebar/SidebarLinks.js b/src/pages/home/sidebar/SidebarLinks.js index 18c4703da0c3..4931b1f6ffdb 100644 --- a/src/pages/home/sidebar/SidebarLinks.js +++ b/src/pages/home/sidebar/SidebarLinks.js @@ -112,7 +112,7 @@ function checkForNewUnreadReports(nextUnreadReports, unreadReports) { && _.some(nextUnreadReports, nextUnreadReport => !_.some(unreadReports, unreadReport => unreadReport.reportID === nextUnreadReport.reportID)); } -const getHasNewUnreadReports = memoizeOne(checkForNewUnreadReports); +const memoizeCheckForNewUnreadReports = memoizeOne(checkForNewUnreadReports); /** * @param {Object} reportsObject @@ -175,7 +175,7 @@ class SidebarLinks extends React.Component { // If any reports have new unread messages, re-order the list const nextUnreadReports = memoizeGetUnreadReports(nextProps.reports || {}); - if (getHasNewUnreadReports(nextUnreadReports, unreadReports)) { + if (memoizeCheckForNewUnreadReports(nextUnreadReports, unreadReports)) { return true; } From 840ee6725dfc70d5f7adb99e869184f997f100da Mon Sep 17 00:00:00 2001 From: OSBotify Date: Fri, 5 Aug 2022 18:11:54 +0000 Subject: [PATCH 15/33] Update version to 1.1.88-2 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 7ca77486631f..9d3cf23b6855 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -152,8 +152,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001018801 - versionName "1.1.88-1" + versionCode 1001018802 + versionName "1.1.88-2" } splits { abi { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 67ed0bd3ea69..d4d695fb5131 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.1.88.1 + 1.1.88.2 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index c1fd524fcba4..c75702f011ff 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.1.88.1 + 1.1.88.2 diff --git a/package-lock.json b/package-lock.json index eca7df40d6e5..f75179355615 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.88-1", + "version": "1.1.88-2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1e24a02ccf63..fb12e30f7946 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.88-1", + "version": "1.1.88-2", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From e7d100bf23c1942d3bd156709859f6ed560a753a Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Fri, 5 Aug 2022 22:29:20 +0200 Subject: [PATCH 16/33] Add an optional parameter --- src/pages/home/report/ReportTypingIndicator.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/home/report/ReportTypingIndicator.js b/src/pages/home/report/ReportTypingIndicator.js index 2ee31974690d..915b9f496641 100755 --- a/src/pages/home/report/ReportTypingIndicator.js +++ b/src/pages/home/report/ReportTypingIndicator.js @@ -16,6 +16,9 @@ const propTypes = { /** Key-value pairs of user logins and whether or not they are typing. Keys are logins. */ userTypingStatuses: PropTypes.objectOf(PropTypes.bool), + /** Optional styles for container element that will override the default styling for the report typing indicator */ + containerStyles: PropTypes.arrayOf(PropTypes.object), + /** Information about the network */ network: networkPropTypes.isRequired, @@ -23,6 +26,7 @@ const propTypes = { }; const defaultProps = { + containerStyles: [], userTypingStatuses: {}, }; From d4d9b2be4715bf174c2ea9d365da06b39f563e35 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Fri, 5 Aug 2022 22:37:52 +0200 Subject: [PATCH 17/33] Remove the containerStyles prop --- src/pages/home/report/ReportTypingIndicator.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/pages/home/report/ReportTypingIndicator.js b/src/pages/home/report/ReportTypingIndicator.js index 915b9f496641..552e126b9c5c 100755 --- a/src/pages/home/report/ReportTypingIndicator.js +++ b/src/pages/home/report/ReportTypingIndicator.js @@ -16,9 +16,6 @@ const propTypes = { /** Key-value pairs of user logins and whether or not they are typing. Keys are logins. */ userTypingStatuses: PropTypes.objectOf(PropTypes.bool), - /** Optional styles for container element that will override the default styling for the report typing indicator */ - containerStyles: PropTypes.arrayOf(PropTypes.object), - /** Information about the network */ network: networkPropTypes.isRequired, @@ -26,7 +23,6 @@ const propTypes = { }; const defaultProps = { - containerStyles: [], userTypingStatuses: {}, }; @@ -82,7 +78,6 @@ class ReportTypingIndicator extends React.Component { style={[ styles.chatItemComposeSecondaryRowSubText, styles.chatItemComposeSecondaryRowOffset, - ...this.props.containerStyles, ]} numberOfLines={1} > From fe7d733f5202d3c4e25deed4a71649c478ac0b7c Mon Sep 17 00:00:00 2001 From: OSBotify Date: Fri, 5 Aug 2022 20:56:33 +0000 Subject: [PATCH 18/33] Update version to 1.1.88-3 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 9d3cf23b6855..8986207b293e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -152,8 +152,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001018802 - versionName "1.1.88-2" + versionCode 1001018803 + versionName "1.1.88-3" } splits { abi { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index d4d695fb5131..59c385c7f981 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.1.88.2 + 1.1.88.3 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index c75702f011ff..759ef3db5bab 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.1.88.2 + 1.1.88.3 diff --git a/package-lock.json b/package-lock.json index f75179355615..6d37fd2a7d31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.88-2", + "version": "1.1.88-3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fb12e30f7946..cb08236d1fb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.88-2", + "version": "1.1.88-3", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From ff5bfdb46a50fa6751502ac8c362a251cebb1c38 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 5 Aug 2022 11:38:49 -1000 Subject: [PATCH 19/33] revert back to OG package-lock.json --- package-lock.json | 213 ++++++++++++++++++++-------------------------- 1 file changed, 92 insertions(+), 121 deletions(-) diff --git a/package-lock.json b/package-lock.json index dde2d9a15881..56757e33cf67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.87-8", + "version": "1.1.88-1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -5187,6 +5187,11 @@ "@types/node": ">= 8" } }, + "@oguzhnatly/react-native-image-manipulator": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@oguzhnatly/react-native-image-manipulator/-/react-native-image-manipulator-1.0.5.tgz", + "integrity": "sha512-12b5A8GMQ0NNzJmFKKvaLHnBylqmlyS1/s8gLsH0Tg9cAfqOKuxGUx7Lg1hqYU67BAhlx1BhF37C9rdBu8plIQ==" + }, "@onfido/react-native-sdk": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/@onfido/react-native-sdk/-/react-native-sdk-5.4.0.tgz", @@ -21787,9 +21792,9 @@ } }, "@types/hammerjs": { - "version": "2.0.39", - "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.39.tgz", - "integrity": "sha512-lYR2Y/tV2ujpk/WyUc7S0VLI0a9hrtVIN9EwnrNo5oSEJI2cK2/XrgwOQmXLL3eTulOESvh9qP6si9+DWM9cOA==" + "version": "2.0.41", + "resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.41.tgz", + "integrity": "sha512-ewXv/ceBaJprikMcxCmWU1FKyMAQ2X7a9Gtmzw8fcg2kIePI1crERDM818W+XYrxqdBBOdlf2rm137bU+BltCA==" }, "@types/hast": { "version": "2.3.4", @@ -21848,7 +21853,7 @@ "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "@types/lodash": { @@ -22655,7 +22660,7 @@ "absolute-path": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/absolute-path/-/absolute-path-0.0.0.tgz", - "integrity": "sha1-p4di+9rftSl76ZsV01p4Wy8JW/c=" + "integrity": "sha512-HQiug4c+/s3WOvEnDRxXVmNtSG5s2gJM9r19BTcqjp7BWcE48PB+Y2G6jE65kqI0LpsQeMZygt/b60Gi4KxGyA==" }, "accepts": { "version": "1.3.7", @@ -22674,7 +22679,7 @@ "acorn-dynamic-import": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz", - "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=", + "integrity": "sha512-GKp5tQ8h0KMPWIYGRHHXI1s5tUpZixZ3IHF2jAu42wSCf6In/G873s6/y4DdKdhWvzhu1T6mE1JgvnhAKqyYYQ==", "requires": { "acorn": "^4.0.3" }, @@ -22682,7 +22687,7 @@ "acorn": { "version": "4.0.13", "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=" + "integrity": "sha512-fu2ygVGuMmlzG8ZeRJ0bvR41nsAkxxhbyk8bZ1SS521Z7vmgJFTQQlfz/Mp/nJexGBz+v8sC9bM6+lNgskt4Ug==" } } }, @@ -22825,7 +22830,7 @@ "align-text": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "integrity": "sha512-GrTZLRpmp6wIC2ztrWW9MjjTgSKccffgFagbNDOX95/dcjEcYZibYTeaOntySQLcdw1ztBoFkviiUvTMbb9MYg==", "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -23172,7 +23177,7 @@ "app-root-dir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/app-root-dir/-/app-root-dir-1.0.2.tgz", - "integrity": "sha1-OBh+wt6nV3//Az/8sSFyaS/24Rg=", + "integrity": "sha512-jlpIfsOoNoafl92Sz//64uQHGSyMrD2vYG5d8o2a4qGvyNCvXur7bzIsWtAC/6flI2RYAp3kv8rsfBtaLm7w0g==", "dev": true }, "appdirsjs": { @@ -23220,7 +23225,7 @@ "aria-query": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-3.0.0.tgz", - "integrity": "sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w=", + "integrity": "sha512-majUxHgLehQTeSA+hClx+DY09OVUqG3GtezWkF1krgLGNdlDu9l9V8DaqNMWbq4Eddc8wsyDA0hpDUtnYxQEXw==", "dev": true, "requires": { "ast-types-flow": "0.0.7", @@ -23230,7 +23235,7 @@ "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" + "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==" }, "arr-flatten": { "version": "1.1.0", @@ -23240,12 +23245,12 @@ "arr-union": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==" }, "array-filter": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", - "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=" + "integrity": "sha512-VW0FpCIhjZdarWjIz8Vpva7U95fl2Jn+b+mmFFMLn8PIVscOQcAgEznwUzTEuUHuqZqIxwzRlcaN/urTFFQoiw==" }, "array-find-index": { "version": "1.0.2", @@ -23295,17 +23300,17 @@ "array-map": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", - "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=" + "integrity": "sha512-123XMszMB01QKVptpDQ7x1m1pP5NmJIG1kbl0JSPPRezvwQChxAN0Gvzo7rvR1IZ2tOL2tmiy7kY/KKgnpVVpg==" }, "array-reduce": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", - "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=" + "integrity": "sha512-8jR+StqaC636u7h3ye1co3lQRefgVVUQUhuAmRbDqIMeR2yuXzRvkCNQiQ5J/wbREmoBLNtp13dhaaVpZQDRUw==" }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "integrity": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==", "dev": true, "requires": { "array-uniq": "^1.0.1" @@ -23314,13 +23319,13 @@ "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", "dev": true }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==" }, "array.prototype.flat": { "version": "1.2.5", @@ -23933,7 +23938,7 @@ "asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" }, "asar": { "version": "3.0.3", @@ -24015,13 +24020,13 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true }, "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==" }, "ast-types": { "version": "0.14.2", @@ -24041,7 +24046,7 @@ "ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", - "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", + "integrity": "sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==", "dev": true }, "async": { @@ -24071,7 +24076,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, "at-least-node": { @@ -24135,7 +24140,7 @@ "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "integrity": "sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==", "dev": true, "requires": { "chalk": "^1.1.3", @@ -24146,19 +24151,19 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "dev": true }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", "dev": true }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", "dev": true, "requires": { "ansi-styles": "^2.2.1", @@ -24213,7 +24218,7 @@ "babel-helper-function-name": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "integrity": "sha512-Oo6+e2iX+o9eVvJ9Y5eKL5iryeRdsIkwRYheCuhYdVHsdEQysbc2z2QkqCLIYnNxkT5Ss3ggrHdXiDI7Dhrn4Q==", "dev": true, "requires": { "babel-helper-get-function-arity": "^6.24.1", @@ -24226,7 +24231,7 @@ "babel-helper-get-function-arity": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "integrity": "sha512-WfgKFX6swFB1jS2vo+DwivRN4NB8XUdM3ij0Y1gnC21y1tdBoe6xjVnd7NSI6alv+gZXCtJqvrTeMW3fR/c0ng==", "dev": true, "requires": { "babel-runtime": "^6.22.0", @@ -24598,7 +24603,7 @@ "babel-messages": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "integrity": "sha512-Bl3ZiA+LjqaMtNYopA9TYE9HP1tQ+E5dLxE0XrAzcIJeK2UqF0/EaqXwBn9esd4UmTfEab+P+UYQ1GnioFIb/w==", "dev": true, "requires": { "babel-runtime": "^6.22.0" @@ -24607,7 +24612,7 @@ "babel-plugin-add-react-displayname": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/babel-plugin-add-react-displayname/-/babel-plugin-add-react-displayname-0.0.5.tgz", - "integrity": "sha1-M51M3be2X9YtHfnbn+BN4TQSK9U=", + "integrity": "sha512-LY3+Y0XVDYcShHHorshrDbt4KFWL4bSeniCtl4SYZbask+Syngk1uMPCeN9+nSiZo6zX5s0RTq/J9Pnaaf/KHw==", "dev": true }, "babel-plugin-apply-mdx-type-prop": { @@ -25110,7 +25115,7 @@ "babel-plugin-syntax-class-properties": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", - "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", + "integrity": "sha512-chI3Rt9T1AbrQD1s+vxw3KcwC9yHtF621/MacuItITfZX344uhQoANjpoSJZleAmW2tjlolqB/f+h7jIqXa7pA==", "dev": true }, "babel-plugin-syntax-trailing-function-commas": { @@ -25121,7 +25126,7 @@ "babel-plugin-transform-class-properties": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", - "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", + "integrity": "sha512-n4jtBA3OYBdvG5PRMKsMXJXHfLYw/ZOmtxCLOOwz6Ro5XlrColkStLnz1AS1L2yfPA9BKJ1ZNlmVCLjAL9DSIg==", "dev": true, "requires": { "babel-helper-function-name": "^6.24.1", @@ -25133,7 +25138,7 @@ "babel-plugin-transform-remove-console": { "version": "6.9.4", "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz", - "integrity": "sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=" + "integrity": "sha512-88blrUrMX3SPiGkT1GnvVY8E/7A+k6oj3MNvUtTIxJflFzXTw1bHkuJ/y039ouhFMp2prRn5cQGzokViYi1dsg==" }, "babel-preset-current-node-syntax": { "version": "1.0.1", @@ -25202,7 +25207,7 @@ "babel-runtime": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", "dev": true, "requires": { "core-js": "^2.4.0", @@ -25220,7 +25225,7 @@ "babel-template": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "integrity": "sha512-PCOcLFW7/eazGUKIoqH97sO9A2UYMahsn/yRQ7uOk37iutwjq7ODtcTNF+iFDSHNfkctqsLRjLP7URnOx0T1fg==", "dev": true, "requires": { "babel-runtime": "^6.26.0", @@ -25233,7 +25238,7 @@ "babel-traverse": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "integrity": "sha512-iSxeXx7apsjCHe9c7n8VtRXGzI2Bk1rBSOJgCCjfyXb6v1aCqE1KSEpq/8SXuVN8Ka/Rh1WDTF0MDzkvTA4MIA==", "dev": true, "requires": { "babel-code-frame": "^6.26.0", @@ -25273,7 +25278,7 @@ "babel-types": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "integrity": "sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g==", "dev": true, "requires": { "babel-runtime": "^6.26.0", @@ -25360,7 +25365,7 @@ "base-64": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", - "integrity": "sha1-eAqZyE59YAJgNhURxId2E78k9rs=" + "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==" }, "base64-js": { "version": "1.3.1", @@ -25370,13 +25375,13 @@ "batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", + "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", "dev": true }, "batch-processor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/batch-processor/-/batch-processor-1.0.0.tgz", - "integrity": "sha1-dclcMrdI4IUNEMKxaPa9vpiRrOg=", + "integrity": "sha512-xoLQD8gmmR32MeuBHgH0Tzd5PuSZx71ZsbhVxOCRbgktZEPe4SQy7s9Z50uPp0F/f7iw2XmkHN2xkgbMfckMDA==", "dev": true }, "bcrypt-pbkdf": { @@ -25544,7 +25549,7 @@ "bonjour": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz", - "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", + "integrity": "sha512-RaVTblr+OnEli0r/ud8InrU7D+G0y6aJhlxaLa6Pwty4+xoxboF1BsUI45tujvRpbj9dQVoglChqonGAsjEBYg==", "dev": true, "requires": { "array-flatten": "^2.1.0", @@ -25558,7 +25563,7 @@ "boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" }, "boolean": { "version": "3.2.0", @@ -25695,7 +25700,7 @@ "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, "browser-process-hrtime": { "version": "1.0.0", @@ -25852,13 +25857,13 @@ "buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "dev": true }, "buffer-fill": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", + "integrity": "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==", "dev": true }, "buffer-from": { @@ -25875,7 +25880,7 @@ "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" }, "builder-util": { "version": "22.13.1", @@ -26022,12 +26027,12 @@ "builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==" }, "bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==" }, "c8": { "version": "7.11.3", @@ -26305,13 +26310,13 @@ "call-me-maybe": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==", "dev": true }, "caller-callsite": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", - "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "integrity": "sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ==", "requires": { "callsites": "^2.0.0" } @@ -26319,7 +26324,7 @@ "caller-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", - "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "integrity": "sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==", "requires": { "caller-callsite": "^2.0.0" } @@ -26327,7 +26332,7 @@ "callsites": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=" + "integrity": "sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==" }, "camel-case": { "version": "4.1.1", @@ -26373,7 +26378,7 @@ "camelize": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", - "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" + "integrity": "sha512-W2lPwkBkMZwFlPCXhIlYgxu+7gC/NUlCtdK652DAJ1JdgV0sTrvuPFshNPrFa1TY2JOkLhgdeEBplB4ezEa+xg==" }, "caniuse-lite": { "version": "1.0.30001252", @@ -26410,7 +26415,7 @@ "center-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "integrity": "sha512-Baz3aNe2gd2LP2qk5U+sDk/m4oSuwSDcBfayTCTBoWpfIGO5XFxPmjILQII4NGiZjD6DoDI6kf7gKaxkf7s3VQ==", "requires": { "align-text": "^0.1.3", "lazy-cache": "^1.0.3" @@ -26544,7 +26549,7 @@ "chromium-pickle-js": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", - "integrity": "sha1-BKEGZywYsIWrd02YPfo+oTjyIgU=", + "integrity": "sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==", "dev": true }, "ci-info": { @@ -26634,7 +26639,7 @@ "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", "requires": { "restore-cursor": "^2.0.0" } @@ -30323,7 +30328,7 @@ "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dev": true, "requires": { "locate-path": "^2.0.0" @@ -30332,7 +30337,7 @@ "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dev": true, "requires": { "p-locate": "^2.0.0", @@ -30351,7 +30356,7 @@ "p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "dev": true, "requires": { "p-limit": "^1.1.0" @@ -30360,13 +30365,13 @@ "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "dev": true }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true } } @@ -31534,7 +31539,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true } } @@ -31721,7 +31726,7 @@ "fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, "requires": { "pend": "~1.2.0" @@ -31846,7 +31851,7 @@ "filter-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", - "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==" + "integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs=" }, "finalhandler": { "version": "1.1.2", @@ -32817,7 +32822,7 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "dev": true } } @@ -38514,11 +38519,6 @@ "fs-monkey": "1.0.3" } }, - "memoize-one": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", - "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" - }, "memoizerific": { "version": "1.11.3", "resolved": "https://registry.npmjs.org/memoizerific/-/memoizerific-1.11.3.tgz", @@ -41391,7 +41391,7 @@ "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, "optional": true } @@ -42200,7 +42200,7 @@ "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "dev": true }, "performance-now": { @@ -43145,7 +43145,7 @@ "proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true, "optional": true }, @@ -43821,39 +43821,15 @@ "dev": true }, "react-native-gesture-handler": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.9.0.tgz", - "integrity": "sha512-fkkNeWDBzDdwDxDcxtYbrb9T1g0PLgT1AxBs2iO/p7uEbDbC6mIoL/NzuOnKNEBHcd0lpLoJuNmIfdmucEON5g==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.4.0.tgz", + "integrity": "sha512-8Aao3iGAmlpTbazEt8AfTdEXiPL052Psv8VztKCdvEUW+rCmUso/2pdWCzmqwG0XQdi9ojYW9lg6A7bpaCK7EA==", "requires": { "@egjs/hammerjs": "^2.0.17", - "fbjs": "^3.0.0", "hoist-non-react-statics": "^3.3.0", "invariant": "^2.2.4", + "lodash": "^4.17.21", "prop-types": "^15.7.2" - }, - "dependencies": { - "fbjs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-3.0.0.tgz", - "integrity": "sha512-dJd4PiDOFuhe7vk4F80Mba83Vr2QuK86FoxtgPmzBqEJahncp+13YCmfoa53KHCo6OnlXLG7eeMWPfB5CrpVKg==", - "requires": { - "cross-fetch": "^3.0.4", - "fbjs-css-vars": "^1.0.0", - "loose-envify": "^1.0.0", - "object-assign": "^4.1.0", - "promise": "^7.1.1", - "setimmediate": "^1.0.5", - "ua-parser-js": "^0.7.18" - } - }, - "promise": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", - "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", - "requires": { - "asap": "~2.0.3" - } - } } }, "react-native-google-places-autocomplete": { @@ -43906,9 +43882,9 @@ } }, "react-native-onyx": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.12.tgz", - "integrity": "sha512-hSjJvZ7tz827xhUJcAV4FtUUm+BqKM4Pbp4HD0Y+GBSexFCsf9DgmjI6rEEkonruqksz88hYs1ptxO31G5Ub6Q==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.10.tgz", + "integrity": "sha512-cWKb/LEDtVCeVoYP8OIbb2Xz4aYjqtRaDxHrWmSB5TtSeEQa0JztJzJt9EnTQ0+Xbc2VE0eHBBvBbWUrPQVsVg==", "requires": { "ascii-table": "0.0.9", "lodash": "^4.17.21", @@ -44304,7 +44280,7 @@ "ajv": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "integrity": "sha512-I/bSHSNEcFFqXLf91nchoNB9D1Kie3QKcWdchYUaoIg1+1bdWDkdfdlvdIOJbi9U8xR0y+MWc5D+won9v95WlQ==", "requires": { "co": "^4.6.0", "json-stable-stringify": "^1.0.1" @@ -44313,12 +44289,12 @@ "ajv-keywords": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=" + "integrity": "sha512-vuBv+fm2s6cqUyey2A7qYcvsik+GMDJsw8BARP2sDE76cqmaZVarsvHf7Vx6VJ0Xk8gLl+u3MoAPf6gKzJefeA==" }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" }, "big.js": { "version": "3.2.0", @@ -44328,7 +44304,7 @@ "camelcase": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" + "integrity": "sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g==" }, "cliui": { "version": "2.1.0", @@ -44513,7 +44489,7 @@ "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==" }, "cliui": { "version": "3.2.0", @@ -44538,7 +44514,7 @@ "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==" } } } @@ -45704,7 +45680,7 @@ "semver-compare": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", "dev": true, "optional": true }, @@ -46023,7 +45999,7 @@ "simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", "requires": { "is-arrayish": "^0.3.1" }, @@ -46599,7 +46575,7 @@ "strict-uri-encode": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==" + "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=" }, "string-hash-64": { "version": "1.0.3", @@ -48508,11 +48484,6 @@ "is-typedarray": "^1.0.0" } }, - "ua-parser-js": { - "version": "0.7.28", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.28.tgz", - "integrity": "sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g==" - }, "uglify-es": { "version": "3.3.9", "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", @@ -50669,7 +50640,7 @@ "yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, "requires": { "buffer-crc32": "~0.2.3", From 4c2c66a2991a2a75d1ab2bb350aaeba935d07a4b Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 5 Aug 2022 11:51:06 -1000 Subject: [PATCH 20/33] fix package-lock.json --- package-lock.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 56757e33cf67..fe0f3fbf8003 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.88-1", + "version": "1.1.87-8", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -5187,11 +5187,6 @@ "@types/node": ">= 8" } }, - "@oguzhnatly/react-native-image-manipulator": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@oguzhnatly/react-native-image-manipulator/-/react-native-image-manipulator-1.0.5.tgz", - "integrity": "sha512-12b5A8GMQ0NNzJmFKKvaLHnBylqmlyS1/s8gLsH0Tg9cAfqOKuxGUx7Lg1hqYU67BAhlx1BhF37C9rdBu8plIQ==" - }, "@onfido/react-native-sdk": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/@onfido/react-native-sdk/-/react-native-sdk-5.4.0.tgz", @@ -38519,6 +38514,11 @@ "fs-monkey": "1.0.3" } }, + "memoize-one": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", + "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" + }, "memoizerific": { "version": "1.11.3", "resolved": "https://registry.npmjs.org/memoizerific/-/memoizerific-1.11.3.tgz", @@ -43821,14 +43821,14 @@ "dev": true }, "react-native-gesture-handler": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.4.0.tgz", - "integrity": "sha512-8Aao3iGAmlpTbazEt8AfTdEXiPL052Psv8VztKCdvEUW+rCmUso/2pdWCzmqwG0XQdi9ojYW9lg6A7bpaCK7EA==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.9.0.tgz", + "integrity": "sha512-fkkNeWDBzDdwDxDcxtYbrb9T1g0PLgT1AxBs2iO/p7uEbDbC6mIoL/NzuOnKNEBHcd0lpLoJuNmIfdmucEON5g==", "requires": { "@egjs/hammerjs": "^2.0.17", + "fbjs": "^3.0.0", "hoist-non-react-statics": "^3.3.0", "invariant": "^2.2.4", - "lodash": "^4.17.21", "prop-types": "^15.7.2" } }, @@ -43882,9 +43882,9 @@ } }, "react-native-onyx": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.10.tgz", - "integrity": "sha512-cWKb/LEDtVCeVoYP8OIbb2Xz4aYjqtRaDxHrWmSB5TtSeEQa0JztJzJt9EnTQ0+Xbc2VE0eHBBvBbWUrPQVsVg==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.12.tgz", + "integrity": "sha512-hSjJvZ7tz827xhUJcAV4FtUUm+BqKM4Pbp4HD0Y+GBSexFCsf9DgmjI6rEEkonruqksz88hYs1ptxO31G5Ub6Q==", "requires": { "ascii-table": "0.0.9", "lodash": "^4.17.21", From ed4628a40e0196ee2fc9d0829acf615aafe3d321 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Wed, 6 Jul 2022 14:55:07 -0400 Subject: [PATCH 21/33] Update RN to 0.69 and build from source on Android --- .bundle/config | 2 + .gitignore | 11 +- .ruby-version | 1 + Gemfile | 2 +- Gemfile.lock | 65 +- android/app/build.gradle | 115 +- android/app/src/debug/AndroidManifest.xml | 1 + .../reactnativechat/ReactNativeFlipper.java | 5 +- android/app/src/main/AndroidManifest.xml | 7 +- .../chat/CustomNotificationProvider.java | 8 +- .../java/com/expensify/chat/MainActivity.java | 33 + .../com/expensify/chat/MainApplication.java | 14 +- .../MainApplicationReactNativeHost.java | 116 + .../components/MainComponentsRegistry.java | 36 + ...ApplicationTurboModuleManagerDelegate.java | 48 + android/app/src/main/jni/Android.mk | 48 + .../jni/MainApplicationModuleProvider.cpp | 24 + .../main/jni/MainApplicationModuleProvider.h | 16 + ...nApplicationTurboModuleManagerDelegate.cpp | 45 + ...ainApplicationTurboModuleManagerDelegate.h | 38 + .../src/main/jni/MainComponentsRegistry.cpp | 61 + .../app/src/main/jni/MainComponentsRegistry.h | 32 + android/app/src/main/jni/OnLoad.cpp | 11 + .../res/drawable/rn_edit_text_material.xml | 36 + android/app/src/main/res/values/styles.xml | 1 + android/build.gradle | 38 +- android/gradle.properties | 17 +- android/gradle/wrapper/gradle-wrapper.jar | Bin 58694 -> 59536 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/gradlew | 257 +- android/settings.gradle | 12 +- ios/.xcode.env | 11 + ios/NewExpensify.xcodeproj/project.pbxproj | 270 +- ios/NewExpensify/AppDelegate.m | 99 - ios/NewExpensify/AppDelegate.mm | 189 + ios/Podfile | 12 +- ios/Podfile.lock | 647 +- jest/setup.js | 2 + package-lock.json | 18515 +++++++--------- package.json | 29 +- src/App.js | 36 +- .../AttachmentPicker/index.native.js | 2 +- .../KeyboardSpacer/KeyboardSpacer.js | 128 + src/components/KeyboardSpacer/index.ios.js | 2 +- src/libs/cropOrRotateImage/index.native.js | 2 +- src/libs/fileDownload/index.android.js | 2 +- src/libs/fileDownload/index.ios.js | 2 +- tests/unit/NetworkTest.js | 1402 +- 48 files changed, 10746 insertions(+), 11706 deletions(-) create mode 100644 .bundle/config create mode 100644 .ruby-version create mode 100644 android/app/src/main/java/com/expensify/chat/newarchitecture/MainApplicationReactNativeHost.java create mode 100644 android/app/src/main/java/com/expensify/chat/newarchitecture/components/MainComponentsRegistry.java create mode 100644 android/app/src/main/java/com/expensify/chat/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java create mode 100644 android/app/src/main/jni/Android.mk create mode 100644 android/app/src/main/jni/MainApplicationModuleProvider.cpp create mode 100644 android/app/src/main/jni/MainApplicationModuleProvider.h create mode 100644 android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp create mode 100644 android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h create mode 100644 android/app/src/main/jni/MainComponentsRegistry.cpp create mode 100644 android/app/src/main/jni/MainComponentsRegistry.h create mode 100644 android/app/src/main/jni/OnLoad.cpp create mode 100644 android/app/src/main/res/drawable/rn_edit_text_material.xml create mode 100644 ios/.xcode.env delete mode 100644 ios/NewExpensify/AppDelegate.m create mode 100644 ios/NewExpensify/AppDelegate.mm create mode 100644 src/components/KeyboardSpacer/KeyboardSpacer.js diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 000000000000..848943bb5274 --- /dev/null +++ b/.bundle/config @@ -0,0 +1,2 @@ +BUNDLE_PATH: "vendor/bundle" +BUNDLE_FORCE_RUBY_PLATFORM: 1 diff --git a/.gitignore b/.gitignore index ffd6dbf69bca..8b43bcaf07d8 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ DerivedData *.p12 *.mobileprovision ios-fastlane-json-key.json +ios/.xcode.env.local # Android/IntelliJ # @@ -62,15 +63,17 @@ android/app/android-fastlane-json-key.json # For more information about the recommended setup visit: # https://docs.fastlane.tools/best-practices/source-control/ -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output # Bundle artifact *.jsbundle -# CocoaPods +# Ruby / CocoaPods /ios/Pods/ +/vendor/bundle/ # Local DEV config /.env diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 000000000000..a603bb50a29e --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.7.5 diff --git a/Gemfile b/Gemfile index 4638bcacbb71..c41a21c6604f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source "https://rubygems.org" -gem "cocoapods", "~> 1" +gem "cocoapods", "~> 1.11.3" gem "fastlane", "~> 2" gem "xcpretty", "~> 0" diff --git a/Gemfile.lock b/Gemfile.lock index bfb1f8e53d19..ac75d801e73b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,11 +2,12 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.3) - activesupport (5.2.4.4) + activesupport (6.1.6) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) algoliasearch (1.27.5) @@ -32,10 +33,10 @@ GEM aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.0.3) - cocoapods (1.10.1) - addressable (~> 2.6) + cocoapods (1.11.3) + addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.10.1) + cocoapods-core (= 1.11.3) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.4.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -46,26 +47,26 @@ GEM escape (~> 0.0.4) fourflusher (>= 2.3.0, < 3.0) gh_inspector (~> 1.0) - molinillo (~> 0.6.6) + molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (~> 1.4) - xcodeproj (>= 1.19.0, < 2.0) - cocoapods-core (1.10.1) - activesupport (> 5.0, < 6) - addressable (~> 2.6) + ruby-macho (>= 1.0, < 3.0) + xcodeproj (>= 1.21.0, < 2.0) + cocoapods-core (1.11.3) + activesupport (>= 5.0, < 7) + addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) netrc (~> 0.11) - public_suffix + public_suffix (~> 4.0) typhoeus (~> 1.0) - cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.4.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (1.6.3) cocoapods-plugins (1.0.0) nap - cocoapods-search (1.0.0) - cocoapods-trunk (1.5.0) + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.2.0) @@ -73,7 +74,7 @@ GEM colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) - concurrent-ruby (1.1.7) + concurrent-ruby (1.1.10) declarative (0.0.20) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) @@ -82,8 +83,8 @@ GEM dotenv (2.7.6) emoji_regex (3.2.2) escape (0.0.4) - ethon (0.12.0) - ffi (>= 1.3.0) + ethon (0.15.0) + ffi (>= 1.15.0) excon (0.85.0) faraday (1.7.1) faraday-em_http (~> 1.0) @@ -149,7 +150,7 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - ffi (1.14.2) + ffi (1.15.5) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) @@ -195,7 +196,7 @@ GEM http-cookie (1.0.4) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.8.7) + i18n (1.10.0) concurrent-ruby (~> 1.0) jmespath (1.4.0) json (2.5.1) @@ -203,8 +204,8 @@ GEM memoist (0.16.2) mini_magick (4.11.0) mini_mime (1.1.1) - minitest (5.14.3) - molinillo (0.6.6) + minitest (5.16.2) + molinillo (0.8.0) multi_json (1.15.0) multipart-post (2.0.0) nanaimo (0.3.0) @@ -223,7 +224,7 @@ GEM retriable (3.1.2) rexml (3.2.5) rouge (2.0.7) - ruby-macho (1.4.0) + ruby-macho (2.5.1) ruby2_keywords (0.0.5) rubyzip (2.3.2) security (0.1.3) @@ -238,7 +239,6 @@ GEM terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) trailblazer-option (0.1.1) tty-cursor (0.7.1) tty-screen (0.8.1) @@ -246,8 +246,8 @@ GEM tty-cursor (~> 0.7) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.9) - thread_safe (~> 0.1) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) uber (0.1.0) unf (0.1.4) unf_ext @@ -266,16 +266,19 @@ GEM rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) + zeitwerk (2.6.0) PLATFORMS + arm64-darwin-21 + ruby universal-darwin-20 x86_64-darwin-19 x86_64-linux DEPENDENCIES - cocoapods (~> 1) + cocoapods (~> 1.11.3) fastlane (~> 2) xcpretty (~> 0) BUNDLED WITH - 2.3.16 + 2.3.9 diff --git a/android/app/build.gradle b/android/app/build.gradle index 8986207b293e..8790af088563 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -121,16 +121,19 @@ def jscFlavor = 'org.webkit:android-jsc:+' /** * Whether to enable the Hermes VM. * - * This should be set on project.ext.react and mirrored here. If it is not set + * This should be set on project.ext.react and that value will be read here. If it is not set * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode * and the benefits of using Hermes will therefore be sharply reduced. */ def enableHermes = project.ext.react.get("enableHermes", false); /** - * Required in order to build native code for debug builds + * Architectures to build native code for. */ -def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures") +def reactNativeArchitectures() { + def value = project.getProperties().get("reactNativeArchitectures") + return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] +} android { compileSdkVersion rootProject.ext.compileSdkVersion @@ -154,13 +157,81 @@ android { multiDexEnabled rootProject.ext.multiDexEnabled versionCode 1001018803 versionName "1.1.88-3" + buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() + + if (isNewArchitectureEnabled()) { + // We configure the NDK build only if you decide to opt-in for the New Architecture. + externalNativeBuild { + ndkBuild { + arguments "APP_PLATFORM=android-21", + "APP_STL=c++_shared", + "NDK_TOOLCHAIN_VERSION=clang", + "GENERATED_SRC_DIR=$buildDir/generated/source", + "PROJECT_BUILD_DIR=$buildDir", + "REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", + "REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build", + "NODE_MODULES_DIR=$rootDir/../node_modules" + cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1" + cppFlags "-std=c++17" + // Make sure this target name is the same you specify inside the + // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable. + targets "rndiffapp_appmodules" + } + } + if (!enableSeparateBuildPerCPUArchitecture) { + ndk { + abiFilters (*reactNativeArchitectures()) + } + } + } } + + if (isNewArchitectureEnabled()) { + // We configure the NDK build only if you decide to opt-in for the New Architecture. + externalNativeBuild { + ndkBuild { + path "$projectDir/src/main/jni/Android.mk" + } + } + def reactAndroidProjectDir = project(':ReactAndroid').projectDir + def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { + dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") + from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") + into("$buildDir/react-ndk/exported") + } + def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { + dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") + from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") + into("$buildDir/react-ndk/exported") + } + afterEvaluate { + // If you wish to add a custom TurboModule or component locally, + // you should uncomment this line. + // preBuild.dependsOn("generateCodegenArtifactsFromSchema") + preDebugBuild.dependsOn(packageReactNdkDebugLibs) + preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) + // Due to a bug inside AGP, we have to explicitly set a dependency + // between configureNdkBuild* tasks and the preBuild tasks. + // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 + configureNdkBuildRelease.dependsOn(preReleaseBuild) + configureNdkBuildDebug.dependsOn(preDebugBuild) + reactNativeArchitectures().each { architecture -> + tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure { + dependsOn("preDebugBuild") + } + tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure { + dependsOn("preReleaseBuild") + } + } + } + } + splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK - include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" + include (*reactNativeArchitectures()) } } signingConfigs { @@ -182,11 +253,6 @@ android { buildTypes { debug { signingConfig signingConfigs.debug - if (nativeArchitectures) { - ndk { - abiFilters nativeArchitectures.split(',') - } - } } release { signingConfig signingConfigs.release @@ -213,6 +279,7 @@ android { dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) + //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules @@ -232,9 +299,10 @@ dependencies { } if (enableHermes) { - def hermesPath = "../../node_modules/hermes-engine/android/"; - debugImplementation files(hermesPath + "hermes-debug.aar") - releaseImplementation files(hermesPath + "hermes-release.aar") + //noinspection GradleDynamicVersion + implementation("com.facebook.react:hermes-engine:+") { // From node_modules + exclude group:'com.facebook.fbjni' + } } else { implementation jscFlavor } @@ -260,6 +328,22 @@ dependencies { implementation "com.squareup.okhttp3:okhttp-urlconnection:4.+" } +if (isNewArchitectureEnabled()) { + // If new architecture is enabled, we let you build RN from source + // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. + // This will be applied to all the imported transtitive dependency. + configurations.all { + resolutionStrategy.dependencySubstitution { + substitute(module("com.facebook.react:react-native")) + .using(project(":ReactAndroid")) + .because("On New Architecture we're building React Native from source") + substitute(module("com.facebook.react:hermes-engine")) + .using(project(":ReactAndroid:hermes-engine")) + .because("On New Architecture we're building Hermes from source") + } + } +} + // Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { @@ -274,4 +358,11 @@ if (googleServicesFile.exists()) { } apply plugin: 'com.google.firebase.crashlytics' +def isNewArchitectureEnabled() { + // To opt-in for the New Architecture, you can either: + // - Set `newArchEnabled` to true inside the `gradle.properties` file + // - Invoke gradle with `-newArchEnabled=true` + // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` + return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" +} diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 912a6f110cb4..7e1870e8b30b 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -9,5 +9,6 @@ android:name="firebase_performance_logcat_enabled" android:value="true" /> + diff --git a/android/app/src/debug/java/com/reactnativechat/ReactNativeFlipper.java b/android/app/src/debug/java/com/reactnativechat/ReactNativeFlipper.java index ae2d14ce9b67..a035517eb727 100644 --- a/android/app/src/debug/java/com/reactnativechat/ReactNativeFlipper.java +++ b/android/app/src/debug/java/com/reactnativechat/ReactNativeFlipper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) Facebook, Inc. and its affiliates. + * Copyright (c) Meta Platforms, Inc. and affiliates. * *

This source code is licensed under the MIT license found in the LICENSE file in the root * directory of this source tree. @@ -19,6 +19,7 @@ import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; import com.facebook.flipper.plugins.react.ReactFlipperPlugin; import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; +import com.facebook.react.ReactInstanceEventListener; import com.facebook.react.ReactInstanceManager; import com.facebook.react.bridge.ReactContext; import com.facebook.react.modules.network.NetworkingModule; @@ -51,7 +52,7 @@ public void apply(OkHttpClient.Builder builder) { ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); if (reactContext == null) { reactInstanceManager.addReactInstanceEventListener( - new ReactInstanceManager.ReactInstanceEventListener() { + new ReactInstanceEventListener() { @Override public void onReactContextInitialized(ReactContext reactContext) { reactInstanceManager.removeReactInstanceEventListener(this); diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index a5d23081f6f2..c8678771bdbf 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -8,7 +8,7 @@ @@ -29,6 +29,7 @@ @@ -74,8 +75,6 @@ - - diff --git a/android/app/src/main/java/com/expensify/chat/CustomNotificationProvider.java b/android/app/src/main/java/com/expensify/chat/CustomNotificationProvider.java index 643b4eef4dd7..8e9f5082ef67 100644 --- a/android/app/src/main/java/com/expensify/chat/CustomNotificationProvider.java +++ b/android/app/src/main/java/com/expensify/chat/CustomNotificationProvider.java @@ -70,7 +70,7 @@ protected NotificationCompat.Builder onExtendBuilder(@NonNull Context context, @ // Apply message style only for report comments if (REPORT_COMMENT_TYPE.equals(payload.get(TYPE_KEY).getString())) { - applyMessageStyle(builder, payload, arguments.getNotificationId()); + applyMessageStyle(context, builder, payload, arguments.getNotificationId()); } } catch (Exception e) { Log.e(TAG, "Failed to parse conversation. SendID=" + message.getSendId(), e); @@ -114,7 +114,7 @@ public Bitmap getCroppedBitmap(Bitmap bitmap) { * @param payload Notification payload, which contains all the data we need to build the notifications. * @param notificationID Current notification ID */ - private void applyMessageStyle(NotificationCompat.Builder builder, JsonMap payload, int notificationID) { + private void applyMessageStyle(@NonNull Context context, NotificationCompat.Builder builder, JsonMap payload, int notificationID) { int reportID = payload.get("reportID").getInt(-1); if (reportID == -1) { return; @@ -136,7 +136,7 @@ private void applyMessageStyle(NotificationCompat.Builder builder, JsonMap paylo // Retrieve or create the Person object who sent the latest report comment Person person = notificationCache.people.get(accountID); if (person == null) { - IconCompat iconCompat = fetchIcon(avatar); + IconCompat iconCompat = fetchIcon(context, avatar); person = new Person.Builder() .setIcon(iconCompat) .setKey(accountID) @@ -216,7 +216,7 @@ public void onDismissNotification(PushMessage message) { } } - private IconCompat fetchIcon(String urlString) { + private IconCompat fetchIcon(@NonNull Context context, String urlString) { URL parsedUrl = null; try { parsedUrl = urlString == null ? null : new URL(urlString); diff --git a/android/app/src/main/java/com/expensify/chat/MainActivity.java b/android/app/src/main/java/com/expensify/chat/MainActivity.java index 23da53ae6d3c..24dcf36a177b 100644 --- a/android/app/src/main/java/com/expensify/chat/MainActivity.java +++ b/android/app/src/main/java/com/expensify/chat/MainActivity.java @@ -4,6 +4,8 @@ import android.content.pm.ActivityInfo; import com.expensify.chat.bootsplash.BootSplash; import com.facebook.react.ReactActivity; +import com.facebook.react.ReactActivityDelegate; +import com.facebook.react.ReactRootView; public class MainActivity extends ReactActivity { @@ -16,6 +18,37 @@ protected String getMainComponentName() { return "NewExpensify"; } + /** + * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and + * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer + * (Paper). + */ + @Override + protected ReactActivityDelegate createReactActivityDelegate() { + return new MainActivityDelegate(this, getMainComponentName()); + } + + public static class MainActivityDelegate extends ReactActivityDelegate { + public MainActivityDelegate(ReactActivity activity, String mainComponentName) { + super(activity, mainComponentName); + } + + @Override + protected ReactRootView createRootView() { + ReactRootView reactRootView = new ReactRootView(getContext()); + // If you opted-in for the New Architecture, we enable the Fabric Renderer. New delegate and enabling Fabric in ReactRootView is only required for the new architecture builds. + reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); + return reactRootView; + } + + @Override + protected boolean isConcurrentRootEnabled() { + // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18). + // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html + return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; + } + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(null); diff --git a/android/app/src/main/java/com/expensify/chat/MainApplication.java b/android/app/src/main/java/com/expensify/chat/MainApplication.java index 26ba1a3f6f5f..68c2cb67d0e1 100644 --- a/android/app/src/main/java/com/expensify/chat/MainApplication.java +++ b/android/app/src/main/java/com/expensify/chat/MainApplication.java @@ -14,6 +14,7 @@ import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; +import com.facebook.react.config.ReactFeatureFlags; import com.facebook.soloader.SoLoader; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Field; @@ -55,14 +56,25 @@ protected JSIModulePackage getJSIModulePackage() { } }; + // TODO: Use this to enable new architecture. + // private final ReactNativeHost mNewArchitectureNativeHost = + // new MainApplicationReactNativeHost(this); + private final ReactNativeHost mNewArchitectureNativeHost = null; + @Override public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; + if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { + return mNewArchitectureNativeHost; + } else { + return mReactNativeHost; + } } @Override public void onCreate() { super.onCreate(); + // If you opted-in for the New Architecture, we enable the TurboModule system + ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; SoLoader.init(this, /* native exopackage */ false); initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); if (BuildConfig.DEBUG) { diff --git a/android/app/src/main/java/com/expensify/chat/newarchitecture/MainApplicationReactNativeHost.java b/android/app/src/main/java/com/expensify/chat/newarchitecture/MainApplicationReactNativeHost.java new file mode 100644 index 000000000000..c8bb18bd02c7 --- /dev/null +++ b/android/app/src/main/java/com/expensify/chat/newarchitecture/MainApplicationReactNativeHost.java @@ -0,0 +1,116 @@ +package com.expensify.chat.newarchitecture; + +import android.app.Application; +import androidx.annotation.NonNull; +import com.facebook.react.PackageList; +import com.facebook.react.ReactInstanceManager; +import com.facebook.react.ReactNativeHost; +import com.facebook.react.ReactPackage; +import com.facebook.react.ReactPackageTurboModuleManagerDelegate; +import com.facebook.react.bridge.JSIModulePackage; +import com.facebook.react.bridge.JSIModuleProvider; +import com.facebook.react.bridge.JSIModuleSpec; +import com.facebook.react.bridge.JSIModuleType; +import com.facebook.react.bridge.JavaScriptContextHolder; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.bridge.UIManager; +import com.facebook.react.fabric.ComponentFactory; +import com.facebook.react.fabric.CoreComponentsRegistry; +import com.facebook.react.fabric.FabricJSIModuleProvider; +import com.facebook.react.fabric.ReactNativeConfig; +import com.facebook.react.uimanager.ViewManagerRegistry; +import com.expensify.chat.BuildConfig; +import com.expensify.chat.newarchitecture.components.MainComponentsRegistry; +import com.expensify.chat.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; +import java.util.ArrayList; +import java.util.List; + +/** + * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both + * TurboModule delegates and the Fabric Renderer. + * + *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the + * `newArchEnabled` property). Is ignored otherwise. + */ +public class MainApplicationReactNativeHost extends ReactNativeHost { + public MainApplicationReactNativeHost(Application application) { + super(application); + } + + @Override + public boolean getUseDeveloperSupport() { + return BuildConfig.DEBUG; + } + + @Override + protected List getPackages() { + List packages = new PackageList(this).getPackages(); + // Packages that cannot be autolinked yet can be added manually here, for example: + // packages.add(new MyReactNativePackage()); + // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: + // packages.add(new TurboReactPackage() { ... }); + // If you have custom Fabric Components, their ViewManagers should also be loaded here + // inside a ReactPackage. + return packages; + } + + @Override + protected String getJSMainModuleName() { + return "index"; + } + + @NonNull + @Override + protected ReactPackageTurboModuleManagerDelegate.Builder + getReactPackageTurboModuleManagerDelegateBuilder() { + // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary + // for the new architecture and to use TurboModules correctly. + return new MainApplicationTurboModuleManagerDelegate.Builder(); + } + + @Override + protected JSIModulePackage getJSIModulePackage() { + return new JSIModulePackage() { + @Override + public List getJSIModules( + final ReactApplicationContext reactApplicationContext, + final JavaScriptContextHolder jsContext) { + final List specs = new ArrayList<>(); + + // Here we provide a new JSIModuleSpec that will be responsible of providing the + // custom Fabric Components. + specs.add( + new JSIModuleSpec() { + @Override + public JSIModuleType getJSIModuleType() { + return JSIModuleType.UIManager; + } + + @Override + public JSIModuleProvider getJSIModuleProvider() { + final ComponentFactory componentFactory = new ComponentFactory(); + CoreComponentsRegistry.register(componentFactory); + + // Here we register a Components Registry. + // The one that is generated with the template contains no components + // and just provides you the one from React Native core. + MainComponentsRegistry.register(componentFactory); + + final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); + + ViewManagerRegistry viewManagerRegistry = + new ViewManagerRegistry( + reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); + + return new FabricJSIModuleProvider( + reactApplicationContext, + componentFactory, + ReactNativeConfig.DEFAULT_CONFIG, + viewManagerRegistry); + } + }); + return specs; + } + }; + } +} diff --git a/android/app/src/main/java/com/expensify/chat/newarchitecture/components/MainComponentsRegistry.java b/android/app/src/main/java/com/expensify/chat/newarchitecture/components/MainComponentsRegistry.java new file mode 100644 index 000000000000..a5cf79a4950c --- /dev/null +++ b/android/app/src/main/java/com/expensify/chat/newarchitecture/components/MainComponentsRegistry.java @@ -0,0 +1,36 @@ +package com.expensify.chat.newarchitecture.components; + +import com.facebook.jni.HybridData; +import com.facebook.proguard.annotations.DoNotStrip; +import com.facebook.react.fabric.ComponentFactory; +import com.facebook.soloader.SoLoader; + +/** + * Class responsible to load the custom Fabric Components. This class has native methods and needs a + * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ + * folder for you). + * + *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the + * `newArchEnabled` property). Is ignored otherwise. + */ +@DoNotStrip +public class MainComponentsRegistry { + static { + SoLoader.loadLibrary("fabricjni"); + } + + @DoNotStrip private final HybridData mHybridData; + + @DoNotStrip + private native HybridData initHybrid(ComponentFactory componentFactory); + + @DoNotStrip + private MainComponentsRegistry(ComponentFactory componentFactory) { + mHybridData = initHybrid(componentFactory); + } + + @DoNotStrip + public static MainComponentsRegistry register(ComponentFactory componentFactory) { + return new MainComponentsRegistry(componentFactory); + } +} diff --git a/android/app/src/main/java/com/expensify/chat/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/android/app/src/main/java/com/expensify/chat/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java new file mode 100644 index 000000000000..1781cfd57ca3 --- /dev/null +++ b/android/app/src/main/java/com/expensify/chat/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java @@ -0,0 +1,48 @@ +package com.expensify.chat.newarchitecture.modules; + +import com.facebook.jni.HybridData; +import com.facebook.react.ReactPackage; +import com.facebook.react.ReactPackageTurboModuleManagerDelegate; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.soloader.SoLoader; +import java.util.List; + +/** + * Class responsible to load the TurboModules. This class has native methods and needs a + * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ + * folder for you). + * + *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the + * `newArchEnabled` property). Is ignored otherwise. + */ +public class MainApplicationTurboModuleManagerDelegate + extends ReactPackageTurboModuleManagerDelegate { + + private static volatile boolean sIsSoLibraryLoaded; + + protected MainApplicationTurboModuleManagerDelegate( + ReactApplicationContext reactApplicationContext, List packages) { + super(reactApplicationContext, packages); + } + + protected native HybridData initHybrid(); + + native boolean canCreateTurboModule(String moduleName); + + public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { + protected MainApplicationTurboModuleManagerDelegate build( + ReactApplicationContext context, List packages) { + return new MainApplicationTurboModuleManagerDelegate(context, packages); + } + } + + @Override + protected synchronized void maybeLoadOtherSoLibraries() { + if (!sIsSoLibraryLoaded) { + // If you change the name of your application .so file in the Android.mk file, + // make sure you update the name here as well. + SoLoader.loadLibrary("rndiffapp_appmodules"); + sIsSoLibraryLoaded = true; + } + } +} diff --git a/android/app/src/main/jni/Android.mk b/android/app/src/main/jni/Android.mk new file mode 100644 index 000000000000..842579d5ed94 --- /dev/null +++ b/android/app/src/main/jni/Android.mk @@ -0,0 +1,48 @@ +THIS_DIR := $(call my-dir) + +include $(REACT_ANDROID_DIR)/Android-prebuilt.mk + +# If you wish to add a custom TurboModule or Fabric component in your app you +# will have to include the following autogenerated makefile. +# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk +include $(CLEAR_VARS) + +LOCAL_PATH := $(THIS_DIR) + +# You can customize the name of your application .so file here. +LOCAL_MODULE := rndiffapp_appmodules + +LOCAL_C_INCLUDES := $(LOCAL_PATH) +LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +# If you wish to add a custom TurboModule or Fabric component in your app you +# will have to uncomment those lines to include the generated source +# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni) +# +# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni +# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp) +# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni + +# Here you should add any native library you wish to depend on. +LOCAL_SHARED_LIBRARIES := \ + libfabricjni \ + libfbjni \ + libfolly_runtime \ + libglog \ + libjsi \ + libreact_codegen_rncore \ + libreact_debug \ + libreact_nativemodule_core \ + libreact_render_componentregistry \ + libreact_render_core \ + libreact_render_debug \ + libreact_render_graphics \ + librrc_view \ + libruntimeexecutor \ + libturbomodulejsijni \ + libyoga + +LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall + +include $(BUILD_SHARED_LIBRARY) diff --git a/android/app/src/main/jni/MainApplicationModuleProvider.cpp b/android/app/src/main/jni/MainApplicationModuleProvider.cpp new file mode 100644 index 000000000000..0ac23cc62634 --- /dev/null +++ b/android/app/src/main/jni/MainApplicationModuleProvider.cpp @@ -0,0 +1,24 @@ +#include "MainApplicationModuleProvider.h" + +#include + +namespace facebook { +namespace react { + +std::shared_ptr MainApplicationModuleProvider( + const std::string moduleName, + const JavaTurboModule::InitParams ¶ms) { + // Here you can provide your own module provider for TurboModules coming from + // either your application or from external libraries. The approach to follow + // is similar to the following (for a library called `samplelibrary`: + // + // auto module = samplelibrary_ModuleProvider(moduleName, params); + // if (module != nullptr) { + // return module; + // } + // return rncore_ModuleProvider(moduleName, params); + return rncore_ModuleProvider(moduleName, params); +} + +} // namespace react +} // namespace facebook diff --git a/android/app/src/main/jni/MainApplicationModuleProvider.h b/android/app/src/main/jni/MainApplicationModuleProvider.h new file mode 100644 index 000000000000..0fa43fa69ad4 --- /dev/null +++ b/android/app/src/main/jni/MainApplicationModuleProvider.h @@ -0,0 +1,16 @@ +#pragma once + +#include +#include + +#include + +namespace facebook { +namespace react { + +std::shared_ptr MainApplicationModuleProvider( + const std::string moduleName, + const JavaTurboModule::InitParams ¶ms); + +} // namespace react +} // namespace facebook diff --git a/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp b/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp new file mode 100644 index 000000000000..dbbdc3d13205 --- /dev/null +++ b/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp @@ -0,0 +1,45 @@ +#include "MainApplicationTurboModuleManagerDelegate.h" +#include "MainApplicationModuleProvider.h" + +namespace facebook { +namespace react { + +jni::local_ref +MainApplicationTurboModuleManagerDelegate::initHybrid( + jni::alias_ref) { + return makeCxxInstance(); +} + +void MainApplicationTurboModuleManagerDelegate::registerNatives() { + registerHybrid({ + makeNativeMethod( + "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), + makeNativeMethod( + "canCreateTurboModule", + MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), + }); +} + +std::shared_ptr +MainApplicationTurboModuleManagerDelegate::getTurboModule( + const std::string name, + const std::shared_ptr jsInvoker) { + // Not implemented yet: provide pure-C++ NativeModules here. + return nullptr; +} + +std::shared_ptr +MainApplicationTurboModuleManagerDelegate::getTurboModule( + const std::string name, + const JavaTurboModule::InitParams ¶ms) { + return MainApplicationModuleProvider(name, params); +} + +bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( + std::string name) { + return getTurboModule(name, nullptr) != nullptr || + getTurboModule(name, {.moduleName = name}) != nullptr; +} + +} // namespace react +} // namespace facebook diff --git a/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h b/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h new file mode 100644 index 000000000000..2dc0d8f514b2 --- /dev/null +++ b/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h @@ -0,0 +1,38 @@ +#include +#include + +#include +#include + +namespace facebook { +namespace react { + +class MainApplicationTurboModuleManagerDelegate + : public jni::HybridClass< + MainApplicationTurboModuleManagerDelegate, + TurboModuleManagerDelegate> { + public: + // Adapt it to the package you used for your Java class. + static constexpr auto kJavaDescriptor = + "Lcom/expensify/chat/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; + + static jni::local_ref initHybrid(jni::alias_ref); + + static void registerNatives(); + + std::shared_ptr getTurboModule( + const std::string name, + const std::shared_ptr jsInvoker) override; + std::shared_ptr getTurboModule( + const std::string name, + const JavaTurboModule::InitParams ¶ms) override; + + /** + * Test-only method. Allows user to verify whether a TurboModule can be + * created by instances of this class. + */ + bool canCreateTurboModule(std::string name); +}; + +} // namespace react +} // namespace facebook diff --git a/android/app/src/main/jni/MainComponentsRegistry.cpp b/android/app/src/main/jni/MainComponentsRegistry.cpp new file mode 100644 index 000000000000..8f7edffd6423 --- /dev/null +++ b/android/app/src/main/jni/MainComponentsRegistry.cpp @@ -0,0 +1,61 @@ +#include "MainComponentsRegistry.h" + +#include +#include +#include +#include + +namespace facebook { +namespace react { + +MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {} + +std::shared_ptr +MainComponentsRegistry::sharedProviderRegistry() { + auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry(); + + // Custom Fabric Components go here. You can register custom + // components coming from your App or from 3rd party libraries here. + // + // providerRegistry->add(concreteComponentDescriptorProvider< + // AocViewerComponentDescriptor>()); + return providerRegistry; +} + +jni::local_ref +MainComponentsRegistry::initHybrid( + jni::alias_ref, + ComponentFactory *delegate) { + auto instance = makeCxxInstance(delegate); + + auto buildRegistryFunction = + [](EventDispatcher::Weak const &eventDispatcher, + ContextContainer::Shared const &contextContainer) + -> ComponentDescriptorRegistry::Shared { + auto registry = MainComponentsRegistry::sharedProviderRegistry() + ->createComponentDescriptorRegistry( + {eventDispatcher, contextContainer}); + + auto mutableRegistry = + std::const_pointer_cast(registry); + + mutableRegistry->setFallbackComponentDescriptor( + std::make_shared( + ComponentDescriptorParameters{ + eventDispatcher, contextContainer, nullptr})); + + return registry; + }; + + delegate->buildRegistryFunction = buildRegistryFunction; + return instance; +} + +void MainComponentsRegistry::registerNatives() { + registerHybrid({ + makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid), + }); +} + +} // namespace react +} // namespace facebook diff --git a/android/app/src/main/jni/MainComponentsRegistry.h b/android/app/src/main/jni/MainComponentsRegistry.h new file mode 100644 index 000000000000..d38e39614efc --- /dev/null +++ b/android/app/src/main/jni/MainComponentsRegistry.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include +#include +#include + +namespace facebook { +namespace react { + +class MainComponentsRegistry + : public facebook::jni::HybridClass { + public: + // Adapt it to the package you used for your Java class. + constexpr static auto kJavaDescriptor = + "Lcom/expensify/chat/newarchitecture/components/MainComponentsRegistry;"; + + static void registerNatives(); + + MainComponentsRegistry(ComponentFactory *delegate); + + private: + static std::shared_ptr + sharedProviderRegistry(); + + static jni::local_ref initHybrid( + jni::alias_ref, + ComponentFactory *delegate); +}; + +} // namespace react +} // namespace facebook diff --git a/android/app/src/main/jni/OnLoad.cpp b/android/app/src/main/jni/OnLoad.cpp new file mode 100644 index 000000000000..c569b6e865da --- /dev/null +++ b/android/app/src/main/jni/OnLoad.cpp @@ -0,0 +1,11 @@ +#include +#include "MainApplicationTurboModuleManagerDelegate.h" +#include "MainComponentsRegistry.h" + +JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { + return facebook::jni::initialize(vm, [] { + facebook::react::MainApplicationTurboModuleManagerDelegate:: + registerNatives(); + facebook::react::MainComponentsRegistry::registerNatives(); + }); +} diff --git a/android/app/src/main/res/drawable/rn_edit_text_material.xml b/android/app/src/main/res/drawable/rn_edit_text_material.xml new file mode 100644 index 000000000000..f35d9962026a --- /dev/null +++ b/android/app/src/main/res/drawable/rn_edit_text_material.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index a6e0f567f7e0..297b87b433dd 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -8,6 +8,7 @@ @color/accent @color/white true + @drawable/rn_edit_text_material