Skip to content

Commit

Permalink
fix: Revert "feat: retry v8 (#916)" (#937)
Browse files Browse the repository at this point in the history
This reverts commit e24406a.

# Conflicts:
#	packages/app/scripts/eas-build-pre-install.sh
  • Loading branch information
sunnylqm authored Jun 21, 2022
1 parent 46d3222 commit 7f2a218
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 105 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
"**/browserslist": "^4",
"**/immer": "^9",
"**/node-fetch": "^2",
"**/metro-react-native-babel-preset": "0.70.0"
"**/metro-react-native-babel-preset": "0.70.0",
"**/jsc-android": "npm:@onekeyfe/jsc-android"
}
}
8 changes: 4 additions & 4 deletions packages/app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ android {
}


packagingOptions {
// Make sure libjsc.so does not packed in APK
exclude "**/libjsc.so"
}
// packagingOptions {
// // Make sure libjsc.so does not packed in APK
// exclude "**/libjsc.so"
// }
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import java.util.List;
import android.webkit.WebView;

import io.csie.kudo.reactnative.v8.executor.V8ExecutorFactory;
// import io.csie.kudo.reactnative.v8.executor.V8ExecutorFactory;

public class MainApplication extends Application implements ReactApplication , ViewModelStoreOwner {
private final ViewModelStore mViewModelStore = new ViewModelStore();
Expand Down Expand Up @@ -61,14 +61,14 @@ protected String getJSMainModuleName() {
return "__generated__/AppEntry.js";
}

@Override
protected JavaScriptExecutorFactory getJavaScriptExecutorFactory() {
return new V8ExecutorFactory(
getApplicationContext(),
getPackageName(),
AndroidInfoHelpers.getFriendlyDeviceName(),
getUseDeveloperSupport());
}
// @Override
// protected JavaScriptExecutorFactory getJavaScriptExecutorFactory() {
// return new V8ExecutorFactory(
// getApplicationContext(),
// getPackageName(),
// AndroidInfoHelpers.getFriendlyDeviceName(),
// getUseDeveloperSupport());
// }

});

