diff --git a/crates/native_binding/package.json b/crates/native_binding/package.json index 03626dfcc51..8213b5de3cf 100644 --- a/crates/native_binding/package.json +++ b/crates/native_binding/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/binding", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Node binding for taro", "main": "binding.js", "typings": "binding.d.ts", diff --git a/npm/darwin-arm64/package.json b/npm/darwin-arm64/package.json index 9de2d330719..144bb33667c 100644 --- a/npm/darwin-arm64/package.json +++ b/npm/darwin-arm64/package.json @@ -1,7 +1,7 @@ { "name": "@tarojs/binding-darwin-arm64", "description": "Native binding for taro", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "os": [ "darwin" ], diff --git a/npm/darwin-x64/package.json b/npm/darwin-x64/package.json index c49b72c2967..730a043ad66 100644 --- a/npm/darwin-x64/package.json +++ b/npm/darwin-x64/package.json @@ -1,7 +1,7 @@ { "name": "@tarojs/binding-darwin-x64", "description": "Native binding for taro", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "os": [ "darwin" ], diff --git a/npm/linux-x64-gnu/package.json b/npm/linux-x64-gnu/package.json index 536ff0f186f..bc2149a4bb2 100644 --- a/npm/linux-x64-gnu/package.json +++ b/npm/linux-x64-gnu/package.json @@ -1,7 +1,7 @@ { "name": "@tarojs/binding-linux-x64-gnu", "description": "Native binding for taro", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "os": [ "linux" ], diff --git a/npm/linux-x64-musl/package.json b/npm/linux-x64-musl/package.json index 41b397bb035..c308eeb70e8 100644 --- a/npm/linux-x64-musl/package.json +++ b/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/binding-linux-x64-musl", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "os": [ "linux" ], diff --git a/npm/win32-x64-msvc/package.json b/npm/win32-x64-msvc/package.json index b1caf0e7e5c..8ce95443a2e 100644 --- a/npm/win32-x64-msvc/package.json +++ b/npm/win32-x64-msvc/package.json @@ -1,7 +1,7 @@ { "name": "@tarojs/binding-win32-x64-msvc", "description": "Native binding for taro", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "os": [ "win32" ], diff --git a/package.json b/package.json index e651190bdbb..da817346d73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "taro", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "开放式跨端跨框架开发解决方案", "homepage": "https://github.com/NervJS/taro#readme", "author": "O2Team", diff --git a/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json b/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json index 605f2e8acd8..006220518c3 100644 --- a/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json +++ b/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-react-jsx-to-rn-stylesheet", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Transform stylesheet selector to style in JSX Elements.", "author": "O2Team", "license": "MIT", diff --git a/packages/babel-plugin-transform-solid-jsx/package.json b/packages/babel-plugin-transform-solid-jsx/package.json index dfec43aa614..6b461adf68a 100644 --- a/packages/babel-plugin-transform-solid-jsx/package.json +++ b/packages/babel-plugin-transform-solid-jsx/package.json @@ -1,7 +1,7 @@ { "name": "babel-plugin-transform-solid-jsx", "description": "A JSX to DOM plugin that wraps expressions for fine grained change detection", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "license": "MIT", "repository": { "type": "git", diff --git a/packages/babel-plugin-transform-taroapi/package.json b/packages/babel-plugin-transform-taroapi/package.json index fabf023f882..51022906f4c 100644 --- a/packages/babel-plugin-transform-taroapi/package.json +++ b/packages/babel-plugin-transform-taroapi/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-taroapi", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "author": "O2Team", "license": "MIT", "main": "dist/index.js", diff --git a/packages/babel-preset-taro/package.json b/packages/babel-preset-taro/package.json index 619a18eb9ca..d991e889995 100644 --- a/packages/babel-preset-taro/package.json +++ b/packages/babel-preset-taro/package.json @@ -1,6 +1,6 @@ { "name": "babel-preset-taro", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro babel preset", "author": "O2Team", "license": "MIT", diff --git a/packages/create-app/package.json b/packages/create-app/package.json index d40d585bebd..f47d14491a4 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/create-app", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "create taro app with one command", "author": "O2Team", "license": "MIT", diff --git a/packages/css-to-react-native/package.json b/packages/css-to-react-native/package.json index 3c33c69e945..ccdcdf59019 100644 --- a/packages/css-to-react-native/package.json +++ b/packages/css-to-react-native/package.json @@ -1,7 +1,7 @@ { "name": "taro-css-to-react-native", "description": "Convert CSS text to a React Native stylesheet object", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "author": "O2Team", "license": "MIT", "main": "dist/index.js", diff --git a/packages/eslint-config-taro/package.json b/packages/eslint-config-taro/package.json index 87a6be572de..8768c5e69ee 100644 --- a/packages/eslint-config-taro/package.json +++ b/packages/eslint-config-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-taro", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro specific linting rules for ESLint", "author": "O2Team", "license": "MIT", diff --git a/packages/jest-helper/package.json b/packages/jest-helper/package.json index 4ea0162c29e..f89f07f13b7 100644 --- a/packages/jest-helper/package.json +++ b/packages/jest-helper/package.json @@ -1,6 +1,6 @@ { "name": "jest-taro-helper", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "jest helper for taro", "private": true, "author": "O2Team", diff --git a/packages/postcss-html-transform/package.json b/packages/postcss-html-transform/package.json index 193ed733ecc..8b99e0c6946 100644 --- a/packages/postcss-html-transform/package.json +++ b/packages/postcss-html-transform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-html-transform", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "transform html tag name selector", "author": "O2Team", "license": "MIT", diff --git a/packages/postcss-plugin-constparse/package.json b/packages/postcss-plugin-constparse/package.json index f3a660cbcf0..a3641f7a90f 100644 --- a/packages/postcss-plugin-constparse/package.json +++ b/packages/postcss-plugin-constparse/package.json @@ -1,6 +1,6 @@ { "name": "postcss-plugin-constparse", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "parse constants defined in config", "author": "O2Team", "license": "MIT", diff --git a/packages/postcss-pxtransform/package.json b/packages/postcss-pxtransform/package.json index 7b81c9f20fa..efdbed1f6d7 100644 --- a/packages/postcss-pxtransform/package.json +++ b/packages/postcss-pxtransform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-pxtransform", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位", "author": "O2Team", "license": "MIT", diff --git a/packages/postcss-unit-transform/package.json b/packages/postcss-unit-transform/package.json index 8a6a579169e..92acebe7517 100644 --- a/packages/postcss-unit-transform/package.json +++ b/packages/postcss-unit-transform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-taro-unit-transform", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "小程序单位转换", "author": "O2Team", "license": "MIT", diff --git a/packages/rollup-plugin-copy/package.json b/packages/rollup-plugin-copy/package.json index bf3a50e0e1e..6737c0e6c6c 100644 --- a/packages/rollup-plugin-copy/package.json +++ b/packages/rollup-plugin-copy/package.json @@ -1,6 +1,6 @@ { "name": "rollup-plugin-copy", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "rollup-plugin-copy for taro", "private": true, "author": "O2Team", diff --git a/packages/shared/package.json b/packages/shared/package.json index c96b341648e..ddfd3b36c0e 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/shared", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro utils internal use.", "author": "O2Team", "license": "MIT", diff --git a/packages/stylelint-config-taro-rn/package.json b/packages/stylelint-config-taro-rn/package.json index 992cb13cbd6..efb7df55148 100644 --- a/packages/stylelint-config-taro-rn/package.json +++ b/packages/stylelint-config-taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "stylelint-config-taro-rn", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Shareable stylelint config for React Native CSS modules", "author": "O2Team", "license": "MIT", diff --git a/packages/stylelint-taro-rn/package.json b/packages/stylelint-taro-rn/package.json index 5ae4a82be42..b74e4fe88e3 100644 --- a/packages/stylelint-taro-rn/package.json +++ b/packages/stylelint-taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "stylelint-taro-rn", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "A collection of React Native specific rules for stylelint", "author": "O2Team", "license": "MIT", diff --git a/packages/stylelint-taro/package.json b/packages/stylelint-taro/package.json index f5fab068bca..21dd680b649 100644 --- a/packages/stylelint-taro/package.json +++ b/packages/stylelint-taro/package.json @@ -1,6 +1,6 @@ { "name": "stylelint-taro", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro stylelint 规则集合", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-api/package.json b/packages/taro-api/package.json index 3a06168cdac..9f419b90d0a 100644 --- a/packages/taro-api/package.json +++ b/packages/taro-api/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/api", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro common API", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-cli-convertor/package.json b/packages/taro-cli-convertor/package.json index 06593c550ee..c33c1e2de78 100644 --- a/packages/taro-cli-convertor/package.json +++ b/packages/taro-cli-convertor/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/cli-convertor", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "cli tool for taro-convert", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-cli/package.json b/packages/taro-cli/package.json index 8606541b0a4..db3e577009b 100644 --- a/packages/taro-cli/package.json +++ b/packages/taro-cli/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/cli", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "cli tool for taro", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-components-advanced/package.json b/packages/taro-components-advanced/package.json index 7b916f4655f..c6b22cd7565 100644 --- a/packages/taro-components-advanced/package.json +++ b/packages/taro-components-advanced/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-advanced", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-components-library-react/package.json b/packages/taro-components-library-react/package.json index 73f6bc7dcbf..e069d257178 100644 --- a/packages/taro-components-library-react/package.json +++ b/packages/taro-components-library-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-library-react", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro 组件库 React 版本库", "private": true, "author": "O2Team", diff --git a/packages/taro-components-library-solid/package.json b/packages/taro-components-library-solid/package.json index 2143ea3d54e..faa108bf002 100644 --- a/packages/taro-components-library-solid/package.json +++ b/packages/taro-components-library-solid/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-library-solid", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro 组件库 Solid 版本库", "private": true, "main": "index.js", diff --git a/packages/taro-components-library-vue3/package.json b/packages/taro-components-library-vue3/package.json index a0b2bf3b595..ea9d7e069a7 100644 --- a/packages/taro-components-library-vue3/package.json +++ b/packages/taro-components-library-vue3/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-library-vue3", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro 组件库 Vue3 版本库", "private": true, "author": "O2Team", diff --git a/packages/taro-components-react/package.json b/packages/taro-components-react/package.json index 73afff13d3c..52cfe2f1525 100644 --- a/packages/taro-components-react/package.json +++ b/packages/taro-components-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-react", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "", "main:h5": "dist/index.js", "main": "dist/index.js", diff --git a/packages/taro-components-rn/package.json b/packages/taro-components-rn/package.json index 0ad69540f3b..d9fabb2ff99 100644 --- a/packages/taro-components-rn/package.json +++ b/packages/taro-components-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-rn", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "React Native 基础组件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-components/package.json b/packages/taro-components/package.json index b664b315933..0a62ebb9901 100644 --- a/packages/taro-components/package.json +++ b/packages/taro-components/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro 组件库", "browser": "dist/index.js", "main:h5": "dist/index.js", diff --git a/packages/taro-extend/package.json b/packages/taro-extend/package.json index 9b57a3e00b7..52741dc01ab 100644 --- a/packages/taro-extend/package.json +++ b/packages/taro-extend/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/extend", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro extend functionality", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-framework-react/package.json b/packages/taro-framework-react/package.json index ad3ddbe6454..62636497e74 100644 --- a/packages/taro-framework-react/package.json +++ b/packages/taro-framework-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-framework-react", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "React/Preact 框架插件", "author": "O2Team", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-framework-solid/package.json b/packages/taro-framework-solid/package.json index 2b68ff273c1..555b0fedb09 100644 --- a/packages/taro-framework-solid/package.json +++ b/packages/taro-framework-solid/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-framework-solid", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Solid 框架插件", "author": "drchan", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-framework-vue3/package.json b/packages/taro-framework-vue3/package.json index 26ea4c37a65..40d58ff2bf5 100644 --- a/packages/taro-framework-vue3/package.json +++ b/packages/taro-framework-vue3/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-framework-vue3", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Vue3 框架插件", "author": "O2Team", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-h5/package.json b/packages/taro-h5/package.json index 73ecc1f1590..1a75a560bfe 100644 --- a/packages/taro-h5/package.json +++ b/packages/taro-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-h5", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro h5 framework", "browser": "dist/index.js", "main:h5": "dist/index.esm.js", diff --git a/packages/taro-helper/package.json b/packages/taro-helper/package.json index f31459f5dd7..90d7bafbbb0 100644 --- a/packages/taro-helper/package.json +++ b/packages/taro-helper/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/helper", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro Helper", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-loader/package.json b/packages/taro-loader/package.json index fd915026fc0..fa2b85f22e8 100644 --- a/packages/taro-loader/package.json +++ b/packages/taro-loader/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-loader", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro runner use webpack loader", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-platform-alipay/package.json b/packages/taro-platform-alipay/package.json index a79c13fe3ec..6abda15286e 100644 --- a/packages/taro-platform-alipay/package.json +++ b/packages/taro-platform-alipay/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-alipay", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "支付宝小程序平台插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-platform-h5/package.json b/packages/taro-platform-h5/package.json index 3dc8ce0df0d..9d85a6f42f9 100644 --- a/packages/taro-platform-h5/package.json +++ b/packages/taro-platform-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-h5", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Web 端平台插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-platform-harmony-hybrid/package.json b/packages/taro-platform-harmony-hybrid/package.json index 356aa5a2525..24b1ff63719 100644 --- a/packages/taro-platform-harmony-hybrid/package.json +++ b/packages/taro-platform-harmony-hybrid/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-harmony-hybrid", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Harmony 端平台插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-platform-harmony/package.json b/packages/taro-platform-harmony/package.json index c3eb37f684e..726c0fa9d34 100644 --- a/packages/taro-platform-harmony/package.json +++ b/packages/taro-platform-harmony/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-harmony-ets", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "OpenHarmony & 鸿蒙系统插件", "author": "O2Team", "homepage": "https://gitee.com/openharmony-sig/taro", diff --git a/packages/taro-platform-jd/package.json b/packages/taro-platform-jd/package.json index b89353d1728..0f4f922160b 100644 --- a/packages/taro-platform-jd/package.json +++ b/packages/taro-platform-jd/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-jd", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "京东小程序平台插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-platform-qq/package.json b/packages/taro-platform-qq/package.json index 2c25a61b117..e73d832c10d 100644 --- a/packages/taro-platform-qq/package.json +++ b/packages/taro-platform-qq/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-qq", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "QQ 小程序平台插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-platform-swan/package.json b/packages/taro-platform-swan/package.json index e5795d4dc0f..9e43c6f6677 100644 --- a/packages/taro-platform-swan/package.json +++ b/packages/taro-platform-swan/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-swan", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "百度小程序平台插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-platform-tt/package.json b/packages/taro-platform-tt/package.json index d84eee95d3d..2f8cafecf52 100644 --- a/packages/taro-platform-tt/package.json +++ b/packages/taro-platform-tt/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-tt", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "头条小程序平台插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-platform-weapp/package.json b/packages/taro-platform-weapp/package.json index a933a1701e0..6473434f212 100644 --- a/packages/taro-platform-weapp/package.json +++ b/packages/taro-platform-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-weapp", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "微信小程序平台插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-plugin-html/package.json b/packages/taro-plugin-html/package.json index 30a74898e1b..358e2b9984d 100644 --- a/packages/taro-plugin-html/package.json +++ b/packages/taro-plugin-html/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-html", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro 小程序端支持使用 HTML 标签的插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-plugin-http/package.json b/packages/taro-plugin-http/package.json index fc278a9d10f..8f9477b6839 100644 --- a/packages/taro-plugin-http/package.json +++ b/packages/taro-plugin-http/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-http", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro 小程序端支持使用 web 请求 的插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-plugin-inject/package.json b/packages/taro-plugin-inject/package.json index 3ef976e50ae..a1d28ceeb37 100644 --- a/packages/taro-plugin-inject/package.json +++ b/packages/taro-plugin-inject/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-inject", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro 小程序端平台中间层插件", "author": "O2Team", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-plugin-mini-ci/package.json b/packages/taro-plugin-mini-ci/package.json index 41e8dce9080..7b24ddade88 100644 --- a/packages/taro-plugin-mini-ci/package.json +++ b/packages/taro-plugin-mini-ci/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-mini-ci", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro 小程序端构建后支持CI(持续集成)的插件", "keywords": [ "Taro", diff --git a/packages/taro-plugin-react-devtools/package.json b/packages/taro-plugin-react-devtools/package.json index 37f096e4ef9..8c9b7dd74bb 100644 --- a/packages/taro-plugin-react-devtools/package.json +++ b/packages/taro-plugin-react-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-react-devtools", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro 小程序端支持使用 React DevTools 的插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-plugin-vue-devtools/package.json b/packages/taro-plugin-vue-devtools/package.json index 2aa552e20bf..cd58817f267 100644 --- a/packages/taro-plugin-vue-devtools/package.json +++ b/packages/taro-plugin-vue-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-vue-devtools", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro 小程序端支持使用 Vue DevTools 的插件", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-react/package.json b/packages/taro-react/package.json index 288ed005f4d..d86f0f733df 100644 --- a/packages/taro-react/package.json +++ b/packages/taro-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/react", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "like react-dom, but for mini apps.", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-rn-runner/package.json b/packages/taro-rn-runner/package.json index 1ad55ecb81f..1eecbf0beda 100644 --- a/packages/taro-rn-runner/package.json +++ b/packages/taro-rn-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-runner", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "ReactNative build tool for taro", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-rn-style-transformer/package.json b/packages/taro-rn-style-transformer/package.json index 08772a7e109..c4b82152a73 100644 --- a/packages/taro-rn-style-transformer/package.json +++ b/packages/taro-rn-style-transformer/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-style-transformer", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "提供 Taro RN 统一处理样式文件能力", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-rn-supporter/package.json b/packages/taro-rn-supporter/package.json index f7c19792082..96de5557cef 100644 --- a/packages/taro-rn-supporter/package.json +++ b/packages/taro-rn-supporter/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-supporter", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro rn supporter", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-rn-transformer/package.json b/packages/taro-rn-transformer/package.json index 06d5eb71f6a..fc133927a48 100644 --- a/packages/taro-rn-transformer/package.json +++ b/packages/taro-rn-transformer/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-transformer", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro RN 入口文件处理", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-rn/package.json b/packages/taro-rn/package.json index 2b5a21ae277..417badb17ba 100644 --- a/packages/taro-rn/package.json +++ b/packages/taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-rn", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro RN framework", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-router-rn/package.json b/packages/taro-router-rn/package.json index b9076c81bb1..0544c4e20f9 100644 --- a/packages/taro-router-rn/package.json +++ b/packages/taro-router-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/router-rn", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro-router-rn", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-router/package.json b/packages/taro-router/package.json index 6f51db738ca..0ae059a48ab 100644 --- a/packages/taro-router/package.json +++ b/packages/taro-router/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/router", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro-router", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-runner-utils/package.json b/packages/taro-runner-utils/package.json index ac2ebfad43c..adeaf3d8b28 100644 --- a/packages/taro-runner-utils/package.json +++ b/packages/taro-runner-utils/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/runner-utils", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro runner utilities.", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-runtime-rn/package.json b/packages/taro-runtime-rn/package.json index 2d36d00cc2a..e35186a0916 100644 --- a/packages/taro-runtime-rn/package.json +++ b/packages/taro-runtime-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/runtime-rn", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "taro-runtime-rn", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-runtime/package.json b/packages/taro-runtime/package.json index 5391d860d58..d160e06c9fc 100644 --- a/packages/taro-runtime/package.json +++ b/packages/taro-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/runtime", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "taro runtime for mini apps.", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-service/package.json b/packages/taro-service/package.json index a6dcabdce2e..0fb8fc8643c 100644 --- a/packages/taro-service/package.json +++ b/packages/taro-service/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/service", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro Service", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-transformer-wx/package.json b/packages/taro-transformer-wx/package.json index 5665455545a..c3a3011fb7c 100644 --- a/packages/taro-transformer-wx/package.json +++ b/packages/taro-transformer-wx/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/transformer-wx", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Transfrom Nerv Component to Wechat mini program.", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-vite-runner/package.json b/packages/taro-vite-runner/package.json index 3d94f0a1a69..8a26d679d36 100644 --- a/packages/taro-vite-runner/package.json +++ b/packages/taro-vite-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/vite-runner", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "main": "index.js", "license": "MIT", "files": [ diff --git a/packages/taro-vite-runner/src/common/vite-plugin-assets.ts b/packages/taro-vite-runner/src/common/vite-plugin-assets.ts index c016a46c2c3..9ead395e69a 100644 --- a/packages/taro-vite-runner/src/common/vite-plugin-assets.ts +++ b/packages/taro-vite-runner/src/common/vite-plugin-assets.ts @@ -42,7 +42,7 @@ export default function (viteCompilerContext: ViteH5CompilerContext | ViteMiniCo return cachedValue } - const source = await fs.readFile(id) + const source = fs.readFileSync(id) const { imageUrlLoaderOption = {}, @@ -78,7 +78,7 @@ export default function (viteCompilerContext: ViteH5CompilerContext | ViteMiniCo const referenceId = this.emitFile({ type: 'asset', fileName, - source + source: Uint8Array.from(source) }) url = `__VITE_ASSET__${referenceId}__` } diff --git a/packages/taro-vite-runner/src/h5/entry.ts b/packages/taro-vite-runner/src/h5/entry.ts index ecf28e14e94..cd8f030464d 100644 --- a/packages/taro-vite-runner/src/h5/entry.ts +++ b/packages/taro-vite-runner/src/h5/entry.ts @@ -69,7 +69,7 @@ export default function (viteCompilerContext: ViteH5CompilerContext): PluginOpti this.emitFile({ type: 'asset', fileName, - source: await fs.readFile(filePath) + source: Uint8Array.from(fs.readFileSync(filePath)) }) this.addWatchFile(filePath) } diff --git a/packages/taro-vite-runner/src/harmony/entry.ts b/packages/taro-vite-runner/src/harmony/entry.ts index 546fe6172ea..8056de9c1f6 100644 --- a/packages/taro-vite-runner/src/harmony/entry.ts +++ b/packages/taro-vite-runner/src/harmony/entry.ts @@ -76,13 +76,7 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi // native components for (const comp of viteCompilerContext.nativeComponents.values()) { - if (comp.isPackage) continue - this.emitFile({ - type: 'chunk', - id: comp.templatePath + QUERY_IS_NATIVE_SCRIPT, - fileName: path.relative(viteCompilerContext.sourceDir, comp.templatePath) + QUERY_IS_NATIVE_SCRIPT, - implicitlyLoadedAfterOneOf: [rawId] - }) + viteCompilerContext.generateNativeComponent(this, comp, [rawId]) } // emit tabbar @@ -97,7 +91,7 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi this.emitFile({ type: 'asset', fileName: removePathPrefix(iconPath), - source: await fs.readFile(filePath) + source: Uint8Array.from(fs.readFileSync(filePath)) }) if (!isFinished) { this.addWatchFile(filePath) @@ -109,7 +103,7 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi this.emitFile({ type: 'asset', fileName: removePathPrefix(selectedIconPath), - source: await fs.readFile(filePath) + source: Uint8Array.from(fs.readFileSync(filePath)) }) if (!isFinished) { this.addWatchFile(filePath) @@ -124,7 +118,7 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi this.emitFile({ type: 'asset', fileName: appConfig.themeLocation, - source: fs.readFileSync(themePath) + source: Uint8Array.from(fs.readFileSync(themePath)) }) if (!isFinished) { this.addWatchFile(themePath) diff --git a/packages/taro-vite-runner/src/harmony/page.ts b/packages/taro-vite-runner/src/harmony/page.ts index 43b50ceb239..371200fca0d 100644 --- a/packages/taro-vite-runner/src/harmony/page.ts +++ b/packages/taro-vite-runner/src/harmony/page.ts @@ -63,7 +63,7 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi } return null }, - async load (id) { + load (id) { if (!viteCompilerContext) return const { taroConfig, cwd: appPath, app, loaderMeta } = viteCompilerContext const appConfig = app.config @@ -100,9 +100,28 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi code: parse.parse(tabbarId, tabbarPages as TaroHarmonyPageMeta[], name, this.resolve), exports: ['default'], }) - await Promise.all(tabbarPages.map(async page => { - await viteCompilerContext.collectedDeps(this, escapePath(page.scriptPath), filter) - })) + tabbarPages.forEach(async page => { + const deps = await viteCompilerContext.collectedDeps(this, escapePath(page.scriptPath), filter) + const ncObj: Record = {} + deps.forEach(dep => { + Object.entries(nCompCache.get(dep) || {}).forEach(([key, value]) => { + const absPath = value[0] + const ext = path.extname(absPath) + const basename = path.basename(absPath, ext) + ncObj[key] = [path.join(path.dirname(path.relative(path.dirname(rawId), absPath)), basename), value[1]] + }) + }) + if (!page.isNative) { + page.config.usingComponents = { + ...page.config.usingComponents, + ...ncObj, + } + } + const nativeComps = viteCompilerContext.collectNativeComponents(page) + nativeComps.forEach(comp => { + viteCompilerContext.generateNativeComponent(this, comp, [rawId]) + }) + }) } } else { const list: string[] = [] @@ -118,7 +137,7 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi list.push(page.name) } - await Promise.all(list.map(async pageName => { + list.forEach(pageName => { pageName = removeHeadSlash(pageName) if (!pageName) { pageName = 'index' @@ -135,29 +154,33 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi code: parse.parse(path.resolve(appRoot, pageName), page_, name, this.resolve), exports: ['default'], }) - const deps: Set = await viteCompilerContext.collectedDeps(this, escapePath(rawId), filter) - const ncObj: Record = {} - deps.forEach(dep => { - Object.entries(nCompCache.get(dep) || {}).forEach(([key, value]) => { - const absPath = value[0] - const ext = path.extname(absPath) - const basename = path.basename(absPath, ext) - ncObj[key] = [path.join(path.dirname(path.relative(path.dirname(rawId), absPath)), basename), value[1]] + viteCompilerContext.collectedDeps(this, escapePath(rawId), filter).then(deps => { + const ncObj: Record = {} + deps.forEach(dep => { + Object.entries(nCompCache.get(dep) || {}).forEach(([key, value]) => { + const absPath = value[0] + const ext = path.extname(absPath) + const basename = path.basename(absPath, ext) + ncObj[key] = [path.join(path.dirname(path.relative(path.dirname(rawId), absPath)), basename), value[1]] + }) }) - }) - if (!page.isNative) { - page.config.usingComponents = { - ...page.config.usingComponents, - ...ncObj, + if (!page.isNative) { + page.config.usingComponents = { + ...page.config.usingComponents, + ...ncObj, + } } - } - viteCompilerContext.collectNativeComponents(page) - })) + const nativeComps = viteCompilerContext.collectNativeComponents(page) + nativeComps.forEach(comp => { + viteCompilerContext.generateNativeComponent(this, comp, [rawId]) + }) + }) + }) } return parse.parseEntry(rawId, page as TaroHarmonyPageMeta) } }, - async transform(code, id) { + transform(code, id) { if (/\.m?[jt]sx?$/.test(id) && filter(id)) { const scopeNativeComp = new Map() let enableImportComponent = true diff --git a/packages/taro-vite-runner/src/mini/entry.ts b/packages/taro-vite-runner/src/mini/entry.ts index 9b52403a2db..4eb0136afd8 100644 --- a/packages/taro-vite-runner/src/mini/entry.ts +++ b/packages/taro-vite-runner/src/mini/entry.ts @@ -5,8 +5,7 @@ import { isString } from '@tarojs/shared' import { appendVirtualModulePrefix, escapePath, prettyPrintJson, stripVirtualModulePrefix } from '../utils' import { baseCompName, customWrapperName } from '../utils/constants' -import { miniTemplateLoader, QUERY_IS_NATIVE_COMP, QUERY_IS_NATIVE_PAGE } from './native-support' -import { PAGE_SUFFIX } from './page' +import { miniTemplateLoader, QUERY_IS_NATIVE_PAGE } from './native-support' import type { ViteMiniCompilerContext } from '@tarojs/taro/types/compile/viteCompilerContext' import type { PluginOption } from 'vite' @@ -57,7 +56,7 @@ export default function (viteCompilerContext: ViteMiniCompilerContext): PluginOp } // pages - await Promise.all(viteCompilerContext.pages.map(async page => { + viteCompilerContext.pages.forEach(async page => { // 小程序原生页面 if (page.isNative) { if (page.templatePath) { @@ -76,27 +75,11 @@ export default function (viteCompilerContext: ViteMiniCompilerContext): PluginOp fileName: viteCompilerContext.getScriptPath(page.name), implicitlyLoadedAfterOneOf: [rawId] }) - await this.load({ - id: appendVirtualModulePrefix(page.scriptPath + PAGE_SUFFIX), - resolveDependencies: true - }) - })) + }) // native components for (const comp of viteCompilerContext.nativeComponents.values()) { - this.emitFile({ - type: 'chunk', - id: comp.scriptPath + QUERY_IS_NATIVE_COMP, - fileName: viteCompilerContext.getScriptPath(comp.name), - implicitlyLoadedAfterOneOf: [rawId] - }) - const source = miniTemplateLoader(this, comp.templatePath, viteCompilerContext.sourceDir) - this.emitFile({ - type: 'asset', - fileName: viteCompilerContext.getTemplatePath(comp.name), - source - }) - comp.cssPath && this.addWatchFile(comp.cssPath) + viteCompilerContext.generateNativeComponent(this, comp, [rawId]) } // comp' script @@ -128,7 +111,7 @@ export default function (viteCompilerContext: ViteMiniCompilerContext): PluginOp this.emitFile({ type: 'asset', fileName: removePathPrefix(iconPath), - source: await fs.readFile(filePath) + source: Uint8Array.from(fs.readFileSync(filePath)) }) this.addWatchFile(filePath) } @@ -138,7 +121,7 @@ export default function (viteCompilerContext: ViteMiniCompilerContext): PluginOp this.emitFile({ type: 'asset', fileName: removePathPrefix(selectedIconPath), - source: await fs.readFile(filePath) + source: Uint8Array.from(fs.readFileSync(filePath)) }) this.addWatchFile(filePath) } @@ -151,7 +134,7 @@ export default function (viteCompilerContext: ViteMiniCompilerContext): PluginOp this.emitFile({ type: 'asset', fileName: appConfig.themeLocation, - source: fs.readFileSync(themePath) + source: Uint8Array.from(fs.readFileSync(themePath)) }) this.addWatchFile(themePath) } diff --git a/packages/taro-vite-runner/src/mini/native-support.ts b/packages/taro-vite-runner/src/mini/native-support.ts index 074dc0f67e7..f742a25cde6 100644 --- a/packages/taro-vite-runner/src/mini/native-support.ts +++ b/packages/taro-vite-runner/src/mini/native-support.ts @@ -71,7 +71,7 @@ export default function (viteCompilerContext: ViteMiniCompilerContext | undefine } else if (IS_NATIVE_STYLE_REG.test(id)) { let source = id.replace(new RegExp(`\\${QUERY_IS_NATIVE_STYLE}`), '') source = viteCompilerContext.getTargetFilePath(source, viteCompilerContext.fileType.style) - const code = await fs.readFile(source, 'utf-8') + const code = fs.readFileSync(source, 'utf-8') return { code } @@ -157,7 +157,7 @@ export function miniTemplateLoader (ctx: PluginContext, templatePath: string, so ctx.emitFile({ type: 'asset', fileName: requests[i].replace(sourceDir, '').replace(/^\//, ''), - source: await fs.readFile(requests[i]) + source: Uint8Array.from(fs.readFileSync(requests[i])) }) ctx.addWatchFile(requests[i]) } diff --git a/packages/taro-vite-runner/src/mini/page.ts b/packages/taro-vite-runner/src/mini/page.ts index b9c8e38333f..dd774b85255 100644 --- a/packages/taro-vite-runner/src/mini/page.ts +++ b/packages/taro-vite-runner/src/mini/page.ts @@ -47,7 +47,7 @@ export default function (viteCompilerContext: ViteMiniCompilerContext): PluginOp } return null }, - async load (id) { + load (id) { if (viteCompilerContext && id.endsWith(PAGE_SUFFIX)) { const rawId = stripVirtualModulePrefix(id).replace(PAGE_SUFFIX, '') const page = viteCompilerContext.getPageById(rawId) @@ -65,23 +65,27 @@ export default function (viteCompilerContext: ViteMiniCompilerContext): PluginOp instantiatePage = viteCompilerContext.loaderMeta.modifyInstantiate(instantiatePage, 'page') } - const deps: Set = await viteCompilerContext.collectedDeps(this, escapePath(rawId), filter) - const ncObj: Record = {} - deps.forEach(dep => { - Object.entries(nCompCache.get(dep) || {}).forEach(([key, value]) => { - const absPath = value - const ext = path.extname(absPath) - const basename = path.basename(absPath, ext) - ncObj[key] = path.join(path.dirname(path.relative(path.dirname(rawId), absPath)), basename) + viteCompilerContext.collectedDeps(this, escapePath(rawId), filter).then(deps => { + const ncObj: Record = {} + deps.forEach(dep => { + Object.entries(nCompCache.get(dep) || {}).forEach(([key, value]) => { + const absPath = value + const ext = path.extname(absPath) + const basename = path.basename(absPath, ext) + ncObj[key] = path.join(path.dirname(path.relative(path.dirname(rawId), absPath)), basename) + }) }) - }) - if (!page.isNative) { - page.config.usingComponents = { - ...page.config.usingComponents, - ...ncObj, + if (!page.isNative) { + page.config.usingComponents = { + ...page.config.usingComponents, + ...ncObj, + } } - } - viteCompilerContext.collectNativeComponents(page) + const nativeComps = viteCompilerContext.collectNativeComponents(page) + nativeComps.forEach(comp => { + viteCompilerContext.generateNativeComponent(this, comp, [rawId]) + }) + }) return [ 'import { createPageConfig } from "@tarojs/runtime"', @@ -93,7 +97,7 @@ export default function (viteCompilerContext: ViteMiniCompilerContext): PluginOp ].join('\n') } }, - async transform(code, id) { + transform(code, id) { if (/\.m?[jt]sx?$/.test(id) && filter(id)) { const scopeNativeComp = new Map() let enableImportComponent = true diff --git a/packages/taro-vite-runner/src/utils/compiler/harmony.ts b/packages/taro-vite-runner/src/utils/compiler/harmony.ts index 8f03820f199..092140b7ab5 100644 --- a/packages/taro-vite-runner/src/utils/compiler/harmony.ts +++ b/packages/taro-vite-runner/src/utils/compiler/harmony.ts @@ -14,6 +14,7 @@ import { isArray, isFunction } from '@tarojs/shared' import JSON5 from 'json5' import defaultConfig from '../../defaultConfig/defaultConfig.harmony' +import { QUERY_IS_NATIVE_SCRIPT } from '../../harmony/ets' import { TARO_TABBAR_PAGE_PATH } from '../../harmony/page' import { componentConfig } from '../../utils/component' import { parseRelativePath } from '..' @@ -28,6 +29,7 @@ import type { ViteNativeCompMeta, VitePageMeta, } from '@tarojs/taro/types/compile/viteCompilerContext' +import type { PluginContext } from 'rollup' export function readJsonSync(file: string) { const ext = path.extname(file) @@ -128,11 +130,12 @@ export class TaroCompilerContext extends CompilerContext return importPath } - collectNativeComponents(meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) { + collectNativeComponents(meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta): ViteNativeCompMeta[] { const { name, scriptPath, config } = meta const { usingComponents } = config - if (!usingComponents) return + const list: ViteNativeCompMeta[] = [] + if (!usingComponents) return list Object.entries(usingComponents).forEach(([compName, value]) => { const compPath = value instanceof Array ? value[0] : value @@ -181,8 +184,21 @@ export class TaroCompilerContext extends CompilerContext componentConfig.thirdPartyComponents.set(compName, new Set()) } - this.collectNativeComponents(nativeCompMeta) + list.push(...this.collectNativeComponents(nativeCompMeta), nativeCompMeta) }) + return list + } + + generateNativeComponent (rollupCtx: PluginContext, meta: ViteNativeCompMeta, implicitlyLoadedAfterOneOf: string[] = []) { + if (meta.isGenerated || meta.isPackage) return + + rollupCtx.emitFile({ + type: 'chunk', + id: meta.templatePath + QUERY_IS_NATIVE_SCRIPT, + fileName: path.relative(this.sourceDir, meta.templatePath) + QUERY_IS_NATIVE_SCRIPT, + implicitlyLoadedAfterOneOf + }) + meta.isGenerated = true } modifyHarmonyResources(id = '', data: any = {}) { diff --git a/packages/taro-vite-runner/src/utils/compiler/mini.ts b/packages/taro-vite-runner/src/utils/compiler/mini.ts index 54fc4da3f81..dfa146b2c82 100644 --- a/packages/taro-vite-runner/src/utils/compiler/mini.ts +++ b/packages/taro-vite-runner/src/utils/compiler/mini.ts @@ -11,6 +11,7 @@ import { import { isArray, isFunction } from '@tarojs/shared' import defaultConfig from '../../defaultConfig/defaultConfig.mini' +import { miniTemplateLoader, QUERY_IS_NATIVE_COMP } from '../../mini/native-support' import { getComponentName } from '../../utils' import { componentConfig } from '../../utils/component' import { CompilerContext } from './base' @@ -24,6 +25,7 @@ import type { ViteNativeCompMeta, VitePageMeta } from '@tarojs/taro/types/compile/viteCompilerContext' +import type { PluginContext } from 'rollup' export class TaroCompilerContext extends CompilerContext implements ViteMiniCompilerContext { fileType: ViteFileType @@ -95,10 +97,12 @@ export class TaroCompilerContext extends CompilerContext im return importPath } - collectNativeComponents (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) { + collectNativeComponents (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta): ViteNativeCompMeta[] { const { name, scriptPath, config } = meta const { usingComponents } = config - if (!usingComponents) return + + const list: ViteNativeCompMeta[] = [] + if (!usingComponents) return list Object.entries(usingComponents).forEach(([compName, value]) => { const compPath = value instanceof Array ? value[0] : value @@ -135,8 +139,28 @@ export class TaroCompilerContext extends CompilerContext im componentConfig.thirdPartyComponents.set(compName, new Set()) } - this.collectNativeComponents(nativeCompMeta) + list.push(...this.collectNativeComponents(nativeCompMeta), nativeCompMeta) + }) + return list + } + + generateNativeComponent (rollupCtx: PluginContext, meta: ViteNativeCompMeta, implicitlyLoadedAfterOneOf: string[] = []) { + if (meta.isGenerated) return + + rollupCtx.emitFile({ + type: 'chunk', + id: meta.scriptPath + QUERY_IS_NATIVE_COMP, + fileName: this.getScriptPath(meta.name), + implicitlyLoadedAfterOneOf, + }) + const source = miniTemplateLoader(rollupCtx, meta.templatePath, this.sourceDir) + rollupCtx.emitFile({ + type: 'asset', + fileName: this.getTemplatePath(meta.name), + source }) + meta.cssPath && rollupCtx.addWatchFile(meta.cssPath) + meta.isGenerated = true } /** 工具函数 */ diff --git a/packages/taro-webpack5-prebundle/package.json b/packages/taro-webpack5-prebundle/package.json index 95ad1e66b07..8f730665082 100644 --- a/packages/taro-webpack5-prebundle/package.json +++ b/packages/taro-webpack5-prebundle/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack5-prebundle", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro app webpack5 prebundle", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-webpack5-runner/package.json b/packages/taro-webpack5-runner/package.json index ba3cef9c776..fbdee1f8242 100644 --- a/packages/taro-webpack5-runner/package.json +++ b/packages/taro-webpack5-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack5-runner", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro app runner", "author": "O2Team", "license": "MIT", diff --git a/packages/taro-with-weapp/package.json b/packages/taro-with-weapp/package.json index 903f1ff432e..ce7649d05f3 100644 --- a/packages/taro-with-weapp/package.json +++ b/packages/taro-with-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/with-weapp", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "taroize 之后的运行时", "author": "O2Team", "license": "MIT", diff --git a/packages/taro/package.json b/packages/taro/package.json index 1212598a3be..4e773b7623d 100644 --- a/packages/taro/package.json +++ b/packages/taro/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "Taro framework", "author": "O2Team", "license": "MIT", diff --git a/packages/taro/types/compile/viteCompilerContext.d.ts b/packages/taro/types/compile/viteCompilerContext.d.ts index 6ac0acdf6a8..25e66ab27f2 100644 --- a/packages/taro/types/compile/viteCompilerContext.d.ts +++ b/packages/taro/types/compile/viteCompilerContext.d.ts @@ -17,6 +17,7 @@ export interface ViteNativeCompMeta { templatePath: string cssPath?: string isPackage?: boolean + isGenerated?: boolean } export interface ViteFileType { @@ -143,7 +144,8 @@ export interface ViteHarmonyCompilerContext extends ViteCompilerContext) => void modifyHostPackage: (deps?: Record, devDeps?: Record) => Exclude resolvePageImportPath: (scriptPath: string, pageName: string) => string - collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => void + collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => ViteNativeCompMeta[] + generateNativeComponent: (rollupCtx: PluginContext, meta: ViteNativeCompMeta, implicitlyLoadedAfterOneOf: string[] = []) => void getScriptPath: (filePath: string) => string getStylePath: (filePath: string) => string getConfigPath: (filePath: string) => string @@ -155,7 +157,8 @@ export interface ViteMiniCompilerContext extends ViteCompilerContext getCommonChunks: () => string[] resolvePageImportPath: (scriptPath: string, pageName: string) => string - collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => void + collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => ViteNativeCompMeta[] + generateNativeComponent: (rollupCtx: PluginContext, meta: ViteNativeCompMeta, implicitlyLoadedAfterOneOf: string[] = []) => void getScriptPath: (filePath: string) => string getTemplatePath: (filePath: string) => string getStylePath: (filePath: string) => string diff --git a/packages/taroize/package.json b/packages/taroize/package.json index 8ac0f2745bf..5a18df53831 100644 --- a/packages/taroize/package.json +++ b/packages/taroize/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taroize", - "version": "4.0.9-beta.1", + "version": "4.0.9-beta.2", "description": "转换原生微信小程序代码为 Taro 代码", "author": "O2Team", "license": "MIT",