提交 e161d6a4 编写于 作者: M mehaotian

Merge branch 'next' of github.com:dcloudio/uni-app into next

# Conflicts:
#	packages/uni-stat/package.json
#	pnpm-lock.yaml
{
"private": true,
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"workspaces": [
"packages/*"
],
......@@ -43,8 +43,8 @@
"devDependencies": {
"@babel/preset-env": "^7.16.11",
"@dcloudio/types": "^2.6.4",
"@dcloudio/uni-api": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-app": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-api": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-app": "3.0.0-alpha-3040720220422003",
"@jest/types": "^27.0.2",
"@microsoft/api-extractor": "^7.19.4",
"@rollup/plugin-alias": "^3.1.1",
......
{
"private": true,
"name": "@dcloudio/size-check",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"devDependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-components": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-h5": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-h5-vite": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-h5-vue": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040620220415003",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3040620220415003"
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-components": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-h5": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-h5-vite": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-h5-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040720220422003",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3040720220422003"
}
}
{
"private": true,
"name": "@dcloudio/uni-api",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-api",
"sideEffects": false,
"repository": {
......@@ -14,6 +14,6 @@
"url": "https://github.com/dcloudio/uni-app/issues"
},
"devDependencies": {
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003"
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003"
}
}
......@@ -16326,6 +16326,28 @@ function restoreGlobal(newVue, newWeex, newPlus, newSetTimeout, newClearTimeout,
clearInterval = newClearInterval;
}
__uniConfig.serviceReady = true;
}
function requireGlobal() {
const list = [
'ArrayBuffer',
'Int8Array',
'Uint8Array',
'Uint8ClampedArray',
'Int16Array',
'Uint16Array',
'Int32Array',
'Uint32Array',
'Float32Array',
'Float64Array',
'BigInt64Array',
'BigUint64Array',
];
const object = {};
for (let i = 0; i < list.length; i++) {
const key = list[i];
object[key] = global[key];
}
return object;
}
const providers = {
......@@ -19074,6 +19096,7 @@ var uni$1 = {
hideTabBarRedDot: hideTabBarRedDot,
getSubNVueById: getSubNVueById,
restoreGlobal: restoreGlobal,
requireGlobal: requireGlobal,
getProvider: getProvider,
login: login,
getUserInfo: getUserInfo,
......
{
"name": "@dcloudio/uni-app-plus",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-app-plus",
"files": [
"dist",
......@@ -28,18 +28,18 @@
"main": "dist/uni.compiler.js"
},
"devDependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-components": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-h5": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-components": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-h5": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@types/pako": "1.0.2",
"@vue/compiler-sfc": "3.2.33",
"pako": "^1.0.11",
"vue": "3.2.33"
},
"dependencies": {
"@dcloudio/uni-app-vite": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-app-vue": "3.0.0-alpha-3040620220415003"
"@dcloudio/uni-app-vite": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-app-vue": "3.0.0-alpha-3040720220422003"
}
}
......@@ -40,3 +40,26 @@ export function restoreGlobal(
}
__uniConfig.serviceReady = true
}
export function requireGlobal() {
const list = [
'ArrayBuffer',
'Int8Array',
'Uint8Array',
'Uint8ClampedArray',
'Int16Array',
'Uint16Array',
'Int32Array',
'Uint32Array',
'Float32Array',
'Float64Array',
'BigInt64Array',
'BigUint64Array',
]
const object: Record<string, any> = {}
for (let i = 0; i < list.length; i++) {
const key = list[i]
object[key] = (global as any)[key]
}
return object
}
{
"name": "@dcloudio/uni-app-vite",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-app-vite",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -19,10 +19,10 @@
"license": "Apache-2.0",
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-nvue-styler": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-nvue-styler": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@rollup/pluginutils": "^4.2.0",
"@vitejs/plugin-vue": "^2.3.1",
"@vue/compiler-dom": "3.2.33",
......
......@@ -14,6 +14,7 @@ import { uniAppCssPlugin } from './plugins/appCss'
import { uniEsbuildPlugin } from './plugins/esbuild'
import { uniMainJsPlugin } from './plugins/mainJs'
import { uniPagesJsonPlugin } from './plugins/pagesJson'
import { uniRenderjsPlugin } from './plugins/renderjs'
export { initNVueNodeTransforms } from './plugin'
......@@ -28,6 +29,7 @@ export function initNVuePlugins() {
uniManifestJsonPlugin(),
uniPagesJsonPlugin({ renderer, appService }),
uniViteInjectPlugin('uni:app-inject', initAppProvide()),
uniRenderjsPlugin(),
uniAppNVuePlugin({ appService }),
uniEsbuildPlugin({ renderer, appService }),
...(appService ? [uniStatsPlugin(), uniTemplatePlugin({ renderer })] : []),
......
import { Plugin } from 'vite'
import { parseRenderjs } from '@dcloudio/uni-cli-shared'
export function uniRenderjsPlugin(): Plugin {
return {
name: 'uni:app-nvue-renderjs',
async transform(code, id) {
const { type } = parseRenderjs(id)
if (!type) {
return
}
return {
code: `export default {}`,
map: { mappings: '' },
}
},
}
}
{
"name": "@dcloudio/uni-app-vue",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-app-vue",
"main": "dist/service.runtime.esm.dev.js",
"module": "dist/service.runtime.esm.dev.js",
......@@ -19,6 +19,6 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"devDependencies": {
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003"
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003"
}
}
{
"name": "@dcloudio/uni-app",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-app",
"main": "./dist/uni-app.cjs.js",
"module": "./dist/uni-app.es.js",
......@@ -24,12 +24,12 @@
"main": "dist/uni.compiler.js"
},
"dependencies": {
"@dcloudio/uni-cloud": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-components": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-push": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-stat": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cloud": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-components": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-push": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-stat": "3.0.0-alpha-3040720220422003",
"@vue/shared": "3.2.33"
}
}
{
"name": "@dcloudio/uni-automator",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-automator",
"main": "dist/index.js",
"files": [
......@@ -27,7 +27,7 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"address": "^1.1.2",
"cross-env": "^7.0.3",
"debug": "^4.3.3",
......
{
"name": "@dcloudio/uni-cli-shared",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-cli-shared",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -21,8 +21,8 @@
"@babel/core": "^7.17.9",
"@babel/parser": "^7.17.9",
"@babel/types": "^7.17.0",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@intlify/core-base": "9.1.9",
"@intlify/shared": "9.1.9",
"@intlify/vue-devtools": "9.1.9",
......
import { isArray } from '@vue/shared'
import { recursive } from 'merge'
const wxPageOrientationMapping = {
auto: [
......@@ -14,15 +15,7 @@ export function initPlus(
manifestJson: Record<string, any>,
pagesJson: UniApp.PagesJson
) {
// 根节点配置了统计
if (manifestJson.uniStatistics) {
manifestJson.plus.uniStatistics = recursive(
true,
manifestJson.uniStatistics,
manifestJson.plus.uniStatistics
)
delete manifestJson.uniStatistics
}
initUniStatistics(manifestJson)
// 转换为老版本配置
if (manifestJson.plus.modules) {
manifestJson.permissions = manifestJson.plus.modules
......@@ -102,3 +95,50 @@ export function initPlus(
manifestJson.plus.popGesture = 'close'
}
}
function initUniStatistics(manifestJson: Record<string, any>) {
// 根节点配置了统计
if (manifestJson.uniStatistics) {
manifestJson.plus.uniStatistics = recursive(
true,
manifestJson.uniStatistics,
manifestJson.plus.uniStatistics
)
delete manifestJson.uniStatistics
}
if (!process.env.UNI_CLOUD_SPACES) {
return
}
let spaces = []
try {
spaces = JSON.parse(process.env.UNI_CLOUD_SPACES)
} catch (e: any) {}
if (!isArray(spaces) || !spaces.length) {
return
}
const space = spaces[0] as {
provider?: string
id: string
name: string
clientSecret?: string
apiEndpoint?: string
}
if (!space) {
return
}
const uniStatistics = manifestJson.plus?.uniStatistics
if (!uniStatistics) {
return
}
if (uniStatistics.version === 2 || uniStatistics.version === '2') {
if (uniStatistics.uniCloud && uniStatistics.uniCloud.spaceId) {
return
}
uniStatistics.uniCloud = {
provider: space.provider,
spaceId: space.id,
clientSecret: space.clientSecret,
endpoint: space.apiEndpoint,
}
}
}
export const arrayBufferCode = `
if(typeof uni !== 'undefined' && uni.base64ToArrayBuffer){
ArrayBuffer = uni.base64ToArrayBuffer('').constructor
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
const global = uni.requireGlobal()
ArrayBuffer = global.ArrayBuffer
Int8Array = global.Int8Array
Uint8Array = global.Uint8Array
Uint8ClampedArray = global.Uint8ClampedArray
Int16Array = global.Int16Array
Uint16Array = global.Uint16Array
Int32Array = global.Int32Array
Uint32Array = global.Uint32Array
Float32Array = global.Float32Array
Float64Array = global.Float64Array
BigInt64Array = global.BigInt64Array
BigUint64Array = global.BigUint64Array
};
`
export const polyfillCode = `
......
{
"name": "@dcloudio/uni-cloud",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-cloud",
"main": "dist/uni-cloud.cjs.js",
"module": "dist/uni-cloud.es.js",
......@@ -20,8 +20,8 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003"
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003"
}
}
{
"name": "@dcloudio/uni-components",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-components",
"main": "index.js",
"files": [
......@@ -18,7 +18,7 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"devDependencies": {
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@types/quill": "^1.3.7"
}
}
{
"private": true,
"name": "@dcloudio/uni-core",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-core",
"sideEffects": false,
"repository": {
......@@ -14,9 +14,9 @@
"url": "https://github.com/dcloudio/uni-app/issues"
},
"devDependencies": {
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"safe-area-insets": "^1.4.1"
}
}
{
"name": "@dcloudio/uni-h5-vite",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-h5-vite",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -19,8 +19,8 @@
"license": "Apache-2.0",
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@rollup/pluginutils": "^4.2.0",
"@vue/compiler-dom": "3.2.33",
"@vue/compiler-sfc": "3.2.33",
......
......@@ -36,6 +36,10 @@ export function createConfig(options: {
...getDevServerOptions(parseManifestJsonOnce(inputDir)),
}
if ((server.port as unknown as string) === '') {
delete server.port
}
const { server: userServer } = config
if (userServer) {
if (hasOwn(userServer, 'host')) {
......
{
"name": "@dcloudio/uni-h5-vue",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-h5-vue",
"main": "dist/vue.runtime.cjs.js",
"module": "dist/vue.runtime.esm.js",
......
{
"name": "@dcloudio/uni-h5",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-h5",
"main": "./dist/uni-h5.cjs.js",
"module": "./dist/uni-h5.es.js",
......@@ -29,10 +29,10 @@
"main": "dist/uni.compiler.js"
},
"dependencies": {
"@dcloudio/uni-h5-vite": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-h5-vue": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-h5-vite": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-h5-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/server-renderer": "3.2.33",
"@vue/shared": "3.2.33",
"localstorage-polyfill": "^1.0.1",
......@@ -43,7 +43,7 @@
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"devDependencies": {
"@dcloudio/uni-cli-i18n": "^2.0.0-32920211029004",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@types/google.maps": "^3.45.6",
"acorn-loose": "^8.2.1",
"acorn-walk": "^8.2.0",
......
{
"name": "@dcloudio/uni-i18n",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-i18n",
"main": "./dist/uni-i18n.cjs.js",
"module": "./dist/uni-i18n.es.js",
......
......@@ -35,6 +35,11 @@
"__PLATFORM__": "\"mp-alipay\"",
"__PLATFORM_TITLE__": "支付宝小程序"
},
"external": ["@dcloudio/uni-i18n", "@vue/shared", "vue"]
"external": [
"@dcloudio/uni-i18n",
"@dcloudio/uni-shared",
"@vue/shared",
"vue"
]
}
]
import { isArray, hasOwn, isString, isPlainObject, isObject, capitalize, toRawType, makeMap, isFunction, isPromise, remove, extend } from '@vue/shared';
let vueApp;
const createVueAppHooks = [];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function onCreateVueApp(hook) {
// TODO 每个 nvue 页面都会触发
if (vueApp) {
return hook(vueApp);
}
createVueAppHooks.push(hook);
}
function invokeCreateVueAppHook(app) {
vueApp = app;
createVueAppHooks.forEach((hook) => hook(app));
}
import { Emitter, onCreateVueApp, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
const eventChannels = {};
const eventChannelStack = [];
......@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return my.getSystemInfoSync()
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx,
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener() {
self.off(name, listener);
callback.apply(ctx, arguments);
}
listener._ = callback;
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents.length ? (e[name] = liveEvents) : delete e[name];
return this;
},
};
var E$1 = E;
function validateProtocolFail(name, msg) {
console.warn(`${name}: ${msg}`);
}
......@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const emitter = new E$1();
const emitter = new Emitter();
const $on = defineSyncApi(API_ON, (name, callback) => {
emitter.on(name, callback);
return () => emitter.off(name, callback);
......@@ -685,7 +618,7 @@ const offPushMessage = (fn) => {
}
};
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const CONTEXT_API_RE = /^create|Manager$/;
// Context例外情况
const CONTEXT_API_RE_EXC = ['createBLEConnection'];
......
import { camelize, isPlainObject, hasOwn, isArray, capitalize, isFunction, extend, isString } from '@vue/shared';
import { SLOT_DEFAULT_NAME, EventChannel, invokeArrayFns, ON_LOAD, ON_SHOW, ON_HIDE, ON_UNLOAD, ON_RESIZE, ON_TAB_ITEM_TAP, ON_REACH_BOTTOM, ON_PULL_DOWN_REFRESH, ON_ADD_TO_FAVORITES, MINI_PROGRAM_PAGE_RUNTIME_HOOKS, ON_READY, ON_LAUNCH, ON_ERROR, ON_THEME_CHANGE, ON_PAGE_NOT_FOUND, ON_UNHANDLE_REJECTION, customizeEvent, addLeadingSlash, stringifyQuery, ON_BACK_PRESS } from '@dcloudio/uni-shared';
import { hasOwn, isArray, capitalize, isFunction, extend, isPlainObject, isString } from '@vue/shared';
import { ref, findComponentPropsData, toRaw, updateProps, invalidateJob, getExposeProxy, EMPTY_OBJ, isRef, setTemplateRef, pruneComponentPropsCache } from 'vue';
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
// App and Page
const ON_SHOW = 'onShow';
const ON_HIDE = 'onHide';
//App
const ON_LAUNCH = 'onLaunch';
const ON_ERROR = 'onError';
const ON_THEME_CHANGE = 'onThemeChange';
const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
//Page
const ON_LOAD = 'onLoad';
const ON_READY = 'onReady';
const ON_UNLOAD = 'onUnload';
const ON_RESIZE = 'onResize';
const ON_BACK_PRESS = 'onBackPress';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
return camelize(str.replace(customizeRE, '-'));
}
function hasLeadingSlash(str) {
return str.indexOf('/') === 0;
}
function addLeadingSlash(str) {
return hasLeadingSlash(str) ? str : '/' + str;
}
const invokeArrayFns = (fns, arg) => {
let ret;
for (let i = 0; i < fns.length; i++) {
ret = fns[i](arg);
}
return ret;
};
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
const res = obj
? Object.keys(obj)
.map((key) => {
let val = obj[key];
if (typeof val === undefined || val === null) {
val = '';
}
else if (isPlainObject(val)) {
val = JSON.stringify(val);
}
return encodeStr(key) + '=' + encodeStr(val);
})
.filter((x) => x.length > 0)
.join('&')
: null;
return res ? `?${res}` : '';
}
class EventChannel {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
onShareAppMessage: 1 << 1,
onShareTimeline: 1 << 2,
};
})();
const eventChannels = {};
const eventChannelStack = [];
function getEventChannel(id) {
......
{
"name": "@dcloudio/uni-mp-alipay",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-app mp-alipay",
"main": "dist/index.js",
"repository": {
......@@ -22,9 +22,10 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/compiler-core": "3.2.33",
"@vue/shared": "3.2.33"
}
......
......@@ -36,6 +36,11 @@
"__PLATFORM__": "\"mp-baidu\"",
"__PLATFORM_TITLE__": "百度小程序"
},
"external": ["@dcloudio/uni-i18n", "@vue/shared", "vue"]
"external": [
"@dcloudio/uni-i18n",
"@dcloudio/uni-shared",
"@vue/shared",
"vue"
]
}
]
import { isArray, hasOwn, isString, isPlainObject, isObject, capitalize, toRawType, makeMap, isFunction, isPromise, remove, extend } from '@vue/shared';
let vueApp;
const createVueAppHooks = [];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function onCreateVueApp(hook) {
// TODO 每个 nvue 页面都会触发
if (vueApp) {
return hook(vueApp);
}
createVueAppHooks.push(hook);
}
function invokeCreateVueAppHook(app) {
vueApp = app;
createVueAppHooks.forEach((hook) => hook(app));
}
import { Emitter, onCreateVueApp, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
const eventChannels = {};
const eventChannelStack = [];
......@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return swan.getSystemInfoSync()
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx,
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener() {
self.off(name, listener);
callback.apply(ctx, arguments);
}
listener._ = callback;
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents.length ? (e[name] = liveEvents) : delete e[name];
return this;
},
};
var E$1 = E;
function validateProtocolFail(name, msg) {
console.warn(`${name}: ${msg}`);
}
......@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const emitter = new E$1();
const emitter = new Emitter();
const $on = defineSyncApi(API_ON, (name, callback) => {
emitter.on(name, callback);
return () => emitter.off(name, callback);
......@@ -685,7 +618,7 @@ const offPushMessage = (fn) => {
}
};
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const CONTEXT_API_RE = /^create|Manager$/;
// Context例外情况
const CONTEXT_API_RE_EXC = ['createBLEConnection'];
......
import { camelize, isPlainObject, isArray, hasOwn, isFunction, extend } from '@vue/shared';
import { SLOT_DEFAULT_NAME, EventChannel, invokeArrayFns, ON_LOAD, ON_SHOW, ON_HIDE, ON_UNLOAD, ON_RESIZE, ON_TAB_ITEM_TAP, ON_REACH_BOTTOM, ON_PULL_DOWN_REFRESH, ON_ADD_TO_FAVORITES, MINI_PROGRAM_PAGE_RUNTIME_HOOKS, ON_READY, once, ON_LAUNCH, ON_ERROR, ON_THEME_CHANGE, ON_PAGE_NOT_FOUND, ON_UNHANDLE_REJECTION, addLeadingSlash, stringifyQuery, ON_INIT, customizeEvent } from '@dcloudio/uni-shared';
import { isArray, hasOwn, isFunction, extend, isPlainObject } from '@vue/shared';
import { ref, nextTick, findComponentPropsData, toRaw, updateProps, invalidateJob, getExposeProxy, pruneComponentPropsCache } from 'vue';
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
// App and Page
const ON_SHOW = 'onShow';
const ON_HIDE = 'onHide';
//App
const ON_LAUNCH = 'onLaunch';
const ON_ERROR = 'onError';
const ON_THEME_CHANGE = 'onThemeChange';
const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
//Page
const ON_LOAD = 'onLoad';
const ON_READY = 'onReady';
const ON_UNLOAD = 'onUnload';
// 百度特有
const ON_INIT = 'onInit';
const ON_RESIZE = 'onResize';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
return camelize(str.replace(customizeRE, '-'));
}
function hasLeadingSlash(str) {
return str.indexOf('/') === 0;
}
function addLeadingSlash(str) {
return hasLeadingSlash(str) ? str : '/' + str;
}
const invokeArrayFns = (fns, arg) => {
let ret;
for (let i = 0; i < fns.length; i++) {
ret = fns[i](arg);
}
return ret;
};
function once(fn, ctx = null) {
let res;
return ((...args) => {
if (fn) {
res = fn.apply(ctx, args);
fn = null;
}
return res;
});
}
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
const res = obj
? Object.keys(obj)
.map((key) => {
let val = obj[key];
if (typeof val === undefined || val === null) {
val = '';
}
else if (isPlainObject(val)) {
val = JSON.stringify(val);
}
return encodeStr(key) + '=' + encodeStr(val);
})
.filter((x) => x.length > 0)
.join('&')
: null;
return res ? `?${res}` : '';
}
class EventChannel {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
onShareAppMessage: 1 << 1,
onShareTimeline: 1 << 2,
};
})();
const eventChannels = {};
const eventChannelStack = [];
function getEventChannel(id) {
......@@ -286,7 +143,7 @@ function findHooks(vueOptions, hooks = new Set()) {
}
return hooks;
}
function initHook$1(mpOptions, hook, excludes) {
function initHook(mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.$callHook(hook, args);
......@@ -295,10 +152,10 @@ function initHook$1(mpOptions, hook, excludes) {
}
const EXCLUDE_HOOKS = [ON_READY];
function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
hooks.forEach((hook) => initHook$1(mpOptions, hook, excludes));
hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initRuntimeHooks(mpOptions, runtimeHooks) {
if (!runtimeHooks) {
......@@ -307,7 +164,7 @@ function initRuntimeHooks(mpOptions, runtimeHooks) {
const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
hooks.forEach((hook) => {
if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
initHook$1(mpOptions, hook, []);
initHook(mpOptions, hook, []);
}
});
}
......@@ -924,7 +781,7 @@ function initTriggerEvent(mpInstance) {
return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
};
}
function initHook(name, options, isComponent) {
function initMiniProgramHook(name, options, isComponent) {
const oldHook = options[name];
if (!oldHook) {
options[name] = function () {
......@@ -939,14 +796,14 @@ function initHook(name, options, isComponent) {
}
}
Page = function (options) {
initHook(ON_LOAD, options);
initMiniProgramHook(ON_LOAD, options);
return MPPage(options);
};
{
Page.after = MPPage.after;
}
Component = function (options) {
initHook('created', options);
initMiniProgramHook('created', options);
// 小程序组件
const isVueComponent = options.properties && options.properties.uP;
if (!isVueComponent) {
......
{
"name": "@dcloudio/uni-mp-baidu",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-app mp-baidu",
"main": "dist/index.js",
"files": [
......@@ -26,11 +26,13 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3040620220415003",
"@vue/compiler-core": "3.2.33"
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/compiler-core": "3.2.33",
"@vue/shared": "3.2.33"
}
}
{
"name": "@dcloudio/uni-mp-compiler",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-mp-compiler",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -22,8 +22,8 @@
"@babel/generator": "^7.17.9",
"@babel/parser": "^7.17.9",
"@babel/types": "^7.17.0",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/compiler-core": "3.2.33",
"@vue/compiler-dom": "3.2.33",
"@vue/shared": "3.2.33",
......
{
"private": true,
"name": "@dcloudio/uni-mp-core",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-mp-core",
"sideEffects": false,
"repository": {
......
......@@ -7,7 +7,7 @@ import {
} from '@dcloudio/uni-api/src/helpers/interceptor'
const SYNC_API_RE =
/^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
/^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
const CONTEXT_API_RE = /^create|Manager$/
......
......@@ -13,7 +13,7 @@ function initTriggerEvent(mpInstance: MPComponentInstance) {
}
}
function initHook(
function initMiniProgramHook(
name: 'onLoad' | 'created',
options: Record<string, any>,
isComponent?: boolean
......@@ -39,7 +39,7 @@ function initHook(
}
Page = function (options) {
initHook(ON_LOAD, options)
initMiniProgramHook(ON_LOAD, options)
return MPPage(options)
}
if (__PLATFORM__ === 'mp-baidu') {
......@@ -48,7 +48,7 @@ if (__PLATFORM__ === 'mp-baidu') {
;(Page as any).after = (MPPage as any).after
}
Component = function (options) {
initHook('created', options, true)
initMiniProgramHook('created', options, true)
// 小程序组件
const isVueComponent = options.properties && options.properties.uP
if (!isVueComponent) {
......
......@@ -36,6 +36,11 @@
"__PLATFORM__": "\"mp-kuaishou\"",
"__PLATFORM_TITLE__": "快手小程序"
},
"external": ["@dcloudio/uni-i18n", "@vue/shared", "vue"]
"external": [
"@dcloudio/uni-i18n",
"@dcloudio/uni-shared",
"@vue/shared",
"vue"
]
}
]
import { isArray, hasOwn, isString, isPlainObject, isObject, capitalize, toRawType, makeMap, isFunction, isPromise, remove, extend } from '@vue/shared';
let vueApp;
const createVueAppHooks = [];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function onCreateVueApp(hook) {
// TODO 每个 nvue 页面都会触发
if (vueApp) {
return hook(vueApp);
}
createVueAppHooks.push(hook);
}
function invokeCreateVueAppHook(app) {
vueApp = app;
createVueAppHooks.forEach((hook) => hook(app));
}
import { Emitter, onCreateVueApp, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
const eventChannels = {};
const eventChannelStack = [];
......@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return ks.getSystemInfoSync()
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx,
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener() {
self.off(name, listener);
callback.apply(ctx, arguments);
}
listener._ = callback;
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents.length ? (e[name] = liveEvents) : delete e[name];
return this;
},
};
var E$1 = E;
function validateProtocolFail(name, msg) {
console.warn(`${name}: ${msg}`);
}
......@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const emitter = new E$1();
const emitter = new Emitter();
const $on = defineSyncApi(API_ON, (name, callback) => {
emitter.on(name, callback);
return () => emitter.off(name, callback);
......@@ -685,7 +618,7 @@ const offPushMessage = (fn) => {
}
};
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const CONTEXT_API_RE = /^create|Manager$/;
// Context例外情况
const CONTEXT_API_RE_EXC = ['createBLEConnection'];
......
import { camelize, isPlainObject, isArray, hasOwn, isFunction, extend } from '@vue/shared';
import { SLOT_DEFAULT_NAME, EventChannel, invokeArrayFns, ON_LOAD, ON_SHOW, ON_HIDE, ON_UNLOAD, ON_RESIZE, ON_TAB_ITEM_TAP, ON_REACH_BOTTOM, ON_PULL_DOWN_REFRESH, ON_ADD_TO_FAVORITES, MINI_PROGRAM_PAGE_RUNTIME_HOOKS, ON_READY, once, ON_LAUNCH, ON_ERROR, ON_THEME_CHANGE, ON_PAGE_NOT_FOUND, ON_UNHANDLE_REJECTION, addLeadingSlash, stringifyQuery, customizeEvent } from '@dcloudio/uni-shared';
import { isArray, hasOwn, isFunction, extend, isPlainObject } from '@vue/shared';
import { ref, nextTick, findComponentPropsData, toRaw, updateProps, invalidateJob, getExposeProxy, pruneComponentPropsCache } from 'vue';
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
// App and Page
const ON_SHOW = 'onShow';
const ON_HIDE = 'onHide';
//App
const ON_LAUNCH = 'onLaunch';
const ON_ERROR = 'onError';
const ON_THEME_CHANGE = 'onThemeChange';
const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
//Page
const ON_LOAD = 'onLoad';
const ON_READY = 'onReady';
const ON_UNLOAD = 'onUnload';
const ON_RESIZE = 'onResize';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
return camelize(str.replace(customizeRE, '-'));
}
function hasLeadingSlash(str) {
return str.indexOf('/') === 0;
}
function addLeadingSlash(str) {
return hasLeadingSlash(str) ? str : '/' + str;
}
const invokeArrayFns = (fns, arg) => {
let ret;
for (let i = 0; i < fns.length; i++) {
ret = fns[i](arg);
}
return ret;
};
function once(fn, ctx = null) {
let res;
return ((...args) => {
if (fn) {
res = fn.apply(ctx, args);
fn = null;
}
return res;
});
}
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
const res = obj
? Object.keys(obj)
.map((key) => {
let val = obj[key];
if (typeof val === undefined || val === null) {
val = '';
}
else if (isPlainObject(val)) {
val = JSON.stringify(val);
}
return encodeStr(key) + '=' + encodeStr(val);
})
.filter((x) => x.length > 0)
.join('&')
: null;
return res ? `?${res}` : '';
}
class EventChannel {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
onShareAppMessage: 1 << 1,
onShareTimeline: 1 << 2,
};
})();
const eventChannels = {};
const eventChannelStack = [];
function getEventChannel(id) {
......@@ -284,7 +143,7 @@ function findHooks(vueOptions, hooks = new Set()) {
}
return hooks;
}
function initHook$1(mpOptions, hook, excludes) {
function initHook(mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.$callHook(hook, args);
......@@ -293,10 +152,10 @@ function initHook$1(mpOptions, hook, excludes) {
}
const EXCLUDE_HOOKS = [ON_READY];
function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
hooks.forEach((hook) => initHook$1(mpOptions, hook, excludes));
hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initRuntimeHooks(mpOptions, runtimeHooks) {
if (!runtimeHooks) {
......@@ -305,7 +164,7 @@ function initRuntimeHooks(mpOptions, runtimeHooks) {
const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
hooks.forEach((hook) => {
if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
initHook$1(mpOptions, hook, []);
initHook(mpOptions, hook, []);
}
});
}
......@@ -911,7 +770,7 @@ function initTriggerEvent(mpInstance) {
return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
};
}
function initHook(name, options, isComponent) {
function initMiniProgramHook(name, options, isComponent) {
const oldHook = options[name];
if (!oldHook) {
options[name] = function () {
......@@ -926,11 +785,11 @@ function initHook(name, options, isComponent) {
}
}
Page = function (options) {
initHook(ON_LOAD, options);
initMiniProgramHook(ON_LOAD, options);
return MPPage(options);
};
Component = function (options) {
initHook('created', options);
initMiniProgramHook('created', options);
// 小程序组件
const isVueComponent = options.properties && options.properties.uP;
if (!isVueComponent) {
......
{
"name": "@dcloudio/uni-mp-kuaishou",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-app mp-kuaishou",
"main": "dist/index.js",
"repository": {
......@@ -22,11 +22,13 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3040620220415003",
"@vue/compiler-core": "3.2.33"
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/compiler-core": "3.2.33",
"@vue/shared": "3.2.33"
}
}
......@@ -36,6 +36,11 @@
"__PLATFORM__": "\"mp-lark\"",
"__PLATFORM_TITLE__": "飞书小程序"
},
"external": ["@dcloudio/uni-i18n", "@vue/shared", "vue"]
"external": [
"@dcloudio/uni-i18n",
"@dcloudio/uni-shared",
"@vue/shared",
"vue"
]
}
]
import { isArray, hasOwn, isString, isPlainObject, isObject, capitalize, toRawType, makeMap, isFunction, isPromise, remove, extend } from '@vue/shared';
let vueApp;
const createVueAppHooks = [];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function onCreateVueApp(hook) {
// TODO 每个 nvue 页面都会触发
if (vueApp) {
return hook(vueApp);
}
createVueAppHooks.push(hook);
}
function invokeCreateVueAppHook(app) {
vueApp = app;
createVueAppHooks.forEach((hook) => hook(app));
}
import { Emitter, onCreateVueApp, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
const eventChannels = {};
const eventChannelStack = [];
......@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return tt.getSystemInfoSync()
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx,
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener() {
self.off(name, listener);
callback.apply(ctx, arguments);
}
listener._ = callback;
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents.length ? (e[name] = liveEvents) : delete e[name];
return this;
},
};
var E$1 = E;
function validateProtocolFail(name, msg) {
console.warn(`${name}: ${msg}`);
}
......@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const emitter = new E$1();
const emitter = new Emitter();
const $on = defineSyncApi(API_ON, (name, callback) => {
emitter.on(name, callback);
return () => emitter.off(name, callback);
......@@ -685,7 +618,7 @@ const offPushMessage = (fn) => {
}
};
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const CONTEXT_API_RE = /^create|Manager$/;
// Context例外情况
const CONTEXT_API_RE_EXC = ['createBLEConnection'];
......
import { camelize, isPlainObject, isArray, hasOwn, isFunction, extend, isObject } from '@vue/shared';
import { SLOT_DEFAULT_NAME, EventChannel, invokeArrayFns, ON_LOAD, ON_SHOW, ON_HIDE, ON_UNLOAD, ON_RESIZE, ON_TAB_ITEM_TAP, ON_REACH_BOTTOM, ON_PULL_DOWN_REFRESH, ON_ADD_TO_FAVORITES, MINI_PROGRAM_PAGE_RUNTIME_HOOKS, ON_READY, once, ON_LAUNCH, ON_ERROR, ON_THEME_CHANGE, ON_PAGE_NOT_FOUND, ON_UNHANDLE_REJECTION, addLeadingSlash, stringifyQuery, customizeEvent } from '@dcloudio/uni-shared';
import { isArray, hasOwn, isFunction, extend, isPlainObject, isObject } from '@vue/shared';
import { ref, nextTick, findComponentPropsData, toRaw, updateProps, invalidateJob, getExposeProxy, pruneComponentPropsCache } from 'vue';
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
// App and Page
const ON_SHOW = 'onShow';
const ON_HIDE = 'onHide';
//App
const ON_LAUNCH = 'onLaunch';
const ON_ERROR = 'onError';
const ON_THEME_CHANGE = 'onThemeChange';
const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
//Page
const ON_LOAD = 'onLoad';
const ON_READY = 'onReady';
const ON_UNLOAD = 'onUnload';
const ON_RESIZE = 'onResize';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
return camelize(str.replace(customizeRE, '-'));
}
function hasLeadingSlash(str) {
return str.indexOf('/') === 0;
}
function addLeadingSlash(str) {
return hasLeadingSlash(str) ? str : '/' + str;
}
const invokeArrayFns = (fns, arg) => {
let ret;
for (let i = 0; i < fns.length; i++) {
ret = fns[i](arg);
}
return ret;
};
function once(fn, ctx = null) {
let res;
return ((...args) => {
if (fn) {
res = fn.apply(ctx, args);
fn = null;
}
return res;
});
}
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
const res = obj
? Object.keys(obj)
.map((key) => {
let val = obj[key];
if (typeof val === undefined || val === null) {
val = '';
}
else if (isPlainObject(val)) {
val = JSON.stringify(val);
}
return encodeStr(key) + '=' + encodeStr(val);
})
.filter((x) => x.length > 0)
.join('&')
: null;
return res ? `?${res}` : '';
}
class EventChannel {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
onShareAppMessage: 1 << 1,
onShareTimeline: 1 << 2,
};
})();
const eventChannels = {};
const eventChannelStack = [];
function getEventChannel(id) {
......@@ -280,7 +139,7 @@ function findHooks(vueOptions, hooks = new Set()) {
}
return hooks;
}
function initHook$1(mpOptions, hook, excludes) {
function initHook(mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
if (hook === 'onError') {
......@@ -292,10 +151,10 @@ function initHook$1(mpOptions, hook, excludes) {
}
const EXCLUDE_HOOKS = [ON_READY];
function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
hooks.forEach((hook) => initHook$1(mpOptions, hook, excludes));
hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initRuntimeHooks(mpOptions, runtimeHooks) {
if (!runtimeHooks) {
......@@ -304,7 +163,7 @@ function initRuntimeHooks(mpOptions, runtimeHooks) {
const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
hooks.forEach((hook) => {
if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
initHook$1(mpOptions, hook, []);
initHook(mpOptions, hook, []);
}
});
}
......@@ -845,7 +704,7 @@ function initTriggerEvent(mpInstance) {
return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
};
}
function initHook(name, options, isComponent) {
function initMiniProgramHook(name, options, isComponent) {
if (isComponent) {
// fix by Lxh 字节自定义组件Component构造器文档上写有created,但是实测只触发了lifetimes上的created
options = options.lifetimes;
......@@ -864,11 +723,11 @@ function initHook(name, options, isComponent) {
}
}
Page = function (options) {
initHook(ON_LOAD, options);
initMiniProgramHook(ON_LOAD, options);
return MPPage(options);
};
Component = function (options) {
initHook('created', options, true);
initMiniProgramHook('created', options, true);
// 小程序组件
const isVueComponent = options.properties && options.properties.uP;
if (!isVueComponent) {
......
{
"name": "@dcloudio/uni-mp-lark",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-app mp-lark",
"main": "dist/index.js",
"repository": {
......@@ -22,11 +22,13 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003",
"@vue/compiler-core": "3.2.33"
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-toutiao": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/compiler-core": "3.2.33",
"@vue/shared": "3.2.33"
}
}
......@@ -37,6 +37,11 @@
"__PLATFORM__": "\"mp-qq\"",
"__PLATFORM_TITLE__": "QQ小程序"
},
"external": ["@dcloudio/uni-i18n", "@vue/shared", "vue"]
"external": [
"@dcloudio/uni-i18n",
"@dcloudio/uni-shared",
"@vue/shared",
"vue"
]
}
]
import { isArray, hasOwn, isString, isPlainObject, isObject, capitalize, toRawType, makeMap, isFunction, isPromise, remove, extend } from '@vue/shared';
let vueApp;
const createVueAppHooks = [];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function onCreateVueApp(hook) {
// TODO 每个 nvue 页面都会触发
if (vueApp) {
return hook(vueApp);
}
createVueAppHooks.push(hook);
}
function invokeCreateVueAppHook(app) {
vueApp = app;
createVueAppHooks.forEach((hook) => hook(app));
}
import { Emitter, onCreateVueApp, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
const eventChannels = {};
const eventChannelStack = [];
......@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return qq.getSystemInfoSync()
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx,
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener() {
self.off(name, listener);
callback.apply(ctx, arguments);
}
listener._ = callback;
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents.length ? (e[name] = liveEvents) : delete e[name];
return this;
},
};
var E$1 = E;
function validateProtocolFail(name, msg) {
console.warn(`${name}: ${msg}`);
}
......@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const emitter = new E$1();
const emitter = new Emitter();
const $on = defineSyncApi(API_ON, (name, callback) => {
emitter.on(name, callback);
return () => emitter.off(name, callback);
......@@ -685,7 +618,7 @@ const offPushMessage = (fn) => {
}
};
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const CONTEXT_API_RE = /^create|Manager$/;
// Context例外情况
const CONTEXT_API_RE_EXC = ['createBLEConnection'];
......
import { camelize, isPlainObject, isArray, hasOwn, isFunction, extend } from '@vue/shared';
import { SLOT_DEFAULT_NAME, EventChannel, invokeArrayFns, ON_LOAD, ON_SHOW, ON_HIDE, ON_UNLOAD, ON_RESIZE, ON_TAB_ITEM_TAP, ON_REACH_BOTTOM, ON_PULL_DOWN_REFRESH, ON_ADD_TO_FAVORITES, MINI_PROGRAM_PAGE_RUNTIME_HOOKS, ON_READY, once, ON_LAUNCH, ON_ERROR, ON_THEME_CHANGE, ON_PAGE_NOT_FOUND, ON_UNHANDLE_REJECTION, addLeadingSlash, stringifyQuery, customizeEvent } from '@dcloudio/uni-shared';
import { isArray, hasOwn, isFunction, extend, isPlainObject } from '@vue/shared';
import { ref, findComponentPropsData, toRaw, updateProps, invalidateJob, getExposeProxy, pruneComponentPropsCache } from 'vue';
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
// App and Page
const ON_SHOW = 'onShow';
const ON_HIDE = 'onHide';
//App
const ON_LAUNCH = 'onLaunch';
const ON_ERROR = 'onError';
const ON_THEME_CHANGE = 'onThemeChange';
const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
//Page
const ON_LOAD = 'onLoad';
const ON_READY = 'onReady';
const ON_UNLOAD = 'onUnload';
const ON_RESIZE = 'onResize';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
return camelize(str.replace(customizeRE, '-'));
}
function hasLeadingSlash(str) {
return str.indexOf('/') === 0;
}
function addLeadingSlash(str) {
return hasLeadingSlash(str) ? str : '/' + str;
}
const invokeArrayFns = (fns, arg) => {
let ret;
for (let i = 0; i < fns.length; i++) {
ret = fns[i](arg);
}
return ret;
};
function once(fn, ctx = null) {
let res;
return ((...args) => {
if (fn) {
res = fn.apply(ctx, args);
fn = null;
}
return res;
});
}
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
const res = obj
? Object.keys(obj)
.map((key) => {
let val = obj[key];
if (typeof val === undefined || val === null) {
val = '';
}
else if (isPlainObject(val)) {
val = JSON.stringify(val);
}
return encodeStr(key) + '=' + encodeStr(val);
})
.filter((x) => x.length > 0)
.join('&')
: null;
return res ? `?${res}` : '';
}
class EventChannel {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
onShareAppMessage: 1 << 1,
onShareTimeline: 1 << 2,
};
})();
const eventChannels = {};
const eventChannelStack = [];
function getEventChannel(id) {
......@@ -280,7 +139,7 @@ function findHooks(vueOptions, hooks = new Set()) {
}
return hooks;
}
function initHook$1(mpOptions, hook, excludes) {
function initHook(mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.$callHook(hook, args);
......@@ -289,10 +148,10 @@ function initHook$1(mpOptions, hook, excludes) {
}
const EXCLUDE_HOOKS = [ON_READY];
function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
hooks.forEach((hook) => initHook$1(mpOptions, hook, excludes));
hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initRuntimeHooks(mpOptions, runtimeHooks) {
if (!runtimeHooks) {
......@@ -301,7 +160,7 @@ function initRuntimeHooks(mpOptions, runtimeHooks) {
const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
hooks.forEach((hook) => {
if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
initHook$1(mpOptions, hook, []);
initHook(mpOptions, hook, []);
}
});
}
......@@ -843,7 +702,7 @@ function initTriggerEvent(mpInstance) {
return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
};
}
function initHook(name, options, isComponent) {
function initMiniProgramHook(name, options, isComponent) {
const oldHook = options[name];
if (!oldHook) {
options[name] = function () {
......@@ -858,11 +717,11 @@ function initHook(name, options, isComponent) {
}
}
Page = function (options) {
initHook(ON_LOAD, options);
initMiniProgramHook(ON_LOAD, options);
return MPPage(options);
};
Component = function (options) {
initHook('created', options);
initMiniProgramHook('created', options);
// 小程序组件
const isVueComponent = options.properties && options.properties.uP;
if (!isVueComponent) {
......
{
"name": "@dcloudio/uni-mp-qq",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-app mp-qq",
"main": "dist/index.js",
"repository": {
......@@ -22,14 +22,16 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"devDependencies": {
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-weixin": "3.0.0-alpha-3040720220422003",
"@types/fs-extra": "^9.0.13",
"@vue/compiler-core": "3.2.33"
},
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/shared": "3.2.33",
"fs-extra": "^10.0.0"
}
}
......@@ -36,6 +36,11 @@
"__PLATFORM__": "\"mp-toutiao\"",
"__PLATFORM_TITLE__": "字节跳动小程序"
},
"external": ["@dcloudio/uni-i18n", "@vue/shared", "vue"]
"external": [
"@dcloudio/uni-i18n",
"@dcloudio/uni-shared",
"@vue/shared",
"vue"
]
}
]
import { isArray, hasOwn, isString, isPlainObject, isObject, capitalize, toRawType, makeMap, isFunction, isPromise, remove, extend } from '@vue/shared';
let vueApp;
const createVueAppHooks = [];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function onCreateVueApp(hook) {
// TODO 每个 nvue 页面都会触发
if (vueApp) {
return hook(vueApp);
}
createVueAppHooks.push(hook);
}
function invokeCreateVueAppHook(app) {
vueApp = app;
createVueAppHooks.forEach((hook) => hook(app));
}
import { Emitter, onCreateVueApp, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
const eventChannels = {};
const eventChannelStack = [];
......@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return tt.getSystemInfoSync()
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx,
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener() {
self.off(name, listener);
callback.apply(ctx, arguments);
}
listener._ = callback;
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents.length ? (e[name] = liveEvents) : delete e[name];
return this;
},
};
var E$1 = E;
function validateProtocolFail(name, msg) {
console.warn(`${name}: ${msg}`);
}
......@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const emitter = new E$1();
const emitter = new Emitter();
const $on = defineSyncApi(API_ON, (name, callback) => {
emitter.on(name, callback);
return () => emitter.off(name, callback);
......@@ -685,7 +618,7 @@ const offPushMessage = (fn) => {
}
};
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const CONTEXT_API_RE = /^create|Manager$/;
// Context例外情况
const CONTEXT_API_RE_EXC = ['createBLEConnection'];
......
import { camelize, isPlainObject, isArray, hasOwn, isFunction, extend, isObject } from '@vue/shared';
import { SLOT_DEFAULT_NAME, EventChannel, invokeArrayFns, ON_LOAD, ON_SHOW, ON_HIDE, ON_UNLOAD, ON_RESIZE, ON_TAB_ITEM_TAP, ON_REACH_BOTTOM, ON_PULL_DOWN_REFRESH, ON_ADD_TO_FAVORITES, MINI_PROGRAM_PAGE_RUNTIME_HOOKS, ON_READY, once, ON_LAUNCH, ON_ERROR, ON_THEME_CHANGE, ON_PAGE_NOT_FOUND, ON_UNHANDLE_REJECTION, addLeadingSlash, stringifyQuery, customizeEvent } from '@dcloudio/uni-shared';
import { isArray, hasOwn, isFunction, extend, isPlainObject, isObject } from '@vue/shared';
import { ref, nextTick, findComponentPropsData, toRaw, updateProps, invalidateJob, getExposeProxy, pruneComponentPropsCache } from 'vue';
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
// App and Page
const ON_SHOW = 'onShow';
const ON_HIDE = 'onHide';
//App
const ON_LAUNCH = 'onLaunch';
const ON_ERROR = 'onError';
const ON_THEME_CHANGE = 'onThemeChange';
const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
//Page
const ON_LOAD = 'onLoad';
const ON_READY = 'onReady';
const ON_UNLOAD = 'onUnload';
const ON_RESIZE = 'onResize';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
return camelize(str.replace(customizeRE, '-'));
}
function hasLeadingSlash(str) {
return str.indexOf('/') === 0;
}
function addLeadingSlash(str) {
return hasLeadingSlash(str) ? str : '/' + str;
}
const invokeArrayFns = (fns, arg) => {
let ret;
for (let i = 0; i < fns.length; i++) {
ret = fns[i](arg);
}
return ret;
};
function once(fn, ctx = null) {
let res;
return ((...args) => {
if (fn) {
res = fn.apply(ctx, args);
fn = null;
}
return res;
});
}
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
const res = obj
? Object.keys(obj)
.map((key) => {
let val = obj[key];
if (typeof val === undefined || val === null) {
val = '';
}
else if (isPlainObject(val)) {
val = JSON.stringify(val);
}
return encodeStr(key) + '=' + encodeStr(val);
})
.filter((x) => x.length > 0)
.join('&')
: null;
return res ? `?${res}` : '';
}
class EventChannel {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
onShareAppMessage: 1 << 1,
onShareTimeline: 1 << 2,
};
})();
const eventChannels = {};
const eventChannelStack = [];
function getEventChannel(id) {
......@@ -280,7 +139,7 @@ function findHooks(vueOptions, hooks = new Set()) {
}
return hooks;
}
function initHook$1(mpOptions, hook, excludes) {
function initHook(mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
if (hook === 'onError') {
......@@ -292,10 +151,10 @@ function initHook$1(mpOptions, hook, excludes) {
}
const EXCLUDE_HOOKS = [ON_READY];
function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
hooks.forEach((hook) => initHook$1(mpOptions, hook, excludes));
hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initRuntimeHooks(mpOptions, runtimeHooks) {
if (!runtimeHooks) {
......@@ -304,7 +163,7 @@ function initRuntimeHooks(mpOptions, runtimeHooks) {
const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
hooks.forEach((hook) => {
if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
initHook$1(mpOptions, hook, []);
initHook(mpOptions, hook, []);
}
});
}
......@@ -846,7 +705,7 @@ function initTriggerEvent(mpInstance) {
return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
};
}
function initHook(name, options, isComponent) {
function initMiniProgramHook(name, options, isComponent) {
if (isComponent) {
// fix by Lxh 字节自定义组件Component构造器文档上写有created,但是实测只触发了lifetimes上的created
options = options.lifetimes;
......@@ -865,11 +724,11 @@ function initHook(name, options, isComponent) {
}
}
Page = function (options) {
initHook(ON_LOAD, options);
initMiniProgramHook(ON_LOAD, options);
return MPPage(options);
};
Component = function (options) {
initHook('created', options, true);
initMiniProgramHook('created', options, true);
// 小程序组件
const isVueComponent = options.properties && options.properties.uP;
if (!isVueComponent) {
......
{
"name": "@dcloudio/uni-mp-toutiao",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-app mp-toutiao",
"main": "dist/index.js",
"repository": {
......@@ -22,10 +22,12 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/shared": "3.2.33",
"@vue/compiler-core": "3.2.33"
}
}
{
"name": "@dcloudio/uni-mp-vite",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-mp-vite",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -17,11 +17,11 @@
},
"license": "Apache-2.0",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-i18n": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/compiler-sfc": "3.2.33",
"@vue/shared": "3.2.33",
"debug": "^4.3.3",
......
......@@ -5420,7 +5420,11 @@ function createInvoker(initialValue, instance) {
setTimeout(invoke);
}
else {
return invoke();
const res = invoke();
if (e.type === 'input' && isPromise(res)) {
return;
}
return res;
}
};
invoker.value = initialValue;
......
{
"name": "@dcloudio/uni-mp-vue",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-mp-vue",
"main": "dist/vue.runtime.esm.js",
"module": "dist/vue.runtime.esm.js",
......@@ -18,7 +18,11 @@
"url": "https://github.com/dcloudio/uni-app/issues"
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/shared": "3.2.33"
},
"devDependencies": {
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003"
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003"
}
}
......@@ -5,6 +5,7 @@ import {
hasOwn,
NOOP,
isString,
isPromise,
} from '@vue/shared'
import {
callWithAsyncErrorHandling,
......@@ -94,7 +95,11 @@ function createInvoker(
if (bubbles.includes(e.type) && !eventSync) {
setTimeout(invoke)
} else {
return invoke()
const res = invoke()
if (e.type === 'input' && isPromise(res)) {
return
}
return res
}
}
invoker.value = initialValue
......
......@@ -36,6 +36,6 @@
"__PLATFORM__": "\"mp-weixin\"",
"__PLATFORM_TITLE__": "微信小程序"
},
"external": ["@dcloudio/uni-i18n", "@vue/shared", "vue"]
"external": ["@dcloudio/uni-i18n", "@dcloudio/uni-shared", "@vue/shared", "vue"]
}
]
import { isArray, hasOwn, isString, isPlainObject, isObject, capitalize, toRawType, makeMap, isFunction, isPromise, remove, extend } from '@vue/shared';
let vueApp;
const createVueAppHooks = [];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function onCreateVueApp(hook) {
// TODO 每个 nvue 页面都会触发
if (vueApp) {
return hook(vueApp);
}
createVueAppHooks.push(hook);
}
function invokeCreateVueAppHook(app) {
vueApp = app;
createVueAppHooks.forEach((hook) => hook(app));
}
import { Emitter, onCreateVueApp, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
function getBaseSystemInfo() {
return wx.getSystemInfoSync()
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx,
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener() {
self.off(name, listener);
callback.apply(ctx, arguments);
}
listener._ = callback;
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents.length ? (e[name] = liveEvents) : delete e[name];
return this;
},
};
var E$1 = E;
function validateProtocolFail(name, msg) {
console.warn(`${name}: ${msg}`);
}
......@@ -547,7 +480,7 @@ const EmitProtocol = [
},
];
const emitter = new E$1();
const emitter = new Emitter();
const $on = defineSyncApi(API_ON, (name, callback) => {
emitter.on(name, callback);
return () => emitter.off(name, callback);
......@@ -649,7 +582,7 @@ const offPushMessage = (fn) => {
}
};
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const CONTEXT_API_RE = /^create|Manager$/;
// Context例外情况
const CONTEXT_API_RE_EXC = ['createBLEConnection'];
......
import { camelize, isPlainObject, isArray, hasOwn, isFunction, extend } from '@vue/shared';
import { SLOT_DEFAULT_NAME, invokeArrayFns, ON_LOAD, ON_SHOW, ON_HIDE, ON_UNLOAD, ON_RESIZE, ON_TAB_ITEM_TAP, ON_REACH_BOTTOM, ON_PULL_DOWN_REFRESH, ON_ADD_TO_FAVORITES, MINI_PROGRAM_PAGE_RUNTIME_HOOKS, ON_READY, once, ON_LAUNCH, ON_ERROR, ON_THEME_CHANGE, ON_PAGE_NOT_FOUND, ON_UNHANDLE_REJECTION, addLeadingSlash, stringifyQuery, customizeEvent } from '@dcloudio/uni-shared';
import { isArray, hasOwn, isFunction, extend, isPlainObject } from '@vue/shared';
import { ref, findComponentPropsData, toRaw, updateProps, invalidateJob, getExposeProxy, pruneComponentPropsCache } from 'vue';
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
// App and Page
const ON_SHOW = 'onShow';
const ON_HIDE = 'onHide';
//App
const ON_LAUNCH = 'onLaunch';
const ON_ERROR = 'onError';
const ON_THEME_CHANGE = 'onThemeChange';
const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
//Page
const ON_LOAD = 'onLoad';
const ON_READY = 'onReady';
const ON_UNLOAD = 'onUnload';
const ON_RESIZE = 'onResize';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
return camelize(str.replace(customizeRE, '-'));
}
function hasLeadingSlash(str) {
return str.indexOf('/') === 0;
}
function addLeadingSlash(str) {
return hasLeadingSlash(str) ? str : '/' + str;
}
const invokeArrayFns = (fns, arg) => {
let ret;
for (let i = 0; i < fns.length; i++) {
ret = fns[i](arg);
}
return ret;
};
function once(fn, ctx = null) {
let res;
return ((...args) => {
if (fn) {
res = fn.apply(ctx, args);
fn = null;
}
return res;
});
}
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
const res = obj
? Object.keys(obj)
.map((key) => {
let val = obj[key];
if (typeof val === undefined || val === null) {
val = '';
}
else if (isPlainObject(val)) {
val = JSON.stringify(val);
}
return encodeStr(key) + '=' + encodeStr(val);
})
.filter((x) => x.length > 0)
.join('&')
: null;
return res ? `?${res}` : '';
}
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
onShareAppMessage: 1 << 1,
onShareTimeline: 1 << 2,
};
})();
const eventChannels = {};
const eventChannelStack = [];
function getEventChannel(id) {
......@@ -217,7 +139,7 @@ function findHooks(vueOptions, hooks = new Set()) {
}
return hooks;
}
function initHook$1(mpOptions, hook, excludes) {
function initHook(mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.$callHook(hook, args);
......@@ -226,10 +148,10 @@ function initHook$1(mpOptions, hook, excludes) {
}
const EXCLUDE_HOOKS = [ON_READY];
function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
hooks.forEach((hook) => initHook$1(mpOptions, hook, excludes));
hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initRuntimeHooks(mpOptions, runtimeHooks) {
if (!runtimeHooks) {
......@@ -238,7 +160,7 @@ function initRuntimeHooks(mpOptions, runtimeHooks) {
const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
hooks.forEach((hook) => {
if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
initHook$1(mpOptions, hook, []);
initHook(mpOptions, hook, []);
}
});
}
......@@ -780,7 +702,7 @@ function initTriggerEvent(mpInstance) {
return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
};
}
function initHook(name, options, isComponent) {
function initMiniProgramHook(name, options, isComponent) {
const oldHook = options[name];
if (!oldHook) {
options[name] = function () {
......@@ -795,11 +717,11 @@ function initHook(name, options, isComponent) {
}
}
Page = function (options) {
initHook(ON_LOAD, options);
initMiniProgramHook(ON_LOAD, options);
return MPPage(options);
};
Component = function (options) {
initHook('created', options);
initMiniProgramHook('created', options);
// 小程序组件
const isVueComponent = options.properties && options.properties.uP;
if (!isVueComponent) {
......
{
"name": "@dcloudio/uni-mp-weixin",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-app mp-weixin",
"main": "dist/index.js",
"files": [
......@@ -29,8 +29,10 @@
"@vue/compiler-core": "3.2.33"
},
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003"
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/shared": "3.2.33"
}
}
{
"name": "@dcloudio/uni-nvue-styler",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-nvue-styler",
"main": "./dist/uni-nvue-styler.cjs.js",
"types": "./dist/uni-nvue-styler.d.ts",
......
{
"name": "@dcloudio/uni-push",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-push",
"main": "lib/uni-push.js",
"module": "lib/uni-push.js",
......@@ -20,6 +20,6 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003"
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003"
}
}
......@@ -37,6 +37,11 @@
"__PLATFORM__": "\"quickapp-webview\"",
"__PLATFORM_TITLE__": "快应用(Webview)版"
},
"external": ["@dcloudio/uni-i18n", "@vue/shared", "vue"]
"external": [
"@dcloudio/uni-i18n",
"@dcloudio/uni-shared",
"@vue/shared",
"vue"
]
}
]
import { isArray, hasOwn, isString, isPlainObject, isObject, capitalize, toRawType, makeMap, isFunction, isPromise, remove, extend } from '@vue/shared';
let vueApp;
const createVueAppHooks = [];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function onCreateVueApp(hook) {
// TODO 每个 nvue 页面都会触发
if (vueApp) {
return hook(vueApp);
}
createVueAppHooks.push(hook);
}
function invokeCreateVueAppHook(app) {
vueApp = app;
createVueAppHooks.forEach((hook) => hook(app));
}
import { Emitter, onCreateVueApp, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
const eventChannels = {};
const eventChannelStack = [];
......@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return qa.getSystemInfoSync()
}
const E = function () {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E.prototype = {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
ctx: ctx,
});
return this;
},
once: function (name, callback, ctx) {
var self = this;
function listener() {
self.off(name, listener);
callback.apply(ctx, arguments);
}
listener._ = callback;
return this.on(name, listener, ctx);
},
emit: function (name) {
var data = [].slice.call(arguments, 1);
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;
var len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
}
return this;
},
off: function (name, callback) {
var e = this.e || (this.e = {});
var evts = e[name];
var liveEvents = [];
if (evts && callback) {
for (var i = 0, len = evts.length; i < len; i++) {
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
liveEvents.push(evts[i]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents.length ? (e[name] = liveEvents) : delete e[name];
return this;
},
};
var E$1 = E;
function validateProtocolFail(name, msg) {
console.warn(`${name}: ${msg}`);
}
......@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const emitter = new E$1();
const emitter = new Emitter();
const $on = defineSyncApi(API_ON, (name, callback) => {
emitter.on(name, callback);
return () => emitter.off(name, callback);
......@@ -685,7 +618,7 @@ const offPushMessage = (fn) => {
}
};
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const SYNC_API_RE = /^\$|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
const CONTEXT_API_RE = /^create|Manager$/;
// Context例外情况
const CONTEXT_API_RE_EXC = ['createBLEConnection'];
......
import { camelize, isPlainObject, isArray, hasOwn, isFunction, extend, isObject } from '@vue/shared';
import { SLOT_DEFAULT_NAME, EventChannel, invokeArrayFns, ON_LOAD, ON_SHOW, ON_HIDE, ON_UNLOAD, ON_RESIZE, ON_TAB_ITEM_TAP, ON_REACH_BOTTOM, ON_PULL_DOWN_REFRESH, ON_ADD_TO_FAVORITES, MINI_PROGRAM_PAGE_RUNTIME_HOOKS, ON_READY, once, ON_LAUNCH, ON_ERROR, ON_THEME_CHANGE, ON_PAGE_NOT_FOUND, ON_UNHANDLE_REJECTION, addLeadingSlash, stringifyQuery, customizeEvent } from '@dcloudio/uni-shared';
import { isArray, hasOwn, isFunction, extend, isPlainObject, isObject } from '@vue/shared';
import { ref, nextTick, findComponentPropsData, toRaw, updateProps, invalidateJob, getExposeProxy, pruneComponentPropsCache } from 'vue';
const ON_READY$1 = 'onReady';
class EventChannel$1 {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const SLOT_DEFAULT_NAME = 'd';
// lifecycle
// App and Page
const ON_SHOW = 'onShow';
const ON_HIDE = 'onHide';
//App
const ON_LAUNCH = 'onLaunch';
const ON_ERROR = 'onError';
const ON_THEME_CHANGE = 'onThemeChange';
const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
//Page
const ON_LOAD = 'onLoad';
const ON_READY = 'onReady';
const ON_UNLOAD = 'onUnload';
const ON_RESIZE = 'onResize';
const ON_TAB_ITEM_TAP = 'onTabItemTap';
const ON_REACH_BOTTOM = 'onReachBottom';
const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const ON_ADD_TO_FAVORITES = 'onAddToFavorites';
const customizeRE = /:/g;
function customizeEvent(str) {
return camelize(str.replace(customizeRE, '-'));
}
function hasLeadingSlash(str) {
return str.indexOf('/') === 0;
}
function addLeadingSlash(str) {
return hasLeadingSlash(str) ? str : '/' + str;
}
const invokeArrayFns = (fns, arg) => {
let ret;
for (let i = 0; i < fns.length; i++) {
ret = fns[i](arg);
}
return ret;
};
function once(fn, ctx = null) {
let res;
return ((...args) => {
if (fn) {
res = fn.apply(ctx, args);
fn = null;
}
return res;
});
}
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
const res = obj
? Object.keys(obj)
.map((key) => {
let val = obj[key];
if (typeof val === undefined || val === null) {
val = '';
}
else if (isPlainObject(val)) {
val = JSON.stringify(val);
}
return encodeStr(key) + '=' + encodeStr(val);
})
.filter((x) => x.length > 0)
.join('&')
: null;
return res ? `?${res}` : '';
}
class EventChannel {
constructor(id, events) {
this.id = id;
this.listener = {};
this.emitCache = {};
if (events) {
Object.keys(events).forEach((name) => {
this.on(name, events[name]);
});
}
}
emit(eventName, ...args) {
const fns = this.listener[eventName];
if (!fns) {
return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
}
fns.forEach((opt) => {
opt.fn.apply(opt.fn, args);
});
this.listener[eventName] = fns.filter((opt) => opt.type !== 'once');
}
on(eventName, fn) {
this._addListener(eventName, 'on', fn);
this._clearCache(eventName);
}
once(eventName, fn) {
this._addListener(eventName, 'once', fn);
this._clearCache(eventName);
}
off(eventName, fn) {
const fns = this.listener[eventName];
if (!fns) {
return;
}
if (fn) {
for (let i = 0; i < fns.length;) {
if (fns[i].fn === fn) {
fns.splice(i, 1);
i--;
}
i++;
}
}
else {
delete this.listener[eventName];
}
}
_clearCache(eventName) {
const cacheArgs = this.emitCache[eventName];
if (cacheArgs) {
for (; cacheArgs.length > 0;) {
this.emit.apply(this, [eventName, ...cacheArgs.shift()]);
}
}
}
_addListener(eventName, type, fn) {
(this.listener[eventName] || (this.listener[eventName] = [])).push({
fn,
type,
});
}
}
const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => {
return {
onPageScroll: 1,
onShareAppMessage: 1 << 1,
onShareTimeline: 1 << 2,
};
})();
const eventChannels = {};
const eventChannelStack = [];
function getEventChannel(id) {
......@@ -345,7 +139,7 @@ function findHooks(vueOptions, hooks = new Set()) {
}
return hooks;
}
function initHook$1(mpOptions, hook, excludes) {
function initHook(mpOptions, hook, excludes) {
if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
mpOptions[hook] = function (args) {
return this.$vm && this.$vm.$callHook(hook, args);
......@@ -354,10 +148,10 @@ function initHook$1(mpOptions, hook, excludes) {
}
const EXCLUDE_HOOKS = [ON_READY];
function initHooks(mpOptions, hooks, excludes = EXCLUDE_HOOKS) {
hooks.forEach((hook) => initHook$1(mpOptions, hook, excludes));
hooks.forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));
findHooks(vueOptions).forEach((hook) => initHook(mpOptions, hook, excludes));
}
function initRuntimeHooks(mpOptions, runtimeHooks) {
if (!runtimeHooks) {
......@@ -366,7 +160,7 @@ function initRuntimeHooks(mpOptions, runtimeHooks) {
const hooks = Object.keys(MINI_PROGRAM_PAGE_RUNTIME_HOOKS);
hooks.forEach((hook) => {
if (runtimeHooks & MINI_PROGRAM_PAGE_RUNTIME_HOOKS[hook]) {
initHook$1(mpOptions, hook, []);
initHook(mpOptions, hook, []);
}
});
}
......@@ -888,7 +682,7 @@ function initTriggerEvent(mpInstance) {
return oldTriggerEvent.apply(mpInstance, [customizeEvent(event), ...args]);
};
}
function initHook(name, options, isComponent) {
function initMiniProgramHook(name, options, isComponent) {
const oldHook = options[name];
if (!oldHook) {
options[name] = function () {
......@@ -903,11 +697,11 @@ function initHook(name, options, isComponent) {
}
}
Page = function (options) {
initHook(ON_LOAD, options);
initMiniProgramHook(ON_LOAD, options);
return MPPage(options);
};
Component = function (options) {
initHook('created', options);
initMiniProgramHook('created', options);
// 小程序组件
const isVueComponent = options.properties && options.properties.uP;
if (!isVueComponent) {
......@@ -1126,7 +920,7 @@ function handleLink({ detail: { nodeId, webviewId }, }) {
delete vm._$childVues;
}
vm.$callHook('mounted');
vm.$callHook(ON_READY$1);
vm.$callHook(ON_READY);
};
// 当 parentVm 已经 mounted 时,直接触发,否则延迟
if (!parentVm || parentVm.$.isMounted) {
......@@ -1142,30 +936,30 @@ function handleLink({ detail: { nodeId, webviewId }, }) {
}
var parseComponentOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
initRelation: initRelation,
handleLink: handleLink,
mocks: mocks,
isPage: isPage,
parse: parse,
initLifetimes: initLifetimes$1
__proto__: null,
initRelation: initRelation,
handleLink: handleLink,
mocks: mocks,
isPage: isPage,
parse: parse,
initLifetimes: initLifetimes$1
});
var parsePageOptions = /*#__PURE__*/Object.freeze({
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes
__proto__: null,
mocks: mocks,
isPage: isPage,
initRelation: initRelation,
handleLink: handleLink,
parse: parse,
initLifetimes: initLifetimes
});
const createApp = initCreateApp();
const createPage = initCreatePage(parsePageOptions);
const createComponent = initCreateComponent(parseComponentOptions);
const createSubpackageApp = initCreateSubpackageApp();
qa.EventChannel = EventChannel$1;
qa.EventChannel = EventChannel;
qa.createApp = global.createApp = createApp;
qa.createPage = createPage;
qa.createComponent = createComponent;
......
{
"name": "@dcloudio/uni-quickapp-webview",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-app quickapp-webview",
"main": "dist/index.js",
"repository": {
......@@ -25,10 +25,10 @@
"@vue/compiler-core": "3.2.33"
},
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@vue/shared": "3.2.33"
}
}
{
"name": "@dcloudio/uni-shared",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-shared",
"main": "./dist/uni-shared.cjs.js",
"module": "./dist/uni-shared.es.js",
......
{
"name": "@dcloudio/uni-stat",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-stat",
"main": "dist/uni-stat.es.js",
"module": "dist/uni-stat.es.js",
......@@ -20,8 +20,8 @@
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"debug": "^4.3.3"
},
"devDependencies": {
......
{
"private": true,
"name": "@dcloudio/uni-vue",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "@dcloudio/uni-vue",
"files": [
"dist"
......@@ -17,7 +17,7 @@
"url": "https://github.com/dcloudio/uni-app/issues"
},
"devDependencies": {
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003"
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003"
}
}
{
"name": "@dcloudio/vite-plugin-uni",
"version": "3.0.0-alpha-3040620220415003",
"version": "3.0.0-alpha-3040720220422003",
"description": "uni-app vite plugin",
"bin": {
"uni": "bin/uni.js"
......@@ -25,8 +25,8 @@
"@babel/core": "^7.17.9",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-typescript": "^7.16.8",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040620220415003",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040720220422003",
"@dcloudio/uni-shared": "3.0.0-alpha-3040720220422003",
"@rollup/pluginutils": "^4.2.0",
"@vitejs/plugin-legacy": "^1.8.1",
"@vitejs/plugin-vue": "^2.3.1",
......
import { Plugin } from 'vite'
import fs from 'fs'
import path from 'path'
import { Plugin, PluginOption } from 'vite'
import {
isInHBuilderX,
// initPreContext,
// normalizePath,
parseManifestJsonOnce,
......@@ -40,6 +43,39 @@ export function createConfig(
optimizeDeps: createOptimizeDeps(options),
build: createBuild(options, config),
css: createCss(options, config),
worker: {
plugins: initFixedEsbuildInitTSConfck(process.env.UNI_INPUT_DIR),
},
plugins: initFixedEsbuildInitTSConfck(process.env.UNI_NODE_ENV),
}
}
}
/**
* 解决 HBuilderX 项目未包含 package.json 时,initTSConfck 可能导致查找过慢,或递归目录时权限不足报错
* 即:未包含 package.json 时,直接移除 initTSConfck 相关逻辑
* @param inputDir
* @returns
*/
function initFixedEsbuildInitTSConfck(inputDir: string): PluginOption[] {
if (!isInHBuilderX()) {
return []
}
if (fs.existsSync(path.resolve(inputDir, 'package.json'))) {
return []
}
const initTSConfckPlugins = ['vite:esbuild', 'vite:esbuild-transpile']
return [
{
name: 'fixed-esbuild-initTSConfck',
enforce: 'pre',
configResolved(config) {
initTSConfckPlugins.forEach((name) => {
const plugin = config.worker.plugins.find((p) => p.name === name)
if (plugin) {
delete plugin.configResolved
}
})
},
},
]
}
......@@ -6,8 +6,8 @@ importers:
specifiers:
'@babel/preset-env': ^7.16.11
'@dcloudio/types': ^2.6.4
'@dcloudio/uni-api': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-app': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-api': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-app': 3.0.0-alpha-3040720220422003
'@jest/types': ^27.0.2
'@microsoft/api-extractor': ^7.19.4
'@rollup/plugin-alias': ^3.1.1
......@@ -129,13 +129,13 @@ importers:
packages/size-check:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-components': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-h5': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-h5-vite': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-h5-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040620220415003
'@dcloudio/vite-plugin-uni': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-components': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-h5': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-h5-vite': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-h5-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040720220422003
'@dcloudio/vite-plugin-uni': 3.0.0-alpha-3040720220422003
devDependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-components': link:../uni-components
......@@ -147,18 +147,18 @@ importers:
packages/uni-api:
specifiers:
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
devDependencies:
'@dcloudio/uni-shared': link:../uni-shared
packages/uni-app:
specifiers:
'@dcloudio/uni-cloud': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-components': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-push': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-stat': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cloud': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-components': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-push': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-stat': 3.0.0-alpha-3040720220422003
'@vue/shared': 3.2.33
dependencies:
'@dcloudio/uni-cloud': link:../uni-cloud
......@@ -171,13 +171,13 @@ importers:
packages/uni-app-plus:
specifiers:
'@dcloudio/uni-app-vite': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-app-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-components': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-h5': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-app-vite': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-app-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-components': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-h5': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@types/pako': 1.0.2
'@vue/compiler-sfc': 3.2.33
pako: ^1.0.11
......@@ -198,10 +198,10 @@ importers:
packages/uni-app-vite:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-nvue-styler': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-nvue-styler': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@rollup/pluginutils': ^4.2.0
'@types/debug': ^4.1.7
'@types/fs-extra': ^9.0.13
......@@ -237,13 +237,13 @@ importers:
packages/uni-app-vue:
specifiers:
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
devDependencies:
'@dcloudio/uni-shared': link:../uni-shared
packages/uni-automator:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@types/debug': ^4.1.7
'@types/fs-extra': ^9.0.13
address: ^1.1.2
......@@ -277,8 +277,8 @@ importers:
'@babel/core': ^7.17.9
'@babel/parser': ^7.17.9
'@babel/types': ^7.17.0
'@dcloudio/uni-i18n': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@intlify/core-base': 9.1.9
'@intlify/shared': 9.1.9
'@intlify/vue-devtools': 9.1.9
......@@ -371,9 +371,9 @@ importers:
packages/uni-cloud:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-i18n': link:../uni-i18n
......@@ -381,7 +381,7 @@ importers:
packages/uni-components:
specifiers:
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@types/quill': ^1.3.7
devDependencies:
'@dcloudio/uni-shared': link:../uni-shared
......@@ -389,9 +389,9 @@ importers:
packages/uni-core:
specifiers:
'@dcloudio/uni-i18n': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
safe-area-insets: ^1.4.1
devDependencies:
'@dcloudio/uni-i18n': link:../uni-i18n
......@@ -402,11 +402,11 @@ importers:
packages/uni-h5:
specifiers:
'@dcloudio/uni-cli-i18n': ^2.0.0-32920211029004
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-h5-vite': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-h5-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-h5-vite': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-h5-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@types/google.maps': ^3.45.6
'@vue/server-renderer': 3.2.33
'@vue/shared': 3.2.33
......@@ -438,8 +438,8 @@ importers:
packages/uni-h5-vite:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@rollup/pluginutils': ^4.2.0
'@types/debug': ^4.1.7
'@types/fs-extra': ^9.0.13
......@@ -483,41 +483,47 @@ importers:
packages/uni-mp-alipay:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-mp-vite': link:../uni-mp-vite
'@dcloudio/uni-mp-vue': link:../uni-mp-vue
'@dcloudio/uni-shared': link:../uni-shared
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
packages/uni-mp-baidu:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-compiler': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-weixin': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-compiler': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-weixin': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-mp-compiler': link:../uni-mp-compiler
'@dcloudio/uni-mp-vite': link:../uni-mp-vite
'@dcloudio/uni-mp-vue': link:../uni-mp-vue
'@dcloudio/uni-mp-weixin': link:../uni-mp-weixin
'@dcloudio/uni-shared': link:../uni-shared
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
packages/uni-mp-compiler:
specifiers:
'@babel/generator': ^7.17.9
'@babel/parser': ^7.17.9
'@babel/types': ^7.17.0
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@vue/compiler-core': 3.2.33
'@vue/compiler-dom': 3.2.33
'@vue/compiler-sfc': 3.2.33
......@@ -543,49 +549,61 @@ importers:
packages/uni-mp-kuaishou:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-compiler': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-weixin': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-compiler': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-weixin': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-mp-compiler': link:../uni-mp-compiler
'@dcloudio/uni-mp-vite': link:../uni-mp-vite
'@dcloudio/uni-mp-vue': link:../uni-mp-vue
'@dcloudio/uni-mp-weixin': link:../uni-mp-weixin
'@dcloudio/uni-shared': link:../uni-shared
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
packages/uni-mp-lark:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-compiler': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-toutiao': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-compiler': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-toutiao': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-mp-compiler': link:../uni-mp-compiler
'@dcloudio/uni-mp-toutiao': link:../uni-mp-toutiao
'@dcloudio/uni-mp-vite': link:../uni-mp-vite
'@dcloudio/uni-mp-vue': link:../uni-mp-vue
'@dcloudio/uni-shared': link:../uni-shared
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
packages/uni-mp-qq:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-weixin': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-weixin': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@types/fs-extra': ^9.0.13
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
fs-extra: ^10.0.0
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-mp-vite': link:../uni-mp-vite
'@dcloudio/uni-mp-vue': link:../uni-mp-vue
'@dcloudio/uni-shared': link:../uni-shared
'@vue/shared': 3.2.33
fs-extra: 10.0.0
devDependencies:
'@dcloudio/uni-mp-weixin': link:../uni-mp-weixin
......@@ -594,25 +612,29 @@ importers:
packages/uni-mp-toutiao:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-compiler': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-compiler': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-mp-compiler': link:../uni-mp-compiler
'@dcloudio/uni-mp-vite': link:../uni-mp-vite
'@dcloudio/uni-mp-vue': link:../uni-mp-vue
'@dcloudio/uni-shared': link:../uni-shared
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
packages/uni-mp-vite:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-compiler': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-i18n': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-compiler': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@types/debug': ^4.1.7
'@vue/compiler-sfc': 3.2.33
'@vue/shared': 3.2.33
......@@ -633,20 +655,29 @@ importers:
packages/uni-mp-vue:
specifiers:
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@vue/shared': 3.2.33
dependencies:
'@dcloudio/uni-shared': link:../uni-shared
'@vue/shared': 3.2.33
devDependencies:
'@dcloudio/uni-mp-vue': 'link:'
packages/uni-mp-weixin:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-mp-vite': link:../uni-mp-vite
'@dcloudio/uni-mp-vue': link:../uni-mp-vue
'@dcloudio/uni-shared': link:../uni-shared
'@vue/shared': 3.2.33
devDependencies:
'@vue/compiler-core': 3.2.33
......@@ -662,16 +693,16 @@ importers:
packages/uni-push:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
packages/uni-quickapp-webview:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vite': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@vue/compiler-core': 3.2.33
'@vue/shared': 3.2.33
dependencies:
......@@ -694,8 +725,8 @@ importers:
packages/uni-stat:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@types/debug': ^4.1.7
debug: ^4.3.3
dependencies:
......@@ -707,8 +738,8 @@ importers:
packages/uni-vue:
specifiers:
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-mp-vue': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
devDependencies:
'@dcloudio/uni-mp-vue': link:../uni-mp-vue
'@dcloudio/uni-shared': link:../uni-shared
......@@ -718,8 +749,8 @@ importers:
'@babel/core': ^7.17.9
'@babel/plugin-syntax-import-meta': ^7.10.4
'@babel/plugin-transform-typescript': ^7.16.8
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-shared': 3.0.0-alpha-3040620220415003
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3040720220422003
'@dcloudio/uni-shared': 3.0.0-alpha-3040720220422003
'@rollup/pluginutils': ^4.2.0
'@types/debug': ^4.1.7
'@types/express': ^4.17.12
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册