Skip to content

Commit

Permalink
feat: upgrade react 17 (#172)
Browse files Browse the repository at this point in the history
* chore: release

* feat: react 17 & new jsx transform (#173)

* feat(scaffolds): react 17 and new jsx transform

* feat: react@17&new jsx transform

* chore: add tmp to gitignore

* chore: eslint config

* chore: migrate types to devDep
  • Loading branch information
imsobear committed Jul 22, 2021
1 parent c353d0b commit 930fbbe
Show file tree
Hide file tree
Showing 52 changed files with 56 additions and 318 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -17,4 +17,5 @@ components/**/lib/
components/**/es/
screenshot.png
.ice
.history
.history
.faas_debug_tmp
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "react-materials",
"version": "0.1.0",
"version": "0.1.1",
"description": "icejs materials",
"author": "",
"scripts": {
Expand Down
13 changes: 6 additions & 7 deletions scaffolds/ant-design-lite/package.json
@@ -1,9 +1,8 @@
{
"name": "@icedesign/ice-antd-scaffold",
"version": "1.1.1",
"version": "1.1.2",
"description": "Ant Design and icejs scaffold, use TypeScript.",
"files": [
".vscode/",
"mock/",
"src/",
"build/",
Expand All @@ -25,19 +24,19 @@
"dependencies": {
"@ant-design/icons": "^4.0.2",
"@ant-design/pro-layout": "^6.5.1",
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"antd": "^4.0.0",
"moment": "^2.24.0",
"prop-types": "^15.5.8",
"react": "^16.4.1",
"react-dom": "^16.4.1"
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@iceworks/spec": "^1.0.1",
"@types/react": "^17.0.14",
"@types/react-dom": "^17.0.9",
"build-plugin-antd": "^0.1.0",
"build-plugin-moment-locales": "^0.1.0",
"eslint": "^6.0.1",
"eslint": "^7.30.0",
"ice.js": "^1.0.0",
"stylelint": "^13.1.0"
},
Expand Down
4 changes: 2 additions & 2 deletions scaffolds/ant-design-lite/src/Layouts/BasicLayout/index.tsx
@@ -1,12 +1,12 @@
import React from 'react';
import { createElement } from 'react';
import ProLayout, { DefaultFooter } from '@ant-design/pro-layout';
import { Link } from 'ice';
import { asideMenuConfig } from './menuConfig';

const loopMenuItem = (menus) =>
menus.map(({ icon, children, ...item }) => ({
...item,
icon: React.createElement(icon),
icon: createElement(icon),
children: children && loopMenuItem(children),
}));

Expand Down
File renamed without changes.
@@ -1,4 +1,3 @@
import React from 'react';
import { Link } from 'ice';

export interface Props {
Expand Down
2 changes: 0 additions & 2 deletions scaffolds/ant-design-lite/src/pages/Dashboard/index.tsx
@@ -1,5 +1,3 @@
import React from 'react';

export default function Dashboard() {
return (
<div>
Expand Down
2 changes: 1 addition & 1 deletion scaffolds/ant-design-lite/src/pages/Home/index.tsx
@@ -1,4 +1,4 @@
import React, { useEffect } from 'react';
import { useEffect } from 'react';
import { useRequest } from 'ice';
import { Table } from 'antd';
import styles from './index.module.less';
Expand Down
2 changes: 1 addition & 1 deletion scaffolds/ant-design-lite/src/routes.ts
Expand Up @@ -4,7 +4,7 @@ import Dashboard from '@/pages/Dashboard';
import Home from '@/pages/Home';
import NotFound from '@/components/NotFound';

const routerConfig: IRouterConfig = [
const routerConfig: IRouterConfig[] = [
{
path: '/',
component: Layout,
Expand Down
2 changes: 1 addition & 1 deletion scaffolds/ant-design-lite/tsconfig.json
Expand Up @@ -6,7 +6,7 @@
"outDir": "build",
"module": "esnext",
"target": "es6",
"jsx": "react",
"jsx": "react-jsx",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"lib": ["es6", "dom"],
Expand Down
4 changes: 2 additions & 2 deletions scaffolds/fusion-design-lite/package.json
Expand Up @@ -3,8 +3,8 @@
"version": "0.2.7",
"description": "轻量级模板,使用 TypeScript,仅包含基础的 Layout。",
"scaffoldConfig": {
"name": "Fusion Design Lite - TS",
"title": "Fusion Design Lite - TS",
"name": "Fusion Design Lite",
"title": "Fusion Design Lite",
"category": "Basic",
"screenshot": "https://img.alicdn.com/tfs/TB12CtTsEY1gK0jSZFMXXaWcVXa-2480-1200.png"
},
Expand Down
14 changes: 6 additions & 8 deletions scaffolds/icestark-child/package.json
@@ -1,10 +1,9 @@
{
"name": "@icedesign/stark-child-scaffold",
"version": "3.1.7",
"version": "3.1.8",
"description": "微前端方案 icestark 的子应用模板,用于快速初始化微应用",
"homepage": "https://icestark-react.surge.sh/seller",
"files": [
".vscode/",
"src/",
"build/",
"public/",
Expand All @@ -27,19 +26,18 @@
"@alifd/next": "^1.x",
"@alifd/theme-design-pro": "^0.x",
"@icedesign/container": "^1.0.4",
"@types/react": "^16.9.20",
"@types/react-dom": "^16.9.5",
"axios": "^0.17.1",
"moment": "^2.24.0",
"react": "^16.6.0",
"react-dom": "^16.6.0"
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@iceworks/spec": "^1.0.0",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"build-plugin-fusion": "^0.1.0",
"build-plugin-icestark": "^2.0.0",
"build-plugin-moment-locales": "^0.1.0",
"eslint": "^6.8.0",
"eslint": "^7.30.0",
"ice.js": "^1.0.0",
"stylelint": "^13.7.2"
},
Expand Down
2 changes: 0 additions & 2 deletions scaffolds/icestark-child/src/components/NotFound/index.tsx
@@ -1,5 +1,3 @@
import React from 'react';

export default () => {
return (
<div>404 not found</div>
Expand Down
@@ -1,4 +1,3 @@
import React from 'react';
import styles from './index.module.scss';

export default ({ title }) => <h5 className={styles.title}>{title}</h5>;
39 changes: 1 addition & 38 deletions scaffolds/icestark-child/src/global.scss
Expand Up @@ -3,42 +3,5 @@ body {
}

.icestark-child-app {
*,
*::before,
*::after {
box-sizing: border-box;
}

ul,
ol {
margin: 0;
padding: 0;
list-style: none;
}

li {
margin-left: 0;
}

hr {
border: 0 $line-solid $color-line1-2;
border-top-width: $line-1;
}

a {
text-decoration: none;
&:link {
color: $color-link-1;
}
&:visited {
color: $color-link-2;
}
&:hover {
color: $color-link-3;
}
&:active {
color: $color-link-3;
text-decoration: underline;
}
}
@import '@alifd/next/reset.scss';
}
1 change: 0 additions & 1 deletion scaffolds/icestark-child/src/layouts/BasicLayout/index.tsx
@@ -1,4 +1,3 @@
import React from 'react';
import styles from './index.module.scss';

export default (props) => {
Expand Down
2 changes: 1 addition & 1 deletion scaffolds/icestark-child/src/pages/Detail/index.tsx
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react';
import { useState, useEffect } from 'react';
import { Grid, Loading } from '@alifd/next';
import IceContainer from '@icedesign/container';
import PageTitle from '@/components/PageTitle';
Expand Down
2 changes: 1 addition & 1 deletion scaffolds/icestark-child/src/pages/Home/index.tsx
@@ -1,4 +1,4 @@
import React, { useEffect } from 'react';
import { useEffect } from 'react';
import { Link } from 'react-router-dom';
import { appHistory } from '@ice/stark-app';
import { Button } from '@alifd/next';
Expand Down
2 changes: 1 addition & 1 deletion scaffolds/icestark-child/src/pages/List/index.tsx
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react';
import { useState, useEffect } from 'react';
import IceContainer from '@icedesign/container';
import { Table, Pagination, Message } from '@alifd/next';
import { Link } from 'ice';
Expand Down
2 changes: 1 addition & 1 deletion scaffolds/icestark-child/tsconfig.json
Expand Up @@ -6,7 +6,7 @@
"outDir": "build",
"module": "esnext",
"target": "es6",
"jsx": "react",
"jsx": "react-jsx",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"lib": ["es6", "dom"],
Expand Down
13 changes: 6 additions & 7 deletions scaffolds/icestark-layout/package.json
@@ -1,10 +1,9 @@
{
"name": "@icedesign/stark-layout-scaffold",
"version": "3.1.7",
"version": "3.1.8",
"description": "微前端方案 icestark 的主应用模板,用于快速初始化主应用",
"homepage": "https://icestark-react.surge.sh",
"files": [
".vscode/",
"src/",
"build/",
"public/",
Expand All @@ -27,20 +26,20 @@
"@alifd/next": "^1.x",
"@alifd/theme-design-pro": "^0.x",
"@icedesign/container": "^1.x",
"@types/react": "^16.9.20",
"@types/react-dom": "^16.9.5",
"classnames": "^2.2.5",
"moment": "^2.24.0",
"prop-types": "^15.5.8",
"react": "^16.8.0",
"react-dom": "^16.8.0"
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@iceworks/spec": "^1.0.0",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"build-plugin-fusion": "^0.1.0",
"build-plugin-icestark": "^2.0.0",
"build-plugin-moment-locales": "^0.1.0",
"eslint": "^6.8.0",
"eslint": "^7.30.0",
"ice.js": "^1.0.0",
"stylelint": "^13.7.2"
},
Expand Down
1 change: 0 additions & 1 deletion scaffolds/icestark-layout/src/app.tsx
@@ -1,4 +1,3 @@
import * as React from 'react';
import { runApp, IAppConfig } from 'ice';
import { ConfigProvider } from '@alifd/next';
import PageLoading from '@/components/PageLoading';
Expand Down
@@ -1,4 +1,3 @@
import React from 'react';
import { Link } from 'ice';
import IceContainer from '@icedesign/container';

Expand Down
@@ -1,4 +1,3 @@
import React from 'react';
import { Loading } from '@alifd/next';

export default () => (
Expand Down
@@ -1,4 +1,3 @@
import React from 'react';
import styles from './index.module.scss';

export default function Footer() {
Expand Down
@@ -1,4 +1,3 @@
import React from 'react';
import PropTypes from 'prop-types';
import { AppLink } from '@ice/stark';
import { Nav } from '@alifd/next';
Expand Down
@@ -1,4 +1,3 @@
import React from 'react';
import { Shell } from '@alifd/next';
import PageNav from './components/PageNav';
import Footer from './components/Footer';
Expand Down
@@ -1,8 +1,7 @@
import * as React from 'react';
import { useEffect } from 'react';
import BasicLayout from '../BasicLayout';
import UserLayout from '../UserLayout';

const { useEffect } = React;
export default function FrameworkLayout(props: {
children: React.ReactNode;
pathname: string;
Expand Down
7 changes: 4 additions & 3 deletions scaffolds/icestark-layout/src/layouts/UserLayout/index.tsx
@@ -1,6 +1,7 @@
import React from 'react';

export default function UserLayout({ children }: { children: React.ReactNode }) {
export default function UserLayout({ children, pathname }: {
children: React.ReactNode;
pathname?: string;
}) {
return (
<div className="user-layout">
{children}
Expand Down
1 change: 0 additions & 1 deletion scaffolds/icestark-layout/src/pages/About/index.tsx
@@ -1,4 +1,3 @@
import React from 'react';
import { Link } from 'ice';

const About = () => {
Expand Down
1 change: 0 additions & 1 deletion scaffolds/icestark-layout/src/pages/Home/index.tsx
@@ -1,4 +1,3 @@
import React from 'react';
import { Link } from 'ice';

const Home = () => {
Expand Down
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import { useState } from 'react';
import { Input, Message, Form, Divider, Checkbox, Icon } from '@alifd/next';
import { appHistory } from '@ice/stark';

Expand Down Expand Up @@ -29,7 +29,6 @@ interface LoginProps {
dataSource?: IDataSource;
}


const LoginBlock: React.FunctionComponent<LoginProps> = (props: LoginProps): JSX.Element => {
const {
dataSource = DEFAULT_DATA,
Expand Down
1 change: 0 additions & 1 deletion scaffolds/icestark-layout/src/pages/Login/index.tsx
@@ -1,4 +1,3 @@
import React from 'react';
import { ResponsiveGrid } from '@alifd/next';
import LoginBlock from './components/LoginBlock';

Expand Down
2 changes: 1 addition & 1 deletion scaffolds/icestark-layout/tsconfig.json
Expand Up @@ -6,7 +6,7 @@
"outDir": "build",
"module": "esnext",
"target": "es6",
"jsx": "react",
"jsx": "react-jsx",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"lib": ["es6", "dom"],
Expand Down

0 comments on commit 930fbbe

Please sign in to comment.