Skip to content

Commit

Permalink
Feat/rn73 (#16807)
Browse files Browse the repository at this point in the history
* feat: native libs version check

* feat: rimraf

* fix: build & test error

* fix: stylelint version

* upgrade linaria to latest version (#16747)

* upgrade linaria to latest version

* use className instead style

* format

* restore

* use space instead of tab

* tweak for submit fail

* t

---------

Co-authored-by: Administrator <Administrator@tech8>

* fix(rn): undefinde error

---------

Co-authored-by: f <[email protected]>
Co-authored-by: Administrator <Administrator@tech8>
3 people authored Nov 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9a6bf39 commit c17123d
Showing 46 changed files with 1,122 additions and 1,298 deletions.
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"scripts": {
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./dist",
"clean": "rimraf ./dist",
"test": "jest",
"test:ci": "jest --ci -i --coverage --silent",
"dev": "tsc -w",
2 changes: 1 addition & 1 deletion packages/babel-plugin-transform-taroapi/package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"scripts": {
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./dist",
"clean": "rimraf ./dist",
"build": "tsc",
"test": "cross-env NODE_ENV=jest jest",
"test:ci": "cross-env NODE_ENV=jest jest --ci -i --coverage --silent",
1 change: 0 additions & 1 deletion packages/babel-preset-taro/package.json
Original file line number Diff line number Diff line change
@@ -36,7 +36,6 @@
"@rnx-kit/babel-preset-metro-react-native": "^1.1.8",
"@tarojs/helper": "workspace:*",
"babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
"babel-plugin-transform-imports-api": "1.0.0",
"babel-plugin-transform-solid-jsx": "workspace:*",
"core-js": "^3.36.1"
4 changes: 0 additions & 4 deletions packages/babel-preset-taro/rn/index.js
Original file line number Diff line number Diff line change
@@ -55,10 +55,6 @@ module.exports = (_, options = {}) => {

plugins.push(require('../remove-define-config'))

plugins.push(
[require('babel-plugin-minify-dead-code-elimination'), {}]
)

return {
presets,
plugins
2 changes: 1 addition & 1 deletion packages/create-app/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"scripts": {
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./dist",
"clean": "rimraf ./dist",
"dev": "tsc -w",
"build": "tsc"
},
2 changes: 1 addition & 1 deletion packages/css-to-react-native/package.json
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
"scripts": {
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./dist",
"clean": "rimraf ./dist",
"build": "babel src --ignore *.spec.js --out-dir ./dist",
"test": "jest"
},
2 changes: 1 addition & 1 deletion packages/jest-helper/package.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
"scripts": {
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./lib",
"clean": "rimraf ./lib",
"build": "tsc",
"dev": "tsc -w"
},
2 changes: 1 addition & 1 deletion packages/postcss-html-transform/package.json
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"scripts": {
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./dist",
"clean": "rimraf ./dist",
"build": "tsc",
"dev": "tsc -w"
},
2 changes: 1 addition & 1 deletion packages/rollup-plugin-copy/package.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
"scripts": {
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./lib",
"clean": "rimraf ./lib",
"build": "tsc",
"dev": "tsc -w"
},
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
"scripts": {
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./dist",
"clean": "rimraf ./dist",
"build": "pnpm run rollup --environment NODE_ENV:production",
"dev": "pnpm run rollup --environment NODE_ENV:development -w",
"rollup": "rollup --config rollup.config.ts --configPlugin typescript",
5 changes: 3 additions & 2 deletions packages/stylelint-taro-rn/package.json
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
"scripts": {
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./dist",
"clean": "rimraf ./dist",
"build": "pnpm run rollup --environment NODE_ENV:production",
"dev": "pnpm run rollup --environment NODE_ENV:development -w",
"rollup": "rollup --config rollup.config.ts --configPlugin typescript",
@@ -45,7 +45,8 @@
"react-native-known-styling-properties": "^1.3.0"
},
"devDependencies": {
"lodash": "^4.17.21"
"lodash": "^4.17.21",
"stylelint": "^16.4.0"
},
"peerDependencies": {
"stylelint": "^16"
2 changes: 1 addition & 1 deletion packages/stylelint-taro/package.json
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"scripts": {
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./dist",
"clean": "rimraf ./dist",
"build": "pnpm run rollup --environment NODE_ENV:production",
"dev": "pnpm run rollup --environment NODE_ENV:development -w",
"rollup": "rollup --config rollup.config.ts --configPlugin typescript",
2 changes: 1 addition & 1 deletion packages/taro-cli-convertor/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"prebuild": "pnpm run clean",
"build": "tsc",
"dev": "tsc -w",
"clean": "rimraf --impl=move-remove dist",
"clean": "rimraf dist",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
"format": "prettier --write \"{src, __tests__}/**/*.{ts,tsx,js,jsx}\" && eslint src __tests__ --ext .js --ext .jsx --ext .ts --ext .tsx --fix",
"test": "jest",
2 changes: 1 addition & 1 deletion packages/taro-cli/package.json
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"prebuild": "pnpm run clean",
"build": "tsc",
"dev": "tsc -w",
"clean": "rimraf --impl=move-remove dist"
"clean": "rimraf dist"
},
"files": [
"bin",
2 changes: 1 addition & 1 deletion packages/taro-components-advanced/package.json
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"build": "rollup -c",
"clean": "rimraf --impl=move-remove ./dist",
"clean": "rimraf ./dist",
"dev": "pnpm run build -w"
},
"keywords": [],
2 changes: 1 addition & 1 deletion packages/taro-components-library-react/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"scripts": {
"prebuild": "pnpm run clean && node ./scripts/fix.js",
"build": "rollup -c",
"clean": "rimraf --impl=move-remove ../taro-components/lib/react",
"clean": "rimraf ../taro-components/lib/react",
"dev": "pnpm run build -w",
"prod": "pnpm run build"
},
2 changes: 1 addition & 1 deletion packages/taro-components-library-solid/package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"scripts": {
"prebuild": "pnpm run clean && node ./scripts/fix.js",
"build": "rollup -c",
"clean": "rimraf --impl=move-remove ../taro-components/lib/solid",
"clean": "rimraf ../taro-components/lib/solid",
"dev": "pnpm run build -w",
"prod": "pnpm run build"
},
2 changes: 1 addition & 1 deletion packages/taro-components-library-vue3/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"prod": "pnpm run build",
"prebuild": "pnpm run clean && node ./scripts/fix.js",
"build": "rollup -c",
"clean": "rimraf --impl=move-remove ../taro-components/lib/vue3",
"clean": "rimraf ../taro-components/lib/vue3",
"dev": "pnpm run build -w"
},
"keywords": [],
45 changes: 22 additions & 23 deletions packages/taro-components-rn/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"prod": "pnpm run build",
"assets": "cpy 'src/**/*.png' '!src/__tests__/*' dist",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./dist",
"clean": "rimraf ./dist",
"build": "tsc && pnpm run assets",
"dev": "pnpm run assets && tsc --watch",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
@@ -33,43 +33,42 @@
},
"dependencies": {
"@ant-design/react-native": "5.0.0",
"@react-native-community/slider": "4.5.2",
"@react-native-picker/picker": "2.7.5",
"@tarojs/components": "workspace:*",
"@tarojs/router-rn": "workspace:*",
"expo-av": "~13.10.0",
"expo-camera": "~15.0.8",
"prop-types": "^15.8.1",
"react-native-maps": "1.3.2",
"react-native-pager-view": "6.2.3",
"react-native-webview": "13.3.1"
"react-native-maps": "1.3.2"
},
"devDependencies": {
"@react-native-community/slider": "4.4.2",
"@react-native-picker/picker": "2.6.1",
"@babel/core": "^7.24.4",
"@babel/preset-env": "^7.24.4",
"@react-native/babel-preset": "^0.73.18",
"@testing-library/jest-native": "^5.4.2",
"@testing-library/react-native": "^12.4.1",
"cpy-cli": "^5.0.0",
"dpdm": "^3.14.0",
"expo": "~51.0.5",
"expo": "~50.0.0",
"expo-av": "~13.10.6",
"expo-camera": "~14.1.3",
"expo-module-scripts": "^3.5.1",
"jest-expo": "^51.0.1",
"jest-expo": "~50.0.3",
"react": "^18.2.0",
"react-native": "^0.72.3",
"react-native-svg": "14.1.0"
"react-native": "^0.73.1",
"react-native-pager-view": "6.2.3",
"react-native-svg": "14.1.0",
"react-native-webview": "13.6.4"
},
"peerDependencies": {
"@react-native-community/slider": ">= 4.5",
"@react-native-picker/picker": ">= 2.6",
"expo": ">= 51",
"expo-av": ">= 13.10.0",
"expo-barcode-scanner": ">= 13",
"expo-camera": ">= 15",
"react": ">= 18",
"react-native": ">= 0.63.0",
"react-native-pager-view": "~ 6.2",
"react-native-svg": ">= 14.1.0",
"react-native-webview": ">= 13"
"@react-native-community/slider": "4.4.2",
"@react-native-picker/picker": "2.6.1",
"expo": "~50.0.0",
"expo-av": "~13.10.6",
"expo-camera": "~14.1.3",
"react": "^18.2.0",
"react-native": "^0.73.1",
"react-native-pager-view": "6.2.3",
"react-native-svg": "14.1.0",
"react-native-webview": "13.6.4"
}
}
32 changes: 16 additions & 16 deletions packages/taro-components-rn/src/components/Camera/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BarcodeScanningResult, BarcodeType, Camera, CameraMountError, CameraView, PermissionStatus } from 'expo-camera'
import { CameraType } from 'expo-camera/build/legacy/Camera.types'
import { BarCodeScanningResult, Camera, CameraMountError, CameraType, PermissionStatus } from 'expo-camera'
import React, { Component } from 'react'

import Text from '../Text'
@@ -15,12 +14,12 @@ export class _Camera extends Component<CameraProps, CameraState> {
}
}

expoCameraRef = React.createRef<CameraView>()
expoCameraRef = React.createRef<Camera>()

async componentDidMount(): Promise<void> {
const permission = await Camera.requestCameraPermissionsAsync()
this.setState({
hasPermission: permission?.status === PermissionStatus.GRANTED
hasPermission: permission?.status === PermissionStatus.GRANTED,
})
}

@@ -34,14 +33,15 @@ export class _Camera extends Component<CameraProps, CameraState> {
this.props.onInitDone && this.props.onInitDone(event)
}

onScanCode = (event: BarcodeScanningResult): void => {
onScanCode = (event: BarCodeScanningResult): void => {
const { data } = event
this.props.onScanCode && this.props.onScanCode({
detail: {
result: data
},
...event
} as any)
this.props.onScanCode &&
this.props.onScanCode({
detail: {
result: data,
},
...event,
} as any)
}

render(): JSX.Element {
@@ -59,16 +59,16 @@ export class _Camera extends Component<CameraProps, CameraState> {
mode === 'scanCode'
? {
barCodeScannerSettings: {
barCodeTypes: ['qr'] as BarcodeType[]
barCodeTypes: ['qr'],
},
onBarCodeScanned: this.onScanCode
onBarCodeScanned: this.onScanCode,
}
: {}
return (
<CameraView
<Camera
ref={this.expoCameraRef}
facing={type}
flash={flash}
type={type}
flashMode={flash}
onMountError={this.onError}
onCameraReady={this.onInitDone}
{...barCodeScannerSettings}
2 changes: 1 addition & 1 deletion packages/taro-framework-react/package.json
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
"prod": "pnpm run build",
"prebuild": "run-s clean",
"build": "pnpm run rollup --environment NODE_ENV:production",
"clean": "rimraf --impl=move-remove dist",
"clean": "rimraf dist",
"dev": "pnpm run rollup --environment NODE_ENV:development -w",
"rollup": "rollup --config rollup.config.ts --configPlugin typescript"
},
2 changes: 1 addition & 1 deletion packages/taro-framework-solid/package.json
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
"prod": "pnpm run build",
"prebuild": "run-s clean",
"build": "pnpm run rollup --environment NODE_ENV:production",
"clean": "rimraf --impl=move-remove dist",
"clean": "rimraf dist",
"dev": "pnpm run rollup --environment NODE_ENV:development -w",
"rollup": "rollup --config rollup.config.ts --configPlugin typescript"
},
2 changes: 1 addition & 1 deletion packages/taro-h5/package.json
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
],
"scripts": {
"prod": "pnpm run build",
"prebuild": "rimraf --impl=move-remove ./dist",
"prebuild": "rimraf ./dist",
"build": "pnpm run rollup --environment NODE_ENV:production",
"dev": "pnpm run rollup --environment NODE_ENV:development -w",
"rollup": "rollup --config rollup.config.mts --configPlugin @rollup/plugin-typescript --bundleConfigAsCjs",
2 changes: 1 addition & 1 deletion packages/taro-helper/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"types": "dist/index.d.ts",
"scripts": {
"prod": "pnpm run build",
"clean": "rimraf --impl=move-remove dist",
"clean": "rimraf dist",
"prebuild": "pnpm run clean",
"build": "tsc",
"postbuild": "pnpm run swc:backup",
2 changes: 1 addition & 1 deletion packages/taro-platform-h5/package.json
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
"prod": "pnpm run build",
"prebuild": "run-s clean generate:desc",
"build": "pnpm run rollup --environment NODE_ENV:production",
"clean": "rimraf --impl=move-remove dist",
"clean": "rimraf dist",
"dev": "pnpm run rollup --environment NODE_ENV:development -w",
"generate:desc": "pnpm run tsx --files ./build/definition-json",
"rollup": "rollup -c",
14 changes: 7 additions & 7 deletions packages/taro-rn-runner/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"scripts": {
"prod": "pnpm run build",
"prebuild": "pnpm run clean",
"clean": "rimraf --impl=move-remove ./dist",
"clean": "rimraf ./dist",
"build": "tsc",
"dev": "tsc -w",
"lint": "eslint src templates __tests__ --ext .js,.ts",
@@ -53,19 +53,19 @@
"@tarojs/components": "workspace:*",
"@tarojs/taro": "workspace:*",
"babel-plugin-transform-react-jsx-to-rn-stylesheet": "workspace:*",
"expo": "~51.0.5",
"expo-file-system": "~16.0.0",
"expo": "~50.0.0",
"expo-file-system": "~16.0.9",
"query-string": "^9.0.0",
"react": "^18.2.0",
"react-is": "^18.3.1",
"react-native": "^0.72.3",
"react-native": "^0.73.1",
"react-native-root-siblings": "^5.0.1",
"rollup": "^4.16.4"
},
"peerDependencies": {
"babel-preset-taro": "workspace:*",
"expo": ">= 51",
"react": ">= 18",
"react-native": ">= 0.63.0"
"expo": "~50.0.0",
"react": "^18.2.0",
"react-native": "^0.73.1"
}
}
Loading

0 comments on commit c17123d

Please sign in to comment.