From 34d3d02dafd5cdb374374097b7173eed527b331f Mon Sep 17 00:00:00 2001 From: luckyadam Date: Sun, 21 Oct 2018 23:46:44 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix(cli):=20h5=20=E5=88=86=E5=8C=85?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=AF=86=E5=88=AB=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/h5.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/taro-cli/src/h5.js b/packages/taro-cli/src/h5.js index 6a74782da660..fd1265206436 100644 --- a/packages/taro-cli/src/h5.js +++ b/packages/taro-cli/src/h5.js @@ -290,7 +290,11 @@ function processEntry (code, filePath) { }) if (root === null) return subPages.forEach(va => { - pages.push(`${root}${va}`) + let pagePath = `${root}/${va}` + pagePath = pagePath.replace(/\/{2,}/g, '/') + if (pages.indexOf(pagePath) < 0) { + pages.push(pagePath) + } }) }) } else if (keyName === 'tabBar' && t.isObjectExpression(value)) { From a187d8eb16cd55817ee13069fbd7c4ea2aef24f2 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 22 Oct 2018 10:26:32 +0800 Subject: [PATCH 2/6] =?UTF-8?q?docs:=20=E5=8A=A0=E7=B2=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76bcf90cb495..70478ac25e30 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Taro 已经投入了我们的生产环境中使用,业界也在广泛地使用 * [Taro整合Dva示例](https://github.com/zuoge85/taro-dva) * [V2ex小程序(TypeScript)](https://github.com/NervJS/taro-v2ex) * [与微信小程序原生融合的示例](https://github.com/NervJS/taro-sample-weapp) -* [基于Taro + Dva构建的时装衣橱(电商实战项目)](https://github.com/EasyTuan/taro-msparis) +* 💯[基于Taro + Dva构建的时装衣橱(电商实战项目)](https://github.com/EasyTuan/taro-msparis) ## 文章教程 From 2bf0838b7dc8418e05089098222c2f512862b9af Mon Sep 17 00:00:00 2001 From: chenjiajian <798095202@qq.com> Date: Mon, 22 Oct 2018 10:32:33 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix(taro-weapp):=20=E8=B0=83=E7=94=A8=20for?= =?UTF-8?q?ceUpdate=20=E6=97=B6=E5=BA=94=E8=AF=A5=E4=B8=8D=E5=8E=BB?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=20shouldComponentUpdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-weapp/src/component.js | 2 ++ packages/taro-weapp/src/lifecycle.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/taro-weapp/src/component.js b/packages/taro-weapp/src/component.js index ce8321ef4080..ea8ea6ebfeee 100644 --- a/packages/taro-weapp/src/component.js +++ b/packages/taro-weapp/src/component.js @@ -21,6 +21,7 @@ class BaseComponent { nextProps = {} _dirty = true _disable = true + _isforceUpdate = false _pendingStates = [] _pendingCallbacks = [] $router = { @@ -71,6 +72,7 @@ class BaseComponent { if (isFunction(callback)) { (this._pendingCallbacks = this._pendingCallbacks || []).push(callback) } + this._isforceUpdate = true updateComponent(this) } diff --git a/packages/taro-weapp/src/lifecycle.js b/packages/taro-weapp/src/lifecycle.js index e33bb95dc336..5231db082cec 100644 --- a/packages/taro-weapp/src/lifecycle.js +++ b/packages/taro-weapp/src/lifecycle.js @@ -35,6 +35,7 @@ export function updateComponent (component) { let skip = false if (component.__mounted) { if (typeof component.shouldComponentUpdate === 'function' && + !component._isForceUpdate && component.shouldComponentUpdate(props, state) === false) { skip = true } else if (typeof component.componentWillUpdate === 'function') { @@ -44,6 +45,7 @@ export function updateComponent (component) { component.props = props component.state = state component._dirty = false + component._isForceUpdate = false if (!component.__componentWillMountTriggered) { component.__componentWillMountTriggered = true componentTrigger(component, 'componentWillMount') From 013061530fd539e63a6bb9d73f801f8092a7225a Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 22 Oct 2018 10:40:36 +0800 Subject: [PATCH 4/6] =?UTF-8?q?docs:=20=E5=BC=80=E5=8F=91=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PLANS.md | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/PLANS.md b/PLANS.md index 6ac2e47f365c..78d8efce479f 100644 --- a/PLANS.md +++ b/PLANS.md @@ -1,18 +1,25 @@ -# 开发计划 +# 版本计划 -## 正在进行 +### 1.1.0 -- [x] TypeScript 支持 -- [x] 第三方组件引用支持 -- [x] 小程序组件化重构 -- [x] 第三方 UI 库支持 -- [x] 小程序性能优化 -- [ ] RN适配开发中,预计 9 月初完成 -- [ ] 快应用适配支持 -- [ ] 小程序代码转 Taro 代码 +> 预计 10 月底 -## 即将开始 +- [x] 百度小程序转换支持 +- [x] 支付宝小程序转换支持 +- [ ] Taro 组件在小程序端原生使用规范 +- [ ] UI 库打包能力开放 -- [ ] 小程序编译支持 Tree Shaking -- [ ] 支持 CSS Modules -- [ ] 支持 Styled Components +### 1.2.0 + +> 预计 11 月初 + +- [ ] 小程序代码转 Taro +- [ ] CSS Modules 支持 + +### 1.3.0 + +> 预计 11 月底 + +- [ ] 快应用转换支持 +- [ ] Taro Doctor +- [ ] 多端同时编译 From 24cdfff1035c4bcc942dc7121daa2ab351525819 Mon Sep 17 00:00:00 2001 From: chenjiajian <798095202@qq.com> Date: Mon, 22 Oct 2018 10:48:04 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix(taro-weapp):=20=E8=B0=83=E7=94=A8=20for?= =?UTF-8?q?ceUpdate=20=E6=97=B6=E5=BA=94=E8=AF=A5=E4=B8=8D=E5=8E=BB?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=20shouldComponentUpdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-weapp/src/component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/taro-weapp/src/component.js b/packages/taro-weapp/src/component.js index ea8ea6ebfeee..6c274731bad4 100644 --- a/packages/taro-weapp/src/component.js +++ b/packages/taro-weapp/src/component.js @@ -21,7 +21,7 @@ class BaseComponent { nextProps = {} _dirty = true _disable = true - _isforceUpdate = false + _isForceUpdate = false _pendingStates = [] _pendingCallbacks = [] $router = { @@ -72,7 +72,7 @@ class BaseComponent { if (isFunction(callback)) { (this._pendingCallbacks = this._pendingCallbacks || []).push(callback) } - this._isforceUpdate = true + this._isForceUpdate = true updateComponent(this) } From 69ed1cb23ddd60bcc8ee729f5b0e12520a88f1c0 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 22 Oct 2018 11:26:52 +0800 Subject: [PATCH 6/6] =?UTF-8?q?fix(taro):=20=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=AB=AF=20api=20=E4=BC=A0=E5=8F=82=E4=B8=A2=E5=A4=B1=E5=8F=82?= =?UTF-8?q?=E6=95=B0=EF=BC=8Cclose=20#420?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-alipay/src/native-api.js | 12 +++++++++--- packages/taro-swan/src/native-api.js | 11 +++++++++-- packages/taro-weapp/src/native-api.js | 11 +++++++++-- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/packages/taro-alipay/src/native-api.js b/packages/taro-alipay/src/native-api.js index 7e19825afe69..4ccf52318f18 100644 --- a/packages/taro-alipay/src/native-api.js +++ b/packages/taro-alipay/src/native-api.js @@ -239,13 +239,16 @@ function processApis (taro) { const weApis = Object.assign({ }, onAndSyncApis, noPromiseApis, otherApis) Object.keys(weApis).forEach(key => { if (!onAndSyncApis[key] && !noPromiseApis[key]) { - taro[key] = options => { + taro[key] = (options, ...args) => { const result = generateSpecialApis(key, options || {}) key = result.api options = result.options let task = null let obj = Object.assign({}, options) if (typeof options === 'string') { + if (args.length) { + return my[key](options, ...args) + } return my[key](options) } const p = new Promise((resolve, reject) => { @@ -272,8 +275,11 @@ function processApis (taro) { } } }) - - task = my[key](obj) + if (args.length) { + task = my[key](obj, ...args) + } else { + task = my[key](obj) + } }) if (key === 'uploadFile' || key === 'downloadFile') { p.progress = cb => { diff --git a/packages/taro-swan/src/native-api.js b/packages/taro-swan/src/native-api.js index 8b730c9f33f7..a4550e8a51d4 100644 --- a/packages/taro-swan/src/native-api.js +++ b/packages/taro-swan/src/native-api.js @@ -66,7 +66,7 @@ function processApis (taro) { const weApis = Object.assign({ }, onAndSyncApis, noPromiseApis, otherApis) Object.keys(weApis).forEach(key => { if (!onAndSyncApis[key] && !noPromiseApis[key]) { - taro[key] = options => { + taro[key] = (options, ...args) => { options = options || {} if (key === 'connectSocket') { if (options['protocols']) { @@ -76,6 +76,9 @@ function processApis (taro) { let task = null let obj = Object.assign({}, options) if (typeof options === 'string') { + if (args.length) { + return swan[key](options, ...args) + } return swan[key](options) } const p = new Promise((resolve, reject) => { @@ -94,7 +97,11 @@ function processApis (taro) { } } }) - task = swan[key](obj) + if (args.length) { + task = swan[key](obj, ...args) + } else { + task = swan[key](obj) + } }) if (key === 'uploadFile' || key === 'downloadFile') { p.progress = cb => { diff --git a/packages/taro-weapp/src/native-api.js b/packages/taro-weapp/src/native-api.js index eacfd97879a8..891f5ff662a0 100644 --- a/packages/taro-weapp/src/native-api.js +++ b/packages/taro-weapp/src/native-api.js @@ -75,11 +75,14 @@ function processApis (taro) { const preloadInitedComponent = '$preloadComponent' Object.keys(weApis).forEach(key => { if (!onAndSyncApis[key] && !noPromiseApis[key]) { - taro[key] = options => { + taro[key] = (options, ...args) => { options = options || {} let task = null let obj = Object.assign({}, options) if (typeof options === 'string') { + if (args.length) { + return wx[key](options, ...args) + } return wx[key](options) } @@ -121,7 +124,11 @@ function processApis (taro) { } } }) - task = wx[key](obj) + if (args.length) { + task = wx[key](obj, ...args) + } else { + task = wx[key](obj) + } }) if (key === 'uploadFile' || key === 'downloadFile') { p.progress = cb => {