@tarojs/runtime 4.0.6 → 4.0.7-alpha.0
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/dist/constants/index.d.ts +2 -1
- package/dist/constants/index.js +2 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/current.d.ts +1 -1
- package/dist/dom/element.js +8 -8
- package/dist/dom/element.js.map +1 -1
- package/dist/dom/event-source.js +1 -1
- package/dist/dom/event-source.js.map +1 -1
- package/dist/dom/event-target.d.ts +1 -0
- package/dist/dom/event-target.js +5 -0
- package/dist/dom/event-target.js.map +1 -1
- package/dist/dom/event.js +5 -5
- package/dist/dom/event.js.map +1 -1
- package/dist/dom/node.d.ts +2 -1
- package/dist/dom/node.js +7 -7
- package/dist/dom/node.js.map +1 -1
- package/dist/dom/root.d.ts +1 -0
- package/dist/dom/root.js +23 -9
- package/dist/dom/root.js.map +1 -1
- package/dist/dom-external/mutation-observer/implements.d.ts +1 -1
- package/dist/dom-external/mutation-observer/implements.js +2 -2
- package/dist/dom-external/mutation-observer/implements.js.map +1 -1
- package/dist/dom-external/mutation-observer/index.d.ts +1 -1
- package/dist/dsl/common.d.ts +1 -1
- package/dist/dsl/common.js +3 -3
- package/dist/dsl/common.js.map +1 -1
- package/dist/hydrate.js +18 -15
- package/dist/hydrate.js.map +1 -1
- package/dist/index-26658829.d.ts +1 -1
- package/dist/index.cjs.d.ts +6 -3
- package/dist/index.cjs.js +73 -49
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime.esm.d.ts +6 -3
- package/dist/runtime.esm.js +73 -50
- package/dist/runtime.esm.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -2
- /package/dist/{instance-4c64b022.d.ts → instance-3211dc5e.d.ts} +0 -0
- /package/dist/{options-4c64b022.d.ts → options-3211dc5e.d.ts} +0 -0
- /package/dist/{record-32b054d8.d.ts → record-6d0833e0.d.ts} +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -43,6 +43,7 @@ const SET_TIMEOUT = 'setTimeout';
|
|
|
43
43
|
const COMPILE_MODE = 'compileMode';
|
|
44
44
|
const CATCHMOVE = 'catchMove';
|
|
45
45
|
const CATCH_VIEW = 'catch-view';
|
|
46
|
+
const CLICK_VIEW = 'click-view';
|
|
46
47
|
const COMMENT = 'comment';
|
|
47
48
|
const ON_LOAD = 'onLoad';
|
|
48
49
|
const ON_READY = 'onReady';
|
|
@@ -113,9 +114,9 @@ class MutationObserverImpl {
|
|
|
113
114
|
return this.records.splice(0, this.records.length);
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
|
-
/** Match two TaroNodes by
|
|
117
|
+
/** Match two TaroNodes by [Shortcuts.Sid]. */
|
|
117
118
|
const sidMatches = (observerTarget, target) => {
|
|
118
|
-
return !!observerTarget && observerTarget.
|
|
119
|
+
return !!observerTarget && observerTarget["s" /* Shortcuts.Sid */] === (target === null || target === void 0 ? void 0 : target["s" /* Shortcuts.Sid */]);
|
|
119
120
|
};
|
|
120
121
|
const isConcerned = (record, options) => {
|
|
121
122
|
const { characterData, characterDataOldValue, attributes, attributeOldValue, childList } = options;
|
|
@@ -1175,7 +1176,7 @@ function shortcutAttr(key) {
|
|
|
1175
1176
|
case ID:
|
|
1176
1177
|
return UID;
|
|
1177
1178
|
case CLASS:
|
|
1178
|
-
return "
|
|
1179
|
+
return "l" /* Shortcuts.Class */;
|
|
1179
1180
|
default:
|
|
1180
1181
|
return key;
|
|
1181
1182
|
}
|
|
@@ -1292,7 +1293,7 @@ class ClassList {
|
|
|
1292
1293
|
|
|
1293
1294
|
class EventSource extends Map {
|
|
1294
1295
|
removeNode(child) {
|
|
1295
|
-
const { sid, uid } = child;
|
|
1296
|
+
const { ["s" /* Shortcuts.Sid */]: sid, uid } = child;
|
|
1296
1297
|
this.delete(sid);
|
|
1297
1298
|
if (uid !== sid && uid)
|
|
1298
1299
|
this.delete(uid);
|
|
@@ -1323,24 +1324,27 @@ function hydrate(node) {
|
|
|
1323
1324
|
let compileModeName = null;
|
|
1324
1325
|
if (isText(node)) {
|
|
1325
1326
|
return {
|
|
1326
|
-
|
|
1327
|
+
["s" /* Shortcuts.Sid */]: node["s" /* Shortcuts.Sid */],
|
|
1327
1328
|
["v" /* Shortcuts.Text */]: node.nodeValue,
|
|
1328
|
-
["
|
|
1329
|
+
["n" /* Shortcuts.NodeName */]: ((_a = componentsAlias[nodeName]) === null || _a === void 0 ? void 0 : _a._num) || '8'
|
|
1329
1330
|
};
|
|
1330
1331
|
}
|
|
1331
1332
|
const data = {
|
|
1332
|
-
["
|
|
1333
|
-
|
|
1333
|
+
["n" /* Shortcuts.NodeName */]: nodeName,
|
|
1334
|
+
["s" /* Shortcuts.Sid */]: node["s" /* Shortcuts.Sid */]
|
|
1334
1335
|
};
|
|
1335
|
-
if (node.uid !== node.
|
|
1336
|
+
if (node.uid !== node["s" /* Shortcuts.Sid */]) {
|
|
1336
1337
|
data.uid = node.uid;
|
|
1337
1338
|
}
|
|
1338
1339
|
if (!node.isAnyEventBinded() && SPECIAL_NODES.indexOf(nodeName) > -1) {
|
|
1339
|
-
data["
|
|
1340
|
+
data["n" /* Shortcuts.NodeName */] = `static-${nodeName}`;
|
|
1340
1341
|
if (nodeName === VIEW && !isHasExtractProp(node)) {
|
|
1341
|
-
data["
|
|
1342
|
+
data["n" /* Shortcuts.NodeName */] = PURE_VIEW;
|
|
1342
1343
|
}
|
|
1343
1344
|
}
|
|
1345
|
+
if (nodeName === VIEW && node.isOnlyClickBinded()) {
|
|
1346
|
+
data["n" /* Shortcuts.NodeName */] = CLICK_VIEW;
|
|
1347
|
+
}
|
|
1344
1348
|
const { props } = node;
|
|
1345
1349
|
for (const prop in props) {
|
|
1346
1350
|
const propInCamelCase = shared.toCamelCase(prop);
|
|
@@ -1356,26 +1360,26 @@ function hydrate(node) {
|
|
|
1356
1360
|
nodeName === VIEW &&
|
|
1357
1361
|
propInCamelCase === CATCHMOVE &&
|
|
1358
1362
|
props[prop] !== false) {
|
|
1359
|
-
data["
|
|
1363
|
+
data["n" /* Shortcuts.NodeName */] = CATCH_VIEW;
|
|
1360
1364
|
}
|
|
1361
1365
|
if (propInCamelCase === COMPILE_MODE) {
|
|
1362
1366
|
compileModeName = props[prop];
|
|
1363
1367
|
}
|
|
1364
1368
|
}
|
|
1365
1369
|
// Children
|
|
1366
|
-
data["
|
|
1370
|
+
data["c" /* Shortcuts.Childnodes */] = node.childNodes.filter(node => !isComment(node)).map(hydrate);
|
|
1367
1371
|
if (node.className !== '') {
|
|
1368
|
-
data["
|
|
1372
|
+
data["l" /* Shortcuts.Class */] = node.className;
|
|
1369
1373
|
}
|
|
1370
1374
|
const cssText = node.cssText;
|
|
1371
1375
|
if (cssText !== '' && nodeName !== 'swiper-item') {
|
|
1372
1376
|
data["st" /* Shortcuts.Style */] = cssText;
|
|
1373
1377
|
}
|
|
1374
1378
|
shared.hooks.call('modifyHydrateData', data, node);
|
|
1375
|
-
const
|
|
1376
|
-
const componentAlias = componentsAlias[
|
|
1379
|
+
const n = data["n" /* Shortcuts.NodeName */];
|
|
1380
|
+
const componentAlias = componentsAlias[n];
|
|
1377
1381
|
if (componentAlias) {
|
|
1378
|
-
data["
|
|
1382
|
+
data["n" /* Shortcuts.NodeName */] = componentAlias._num;
|
|
1379
1383
|
for (const prop in data) {
|
|
1380
1384
|
if (prop in componentAlias) {
|
|
1381
1385
|
data[componentAlias[prop]] = data[prop];
|
|
@@ -1384,7 +1388,7 @@ function hydrate(node) {
|
|
|
1384
1388
|
}
|
|
1385
1389
|
}
|
|
1386
1390
|
if (compileModeName !== null) {
|
|
1387
|
-
data["
|
|
1391
|
+
data["n" /* Shortcuts.NodeName */] = compileModeName;
|
|
1388
1392
|
}
|
|
1389
1393
|
const resData = shared.hooks.call('transferHydrateData', data, node, componentAlias);
|
|
1390
1394
|
return resData || data;
|
|
@@ -1462,9 +1466,14 @@ class TaroEventTarget {
|
|
|
1462
1466
|
const isAnyEventBinded = Object.keys(handlers).find(key => handlers[key].length);
|
|
1463
1467
|
return Boolean(isAnyEventBinded);
|
|
1464
1468
|
}
|
|
1469
|
+
isOnlyClickBinded() {
|
|
1470
|
+
const handlers = this.__handlers;
|
|
1471
|
+
const isOnlyClickBinded = handlers.tap && Object.keys(handlers).length === 1;
|
|
1472
|
+
return Boolean(isOnlyClickBinded);
|
|
1473
|
+
}
|
|
1465
1474
|
}
|
|
1466
1475
|
|
|
1467
|
-
const CHILDNODES = "
|
|
1476
|
+
const CHILDNODES = "c" /* Shortcuts.Childnodes */;
|
|
1468
1477
|
const nodeId = incrementId();
|
|
1469
1478
|
class TaroNode extends TaroEventTarget {
|
|
1470
1479
|
constructor() {
|
|
@@ -1473,8 +1482,8 @@ class TaroNode extends TaroEventTarget {
|
|
|
1473
1482
|
this.childNodes = [];
|
|
1474
1483
|
this.hydrate = (node) => () => hydrate(node);
|
|
1475
1484
|
this.uid = '_' + nodeId(); // dom 节点 id,开发者可修改
|
|
1476
|
-
this.
|
|
1477
|
-
eventSource.set(this.
|
|
1485
|
+
this["s" /* Shortcuts.Sid */] = this.uid; // dom 节点全局唯一 id,不可被修改
|
|
1486
|
+
eventSource.set(this["s" /* Shortcuts.Sid */], this);
|
|
1478
1487
|
}
|
|
1479
1488
|
updateChildNodes(isClean) {
|
|
1480
1489
|
const cleanChildNodes = () => [];
|
|
@@ -1629,13 +1638,13 @@ class TaroNode extends TaroEventTarget {
|
|
|
1629
1638
|
// insertBefore 有两种更新模式
|
|
1630
1639
|
// 比方说有 A B C 三个节点,现在要在 C 前插入 D
|
|
1631
1640
|
// 1. 插入 D,然后更新整个父节点的 childNodes 数组
|
|
1632
|
-
// setData({
|
|
1641
|
+
// setData({ c: [A, B, D, C] })
|
|
1633
1642
|
// 2. 插入 D,然后更新 D 以及 D 之后每个节点的数据
|
|
1634
1643
|
// setData ({
|
|
1635
|
-
//
|
|
1636
|
-
//
|
|
1644
|
+
// c.[2]: D,
|
|
1645
|
+
// c.[3]: C,
|
|
1637
1646
|
// })
|
|
1638
|
-
// 由于微信解析 ’
|
|
1647
|
+
// 由于微信解析 ’c.[2]‘ 这些路径的时候也需要消耗时间,
|
|
1639
1648
|
// 所以根据 insertBefore 插入的位置来做不同的处理
|
|
1640
1649
|
const mark = childNodesLength * 2 / 3;
|
|
1641
1650
|
if (mark > index) {
|
|
@@ -2223,8 +2232,8 @@ class TaroElement extends TaroNode {
|
|
|
2223
2232
|
this.style.cssText = value;
|
|
2224
2233
|
break;
|
|
2225
2234
|
case ID:
|
|
2226
|
-
if (this.uid !== this.
|
|
2227
|
-
// eventSource[
|
|
2235
|
+
if (this.uid !== this["s" /* Shortcuts.Sid */]) {
|
|
2236
|
+
// eventSource[Shortcuts.Sid] 永远保留,直到组件卸载
|
|
2228
2237
|
// eventSource[uid] 可变
|
|
2229
2238
|
eventSource.delete(this.uid);
|
|
2230
2239
|
}
|
|
@@ -2268,14 +2277,14 @@ class TaroElement extends TaroNode {
|
|
|
2268
2277
|
// catchMove = true: catch-view
|
|
2269
2278
|
// catchMove = false: view or static-view
|
|
2270
2279
|
this.enqueueUpdate({
|
|
2271
|
-
path: `${_path}.${"
|
|
2280
|
+
path: `${_path}.${"n" /* Shortcuts.NodeName */}`,
|
|
2272
2281
|
value: value ? catchViewAlias : (this.isAnyEventBinded() ? viewAlias : staticViewAlias)
|
|
2273
2282
|
});
|
|
2274
2283
|
}
|
|
2275
2284
|
else if (isPureView && isHasExtractProp(this)) {
|
|
2276
2285
|
// pure-view => static-view
|
|
2277
2286
|
this.enqueueUpdate({
|
|
2278
|
-
path: `${_path}.${"
|
|
2287
|
+
path: `${_path}.${"n" /* Shortcuts.NodeName */}`,
|
|
2279
2288
|
value: staticViewAlias
|
|
2280
2289
|
});
|
|
2281
2290
|
}
|
|
@@ -2327,14 +2336,14 @@ class TaroElement extends TaroNode {
|
|
|
2327
2336
|
if (qualifiedNameInCamelCase === CATCHMOVE) {
|
|
2328
2337
|
// catch-view => view or static-view or pure-view
|
|
2329
2338
|
this.enqueueUpdate({
|
|
2330
|
-
path: `${_path}.${"
|
|
2339
|
+
path: `${_path}.${"n" /* Shortcuts.NodeName */}`,
|
|
2331
2340
|
value: this.isAnyEventBinded() ? viewAlias : (isHasExtractProp(this) ? staticViewAlias : pureViewAlias)
|
|
2332
2341
|
});
|
|
2333
2342
|
}
|
|
2334
2343
|
else if (isStaticView && !isHasExtractProp(this)) {
|
|
2335
2344
|
// static-view => pure-view
|
|
2336
2345
|
this.enqueueUpdate({
|
|
2337
|
-
path: `${_path}.${"
|
|
2346
|
+
path: `${_path}.${"n" /* Shortcuts.NodeName */}`,
|
|
2338
2347
|
value: pureViewAlias
|
|
2339
2348
|
});
|
|
2340
2349
|
}
|
|
@@ -2403,7 +2412,7 @@ class TaroElement extends TaroNode {
|
|
|
2403
2412
|
const componentsAlias = getComponentsAlias();
|
|
2404
2413
|
const alias = componentsAlias[name]._num;
|
|
2405
2414
|
this.enqueueUpdate({
|
|
2406
|
-
path: `${this._path}.${"
|
|
2415
|
+
path: `${this._path}.${"n" /* Shortcuts.NodeName */}`,
|
|
2407
2416
|
value: alias
|
|
2408
2417
|
});
|
|
2409
2418
|
}
|
|
@@ -2419,7 +2428,7 @@ class TaroElement extends TaroNode {
|
|
|
2419
2428
|
const value = isHasExtractProp(this) ? `static-${name}` : `pure-${name}`;
|
|
2420
2429
|
const valueAlias = componentsAlias[value]._num;
|
|
2421
2430
|
this.enqueueUpdate({
|
|
2422
|
-
path: `${this._path}.${"
|
|
2431
|
+
path: `${this._path}.${"n" /* Shortcuts.NodeName */}`,
|
|
2423
2432
|
value: valueAlias
|
|
2424
2433
|
});
|
|
2425
2434
|
}
|
|
@@ -3383,9 +3392,9 @@ class TaroEvent {
|
|
|
3383
3392
|
const cacheTarget = this.cacheTarget;
|
|
3384
3393
|
if (!cacheTarget) {
|
|
3385
3394
|
const target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
|
|
3386
|
-
const currentEle = env.document.getElementById(((_b = target.dataset) === null || _b === void 0 ? void 0 : _b.
|
|
3395
|
+
const currentEle = env.document.getElementById(((_b = target.dataset) === null || _b === void 0 ? void 0 : _b["s" /* Shortcuts.Sid */]) || target.id || null);
|
|
3387
3396
|
// Note:优先判断冒泡场景alipay的targetDataset的sid, 不然冒泡场景target属性吐出不对,其余拿取当前绑定id
|
|
3388
|
-
const element = env.document.getElementById(((_c = target.targetDataset) === null || _c === void 0 ? void 0 : _c.
|
|
3397
|
+
const element = env.document.getElementById(((_c = target.targetDataset) === null || _c === void 0 ? void 0 : _c["s" /* Shortcuts.Sid */]) || ((_d = target.dataset) === null || _d === void 0 ? void 0 : _d["s" /* Shortcuts.Sid */]) || target.id || null);
|
|
3389
3398
|
target.dataset = Object.assign(Object.assign({}, (currentEle !== null ? currentEle.dataset : shared.EMPTY_OBJ)), (element !== null ? element.dataset : shared.EMPTY_OBJ));
|
|
3390
3399
|
for (const key in (_e = this.mpEvent) === null || _e === void 0 ? void 0 : _e.detail) {
|
|
3391
3400
|
target[key] = this.mpEvent.detail[key];
|
|
@@ -3403,8 +3412,8 @@ class TaroEvent {
|
|
|
3403
3412
|
if (!cacheCurrentTarget) {
|
|
3404
3413
|
const doc = env.document;
|
|
3405
3414
|
const currentTarget = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.currentTarget) || null);
|
|
3406
|
-
const element = doc.getElementById(((_b = currentTarget.dataset) === null || _b === void 0 ? void 0 : _b.
|
|
3407
|
-
const targetElement = doc.getElementById(((_e = (_d = (_c = this.mpEvent) === null || _c === void 0 ? void 0 : _c.target) === null || _d === void 0 ? void 0 : _d.dataset) === null || _e === void 0 ? void 0 : _e.
|
|
3415
|
+
const element = doc.getElementById(((_b = currentTarget.dataset) === null || _b === void 0 ? void 0 : _b["s" /* Shortcuts.Sid */]) || currentTarget.id || null);
|
|
3416
|
+
const targetElement = doc.getElementById(((_e = (_d = (_c = this.mpEvent) === null || _c === void 0 ? void 0 : _c.target) === null || _d === void 0 ? void 0 : _d.dataset) === null || _e === void 0 ? void 0 : _e["s" /* Shortcuts.Sid */]) || ((_g = (_f = this.mpEvent) === null || _f === void 0 ? void 0 : _f.target) === null || _g === void 0 ? void 0 : _g.id) || null);
|
|
3408
3417
|
if (element === null || (element && element === targetElement)) {
|
|
3409
3418
|
this.cacheCurrentTarget = this.target;
|
|
3410
3419
|
return this.target;
|
|
@@ -3462,7 +3471,7 @@ function eventHandler(event) {
|
|
|
3462
3471
|
event.currentTarget = event.currentTarget || event.target || Object.assign({}, event);
|
|
3463
3472
|
shared.hooks.call('modifyMpEventImpl', event);
|
|
3464
3473
|
const currentTarget = event.currentTarget;
|
|
3465
|
-
const id = ((_a = currentTarget.dataset) === null || _a === void 0 ? void 0 : _a.
|
|
3474
|
+
const id = ((_a = currentTarget.dataset) === null || _a === void 0 ? void 0 : _a["s" /* Shortcuts.Sid */] /** sid */) || currentTarget.id /** uid */ || ((_b = event.detail) === null || _b === void 0 ? void 0 : _b.id) || '';
|
|
3466
3475
|
const node = env.document.getElementById(id);
|
|
3467
3476
|
if (node) {
|
|
3468
3477
|
const dispatch = () => {
|
|
@@ -3572,7 +3581,7 @@ _Performance_instances = new WeakSet(), _Performance_parseTime = function _Perfo
|
|
|
3572
3581
|
const perf = new Performance();
|
|
3573
3582
|
|
|
3574
3583
|
function findCustomWrapper(root, dataPathArr) {
|
|
3575
|
-
// ['root', '
|
|
3584
|
+
// ['root', 'c', '[0]'] remove 'root' => ['c', '[0]']
|
|
3576
3585
|
const list = dataPathArr.slice(1);
|
|
3577
3586
|
let currentData = root;
|
|
3578
3587
|
let customWrapper;
|
|
@@ -3581,8 +3590,8 @@ function findCustomWrapper(root, dataPathArr) {
|
|
|
3581
3590
|
const key = item
|
|
3582
3591
|
// '[0]' => '0'
|
|
3583
3592
|
.replace(/^\[(.+)\]$/, '$1')
|
|
3584
|
-
// '
|
|
3585
|
-
.replace(/\
|
|
3593
|
+
// 'c' => 'Shortcuts.Childnodes'
|
|
3594
|
+
.replace(/\bc\b/g, 'childNodes');
|
|
3586
3595
|
currentData = currentData[key];
|
|
3587
3596
|
if (shared.isArray(currentData)) {
|
|
3588
3597
|
currentData = currentData.filter(el => !isComment(el));
|
|
@@ -3590,7 +3599,7 @@ function findCustomWrapper(root, dataPathArr) {
|
|
|
3590
3599
|
if (shared.isUndefined(currentData))
|
|
3591
3600
|
return true;
|
|
3592
3601
|
if (currentData.nodeName === CUSTOM_WRAPPER) {
|
|
3593
|
-
const res = customWrapperCache.get(currentData.
|
|
3602
|
+
const res = customWrapperCache.get(currentData["s" /* Shortcuts.Sid */]);
|
|
3594
3603
|
if (res) {
|
|
3595
3604
|
customWrapper = res;
|
|
3596
3605
|
splitedPath = dataPathArr.slice(i + 2).join('.');
|
|
@@ -3620,6 +3629,20 @@ class TaroRootElement extends TaroElement {
|
|
|
3620
3629
|
get _root() {
|
|
3621
3630
|
return this;
|
|
3622
3631
|
}
|
|
3632
|
+
scheduleTask(fn) {
|
|
3633
|
+
if (shared.isFunction(Promise)) {
|
|
3634
|
+
Promise.resolve()
|
|
3635
|
+
.then(fn)
|
|
3636
|
+
.catch((error) => {
|
|
3637
|
+
setTimeout(() => {
|
|
3638
|
+
throw error;
|
|
3639
|
+
});
|
|
3640
|
+
});
|
|
3641
|
+
}
|
|
3642
|
+
else {
|
|
3643
|
+
setTimeout(fn);
|
|
3644
|
+
}
|
|
3645
|
+
}
|
|
3623
3646
|
enqueueUpdate(payload) {
|
|
3624
3647
|
this.updatePayloads.push(payload);
|
|
3625
3648
|
if (!this.pendingUpdate && this.ctx) {
|
|
@@ -3629,16 +3652,16 @@ class TaroRootElement extends TaroElement {
|
|
|
3629
3652
|
performUpdate(initRender = false, prerender) {
|
|
3630
3653
|
this.pendingUpdate = true;
|
|
3631
3654
|
const ctx = shared.hooks.call('proxyToRaw', this.ctx);
|
|
3632
|
-
|
|
3655
|
+
this.scheduleTask(() => {
|
|
3633
3656
|
const setDataMark = `${SET_DATA} 开始时间戳 ${Date.now()}`;
|
|
3634
3657
|
perf.start(setDataMark);
|
|
3635
3658
|
const data = Object.create(null);
|
|
3636
3659
|
const resetPaths = new Set(initRender
|
|
3637
|
-
? [
|
|
3660
|
+
? [`root.${"c" /* Shortcuts.Childnodes */}.[0]`, `root.${"c" /* Shortcuts.Childnodes */}[0]`]
|
|
3638
3661
|
: []);
|
|
3639
3662
|
while (this.updatePayloads.length > 0) {
|
|
3640
3663
|
const { path, value } = this.updatePayloads.shift();
|
|
3641
|
-
if (path.endsWith("
|
|
3664
|
+
if (path.endsWith("c" /* Shortcuts.Childnodes */)) {
|
|
3642
3665
|
resetPaths.add(path);
|
|
3643
3666
|
}
|
|
3644
3667
|
data[path] = value;
|
|
@@ -3712,7 +3735,7 @@ class TaroRootElement extends TaroElement {
|
|
|
3712
3735
|
}
|
|
3713
3736
|
ctx.setData(normalUpdate, cb);
|
|
3714
3737
|
}
|
|
3715
|
-
}
|
|
3738
|
+
});
|
|
3716
3739
|
}
|
|
3717
3740
|
enqueueUpdateCallback(cb, ctx) {
|
|
3718
3741
|
this.updateCallbacks.push(() => {
|
|
@@ -4213,7 +4236,7 @@ function createRecursiveComponentConfig(componentName) {
|
|
|
4213
4236
|
? {
|
|
4214
4237
|
[ATTACHED]() {
|
|
4215
4238
|
var _a, _b;
|
|
4216
|
-
const componentId = ((_a = this.data.i) === null || _a === void 0 ? void 0 : _a.
|
|
4239
|
+
const componentId = ((_a = this.data.i) === null || _a === void 0 ? void 0 : _a["s" /* Shortcuts.Sid */]) || ((_b = this.props.i) === null || _b === void 0 ? void 0 : _b["s" /* Shortcuts.Sid */]);
|
|
4217
4240
|
if (shared.isString(componentId)) {
|
|
4218
4241
|
customWrapperCache.set(componentId, this);
|
|
4219
4242
|
const el = env.document.getElementById(componentId);
|
|
@@ -4224,7 +4247,7 @@ function createRecursiveComponentConfig(componentName) {
|
|
|
4224
4247
|
},
|
|
4225
4248
|
[DETACHED]() {
|
|
4226
4249
|
var _a, _b;
|
|
4227
|
-
const componentId = ((_a = this.data.i) === null || _a === void 0 ? void 0 : _a.
|
|
4250
|
+
const componentId = ((_a = this.data.i) === null || _a === void 0 ? void 0 : _a["s" /* Shortcuts.Sid */]) || ((_b = this.props.i) === null || _b === void 0 ? void 0 : _b["s" /* Shortcuts.Sid */]);
|
|
4228
4251
|
if (shared.isString(componentId)) {
|
|
4229
4252
|
customWrapperCache.delete(componentId);
|
|
4230
4253
|
const el = env.document.getElementById(componentId);
|
|
@@ -4239,7 +4262,7 @@ function createRecursiveComponentConfig(componentName) {
|
|
|
4239
4262
|
i: {
|
|
4240
4263
|
type: Object,
|
|
4241
4264
|
value: {
|
|
4242
|
-
["
|
|
4265
|
+
["n" /* Shortcuts.NodeName */]: shared.getComponentsAlias(shared.internalComponents)[VIEW]._num
|
|
4243
4266
|
}
|
|
4244
4267
|
},
|
|
4245
4268
|
l: {
|
|
@@ -5082,6 +5105,7 @@ exports.CATCHMOVE = CATCHMOVE;
|
|
|
5082
5105
|
exports.CATCH_VIEW = CATCH_VIEW;
|
|
5083
5106
|
exports.CHANGE = CHANGE;
|
|
5084
5107
|
exports.CLASS = CLASS;
|
|
5108
|
+
exports.CLICK_VIEW = CLICK_VIEW;
|
|
5085
5109
|
exports.COMMENT = COMMENT;
|
|
5086
5110
|
exports.COMPILE_MODE = COMPILE_MODE;
|
|
5087
5111
|
exports.CONFIRM = CONFIRM;
|