Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rn71 prep #4286

Merged
merged 11 commits into from
Jun 23, 2023
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ buildscript {
// in the individual module build.gradle files

// Edge additions:
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.gms:google-services:4.3.14'
}
}

Expand Down
16 changes: 8 additions & 8 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- _NIODataStructures (2.32.3)
- boost (1.76.0)
- BugsnagReactNative (7.16.4):
- BugsnagReactNative (7.20.2):
- React-Core
- BVLinearGradient (2.5.6):
- React
Expand Down Expand Up @@ -476,7 +476,7 @@ PODS:
- react-native-tcp-socket (5.6.1):
- CocoaAsyncSocket
- React-Core
- react-native-webview (11.18.2):
- react-native-webview (13.2.2):
- React-Core
- react-native-zcash (0.3.3):
- React
Expand Down Expand Up @@ -556,7 +556,7 @@ PODS:
- React
- RNCPicker (2.4.0):
- React-Core
- RNDateTimePicker (6.1.3):
- RNDateTimePicker (7.2.0):
- React-Core
- RNDeviceInfo (8.7.1):
- React-Core
Expand Down Expand Up @@ -593,7 +593,7 @@ PODS:
- React
- RNReactNativeHapticFeedback (1.14.0):
- React-Core
- RNReanimated (2.8.0):
- RNReanimated (2.17.0):
- DoubleConversion
- FBLazyVector
- FBReactNativeSpec
Expand Down Expand Up @@ -1101,7 +1101,7 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
_NIODataStructures: e2077c7dc7c1d6c93e698c85fe04d663a17f53a4
boost: a7c83b31436843459a1961bfd74b96033dc77234
BugsnagReactNative: b9f5f474d0a942cefc5d4811938a8a233666cb5e
BugsnagReactNative: bf6f4ebababa8536726b3014c7d3e4af8c53d488
BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872
CGRPCZlib: b0c9d704a12fa667f1824ffff20688f191945989
CNIOAtomics: 4dde57e1838a29a9b23ef91617505f34751cdbe5
Expand Down Expand Up @@ -1185,7 +1185,7 @@ SPEC CHECKSUMS:
react-native-safe-area-context: 39c2d8be3328df5d437ac1700f4f3a4f75716acc
react-native-smart-splash-screen: a961513689f11d63e8496684c2fa4be2d24fe23b
react-native-tcp-socket: e511a697bc850f504e65b454b5fc4422235407b1
react-native-webview: 8ec7ddf9eb4ddcd92b32cee7907efec19a9ec7cb
react-native-webview: b8ec89966713985111a14d6e4bf98d8b54bced0d
react-native-zcash: 173a2c8148aed6d7a5ec0867b19279dff938942e
React-perflogger: d32ee13196f4ae2e4098fb7f8e7ed4f864c6fb0f
React-RCTActionSheet: 81779c09e34a6a3d6b15783407ba9016a774f535
Expand All @@ -1204,7 +1204,7 @@ SPEC CHECKSUMS:
RNCClipboard: f1736c75ab85b627a4d57587edb4b60999c4dd80
RNCMaskedView: 0e1bc4bfa8365eba5fbbb71e07fbdc0555249489
RNCPicker: 6d5d64e7b90c240c779ee0938ec433c11e2dd758
RNDateTimePicker: 04b805a3cb4d386e5e6aff54b47ace7bad706fda
RNDateTimePicker: 3942382593f104af226ad9c56e16166960c7ae30
RNDeviceInfo: aad3c663b25752a52bf8fce93f2354001dd185aa
RNFastImage: 1f2cab428712a4baaf78d6169eaec7f622556dd7
RNFBAnalytics: fae7572493095e19d22498650c97507f988e627d
Expand All @@ -1218,7 +1218,7 @@ SPEC CHECKSUMS:
RNPermissions: 34d678157c800b25b22a488e4d8babb57456e796
RNQrGenerator: 86fb623932ed29627c6a95b8dc94af5e93d8abe1
RNReactNativeHapticFeedback: 1e3efeca9628ff9876ee7cdd9edec1b336913f8c
RNReanimated: 46cdb89ca59ab7181334f4ed05a70e82ddb36751
RNReanimated: 953281675307b83d2c12ac4c39e6c3415d0ce248
RNScreens: ea4cd3a853063cda19a4e3c28d2e52180c80f4eb
RNShare: 0fec82bd2e67d09f895937ccb4f5a097e714dec2
RNSound: da030221e6ac7e8290c6b43f2b5f2133a8e225b0
Expand Down
6 changes: 6 additions & 0 deletions jestSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ global.nonce = () => _nonce++

