Skip to content

Commit

Permalink
feat: 默认不再进行polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
三少 committed Aug 29, 2022
1 parent 36fff46 commit 5cef4a8
Show file tree
Hide file tree
Showing 82 changed files with 342 additions and 1,079 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@
"packages/*"
],
"dependencies": {
"@antmjs/eslint": "^1.21.3",
"@antmjs/stylelint": "^1.21.3",
"@antmjs/warning": "^1.21.3",
"@antmjs/eslint": "^2.0.1",
"@antmjs/stylelint": "^2.0.1",
"@antmjs/warning": "^2.0.1",
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"all-contributors-cli": "^6.20.0",
Expand All @@ -120,7 +120,7 @@
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"stylelint": "^13.13.1",
"stylelint": "^14.11.0",
"typescript": "^4.7.4"
}
}
8 changes: 4 additions & 4 deletions packages/vantui-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"antm-vantui-cli": "./bin.js"
},
"engines": {
"node": ">=12",
"node": ">=14",
"npm": ">=6.4",
"yarn": ">=1.22"
},
Expand All @@ -28,8 +28,8 @@
"antmjs"
],
"scripts": {
"watch": "tsc --watch",
"build": "tsc",
"watch": "rm -rf dest && npx tsc -p tsconfig.cjs.json --watch --sourceMap",
"build": "rm -rf dest && npx tsc -p tsconfig.cjs.json",
"test:watch": "",
"test": ""
},
Expand All @@ -44,7 +44,7 @@
"@types/prettier": "^2.6.1"
},
"dependencies": {
"@antmjs/babel-preset": "1.21.3",
"@antmjs/babel-preset": "2.0.1",
"@babel/core": "^7.16.0",
"@babel/plugin-transform-runtime": "^7.17.10",
"@babel/plugin-transform-typescript": "^7.16.8",
Expand Down
7 changes: 7 additions & 0 deletions packages/vantui-cli/site/docs/components/markdown/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@
border-radius: 50%;
content: '';
}

blockquote {
margin: 16px 0 0;
padding: 16px;
background-color: #ecf9ff;
border-radius: 20px;
}

p a,
ul a,
table a,
Expand Down Expand Up @@ -210,22 +212,26 @@
&:first-child {
padding-left: 0;
}

