uview-ultra 4.5.78 → 4.5.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +14 -0
- package/components/up-tabs/up-tabs.uvue +12 -0
- package/libs/function/index.uts +15 -2
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 4.5.79
|
|
2
|
+
perf: up-tabs uvue 深度监听补内容指纹守卫,index.uts 缓存设备信息同步调用
|
|
3
|
+
|
|
4
|
+
本版补齐 4.5.78 性能优化未覆盖的 .uvue / .uts 侧(uni-app x / App 端),对齐 uview-plus 3.8.140 / 3.8.141,并按 4.5.76 起强制规范完成真机运行验证。
|
|
5
|
+
|
|
6
|
+
性能优化(.uvue / .uts 侧):
|
|
7
|
+
- up-tabs:list 深度监听入口增加 JSON 序列化内容指纹比对——父组件重渲染传入内容相同的新数组引用(模板内联数组、重新 map 等常见写法)时,跳过全量 deepClone 与 1+N 次节点测量,仅付一次序列化比对成本;内容真变走原逻辑,deep 监听语义不变;首次触发与旧代码逐指令一致
|
|
8
|
+
- os()(osName)/ getDeviceInfo() 结果模块级缓存:设备信息与平台标识运行期不变,up-input、up-no-network、up-radio、up-rate、up-toast 等 uvue 调用点不再重复发起同步系统信息查询
|
|
9
|
+
|
|
10
|
+
验证:
|
|
11
|
+
- Android 全项目编译通过(110 页面 0 error),模拟器(MuMu)与真机(vivo V2118A)分别全量构建
|
|
12
|
+
- 真机运行 tabs 示例页:各分组渲染、up-tabs-pro、非滚动模式、指示条定位正常;点击「切换下一个」响应式重渲染正常;logcat 无 JS 异常
|
|
13
|
+
- 既有问题记录(与本版无关):可滚动模式 tabs 的首帧文字在 MuMu 与真机上均出现绘制重叠,页面重渲染与滚动重绘后依旧;经分析首渲染路径与旧代码一致且重渲染不修复,为 up-tabs uvue scroll-view 首帧布局既有问题,待另立任务排查
|
|
14
|
+
|
|
1
15
|
## 4.5.78
|
|
2
16
|
perf: 同步 uview-plus 3.8.140/3.8.141 三处性能优化,并恢复源码授权价 99.00
|
|
3
17
|
|
|
@@ -470,7 +470,19 @@
|
|
|
470
470
|
}, { immediate: true })
|
|
471
471
|
|
|
472
472
|
// list变化时,重新渲染list各项信息
|
|
473
|
+
// 内容指纹守卫:父组件重渲染常用内容相同的新数组引用(模板内联数组、重新 map 等)
|
|
474
|
+
// 触发本 deep watch,内容未变时跳过 deepClone 与 resize 的整轮节点测量。
|
|
475
|
+
// 序列化失败的异构输入(如循环引用)回退为按原逻辑处理
|
|
476
|
+
let listFingerprint: string | null = null
|
|
473
477
|
watch((): Array<UTSJSONObject> => safeList.value, () => {
|
|
478
|
+
let fingerprint: string | null = null
|
|
479
|
+
try {
|
|
480
|
+
fingerprint = JSON.stringify(safeList.value)
|
|
481
|
+
} catch (e) {}
|
|
482
|
+
if (fingerprint != null && fingerprint == listFingerprint) {
|
|
483
|
+
return
|
|
484
|
+
}
|
|
485
|
+
listFingerprint = fingerprint
|
|
474
486
|
syncTabList()
|
|
475
487
|
nextTick(() => {
|
|
476
488
|
resize()
|
package/libs/function/index.uts
CHANGED
|
@@ -131,8 +131,14 @@ export function sleep(value = 30): Promise<UTSJSONObject> {
|
|
|
131
131
|
* @returns {string} 返回所在平台(小写)
|
|
132
132
|
* @link 运行期判断平台 https://uniapp.dcloud.io/frame?id=判断平台
|
|
133
133
|
*/
|
|
134
|
+
// 平台标识运行期不变,缓存结果避免高频路径重复发起同步调用
|
|
135
|
+
let cachedOs = ''
|
|
134
136
|
export function os(): string {
|
|
135
|
-
|
|
137
|
+
if (cachedOs != '') {
|
|
138
|
+
return cachedOs
|
|
139
|
+
}
|
|
140
|
+
cachedOs = uni.getSystemInfoSync().osName
|
|
141
|
+
return cachedOs
|
|
136
142
|
}
|
|
137
143
|
/**
|
|
138
144
|
* @description 获取系统信息同步接口
|
|
@@ -146,8 +152,15 @@ export function getWindowInfo(): GetWindowInfoResult {
|
|
|
146
152
|
return uni.getWindowInfo()
|
|
147
153
|
}
|
|
148
154
|
|
|
155
|
+
// 设备信息运行期不变,缓存结果避免重复发起同步调用;
|
|
156
|
+
// 调用方(platform/system 等)均为只读读取,共享同一对象是安全的
|
|
157
|
+
let cachedDeviceInfo: GetDeviceInfoResult | null = null
|
|
149
158
|
export function getDeviceInfo(): GetDeviceInfoResult {
|
|
150
|
-
|
|
159
|
+
if (cachedDeviceInfo != null) {
|
|
160
|
+
return cachedDeviceInfo!
|
|
161
|
+
}
|
|
162
|
+
cachedDeviceInfo = uni.getDeviceInfo()
|
|
163
|
+
return cachedDeviceInfo!
|
|
151
164
|
}
|
|
152
165
|
|
|
153
166
|
/**
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "uview-ultra",
|
|
3
3
|
"name": "uview-ultra",
|
|
4
4
|
"displayName": "零云®UviewUltra v4重磅发布,大满贯全面兼容uniapp-x蒸汽模式、uniapp鸿蒙组件库。",
|
|
5
|
-
"version": "4.5.
|
|
5
|
+
"version": "4.5.79",
|
|
6
6
|
"description": "uview-ultra全面兼容uni-app/uni-app-x/鸿蒙/nvue,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"uview",
|