jest.mock('react-native-safe-area-context', () => mockSafeAreaContext)

jest.mock('react-native-webview', () => ({
WebView: () => {
return null
}
}))

jest.mock('react-native/Libraries/Utilities/Platform', () => ({
OS: 'ios',
isPad: false,
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@
"uuid": "3.3.2"
},
"dependencies": {
"@bugsnag/react-native": "^7.16.4",
"@bugsnag/react-native": "^7.20.2",
"@connectedcars/react-native-slide-charts": "^1.0.5",
"@ethersproject/shims": "^5.6.0",
"@react-native-async-storage/async-storage": "^1.18.2",
"@react-native-clipboard/clipboard": "^1.10.0",
"@react-native-community/datetimepicker": "^6.1.2",
"@react-native-community/datetimepicker": "^7.2.0",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-community/netinfo": "^8.3.0",
"@react-native-firebase/analytics": "^14.9.1",
Expand Down Expand Up @@ -161,8 +161,8 @@
"react-native-patina": "^0.1.6",
"react-native-permissions": "^3.3.1",
"react-native-piratechain": "^0.3.2",
"react-native-popup-menu": "0.13.3",
"react-native-reanimated": "^2.8.0",
"react-native-popup-menu": "^0.16.1",
"react-native-reanimated": "^2.17.0",
"react-native-safari-view": "^2.1.0",
"react-native-safe-area-context": "^4.5.0",
"react-native-screens": "^3.19.0",
Expand All @@ -173,7 +173,7 @@
"react-native-svg": "^12.3.0",
"react-native-tcp-socket": "^5.6.0",
"react-native-vector-icons": "^7.1.0",
"react-native-webview": "^11.18.1",
"react-native-webview": "^13.2.2",
"react-native-zcash": "^0.3.3",
"react-redux": "^7.2.4",
"redux": "^4.1.0",
Expand Down Expand Up @@ -251,7 +251,7 @@
"process": "^0.11.10",
"react-native-svg-transformer": "^1.0.0",
"react-test-renderer": "17.0.2",
"readable-stream": "^3.6.0",
"readable-stream": "^3.6.2",
"rollup": "^3.20.6",
"rollup-plugin-node-resolve": "4.0.0",
"stream-browserify": "^3.0.0",
Expand Down
40 changes: 0 additions & 40 deletions patches/@react-native-community+datetimepicker+6.1.3.patch

This file was deleted.

21 changes: 21 additions & 0 deletions patches/react-native-reanimated+2.17.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/node_modules/react-native-reanimated/react-native-reanimated.d.ts b/node_modules/react-native-reanimated/react-native-reanimated.d.ts
index c33d830..75f094f 100644
--- a/node_modules/react-native-reanimated/react-native-reanimated.d.ts
+++ b/node_modules/react-native-reanimated/react-native-reanimated.d.ts
@@ -129,6 +129,7 @@ declare module 'react-native-reanimated' {
export type TransformStyleTypes = TransformsStyle['transform'] extends
| readonly (infer T)[]
| undefined
+ | string
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For context on this change: software-mansion/react-native-reanimated#4548 (comment)

Maybe I should stick that link into the commit message.

? T
: never;
export type AdaptTransforms<T> = {
@@ -138,7 +139,7 @@ declare module 'react-native-reanimated' {

export type AnimateStyle<S> = {
[K in keyof S]: K extends 'transform'
- ? AnimatedTransform
+ ? AnimatedTransform | string
: S[K] extends ReadonlyArray<any>
? ReadonlyArray<AnimateStyle<S[K][0]>>
: S[K] extends object
54 changes: 0 additions & 54 deletions patches/react-native-webview+11.18.2.patch

This file was deleted.

41 changes: 41 additions & 0 deletions patches/react-native-webview+13.2.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModuleImpl.java b/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModuleImpl.java
index d5f3533..6e88590 100644
--- a/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModuleImpl.java
+++ b/node_modules/react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModuleImpl.java
@@ -325,10 +325,6 @@ public class RNCWebViewModuleImpl implements ActivityEventListener {

public boolean grantFileDownloaderPermissions(String downloadingMessage, String lackPermissionToDownloadMessage) {
Activity activity = mContext.getCurrentActivity();
- // Permission not required for Android Q and above
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
- return true;
- }

boolean result = ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
if (!result && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
diff --git a/node_modules/react-native-webview/lib/WebViewShared.js b/node_modules/react-native-webview/lib/WebViewShared.js
index 347e915..167692f 100644
--- a/node_modules/react-native-webview/lib/WebViewShared.js
+++ b/node_modules/react-native-webview/lib/WebViewShared.js
@@ -17,7 +17,7 @@ var extractOrigin = function (url) {
return result === null ? '' : result[0];
};
var originWhitelistToRegex = function (originWhitelist) {
- return "^".concat(escapeStringRegexp(originWhitelist).replace(/\\\*/g, '.*'));
+ return "^" + escapeStringRegexp(originWhitelist).replace(/\\\*/g, '.*') + "$";
};
var passesWhitelist = function (compiledWhitelist, url) {
var origin = extractOrigin(url);
diff --git a/node_modules/react-native-webview/src/WebViewShared.tsx b/node_modules/react-native-webview/src/WebViewShared.tsx
index 7e4bc18..759bed8 100644
--- a/node_modules/react-native-webview/src/WebViewShared.tsx
+++ b/node_modules/react-native-webview/src/WebViewShared.tsx
@@ -199,6 +199,8 @@ export const useWebViewLogic = ({
}
// !patch for Android only
onLoadProgress?.(event);
+ // @ts-expect-error
+ updateNavigationState(event);
}, [onLoadProgress]);

const onShouldStartLoadWithRequest = useMemo(() => createOnShouldStartLoadWithRequest(
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/readable-stream/lib/_stream_writable.js
index a2634d7..bfbcfea 100644
index 292415e..a36257e 100644
--- a/node_modules/readable-stream/lib/_stream_writable.js
+++ b/node_modules/readable-stream/lib/_stream_writable.js
@@ -466,7 +466,7 @@ function onwrite(stream, er) {
@@ -440,7 +440,7 @@ function onwrite(stream, er) {
function afterWrite(stream, state, finished, cb) {
if (!finished) onwriteDrain(stream, state);
state.pendingcb--;
- cb();
+ if (cb != null) cb();
finishMaybe(stream, state);
} // Must force callback to be called on nextTick, so that we don't
// emit 'drain' before the write() consumer gets the 'false' return
}

2 changes: 1 addition & 1 deletion src/components/legacy/AirshipModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function AirshipModal<T>(props: Props<T>) {
onCancel={onCancel}
underlay={<BlurView blurType="dark" style={StyleSheet.absoluteFill} />}
>
{typeof children === 'function' ? children({ bottom: 50, left: 0, right: 0, top: 0 }) : children}
{children}
</RealAirshipModal>
)
}
6 changes: 3 additions & 3 deletions src/components/legacy/FormField.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { Dimensions, ViewStyle } from 'react-native'
import { Dimensions } from 'react-native'
import { TextField, TextFieldProps } from 'react-native-material-textfield'

import { THEME } from '../../theme/variables/airbitz'
Expand Down Expand Up @@ -30,11 +30,11 @@ export class FormField extends React.Component<Props> {
}
}

const containerStyle: ViewStyle = {
const containerStyle = {
position: 'relative',
width: Dimensions.get('window').width / 1.52,
height: 60
}
} as const

export const MaterialInputOnWhite = {
containerStyle,
Expand Down
5 changes: 2 additions & 3 deletions src/components/progress-indicators/FillLoader.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import * as React from 'react'
import { ActivityIndicator, StyleSheet, View, ViewPropTypes } from 'react-native'
import { ActivityIndicator, StyleSheet, View, ViewStyle } from 'react-native'

import { THEME } from '../../theme/variables/airbitz'

interface Props {
// @ts-expect-error
indicatorStyles?: ViewPropTypes.style
indicatorStyles?: ViewStyle
size?: 'large' | 'small'
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/scenes/Loans/LoanCreateScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export const LoanCreateScene = (props: Props) => {
.catch(e => showError(e.message))
}

const handleBorrowAmountChanged = React.useCallback((fiatAmount, nativeCryptoAmount) => {
const handleBorrowAmountChanged = React.useCallback((fiatAmount: string, nativeCryptoAmount: string) => {
setBorrowAmountFiat(fiatAmount)
setNativeCryptoBorrowAmount(nativeCryptoAmount)
}, [])
Expand Down
Loading