Expand Down
4 changes: 2 additions & 2 deletions packages/app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ PODS:
- RNFBApp
- RNGestureHandler (2.4.2):
- React-Core
- RNReanimated (3.0.0-rc.0):
- RNReanimated (2.8.0):
- DoubleConversion
- FBLazyVector
- FBReactNativeSpec
Expand Down Expand Up @@ -910,7 +910,7 @@ SPEC CHECKSUMS:
RNFBApp: ca5f49bbe21f663142320337eb39956b04de4d12
RNFBCrashlytics: 97bf2b05e4a5523c57adc8f9e5bf6e1b17804482
RNGestureHandler: 61628a2c859172551aa2100d3e73d1e57878392f
RNReanimated: 536c4a11a340b5e0e94629b24101decc2df3126e
RNReanimated: 64573e25e078ae6bec03b891586d50b9ec284393
RNScreens: 4d83613b50b74ed277026375dc0810893b0c347f
RNSVG: 302bfc9905bd8122f08966dc2ce2d07b7b52b9f8
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
Expand Down
5 changes: 2 additions & 3 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"expo-location": "^14.2.2",
"expo-media-library": "^14.1.0",
"expo-splash-screen": "^0.15.1",
"jsc-android": "npm:@onekeyfe/jsc-android",
"lottie-ios": "3.2.3",
"lottie-react": "^2.2.1",
"lottie-react-native": "5.0.1",
Expand All @@ -61,20 +62,18 @@
"react-native-keyboard-manager": "^6.5.4-4",
"react-native-pager-view": "5.4.15",
"react-native-randombytes": "^3.6.1",
"react-native-reanimated": "npm:@onekeyfe/react-native-reanimated",
"react-native-reanimated": "^2.8.0",
"react-native-restart": "0.0.24",
"react-native-safe-area-context": "4.2.4",
"react-native-screens": "3.11.1",
"react-native-svg": "^12.3.0",
"react-native-toast-message": "2.1.2",
"react-native-v8": "^1.4.1",
"react-native-vision-camera": "^2.13.3",
"react-native-web": "0.17.7",
"react-native-webview": "11.18.1",
"readable-stream": "^3.6.0",
"realm": "10.20.0-beta.2",
"text-encoding": "^0.7.0",
"v8-android-jit": "^10.100.0",
"vision-camera-code-scanner": "^0.2.0"
},
"devDependencies": {
Expand Down
28 changes: 14 additions & 14 deletions packages/app/react-native.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module.exports = {
dependencies: {
// disable frameprocessor and vision-camera-code-scanner
// until reanimated v3 offcially supports v8
'vision-camera-code-scanner': {
platforms: {
android: null, // disable Android platform, other platforms will still autolink if provided
},
},
'react-native-vision-camera': {
platforms: {
android: null, // disable Android platform, other platforms will still autolink if provided
},
},
},
// dependencies: {
// // disable frameprocessor and vision-camera-code-scanner
// // until reanimated v3 offcially supports v8
// 'vision-camera-code-scanner': {
// platforms: {
// android: null, // disable Android platform, other platforms will still autolink if provided
// },
// },
// 'react-native-vision-camera': {
// platforms: {
// android: null, // disable Android platform, other platforms will still autolink if provided
// },
// },
// },
};
44 changes: 0 additions & 44 deletions packages/kit/src/views/ScanQrcode/ScanCamera.ios.tsx

This file was deleted.

42 changes: 29 additions & 13 deletions packages/kit/src/views/ScanQrcode/ScanCamera.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React, { FC } from 'react';

import { BarCodeScanner } from 'expo-barcode-scanner';
import { Camera } from 'expo-camera';
import { runOnJS } from 'react-native-reanimated';
import {
Camera,
useCameraDevices,
useFrameProcessor,
} from 'react-native-vision-camera';
import { BarcodeFormat, scanBarcodes } from 'vision-camera-code-scanner';

import { ScanCameraProps } from './types';

Expand All @@ -10,19 +15,30 @@ const ScanCamera: FC<ScanCameraProps> = ({
isActive,
children,
onQrcodeScanned,
}) =>
isActive ? (
<Camera
style={style}
onBarCodeScanned={({ data }) => onQrcodeScanned(data)}
barCodeScannerSettings={{
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
barCodeTypes: [BarCodeScanner.Constants.BarCodeType.qr],
}}
>
}) => {
const devices = useCameraDevices();
const device = devices.back;
const frameProcessor = useFrameProcessor((frame) => {
'worklet';

const detectedBarcodes = scanBarcodes(frame, [BarcodeFormat.QR_CODE], {
checkInverted: true,
});
runOnJS(onQrcodeScanned)(detectedBarcodes[0]?.rawValue);
}, []);
return device ? (
<>
<Camera
style={style}
device={device}
isActive={isActive}
frameProcessor={frameProcessor}
frameProcessorFps={5}
/>
{children}
</Camera>
</>
) : null;
};
ScanCamera.displayName = 'ScanCamera';

export default ScanCamera;
28 changes: 28 additions & 0 deletions packages/kit/src/views/ScanQrcode/ScanCamera.web.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React, { FC } from 'react';

import { BarCodeScanner } from 'expo-barcode-scanner';
import { Camera } from 'expo-camera';

import { ScanCameraProps } from './types';

const ScanCamera: FC<ScanCameraProps> = ({
style,
isActive,
children,
onQrcodeScanned,
}) =>
isActive ? (
<Camera
style={style}
onBarCodeScanned={({ data }) => onQrcodeScanned(data)}
barCodeScannerSettings={{
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
barCodeTypes: [BarCodeScanner.Constants.BarCodeType.qr],
}}
>
{children}
</Camera>
) : null;
ScanCamera.displayName = 'ScanCamera';

export default ScanCamera;
26 changes: 26 additions & 0 deletions patches/@starcoin+starcoin+2.1.5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/node_modules/@starcoin/starcoin/dist/starcoin.js b/node_modules/@starcoin/starcoin/dist/starcoin.js
index cd80f13..80fb4b9 100644
--- a/node_modules/@starcoin/starcoin/dist/starcoin.js
+++ b/node_modules/@starcoin/starcoin/dist/starcoin.js
@@ -438,8 +438,8 @@ var BinarySerializer = /*#__PURE__*/function () {
var low = BigInt(value) & BinarySerializer.BIG_32Fs;
var high = BigInt(value) >> BinarySerializer.BIG_32; // write little endian number

- this.serializeU32(Number(low));
- this.serializeU32(Number(high));
+ this.serializeU32(parseInt(low));
+ this.serializeU32(parseInt(high));
};

