From 2aa8d47de18836ad54befc2a1c3fd952d15c86c6 Mon Sep 17 00:00:00 2001 From: Spencer17x <1253478653@qq.com> Date: Fri, 3 Jul 2020 16:10:13 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DgetCurrentInstance?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=B1=BB=E5=9E=8B=E5=A3=B0=E6=98=8E#6904?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro/types/taro.extend.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/taro/types/taro.extend.d.ts b/packages/taro/types/taro.extend.d.ts index ba802d3bc57d..a0b5cc481cd8 100644 --- a/packages/taro/types/taro.extend.d.ts +++ b/packages/taro/types/taro.extend.d.ts @@ -106,7 +106,7 @@ declare namespace Taro { function setIsUsingDiff (flag: boolean) - const Current: { + interface Current { app: AppInstance | null, router: RouterInfo | null, page: PageInstance | null, @@ -114,4 +114,6 @@ declare namespace Taro { onHide: string, onShow: string } + + function getCurrentInstance(): Current } From 98ddac0696af63a2c40cc40d6d7697085a365120 Mon Sep 17 00:00:00 2001 From: Spencer17x <1253478653@qq.com> Date: Fri, 3 Jul 2020 18:19:43 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dtaro=20update=20pr?= =?UTF-8?q?oject=E6=8A=A5=E9=94=99#6850?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/presets/commands/update.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/taro-cli/src/presets/commands/update.ts b/packages/taro-cli/src/presets/commands/update.ts index 2ffd766f4f01..8941908264a3 100644 --- a/packages/taro-cli/src/presets/commands/update.ts +++ b/packages/taro-cli/src/presets/commands/update.ts @@ -93,7 +93,7 @@ export default (ctx: IPluginContext) => { const nervJSVersion = `^${await getLatestVersion('nervjs')}` // 更新 @tarojs/* 版本和 NervJS 版本 - Object.keys(packageMap.dependencies).forEach((key) => { + Object.keys(packageMap.dependencies || {}).forEach((key) => { if (UPDATE_PACKAGE_LIST.indexOf(key) !== -1) { if (key.includes('nerv')) { packageMap.dependencies[key] = nervJSVersion @@ -102,7 +102,7 @@ export default (ctx: IPluginContext) => { } } }) - Object.keys(packageMap.devDependencies).forEach((key) => { + Object.keys(packageMap.devDependencies || {}).forEach((key) => { if (UPDATE_PACKAGE_LIST.indexOf(key) !== -1) { if (key.includes('nerv')) { packageMap.devDependencies[key] = nervJSVersion From 6a3fdb375d4c26b92d6fc5e058eca0649b427521 Mon Sep 17 00:00:00 2001 From: Spencer17x <1253478653@qq.com> Date: Tue, 7 Jul 2020 17:11:10 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E4=BF=9D=E7=95=99=20Current=20?= =?UTF-8?q?=E7=9A=84=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro/types/taro.extend.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/taro/types/taro.extend.d.ts b/packages/taro/types/taro.extend.d.ts index a0b5cc481cd8..8e597c66c531 100644 --- a/packages/taro/types/taro.extend.d.ts +++ b/packages/taro/types/taro.extend.d.ts @@ -106,6 +106,15 @@ declare namespace Taro { function setIsUsingDiff (flag: boolean) + const Current: { + app: AppInstance | null, + router: RouterInfo | null, + page: PageInstance | null, + onReady: string, + onHide: string, + onShow: string + } + interface Current { app: AppInstance | null, router: RouterInfo | null, From 9c036e9adf068e8ad2655ae3036a7d28ba39ed3d Mon Sep 17 00:00:00 2001 From: Spencer17x <1253478653@qq.com> Date: Wed, 8 Jul 2020 14:37:23 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4Curren=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro/types/taro.extend.d.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/taro/types/taro.extend.d.ts b/packages/taro/types/taro.extend.d.ts index 8e597c66c531..fe22bd7cb696 100644 --- a/packages/taro/types/taro.extend.d.ts +++ b/packages/taro/types/taro.extend.d.ts @@ -106,15 +106,6 @@ declare namespace Taro { function setIsUsingDiff (flag: boolean) - const Current: { - app: AppInstance | null, - router: RouterInfo | null, - page: PageInstance | null, - onReady: string, - onHide: string, - onShow: string - } - interface Current { app: AppInstance | null, router: RouterInfo | null, @@ -124,5 +115,7 @@ declare namespace Taro { onShow: string } + const Current: Current + function getCurrentInstance(): Current }