Skip to content

Commit

Permalink
chore: changelog && docs
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Dec 31, 2019
1 parent 4455175 commit 505fe4d
Show file tree
Hide file tree
Showing 5 changed files with 872 additions and 13 deletions.
34 changes: 21 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<a name=""></a>
# [](https://github.com/NervJS/taro/compare/v1.3.34...v) (2019-12-31)
# [](https://github.com/NervJS/taro/compare/v2.0.0-beta.13...v) (2019-12-31)



<a name="2.0.0-beta.13"></a>
# [2.0.0-beta.13](https://github.com/NervJS/taro/compare/v1.3.34...v2.0.0-beta.13) (2019-12-31)


### Bug Fixes
Expand All @@ -14,48 +19,49 @@
* **mini-runner:** 优化 watch 时文件编译速度 ([d8e180c](https://github.com/NervJS/taro/commit/d8e180c))
* **mini-runner:** 修复 defineConstants 小程序表现与 H5 不一致问题 close [#5078](https://github.com/NervJS/taro/issues/5078) ([a560edb](https://github.com/NervJS/taro/commit/a560edb))
* **mini-runner:** 修复 sass 变量失效的问题,close [#4893](https://github.com/NervJS/taro/issues/4893) ([e1e979d](https://github.com/NervJS/taro/commit/e1e979d))
* **mini-runner:** 修复 watch 时修改页面导致组件无法及时更新的问题 ([b5394c7](https://github.com/NervJS/taro/commit/b5394c7))
* **mini-runner:** 修复 watch 时增加组件文件的 bug,close [#5140](https://github.com/NervJS/taro/issues/5140) ([769ded0](https://github.com/NervJS/taro/commit/769ded0))
* **mini-runner:** 修复 watch 时文件报错导致无法重新编译的问题,fix [#4949](https://github.com/NervJS/taro/issues/4949) ([70dde62](https://github.com/NervJS/taro/commit/70dde62))
* **mini-runner:** 修复 windows 下编译后 taro 引用错误的问题 ([6798787](https://github.com/NervJS/taro/commit/6798787))
* **mini-runner:** 修复使用 preval 报错的问题 ([24701e6](https://github.com/NervJS/taro/commit/24701e6))
* **mini-runner:** 修复分包页面丢失的问题 ([98c82da](https://github.com/NervJS/taro/commit/98c82da))
* **mini-runner:** 修复包未安装不报错的问题 ([09dd6b7](https://github.com/NervJS/taro/commit/09dd6b7))
* **mini-runner:** 修复多端文件引用的问题,close [#5175](https://github.com/NervJS/taro/issues/5175) ([def32f5](https://github.com/NervJS/taro/commit/def32f5))
* **mini-runner:** 修复对 alias 的支持 ([2e09509](https://github.com/NervJS/taro/commit/2e09509))
* **mini-runner:** 修复小程序编译时样式中引用静态资源转换为 base64 ([955784f](https://github.com/NervJS/taro/commit/955784f))
* **mini-runner:** 修复引用原生组件报错的问题 ([03967de](https://github.com/NervJS/taro/commit/03967de))
* **mini-runner:** 修复引用原生组件编译后样式文件缺失的问题 ([9d58a87](https://github.com/NervJS/taro/commit/9d58a87))
* **mini-runner:** 修复组件 watch 时改动不生效的问题 ([8cfd5bb](https://github.com/NervJS/taro/commit/8cfd5bb))
* **mini-runner:** 修复静态资源引用的 bug ([a0ccc36](https://github.com/NervJS/taro/commit/a0ccc36))
* **mini-runner:** 修复页面 hooks config 失效问题 ([4635bec](https://github.com/NervJS/taro/commit/4635bec))
* **mini-runner:** 修正快应用pages中ux文件未正确生成问题 ([#4969](https://github.com/NervJS/taro/issues/4969)) ([2c61570](https://github.com/NervJS/taro/commit/2c61570))
* **mini-runner:** 加入 preval 支持 ([b0c68cf](https://github.com/NervJS/taro/commit/b0c68cf))
* **mini-runner:** 增加快应用公共属性的自动更新,优化button动画直接调用 ([#5044](https://github.com/NervJS/taro/issues/5044)) ([cca8c72](https://github.com/NervJS/taro/commit/cca8c72))
* **mini-runner:** 快应用页面路径编译错误 ([52032dd](https://github.com/NervJS/taro/commit/52032dd))
* **mini-runner:** 支持自定义 tabBar ([801bb80](https://github.com/NervJS/taro/commit/801bb80))
* **mini-runner:** 暴露 commonChunks 配置以供自定义公共 chunks 生成 ([3d3118e](https://github.com/NervJS/taro/commit/3d3118e))
* **mini-runner:** 更新编译时提示 ([174c7b2](https://github.com/NervJS/taro/commit/174c7b2))
* **mini-runner:** 移除无用代码 ([931a208](https://github.com/NervJS/taro/commit/931a208))
* **mini-runner:** 组件中 $componentPath 路径生成不对 ([4d4d080](https://github.com/NervJS/taro/commit/4d4d080))
* **mini-runner:** 组件引入支持统一从一个入口文件中引入 ([d8898f1](https://github.com/NervJS/taro/commit/d8898f1))
* **mini-runner:** 组件引用支持 import as 语法 ([e4616eb](https://github.com/NervJS/taro/commit/e4616eb))
* **mini-runner:** 编译时移除组件文件引用,遗漏了 npm 包中组件,close [#5139](https://github.com/NervJS/taro/issues/5139) ([bf2af74](https://github.com/NervJS/taro/commit/bf2af74))
* **mini-runner:** 编译时需要移除对组件文件的引用 ([03a7672](https://github.com/NervJS/taro/commit/03a7672))
* **mini-runner:** 降低 babel-plugin-preval 版本以保证使用 async await 时不报错 ([e703bd6](https://github.com/NervJS/taro/commit/e703bd6))
* **taro:** update getStorage return typings ([#5170](https://github.com/NervJS/taro/issues/5170)) ([38279ec](https://github.com/NervJS/taro/commit/38279ec))
* **types:** add enableFlex to ScrollViewProps ([#5142](https://github.com/NervJS/taro/issues/5142)) ([c984109](https://github.com/NervJS/taro/commit/c984109))
* for video objectFit ([cd36ca1](https://github.com/NervJS/taro/commit/cd36ca1))
* use rimraf instead of rm to fixed Windows build error ([37af02e](https://github.com/NervJS/taro/commit/37af02e))
* **taro:** 增加递归查找中止条件,修正拼写错误 ([#5045](https://github.com/NervJS/taro/issues/5045)) ([7dac473](https://github.com/NervJS/taro/commit/7dac473))
* **taro-cli:** update package list 新增 [@tarojs](https://github.com/tarojs)/mini-runner,对列表排序 ([cd264dd](https://github.com/NervJS/taro/commit/cd264dd))
* **taro-runner-utils:** 优化代码,修复找不到类型定义的问题 ([765c8de](https://github.com/NervJS/taro/commit/765c8de))
* **taro-webpack-runner:** 修复 sassLoaderOption 未定义的问题 ([60bfe5c](https://github.com/NervJS/taro/commit/60bfe5c))
* **template:** 更新 Taro 2.0 的模版和下载地址 [#4837](https://github.com/NervJS/taro/issues/4837) ([71b34eb](https://github.com/NervJS/taro/commit/71b34eb))
* somethings no need ([0598df6](https://github.com/NervJS/taro/commit/0598df6))
* **types:** add enableFlex to ScrollViewProps ([#5142](https://github.com/NervJS/taro/issues/5142)) ([c984109](https://github.com/NervJS/taro/commit/c984109))
* for video objectFit ([cd36ca1](https://github.com/NervJS/taro/commit/cd36ca1))
* **cli:** lerna 加入 taro-mini-runner && 接入 webpack 生成小程序文件 ([ed9e755](https://github.com/NervJS/taro/commit/ed9e755))
* **cli:** 修复 doctor 对 config 的检测 ([127d6d2](https://github.com/NervJS/taro/commit/127d6d2))
* **cli:** 修复 watch 时文件修改不对的问题 ([aa9f99e](https://github.com/NervJS/taro/commit/aa9f99e))
* **cli:** 修复代码合并的问题 ([1a5a903](https://github.com/NervJS/taro/commit/1a5a903))
* **cli:** 修复目录创建 ([9f19372](https://github.com/NervJS/taro/commit/9f19372))
* **cli:** 修复配置文件中读取不到 process.env.TARO_ENV 的问题 ([121ba14](https://github.com/NervJS/taro/commit/121ba14))
* **mini-runner:** 修复对 alias 的支持 ([2e09509](https://github.com/NervJS/taro/commit/2e09509))
* **mini-runner:** 移除无用代码 ([931a208](https://github.com/NervJS/taro/commit/931a208))
* somethings no need ([0598df6](https://github.com/NervJS/taro/commit/0598df6))
* **cli:** 支持引用 node_modules 中组件 ([18bc2bc](https://github.com/NervJS/taro/commit/18bc2bc))
* **cli:** 普通文件经过编译器编译必须传入 isNormal ([3bc5450](https://github.com/NervJS/taro/commit/3bc5450))
* **cli:** 更新默认模板 ([d17a8c5](https://github.com/NervJS/taro/commit/d17a8c5))
Expand All @@ -72,21 +78,23 @@
* **mini-runner:** 修复 watch bug ([c84b683](https://github.com/NervJS/taro/commit/c84b683))
* **mini-runner:** 修复对 css modules 的支持 ([5019023](https://github.com/NervJS/taro/commit/5019023))
* **mini-runner:** 修复小程序编译报错 ([1e8aef1](https://github.com/NervJS/taro/commit/1e8aef1))
* **mini-runner:** 修复引用 npm 中组件间存在依赖时依赖路径解析错误的问题 ([27612a3](https://github.com/NervJS/taro/commit/27612a3))
* **mini-runner:** 修复快应用打包报错的问题 ([ca7bdb7](https://github.com/NervJS/taro/commit/ca7bdb7))
* **quickapp:** pull-down-refresh page-scroll ([1c2fa60](https://github.com/NervJS/taro/commit/1c2fa60))
* position linter for quickapp 1060+ ([42eb4c4](https://github.com/NervJS/taro/commit/42eb4c4))
* quickapp api upload from docs ([c263ee6](https://github.com/NervJS/taro/commit/c263ee6))
* **mini-runner:** 修复快应用编译后页面标题展示不正确的问题 ([de5dc7b](https://github.com/NervJS/taro/commit/de5dc7b))
* **mini-runner:** 修复普通小程序编译的问题 ([7251ea3](https://github.com/NervJS/taro/commit/7251ea3))
* **mini-runner:** 加上文件编译提示 ([4597d1a](https://github.com/NervJS/taro/commit/4597d1a))
* **mini-runner:** 只有 taro 的包不能经过依赖包名替换 ([c861872](https://github.com/NervJS/taro/commit/c861872))
* **mini-runner:** 打包优化,引用自 npm 包中的组件不抽离至 vendors 中 ([6e8a4ff](https://github.com/NervJS/taro/commit/6e8a4ff))
* **mini-runner:** 提前解析快应用页面 ([d469c84](https://github.com/NervJS/taro/commit/d469c84))
* **mini-runner:** 支持快应用编译后模板与样式的检测 ([e38ebc7](https://github.com/NervJS/taro/commit/e38ebc7))
* **quickapp:** pull-down-refresh page-scroll ([1c2fa60](https://github.com/NervJS/taro/commit/1c2fa60))
* quickapp api upload from docs ([c263ee6](https://github.com/NervJS/taro/commit/c263ee6))
* **taro:** 修复快应用下拉刷新问题 ([5a7638e](https://github.com/NervJS/taro/commit/5a7638e))
* position linter for quickapp 1060+ ([42eb4c4](https://github.com/NervJS/taro/commit/42eb4c4))
* use rimraf instead of rm to fixed Windows build error ([37af02e](https://github.com/NervJS/taro/commit/37af02e))
* **mini-runner:** 修复引用 npm 中组件间存在依赖时依赖路径解析错误的问题 ([27612a3](https://github.com/NervJS/taro/commit/27612a3))
* **mini-runner:** 加上文件编译提示 ([4597d1a](https://github.com/NervJS/taro/commit/4597d1a))
* **taro:** 小程序 webpack 编译静态文件路径 ([2e13173](https://github.com/NervJS/taro/commit/2e13173))
* **taro-quickapp:** 修复快应用事件绑定异常问题 ([3f1aa7d](https://github.com/NervJS/taro/commit/3f1aa7d))
* **template:** 更新 Taro 2.0 的模版和下载地址 [#4837](https://github.com/NervJS/taro/issues/4837) ([71b34eb](https://github.com/NervJS/taro/commit/71b34eb))
* pxtransform disable on quick-app ([2a26e20](https://github.com/NervJS/taro/commit/2a26e20))
* **transformer:** 修复测试用例 ([5f78126](https://github.com/NervJS/taro/commit/5f78126))
* **transformer:** 修复错误类型 ([f012d26](https://github.com/NervJS/taro/commit/f012d26))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: Button
sidebar_label: Button
id: version-2.0.0-beta.13-button
original_id: button
---

##### 按钮

> 属性及支持度
| H5 | ReactNative| Quickapp| 属性名 | 类型 | 默认值 | 说明 |
| :-: | :-: | :-: | :- | :- | :- | :- |
|||| type | String | default | 按钮的样式类型 |
|||| size | String | default | 按钮的大小 px |
|||| plain | Boolean | false | 按钮是否镂空,背景色透明 |
|||| disabled | Boolean | false | 是否禁用 |
|||| loading | Boolean | false | 名称前是否带 loading 图标 |
|| X (支持 hoverStyle 属性,但框架未支持 hoverClass) | X(支持 active 伪类状态变化) | hoverClass | String | button-hover | 指定按钮按下去的样式类。当 hover-class='none' 时,没有点击态效果 |
||| X | hoverStartTime | Number | 20 | 按住后多久出现点击态,单位毫秒 |
||| X | hoverStayTime | Number | 70 | 手指松开后点击态保留时间,单位毫秒 |
| X | X | X | onGetUserInfo | Handler | | 微信小程序open-type='getUserInfo'时,用户点击该按钮,会返回获取到的用户信息,从返回参数的 detail 中获取到的值同 wx.getUserInfo |

>其他相关属性请看各小程序官方文档
[微信小程序 Button](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)

[百度小程序 Button](https://smartprogram.baidu.com/docs/develop/component/formlist/#button)

[支付宝小程序 Button](https://docs.alipay.com/mini/component/button)

[字节跳动小程序 Button](https://developer.toutiao.com/docs/comp/button.html)



###### 示例:
```jsx
import Taro, { Component } from '@tarojs/taro'
import { View, Text, Button } from '@tarojs/components'

export default class PageButton extends Component {
state = {
btn: [
{
text: '页面主操作 Normal',
size: 'default',
type: 'primary'
},
{
text: '页面主操作 Loading',
size: 'default',
type: 'primary',
loading: true,
},
{
text: '页面主操作 Disabled',
size: 'default',
type: 'primary',
disabled: true,
},
{
text: '页面次要操作 Normal',
size: 'default',
type: 'default'
},
{
text: '页面次要操作 Disabled',
size: 'default',
type: 'default',
disabled: true,
},
{
text: '警告类操作 Normal',
size: 'default',
type: 'warn'
},
{
text: '警告类操作 Disabled',
size: 'default',
type: 'warn',
disabled: true,
}
]
}
render () {
return (
<View className='container'>
{this.state.btn.map(item => {
return (
<Button
size={item.size ? item.size : ''}
type={item.type ? item.type : ''}
loading={item.loading ? item.loading : false}
disabled={item.disabled ? item.disabled : false}
>
{item.text}
</Button>
)
})}
<Button className='btn-max-w' plain type='primary'>按钮</Button>
<Button className='btn-max-w' plain type='primary' disabled>不可点击的按钮</Button>
<Button className='btn-max-w' plain >按钮</Button>
<Button className='btn-max-w' plain disabled >按钮</Button>
<Button size='mini' type='primary'>按钮</Button>
<Button size='mini' >按钮</Button>
<Button size='mini' type='warn'>按钮</Button>
</View>
)
}
}
```
101 changes: 101 additions & 0 deletions website/versioned_docs/version-2.0.0-beta.13/debug-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
title: 单步调测配置
id: version-2.0.0-beta.13-debug-config
original_id: debug-config
---

> 通过本身 `VSCode` 提供的跨平台代码单步调测能力,能够极大提升基于 `Taro` 开发框架的应用开发速度,因其他平台已有比较成熟的工具可以使用,着重降低 Windows 平台配置复杂度。
## 一、开发环境搭建

首先准备 `Taro` 在 Windows 下的基础开发环境,详情如下(已有开发环境可略过):

#### 1. 安装 Node.js
建议安装 `10.15` 以上版本,官方下载地址:[Node.js](https://nodejs.org/dist/v12.14.0/node-v12.14.0-x64.msi " node.js")

#### 2. 安装 VSCode

安装完最新 `VSCode` 后,建议安装如下插件:
- `ESlint` — 代码规范
- `TSlint` — 语法检查

#### 3. Taro 源码下载
下载地址:[Taro](https://github.com/NervJS/taro.git "Taro"),默认为 2.x 分支,如有需要,请切换到开发分支

#### 4. 全局安装 Node-sass 、Lerna 和 Rollup
```shell
npm i -g node-sass --sass_binary site=https://npm.taobao.org/mirrors/node_sass/
yarn global add lerna
yarn global add rollup
```
> Node-sass 比较特殊,建议提前进行安装,规避可能出现的各种异常错误。
#### 5. 源码依赖安装
1.使用 `VSCode` 打开 `Taro` 源码目录,在根目录下执行 `yarn` ,安装项目所需依赖库(首次安装所花时间较长,请耐心等待)

2.待 `yarn` 执行完毕后,执行 `yarn bootstrap` 解析子包之间的依赖关系

## 二、单步调试配置

#### 1. 拷贝测试项目
进入 `taro cli` 目录,将需要调试的测试项目拷贝至根目录,以测试项目命名 `test` 为例

#### 2. 在测试项目中添加 `js` 入口
进入测试项目根目录,新增 `debug.js` 调试入口文件,文件内容如下:
```javascript
const Builder = require('../dist/build').default
const appPath = process.cwd()
const builder = new Builder(appPath)

builder.build({
type: 'weapp',
watch: 'watch'
})
```
> 调试入口文件名可自定义设置
#### 3. 增加 VSCode 调试参数配置
打开 `taro cli` 所在 Windows 文件夹,进入目录下的 `.vscode` 子目录,在 `lanuch.json` 文件中新增调试入口参数,设置如下:
```shell
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "debug.js",
"request": "launch",
"sourceMaps": true,
"args": [
"--runInBand",
"-r",
"ts-node/register"
],
"cwd": "${workspaceFolder}/packages/taro-cli/debug",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"program": "${workspaceFolder}/packages/taro-cli/test/debug.js"
}
]
}
```
> `.vscode` 目录或 `lanuch.json` 文件不存在,需手动创建;同时 `name``cwd``program` 三个参数根据测试项目的实际名称、目录进行调整
#### 2. 编译子包
`node.js` 调试过程中只能调用 `js` 文件,调试过程所依赖的 `taro` 子模块,需要进入子模块根目录,执行编译命令,将 `ts` 代码编译打包成 `js` 代码之后,才能进行调试,主要编译如下关键子包:

| 模块名称 | 功能描述 | 编译方式 |
| :------------ |:---------------:| -----:|
| taro-cli | Taro开发工具转换总入口 | yarn dev |
| taroize | Taro小程序编译器,主要负责小程序转Taro | yarn dev |
| taro-mini-runner | Taro编译时,webpack插件化管理打包任务 | yarn dev |
| taro-transformer-wx | Taro解析模块,解析AST目录树 | yarn dev |

#### 3.链接未发布的库
为了测试代码更改效果,或依赖未正式发布的包,可通过软链接的方式,将最新代码链接到测试目录下进行测试,同时保持子模块的 `watch` 状态,可以实时更新修改代码,此处以 `taro-mini-runner` 举例:

1.首先进入 `taro-mini-runner` 根目录,执行 `yarn link` 命令

2.进入测试项目 `test` 的根目录,执行 `Debug and Run``yarn link taro-mini-runner` 命令进行软链接

#### 4.启动调试
在编译后的 `js` 文件中打断点,在 `VSCode` 左侧按钮列表中,选择启动调试 `Debug and Run` 按钮,在出现的选择框列表中,选择需要启动的测试项目,启动调试,即可开始单步调试。
Loading

0 comments on commit 505fe4d

Please sign in to comment.