_proto.serializeU128 = function serializeU128(value) {
@@ -475,8 +475,8 @@ var BinarySerializer = /*#__PURE__*/function () {
var low = BigInt(value) & BinarySerializer.BIG_32Fs;
var high = BigInt(value) >> BinarySerializer.BIG_32; // write little endian number

- this.serializeI32(Number(low));
- this.serializeI32(Number(high));
+ this.serializeI32(parseInt(low));
+ this.serializeI32(parseInt(high));
};

_proto.serializeI128 = function serializeI128(value) {
20 changes: 5 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14617,7 +14617,7 @@ jsbn@~0.1.0:
resolved "https://registry.nlark.com/jsbn/download/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=

jsc-android@^250230.2.1:
jsc-android@^250230.2.1, "jsc-android@npm:@onekeyfe/jsc-android":
version "250230.2.1"
resolved "https://registry.yarnpkg.com/@onekeyfe/jsc-android/-/jsc-android-250230.2.1.tgz#26917ac7e409642c00df70d4afb390ff708a91f1"
integrity sha512-qZgN2vF/5O8PxC+5ivQL8H4nAPymXfCNtdMDV3nMqtqznWYtL0TwTdk6Ct2WdiOpIwE82klmbBzIlyUCQPYh2Q==
Expand Down Expand Up @@ -18650,10 +18650,10 @@ react-native-randombytes@^3.6.1:
buffer "^4.9.1"
sjcl "^1.0.3"

"react-native-reanimated@npm:@onekeyfe/react-native-reanimated":
version "3.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@onekeyfe/react-native-reanimated/-/react-native-reanimated-3.0.0-rc.0.tgz#53d980a6ee28f85be5bc604c495edfbea42d13d3"
integrity sha512-YcU9aYFA/faxW/i7g8cP4rLfg79H0ylq19+RwOaJX0n9OpOUV2ydzYuRFpF3N3H9maAWm4rRYvJyS82XzPqgEA==
react-native-reanimated@^2.8.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.8.0.tgz#93c06ca84d91fb3865110b0857c49a24e316130e"
integrity sha512-kJvf/UWLBMaGCs9X66MKq5zdFMgwx8D0nHnolbHR7s8ZnbLdb7TlQ/yuzIXqn/9wABfnwtNRI3CyaP1aHWMmZg==
dependencies:
"@babel/plugin-transform-object-assign" "^7.16.7"
"@babel/preset-typescript" "^7.16.7"
Expand Down Expand Up @@ -18756,11 +18756,6 @@ react-native-uuid@^2.0.1:
resolved "https://registry.yarnpkg.com/react-native-uuid/-/react-native-uuid-2.0.1.tgz#ed4e2dfb1683eddb66967eb5dca140dfe1abddb9"
integrity sha512-cptnoIbL53GTCrWlb/+jrDC6tvb7ypIyzbXNJcpR3Vab0mkeaaVd5qnB3f0whXYzS+SMoSQLcUUB0gEWqkPC0g==

react-native-v8@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/react-native-v8/-/react-native-v8-1.4.1.tgz#52129a0f6c52d3fa3d392474b5d7ac6b2e6500e4"
integrity sha512-5HTfa8H4kK2xv1VunT5zZOJxiuPh12VdBoZEBO4i4TTWBNCtuB6VKmHFkAidKXEc8otH6JLYtgVdLe97qnS0mQ==

react-native-vision-camera@^2.13.3:
version "2.13.3"
resolved "https://registry.yarnpkg.com/react-native-vision-camera/-/react-native-vision-camera-2.13.3.tgz#cacd20b7f3fd777691496f007a47a34c02be93be"
Expand Down Expand Up @@ -22004,11 +21999,6 @@ uuid@^8.0.0, uuid@^8.3.0, uuid@^8.3.2:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==

v8-android-jit@^10.100.0:
version "10.100.0"
resolved "https://registry.yarnpkg.com/v8-android-jit/-/v8-android-jit-10.100.0.tgz#7d939ce615b1e8457e5ff52056d01cb5a5bdcefa"
integrity sha512-jakoPAKXK6a/q7LFx2ZjrdcVfR0V4jXaoDAyrWOt3SiPQGL6uq+3tdyQxX6OdPqYrK8xz8HGjW4EhD9xY1fC1Q==

v8-compile-cache@^2.0.3:
version "2.3.0"
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"
Expand Down

0 comments on commit 7f2a218

Please sign in to comment.