提交 d044f765 编写于 作者: fxy060608's avatar fxy060608

chore: merge

......@@ -40,6 +40,24 @@ export function mergeMiniProgramAppJson(
})
}
function normalizeUsingComponentsPath(
usingComponents: PageWindowOptions['usingComponents'],
platform: UniApp.PLATFORM
) {
if (platform === 'mp-baidu') {
const flag = './'
const _usingComponents: PageWindowOptions['usingComponents'] = {}
for (const key in usingComponents) {
const componentPath = usingComponents[key]
_usingComponents[key] = componentPath.startsWith(flag)
? componentPath.replace(flag, '/')
: componentPath
}
return _usingComponents
}
return usingComponents
}
function parsePagesJson(
jsonStr: string,
platform: UniApp.PLATFORM,
......@@ -135,7 +153,10 @@ function parsePagesJson(
const { usingComponents } = windowOptions as PageWindowOptions
if (usingComponents) {
delete (windowOptions as PageWindowOptions).usingComponents
appJson.usingComponents = usingComponents
appJson.usingComponents = normalizeUsingComponentsPath(
usingComponents,
platform
)
} else {
delete appJson.usingComponents
}
......
......@@ -1413,10 +1413,17 @@ function queueJob(job) {
queueFlush();
}
}
// fixed by xxxxxx
function sleep(ms) {
return () => {
return new Promise(resolve => setTimeout(() => resolve(void 0), ms));
};
}
function queueFlush() {
if (!isFlushing && !isFlushPending) {
isFlushPending = true;
currentFlushPromise = resolvedPromise.then(flushJobs);
// fixed by xxxxxx 延迟执行,避免同一批次的事件执行时机不正确,对性能可能有略微影响 https://github.com/dcloudio/uni-app/issues/3228
currentFlushPromise = resolvedPromise.then(sleep(0)).then(flushJobs);
}
}
function invalidateJob(job) {
......
......@@ -1413,10 +1413,17 @@ function queueJob(job) {
queueFlush();
}
}
// fixed by xxxxxx
function sleep(ms) {
return () => {
return new Promise(resolve => setTimeout(() => resolve(void 0), ms));
};
}
function queueFlush() {
if (!isFlushing && !isFlushPending) {
isFlushPending = true;
currentFlushPromise = resolvedPromise.then(flushJobs);
// fixed by xxxxxx 延迟执行,避免同一批次的事件执行时机不正确,对性能可能有略微影响 https://github.com/dcloudio/uni-app/issues/3228
currentFlushPromise = resolvedPromise.then(sleep(0)).then(flushJobs);
}
}
function invalidateJob(job) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册