Skip to content

Commit

Permalink
feat: update to 3.5.7 & fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqingchen committed Nov 22, 2022
1 parent d2a0123 commit 2bae920
Show file tree
Hide file tree
Showing 14 changed files with 986 additions and 549 deletions.
1 change: 1 addition & 0 deletions config/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
},
defineConstants: {
},
isWatch: true,
mini: {},
h5: {
esnextModules: ['taro-ui']
Expand Down
7 changes: 6 additions & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ const config = {
750: 1,
828: 1.81 / 2
},
compiler: 'webpack5',
compiler: {
type: 'webpack5',
prebundle: {
enable: false,
},
},
sourceRoot: "src",
outputRoot: `dist/${process.env.TARO_ENV}`,
plugins: [],
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@
"@babel/runtime": "^7.7.7",
"@codler/react-native-keyboard-aware-scroll-view": "^2.0.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@tarojs/cli": "^3.5.2",
"@tarojs/components": "^3.5.2",
"@tarojs/plugin-framework-react": "^3.5.2",
"@tarojs/react": "^3.5.2",
"@tarojs/rn-runner": "^3.5.2",
"@tarojs/runtime": "^3.5.2",
"@tarojs/taro": "^3.5.2",
"@tarojs/taro-rn": "^3.5.2",
"@tarojs/cli": "^3.5.7",
"@tarojs/components": "^3.5.7",
"@tarojs/plugin-framework-react": "^3.5.7",
"@tarojs/react": "^3.5.7",
"@tarojs/rn-runner": "^3.5.7",
"@tarojs/runtime": "^3.5.7",
"@tarojs/taro": "^3.5.7",
"@tarojs/taro-rn": "^3.5.7",
"lodash": "4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand All @@ -72,14 +72,14 @@
"@babel/core": "^7.8.0",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@tarojs/webpack5-runner": "^3.5.2",
"@tarojs/webpack5-runner": "^3.5.7",
"@types/react": "^17.0.2",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^2.x",
"@typescript-eslint/parser": "^2.x",
"babel-preset-taro": "^3.5.2",
"babel-preset-taro": "^3.5.7",
"eslint": "^6.8.0",
"eslint-config-taro": "^3.5.2",
"eslint-config-taro": "^3.5.7",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-react-hooks": "^4.2.0",
Expand Down
10 changes: 2 additions & 8 deletions src/components/box-shadow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @Last Modified by: qiuz
*/

import { Color, ComponentOptions } from "@tarojs/taro";
import { Color } from "@tarojs/taro";
import { View } from "@tarojs/components";
import React, { FunctionComponent, CSSProperties } from "react";
import "./index.scss";
Expand All @@ -29,9 +29,7 @@ interface BoxShadowProps {
style?: CSSProperties;
}

const BoxShadow: FunctionComponent<BoxShadowProps> & {
options?: ComponentOptions;
} = props => {
const BoxShadow: FunctionComponent<BoxShadowProps> = props => {
const {
shadowColor = "#000",
shadowOffset = { width: 0, height: 0 },
Expand Down Expand Up @@ -73,8 +71,4 @@ const BoxShadow: FunctionComponent<BoxShadowProps> & {
);
};

BoxShadow.options = {
addGlobalClass: true
};

export default BoxShadow;
9 changes: 1 addition & 8 deletions src/components/linear-gradient/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/

import React, { FunctionComponent } from "react";
import { ComponentOptions } from "@tarojs/taro";
import { View, Image } from "@tarojs/components";
import { LinearGradientProps } from "react-native-linear-gradient";
import "./index.scss";
Expand Down Expand Up @@ -36,9 +35,7 @@ export interface LinearGradientType extends LinearGradientProps {

const TaroLinearGradient: FunctionComponent<
LinearGradientType & TaroLinearGradientProps
> & {
options?: ComponentOptions;
} = props => {
> = props => {
const {
src = "",
style = {},
Expand Down Expand Up @@ -110,8 +107,4 @@ const TaroLinearGradient: FunctionComponent<
);
};

TaroLinearGradient.options = {
addGlobalClass: true
};

export default TaroLinearGradient;
10 changes: 1 addition & 9 deletions src/components/modal/index.rn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ import Modal from '@ant-design/react-native/lib/modal';
import './index.scss';
import { CLOSE_ICON } from './constant';
import { TaroModalProps } from './type';
import { ComponentOptions } from "@tarojs/taro";

const TaroModal: FunctionComponent<TaroModalProps> & {
options?: ComponentOptions;
} = (props) => {
const TaroModal: FunctionComponent<TaroModalProps> = (props) => {
const { visible = false, closable = false, onClose = () => {}, closeIconStyle = {}, closeIconName = '' , animationType = 'fade' } = props;

return (
Expand All @@ -39,9 +36,4 @@ const TaroModal: FunctionComponent<TaroModalProps> & {
);
};

TaroModal.options = {
addGlobalClass: true,
};


export default TaroModal;
11 changes: 2 additions & 9 deletions src/components/modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@
* @Last Modified by: qiuz
*/

import React from "react";
import { ComponentOptions, FunctionComponent } from '@tarojs/taro';
import React, { FunctionComponent } from "react";
import { AtModal } from 'taro-ui';
import './index.scss';
import { View, Image } from '@tarojs/components';
import { CLOSE_ICON } from './constant';
import { TaroModalProps } from './type';

const TaroModal: FunctionComponent<TaroModalProps> & {
options?: ComponentOptions;
} = (props) => {
const TaroModal: FunctionComponent<TaroModalProps> = (props) => {
const { visible = false, closable = false, onClose = () => {} } = props;

return (
Expand All @@ -28,8 +25,4 @@ const TaroModal: FunctionComponent<TaroModalProps> & {
);
};

TaroModal.options = {
addGlobalClass: true,
};

export default TaroModal;
11 changes: 2 additions & 9 deletions src/components/picker/index.h5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
* @Last Modified by: qiuz
*/

import React from "react";
import { ComponentOptions, FunctionComponent } from "@tarojs/taro";
import React, { FunctionComponent } from "react";
import { Picker } from "@tarojs/components";
import { isArray } from "@utils";
import "./index.scss";
import { TaroPickerSelectorProps, RangeItem } from "./type";

const TaroPickerSelector: FunctionComponent<TaroPickerSelectorProps> & {
options?: ComponentOptions;
} = props => {
const TaroPickerSelector: FunctionComponent<TaroPickerSelectorProps> = props => {
const {
range = [],
onChange = () => {},
Expand Down Expand Up @@ -81,8 +78,4 @@ const TaroPickerSelector: FunctionComponent<TaroPickerSelectorProps> & {
);
};

TaroPickerSelector.options = {
addGlobalClass: true
};

export default TaroPickerSelector;
4 changes: 0 additions & 4 deletions src/components/safe-area-view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,4 @@ const TaroSafeAreaView: TaroSafeAreaViewType = props => {
);
};

TaroSafeAreaView.options = {
addGlobalClass: true
};

export default TaroSafeAreaView;
5 changes: 1 addition & 4 deletions src/components/safe-area-view/type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import { ViewProps } from '@tarojs/components/types/view';
import { ComponentOptions } from '@tarojs/taro';
import { FunctionComponent } from 'react';
import { NativeSafeAreaViewProps } from 'react-native-safe-area-context';

Expand All @@ -16,9 +15,7 @@ export interface TaroSafeAreaViewProps {

export type TaroSafeAreaViewType = FunctionComponent<
NativeSafeAreaViewProps & ViewProps
> & {
options?: ComponentOptions;
};
>;

declare const TaroSafeAreaView: TaroSafeAreaViewType;

Expand Down
6 changes: 2 additions & 4 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
<meta name="format-detection" content="telephone=no,address=no">
<meta name="apple-mobile-web-app-status-bar-style" content="white">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
<title></title>
<script>
!function(x){function w(){var v,u,t,tes,s=x.document,r=s.documentElement,a=r.getBoundingClientRect().width;if(!v&&!u){var n=!!x.navigator.appVersion.match(/AppleWebKit.*Mobile.*/);v=x.devicePixelRatio;tes=x.devicePixelRatio;v=n?v:1,u=1/v}if(a>=640){r.style.fontSize="40px"}else{if(a<=320){r.style.fontSize="20px"}else{r.style.fontSize=a/320*20+"px"}}}x.addEventListener("resize",function(){w()});w()}(window);
</script>
<title>Taro Mortgage Calculator</title>
<script><%= htmlWebpackPlugin.options.script %></script>
</head>
<body>
<div id="app"></div>
Expand Down
9 changes: 1 addition & 8 deletions src/pages/calculator/compute-header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import React, { FunctionComponent } from "react";
import { ComponentOptions } from "@tarojs/taro";
import { View, Text, Image } from "@tarojs/components";
import "./index.scss";
import {
Expand All @@ -30,9 +29,7 @@ interface HouseLoanComputeHeaderProps {
goMonthlyPayments: () => void;
}

const HouseLoanComputeHeader: FunctionComponent<HouseLoanComputeHeaderProps> & {
options?: ComponentOptions;
} = props => {
const HouseLoanComputeHeader: FunctionComponent<HouseLoanComputeHeaderProps> = props => {
const {
way,
houseTotal,
Expand Down Expand Up @@ -156,8 +153,4 @@ const HouseLoanComputeHeader: FunctionComponent<HouseLoanComputeHeaderProps> & {
);
};

HouseLoanComputeHeader.options = {
addGlobalClass: true
};

export default React.memo(HouseLoanComputeHeader);
9 changes: 1 addition & 8 deletions src/pages/calculator/title-tpl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import React, { FunctionComponent } from "react";
import { ComponentOptions } from "@tarojs/taro";
import { View, Text } from "@tarojs/components";
import "./index.scss";

Expand All @@ -17,9 +16,7 @@ interface TitleTplProps {
onWayClick: (...args: any) => void;
}

export const TitleTpl: FunctionComponent<TitleTplProps> & {
options?: ComponentOptions;
} = props => {
export const TitleTpl: FunctionComponent<TitleTplProps> = props => {
const {
title = "",
data = [],
Expand Down Expand Up @@ -61,7 +58,3 @@ export const TitleTpl: FunctionComponent<TitleTplProps> & {
</View>
);
};

TitleTpl.options = {
addGlobalClass: true
};
Loading

0 comments on commit 2bae920

Please sign in to comment.