tr {
td {
font-size: 14px;
font-family: 'Source Code Pro', 'Monaco', 'Inconsolata', monospace;
font-style: normal;
-webkit-font-smoothing: auto;
}

td {
padding: 8px;
font-style: normal !important;
border-top: 1px solid #f1f4f8;

&:nth-child(1) {
max-width: 160px;
word-wrap: break-word;
word-break: normal;
}

code {
-webkit-font-smoothing: antialiased;
background-color: #f7f8fa;
Expand All @@ -243,6 +249,7 @@
white-space: pre-wrap;
}
}

em {
font-style: normal !important;
color: #4fc08d;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
font-family: Open Sans, -apple-system, BlinkMacSystemFont, Helvetica Neue,
Helvetica, Segoe UI, Arial, Roboto, PingFang SC, miui, Hiragino Sans GB,
Microsoft Yahei, sans-serif;

&-header {
background: #001838;
color: #ffffff;
Expand Down
2 changes: 1 addition & 1 deletion packages/vantui-cli/src/compiler/compile-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function compileScript(
},
runtime: {
absoluteRuntime: false,
corejs: { version: 3, proposals: false },
corejs: false,
helpers: true, // 使用到@babel/runtime
regenerator: true, // 使用到@babel/runtime
useESModules: false,
Expand Down
10 changes: 10 additions & 0 deletions packages/vantui-cli/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"target": "ES2017",
"module": "ES2022",
"baseUrl": "./",
"outDir": "dest"
},
"include": ["src"]
}
2 changes: 1 addition & 1 deletion packages/vantui-demo/config/webpack/h5Chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function (chain) {
/css-loader/.test(filename) ||
(/node_modules/.test(filename) &&
!(
/(taro)|(react-spring)/.test(filename) &&
/(taro)|(react-spring)|(@antmjs)/.test(filename) &&
!/tarojs[\\/](runtime|shared|plugin-platform)/.test(filename)
)),
)
Expand Down
2 changes: 1 addition & 1 deletion packages/vantui-demo/config/webpack/miniChain.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function (chain) {
/css-loader/.test(filename) ||
(/node_modules/.test(filename) &&
!(
/(taro)|(react-spring)/.test(filename) &&
/(taro)|(react-spring)|(@antmjs)/.test(filename) &&
!/tarojs[\\/](runtime|shared|plugin-platform)/.test(filename)
)),
)
Expand Down
8 changes: 4 additions & 4 deletions packages/vantui-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
"author": "",
"dependencies": {
"@antmjs/mini-fix": "^1.21.3",
"@antmjs/mini-fix": "^2.0.1",
"@antmjs/vantui": "1.9.23",
"@babel/runtime": "^7.7.7",
"@tarojs/components": "3.5.3",
Expand All @@ -109,9 +109,9 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@antmjs/iconfont": "^1.21.3",
"@antmjs/plugin-global-fix": "^1.21.3",
"@antmjs/plugin-mini-fix": "^1.21.3",
"@antmjs/iconfont": "^2.0.1",
"@antmjs/plugin-global-fix": "^2.0.1",
"@antmjs/plugin-mini-fix": "^2.0.1",
"@babel/core": "^7.8.0",
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
Expand Down
21 changes: 21 additions & 0 deletions packages/vantui-demo/src/app.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
/* stylelint-disable font-family-no-missing-generic-family-keyword */
/* stylelint-disable selector-type-no-unknown, selector-max-type */
@import '@antmjs/vantui/es/style/base.less';

page,
body {
background-color: #f7f8fa;
font-size: 28px;
}

body taro-button-core {
width: initial;
}
Expand Down Expand Up @@ -37,6 +39,7 @@ taro-button-core + taro-button-core {

.pages-icon-index {
background-color: #ffffff;

.van-col {
display: flex;
align-items: center;
Expand Down Expand Up @@ -102,6 +105,7 @@ taro-button-core + taro-button-core {

.pages-image-index {
background-color: #ffffff;

.van-col {
color: #7d7e80;
display: flex;
Expand Down Expand Up @@ -131,6 +135,7 @@ taro-button-core + taro-button-core {
align-items: center;
justify-content: center;
}

.block {
width: 200px;
height: 200px;
Expand All @@ -146,15 +151,18 @@ taro-button-core + taro-button-core {
background-color: #ffffff;
text-align: center;
}

.van-popup--center {
width: 200px;
height: 200px;
}

.van-popup--top,
.van-popup--bottom {
width: 100%;
height: 30%;
}

.van-popup--left,
.van-popup--right {
width: 30%;
Expand Down Expand Up @@ -182,6 +190,7 @@ taro-button-core + taro-button-core {
.demo-block {
margin-bottom: 40px;
}

.customButton {
width: 112px;
color: #ffffff;
Expand Down Expand Up @@ -209,6 +218,7 @@ taro-button-core + taro-button-core {

.pages-sticky-index {
position: relative;

.demo-block:last-child {
padding-bottom: 1800px !important;
}
Expand Down Expand Up @@ -311,9 +321,11 @@ taro-button-core + taro-button-core {
.scroll-container {
display: flex;
flex-direction: column;

.scroll-container-content {
flex: 1;
overflow: scroll;

& > scroll-view,
& > taro-scroll-view-core {
height: 100%;
Expand All @@ -336,6 +348,7 @@ taro-button-core + taro-button-core {
padding-top: 30vh;
text-align: center;
color: #cccccc;

.loadingWrapper {
font-size: 24px;
margin-bottom: 24px;
Expand All @@ -350,12 +363,20 @@ taro-button-core + taro-button-core {
position: sticky;
top: 0;
left: 0;

.left {
flex: auto;
}

.right {
flex: none;
padding-left: 12px;
}
}
}

.pages-dropdown-menu-index {
.demo-block--padding {
padding: 0 !important;
}
}
52 changes: 0 additions & 52 deletions packages/vantui-demo/tsconfig.json

This file was deleted.

4 changes: 2 additions & 2 deletions packages/vantui-doc/docs/premium.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
- 默认封装了 Request 请求,统一规范,通过 TS 的加持,使得响应标准一致
- 默认添加了三种类型的页面模版(能覆盖百分之七八十的业务),普通模版(自动下拉刷新)、分页模版(自动下拉刷新、上划分页),Tabs 分页模版(自动下拉刷新、上划分页、tab 切换及搜索)
- 集成了开箱即用的主题变更逻辑
- 通过@antmjs/vantui 的 Unite“组件”以空间换时间的方案加快研发速度,同时保证 TS 类型安全
- 通过@antmjs/unite 的 Unite“组件”以空间换时间的方案加快研发速度,同时保证 TS 类型安全

### Unite 是什么

```jsx
// 代码不多,可以自己看源码
import { Unite } from '@antmjs/vantui'
import { Unite } from '@antmjs/unite'
// 和UI无关的全局数据定义在这里面,具体可以看项目模版
import {} from '@/cache'
// 和UI相关的全局数据定义在这里面,具体可以看项目模版
Expand Down
2 changes: 2 additions & 0 deletions packages/vantui-doc/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

## 开始使用

> 2.0 版本起内部不再注入 polyfill 逻辑,需要兼容低版本的请自行进行 polyfill。
### 通过 npm/yarn 安装

```bash
Expand Down
3 changes: 1 addition & 2 deletions packages/vantui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@
"test": ""
},
"dependencies": {
"@babel/runtime-corejs3": "^7.14.7",
"@vant/icons": "^1.7.1",
"classnames": "^2.3.1",
"dayjs": "^1.10.6",
"rc-util": "^5.14.0",
"use-deep-compare-effect": "^1.8.1"
},
"devDependencies": {
"@antmjs/iconfont": "^1.21.3",
"@antmjs/iconfont": "^2.0.1",
"@antmjs/vantui-cli": "1.9.23",
"@tarojs/components": "^3.5.3",
"@tarojs/taro": "^3.5.3",
Expand Down
Loading

0 comments on commit 5cef4a8

Please sign in to comment.