@viewfly/core 1.0.0-alpha.1 → 1.0.0-alpha.11

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.
@@ -161,6 +161,40 @@ var InjectFlags;
161
161
  class Injector {
162
162
  }
163
163
 
164
+ /**
165
+ * 构造函数参数装饰器,用于改变注入 token
166
+ */
167
+ const Inject = function InjectDecorator(token) {
168
+ if (this instanceof Inject) {
169
+ this.token = token;
170
+ }
171
+ else {
172
+ return makeParamDecorator(Inject, new Inject(token));
173
+ }
174
+ };
175
+ const Self = function SelfDecorator() {
176
+ if (!(this instanceof Self)) {
177
+ return makeParamDecorator(Self, new Self());
178
+ }
179
+ };
180
+ const SkipSelf = function SkipSelfDecorator() {
181
+ if (!(this instanceof SkipSelf)) {
182
+ return makeParamDecorator(SkipSelf, new SkipSelf());
183
+ }
184
+ };
185
+ const Optional = function OptionalDecorator() {
186
+ if (!(this instanceof Optional)) {
187
+ return makeParamDecorator(Optional, new Optional());
188
+ }
189
+ };
190
+ const Prop = function PropDecorator(token, notFoundValue, flags) {
191
+ if (!(this instanceof Prop)) {
192
+ return makePropertyDecorator(Prop, token, function (instance, propertyName, token, injector) {
193
+ instance[propertyName] = injector.get(token instanceof ForwardRef ? token.getRef() : token, notFoundValue, flags);
194
+ });
195
+ }
196
+ };
197
+
164
198
  function stringify(token) {
165
199
  if (typeof token === 'string') {
166
200
  return token;
@@ -205,7 +239,8 @@ class NullInjector extends Injector {
205
239
  super(...arguments);
206
240
  this.parentInjector = null;
207
241
  }
208
- get(token, flag, notFoundValue = THROW_IF_NOT_FOUND) {
242
+ /* eslint-disable-next-line */
243
+ get(token, notFoundValue = THROW_IF_NOT_FOUND, _) {
209
244
  if (notFoundValue === THROW_IF_NOT_FOUND) {
210
245
  throw nullInjectorErrorFn(token);
211
246
  }
@@ -213,40 +248,6 @@ class NullInjector extends Injector {
213
248
  }
214
249
  }
215
250
 
216
- /**
217
- * 构造函数参数装饰器,用于改变注入 token
218
- */
219
- const Inject = function InjectDecorator(token) {
220
- if (this instanceof Inject) {
221
- this.token = token;
222
- }
223
- else {
224
- return makeParamDecorator(Inject, new Inject(token));
225
- }
226
- };
227
- const Self = function SelfDecorator() {
228
- if (!(this instanceof Self)) {
229
- return makeParamDecorator(Self, new Self());
230
- }
231
- };
232
- const SkipSelf = function SkipSelfDecorator() {
233
- if (!(this instanceof SkipSelf)) {
234
- return makeParamDecorator(SkipSelf, new SkipSelf());
235
- }
236
- };
237
- const Optional = function OptionalDecorator() {
238
- if (!(this instanceof Optional)) {
239
- return makeParamDecorator(Optional, new Optional());
240
- }
241
- };
242
- const Prop = function PropDecorator(token, flags, notFoundValue = THROW_IF_NOT_FOUND) {
243
- if (!(this instanceof Prop)) {
244
- return makePropertyDecorator(Prop, token, function (instance, propertyName, token, injector) {
245
- instance[propertyName] = injector.get(token instanceof ForwardRef ? token.getRef() : token, flags, notFoundValue);
246
- });
247
- }
248
- };
249
-
250
251
  /**
251
252
  * 标准化 provide,并返回统一数据结构
252
253
  * @param provider
@@ -424,15 +425,15 @@ class ReflectiveInjector extends Injector {
424
425
  /**
425
426
  * 用于获取当前注入器上下文内的实例、对象或数据
426
427
  * @param token 访问 token
427
- * @param flags 查询规则
428
428
  * @param notFoundValue 如未查找到的返回值
429
+ * @param flags 查询规则
429
430
  */
430
- get(token, flags = InjectFlags.Default, notFoundValue = THROW_IF_NOT_FOUND) {
431
+ get(token, notFoundValue = THROW_IF_NOT_FOUND, flags) {
431
432
  var _a;
432
433
  flags = flags || InjectFlags.Default;
433
434
  if (flags === InjectFlags.SkipSelf) {
434
435
  if (this.parentInjector) {
435
- return this.parentInjector.get(token, InjectFlags.Default, notFoundValue);
436
+ return this.parentInjector.get(token, notFoundValue);
436
437
  }
437
438
  if (notFoundValue !== THROW_IF_NOT_FOUND) {
438
439
  return notFoundValue;
@@ -476,9 +477,12 @@ class ReflectiveInjector extends Injector {
476
477
  return notFoundValue;
477
478
  }
478
479
  if (this.parentInjector) {
479
- return this.parentInjector.get(token, flags === InjectFlags.Optional ? InjectFlags.Optional : InjectFlags.Default, notFoundValue);
480
+ return this.parentInjector.get(token, notFoundValue, flags === InjectFlags.Optional ? InjectFlags.Optional : InjectFlags.Default);
480
481
  }
481
482
  if (notFoundValue === THROW_IF_NOT_FOUND) {
483
+ // if (flags === InjectFlags.Optional) {
484
+ // return null as U
485
+ // }
482
486
  throw reflectiveInjectorErrorFn(token);
483
487
  }
484
488
  return notFoundValue;
@@ -508,11 +512,11 @@ class ReflectiveInjector extends Injector {
508
512
  const tryValue = {};
509
513
  const injectToken = dep.injectKey instanceof ForwardRef ? dep.injectKey.getRef() : dep.injectKey;
510
514
  if (dep.visibility instanceof Self) {
511
- reflectiveValue = this.get(injectToken, InjectFlags.Self, tryValue);
515
+ reflectiveValue = this.get(injectToken, tryValue, InjectFlags.Self);
512
516
  }
513
517
  else if (dep.visibility instanceof SkipSelf) {
514
518
  if (this.parentInjector) {
515
- reflectiveValue = this.parentInjector.get(injectToken, InjectFlags.Default, tryValue);
519
+ reflectiveValue = this.parentInjector.get(injectToken, tryValue);
516
520
  }
517
521
  else {
518
522
  if (dep.optional) {
@@ -525,7 +529,7 @@ class ReflectiveInjector extends Injector {
525
529
  }
526
530
  }
527
531
  else {
528
- reflectiveValue = this.get(injectToken, InjectFlags.Default, tryValue);
532
+ reflectiveValue = this.get(injectToken, tryValue);
529
533
  }
530
534
  if (reflectiveValue === tryValue) {
531
535
  if (dep.optional) {
@@ -587,13 +591,13 @@ function getArrayChanges(left, right) {
587
591
  return changes;
588
592
  }
589
593
  function classToString(config) {
590
- if (!config) {
591
- return '';
592
- }
593
594
  if (typeof config === 'string') {
594
595
  return config;
595
596
  }
596
- else if (Array.isArray(config)) {
597
+ if (!config) {
598
+ return '';
599
+ }
600
+ if (Array.isArray(config)) {
597
601
  const classes = [];
598
602
  for (const i of config) {
599
603
  const v = classToString(i);
@@ -603,7 +607,7 @@ function classToString(config) {
603
607
  }
604
608
  return classes.join(' ');
605
609
  }
606
- else if (typeof config === 'object') {
610
+ if (typeof config === 'object') {
607
611
  if (config.toString !== Object.prototype.toString && !config.toString.toString().includes('[native code]')) {
608
612
  return config.toString();
609
613
  }
@@ -737,30 +741,32 @@ class Component extends ReflectiveInjector {
737
741
  };
738
742
  }
739
743
  update(newProps, forceUpdate = false) {
740
- const oldProps = this.props;
741
- const { add, remove, replace } = getObjectChanges(newProps, this.props);
742
- if (add.length || remove.length || replace.length) {
743
- this.invokePropsChangedHooks(newProps);
744
- }
745
- else if (!this.dirty) {
746
- return this.template;
747
- }
748
- const newRefs = toRefs(newProps.ref);
749
- if (this.refs) {
750
- for (const oldRef of this.refs) {
751
- if (!newRefs.includes(oldRef)) {
752
- oldRef.unBind(this.instance);
744
+ if (!forceUpdate) {
745
+ const { add, remove, replace } = getObjectChanges(newProps, this.props);
746
+ if (add.length || remove.length || replace.length) {
747
+ this.invokePropsChangedHooks(newProps);
748
+ }
749
+ else if (!this.dirty) {
750
+ this.props = newProps;
751
+ return this.template;
752
+ }
753
+ const newRefs = toRefs(newProps.ref);
754
+ if (this.refs) {
755
+ for (const oldRef of this.refs) {
756
+ if (!newRefs.includes(oldRef)) {
757
+ oldRef.unBind(this.instance);
758
+ }
753
759
  }
754
760
  }
761
+ for (const newRef of newRefs) {
762
+ newRef.bind(this.instance);
763
+ }
764
+ if (newRefs.length) {
765
+ this.refs = newRefs;
766
+ }
755
767
  }
756
- for (const newRef of newRefs) {
757
- newRef.bind(this.instance);
758
- }
759
- if (newRefs.length) {
760
- this.refs = newRefs;
761
- }
762
- if (!forceUpdate && typeof this.instance.$useMemo === 'function') {
763
- if (this.instance.$useMemo(newProps, oldProps)) {
768
+ if (typeof this.instance.$useMemo === 'function') {
769
+ if (this.instance.$useMemo(newProps, this.props)) {
764
770
  return this.template;
765
771
  }
766
772
  }
@@ -843,7 +849,12 @@ class Component extends ReflectiveInjector {
843
849
  }
844
850
  }
845
851
  if (unmountedCallbacks.length) {
846
- this.unmountedCallbacks = unmountedCallbacks;
852
+ if (this.unmountedCallbacks) {
853
+ this.unmountedCallbacks.push(...unmountedCallbacks);
854
+ }
855
+ else {
856
+ this.unmountedCallbacks = unmountedCallbacks;
857
+ }
847
858
  }
848
859
  this.mountCallbacks = null;
849
860
  }
@@ -1232,9 +1243,9 @@ function withAnnotation(annotation, componentSetup) {
1232
1243
  /**
1233
1244
  * 通过组件上下文获取 IoC 容器内数据的勾子方法
1234
1245
  */
1235
- function inject(token, flags = InjectFlags.Default, notFoundValue = THROW_IF_NOT_FOUND) {
1246
+ function inject(token, notFoundValue = THROW_IF_NOT_FOUND, flags) {
1236
1247
  const component = getSetupContext();
1237
- return component.get(token, flags, notFoundValue);
1248
+ return component.get(token, notFoundValue, flags);
1238
1249
  }
1239
1250
  /**
1240
1251
  * 获取当前组件实例
@@ -1272,6 +1283,7 @@ function withMemo(canUseMemo, render) {
1272
1283
  };
1273
1284
  }
1274
1285
 
1286
+ const componentViewCache = new WeakMap();
1275
1287
  const listenerReg = /^on(?=[A-Z])/;
1276
1288
  function createRenderer(component, nativeRenderer) {
1277
1289
  let isInit = true;
@@ -1280,6 +1292,7 @@ function createRenderer(component, nativeRenderer) {
1280
1292
  isInit = false;
1281
1293
  const atom = {
1282
1294
  type: 'component',
1295
+ index: 0,
1283
1296
  jsxNode: component,
1284
1297
  sibling: null,
1285
1298
  child: null,
@@ -1349,7 +1362,7 @@ function updateView(nativeRenderer, component) {
1349
1362
  }
1350
1363
  }
1351
1364
  function applyChanges(nativeRenderer, component) {
1352
- const { atom, host, isParent, rootHost } = component.$$view;
1365
+ const { atom, host, isParent, rootHost } = componentViewCache.get(component);
1353
1366
  const diffAtom = atom.child;
1354
1367
  const template = component.update(component.props, true);
1355
1368
  atom.child = createChildChain(template, atom.isSvg);
@@ -1358,58 +1371,35 @@ function applyChanges(nativeRenderer, component) {
1358
1371
  isParent,
1359
1372
  rootHost
1360
1373
  };
1361
- diff(nativeRenderer, component, atom.child, diffAtom, context, 0, 0);
1374
+ diff(nativeRenderer, component, atom.child, diffAtom, context);
1362
1375
  const next = atom.sibling;
1363
1376
  if (next && next.jsxNode instanceof Component) {
1364
- next.jsxNode.$$view.host = context.host;
1365
- next.jsxNode.$$view.isParent = context.isParent;
1366
- }
1367
- }
1368
- function diff(nativeRenderer, parentComponent, newAtom, oldAtom, context, expectIndex, index) {
1369
- let prevDiffAtom = null;
1370
- let firstDiffAtomIndexed = null;
1371
- if (oldAtom) {
1372
- prevDiffAtom = {
1373
- index,
1374
- atom: oldAtom,
1375
- prev: null
1376
- };
1377
- index++;
1378
- firstDiffAtomIndexed = prevDiffAtom;
1379
- oldAtom = oldAtom.sibling;
1380
- while (oldAtom) {
1381
- const diffAtom = {
1382
- index,
1383
- atom: oldAtom,
1384
- prev: prevDiffAtom
1385
- };
1386
- prevDiffAtom.next = diffAtom;
1387
- prevDiffAtom = diffAtom;
1388
- oldAtom = oldAtom.sibling;
1389
- index++;
1390
- }
1377
+ const view = componentViewCache.get(next.jsxNode);
1378
+ view.host = context.host;
1379
+ view.isParent = context.isParent;
1391
1380
  }
1381
+ }
1382
+ function diff(nativeRenderer, parentComponent, newAtom, oldAtom, context) {
1392
1383
  const commits = [];
1393
1384
  function changeOffset() {
1394
1385
  offset++;
1395
1386
  }
1396
1387
  while (newAtom) {
1397
- firstDiffAtomIndexed = createChanges(newAtom, expectIndex, firstDiffAtomIndexed, nativeRenderer, commits, context, parentComponent, changeOffset);
1388
+ oldAtom = createChanges(newAtom, oldAtom, nativeRenderer, commits, context, parentComponent, changeOffset);
1398
1389
  newAtom = newAtom.sibling;
1399
- expectIndex++;
1400
1390
  }
1401
- let dirtyDiffAtom = firstDiffAtomIndexed;
1391
+ let dirtyDiffAtom = oldAtom;
1402
1392
  while (dirtyDiffAtom) {
1403
- cleanView(nativeRenderer, dirtyDiffAtom.atom, false);
1404
- dirtyDiffAtom = dirtyDiffAtom.next;
1393
+ cleanView(nativeRenderer, dirtyDiffAtom, true);
1394
+ dirtyDiffAtom = dirtyDiffAtom.sibling;
1405
1395
  }
1406
1396
  let offset = 0;
1407
1397
  for (let i = 0; i < commits.length; i++) {
1408
1398
  const commit = commits[i];
1409
- while (firstDiffAtomIndexed) {
1410
- if (firstDiffAtomIndexed.index <= i) {
1399
+ while (oldAtom) {
1400
+ if (oldAtom.index <= i) {
1411
1401
  offset--;
1412
- firstDiffAtomIndexed = firstDiffAtomIndexed.next;
1402
+ oldAtom = oldAtom.sibling;
1413
1403
  continue;
1414
1404
  }
1415
1405
  break;
@@ -1417,47 +1407,42 @@ function diff(nativeRenderer, parentComponent, newAtom, oldAtom, context, expect
1417
1407
  commit(offset);
1418
1408
  }
1419
1409
  }
1420
- function createChanges(newAtom, expectIndex, diffAtomIndexed, nativeRenderer, commits, context, parentComponent, effect) {
1421
- const startDiffAtom = diffAtomIndexed;
1410
+ function createChanges(newAtom, oldAtom, nativeRenderer, commits, context, parentComponent, effect) {
1411
+ const startDiffAtom = oldAtom;
1422
1412
  const { jsxNode: newJsxNode, type } = newAtom;
1423
1413
  const key = newJsxNode.key;
1424
- while (diffAtomIndexed) {
1425
- const { atom: diffAtom, index: diffIndex } = diffAtomIndexed;
1426
- if (type === diffAtom.type) {
1414
+ let prev = null;
1415
+ while (oldAtom) {
1416
+ const diffIndex = oldAtom.index;
1417
+ if (type === oldAtom.type) {
1427
1418
  let commit;
1428
1419
  if (type === 'text') {
1429
- commit = updateText(newAtom, diffAtom, nativeRenderer, context);
1420
+ commit = updateText(newAtom, oldAtom, nativeRenderer, context);
1430
1421
  }
1431
1422
  else {
1432
- const { key: diffKey, type: diffType } = diffAtom.jsxNode;
1423
+ const { key: diffKey, type: diffType } = oldAtom.jsxNode;
1433
1424
  if (diffKey !== key || newJsxNode.type !== diffType) {
1434
- diffAtomIndexed = diffAtomIndexed.next;
1425
+ prev = oldAtom;
1426
+ oldAtom = oldAtom.sibling;
1435
1427
  continue;
1436
1428
  }
1437
1429
  if (type === 'component') {
1438
- commit = updateComponent(newAtom, diffAtom, expectIndex, diffIndex, nativeRenderer, context);
1430
+ commit = updateComponent(newAtom, oldAtom, newAtom.index, diffIndex, nativeRenderer, context);
1439
1431
  }
1440
1432
  else {
1441
- commit = updateElement(newAtom, diffAtom, expectIndex, diffIndex, nativeRenderer, context, parentComponent);
1433
+ commit = updateElement(newAtom, oldAtom, newAtom.index, diffIndex, nativeRenderer, context, parentComponent);
1442
1434
  }
1443
1435
  }
1444
1436
  commits.push(commit);
1445
- const next = diffAtomIndexed.next;
1446
- const prev = diffAtomIndexed.prev;
1437
+ const next = oldAtom.sibling;
1447
1438
  if (!prev) {
1448
- diffAtomIndexed = next;
1449
- if (diffAtomIndexed) {
1450
- diffAtomIndexed.prev = null;
1451
- }
1452
- return diffAtomIndexed;
1453
- }
1454
- prev.next = next;
1455
- if (next) {
1456
- next.prev = prev;
1439
+ return next;
1457
1440
  }
1441
+ prev.sibling = next;
1458
1442
  return startDiffAtom;
1459
1443
  }
1460
- diffAtomIndexed = diffAtomIndexed.next;
1444
+ prev = oldAtom;
1445
+ oldAtom = oldAtom.sibling;
1461
1446
  }
1462
1447
  commits.push(createNewView(newAtom, nativeRenderer, context, parentComponent, effect));
1463
1448
  return startDiffAtom;
@@ -1493,13 +1478,13 @@ function updateElement(newAtom, oldAtom, expectIndex, oldIndex, nativeRenderer,
1493
1478
  host: newAtom.nativeNode,
1494
1479
  isParent: true,
1495
1480
  rootHost: context.rootHost
1496
- }, 0, 0);
1481
+ });
1497
1482
  }
1498
1483
  else if (oldAtom.child) {
1499
1484
  let atom = oldAtom.child;
1500
1485
  nativeRenderer.cleanChildren(oldAtom.nativeNode, oldAtom.isSvg);
1501
1486
  while (atom) {
1502
- cleanView(nativeRenderer, atom, true);
1487
+ cleanView(nativeRenderer, atom, false);
1503
1488
  atom = atom.sibling;
1504
1489
  }
1505
1490
  }
@@ -1514,7 +1499,7 @@ function updateComponent(newAtom, reusedAtom, expectIndex, oldIndex, nativeRende
1514
1499
  const newTemplate = component.update(newProps);
1515
1500
  const portalHost = component.instance.$portalHost;
1516
1501
  context = portalHost ? { isParent: true, host: portalHost, rootHost: portalHost } : context;
1517
- component.$$view = Object.assign({ atom: newAtom }, context);
1502
+ componentViewCache.set(component, Object.assign({ atom: newAtom }, context));
1518
1503
  newAtom.jsxNode = component;
1519
1504
  if (newTemplate === oldTemplate) {
1520
1505
  reuseComponentView(nativeRenderer, newAtom, reusedAtom, context, expectIndex - offset !== oldIndex);
@@ -1525,12 +1510,12 @@ function updateComponent(newAtom, reusedAtom, expectIndex, oldIndex, nativeRende
1525
1510
  newAtom.child = createChildChain(newTemplate, newAtom.isSvg);
1526
1511
  }
1527
1512
  if (newAtom.child) {
1528
- diff(nativeRenderer, component, newAtom.child, reusedAtom.child, context, expectIndex, oldIndex + offset);
1513
+ diff(nativeRenderer, component, newAtom.child, reusedAtom.child, context);
1529
1514
  }
1530
1515
  else if (reusedAtom.child) {
1531
1516
  let atom = reusedAtom.child;
1532
1517
  while (atom) {
1533
- cleanView(nativeRenderer, atom, false);
1518
+ cleanView(nativeRenderer, atom, true);
1534
1519
  atom = atom.sibling;
1535
1520
  }
1536
1521
  }
@@ -1563,9 +1548,9 @@ function reuseComponentView(nativeRenderer, newAtom, reusedAtom, context, moveVi
1563
1548
  }
1564
1549
  function cleanView(nativeRenderer, atom, needClean) {
1565
1550
  if (atom.nativeNode) {
1566
- if (!needClean) {
1551
+ if (needClean) {
1567
1552
  nativeRenderer.remove(atom.nativeNode, atom.isSvg);
1568
- needClean = true;
1553
+ needClean = false;
1569
1554
  }
1570
1555
  if (atom.type === 'element') {
1571
1556
  const ref = atom.jsxNode.props[refKey];
@@ -1575,7 +1560,7 @@ function cleanView(nativeRenderer, atom, needClean) {
1575
1560
  let child = atom.child;
1576
1561
  while (child) {
1577
1562
  if (child.jsxNode instanceof Component && child.jsxNode.instance.$portalHost) {
1578
- needClean = false;
1563
+ needClean = true;
1579
1564
  }
1580
1565
  cleanView(nativeRenderer, child, needClean);
1581
1566
  child = child.sibling;
@@ -1588,7 +1573,7 @@ function componentRender(nativeRenderer, component, from, context) {
1588
1573
  const { template, portalHost } = component.render();
1589
1574
  from.child = createChildChain(template, from.isSvg);
1590
1575
  context = portalHost ? { isParent: true, host: portalHost, rootHost: portalHost } : context;
1591
- component.$$view = Object.assign({ atom: from }, context);
1576
+ componentViewCache.set(component, Object.assign({ atom: from }, context));
1592
1577
  let child = from.child;
1593
1578
  while (child) {
1594
1579
  buildView(nativeRenderer, component, child, context);
@@ -1599,6 +1584,7 @@ function componentRender(nativeRenderer, component, from, context) {
1599
1584
  function createChainByJSXComponent(jsxNode, prevAtom, isSvg) {
1600
1585
  const atom = {
1601
1586
  type: 'component',
1587
+ index: prevAtom.index + 1,
1602
1588
  jsxNode,
1603
1589
  sibling: null,
1604
1590
  child: null,
@@ -1611,6 +1597,7 @@ function createChainByJSXComponent(jsxNode, prevAtom, isSvg) {
1611
1597
  function createChainByJSXText(jsxNode, prevAtom, isSvg) {
1612
1598
  const atom = {
1613
1599
  type: 'text',
1600
+ index: prevAtom.index + 1,
1614
1601
  jsxNode,
1615
1602
  sibling: null,
1616
1603
  child: null,
@@ -1624,6 +1611,7 @@ function createChainByJSXElement(element, prevAtom, isSvg) {
1624
1611
  isSvg = isSvg || element.type === 'svg';
1625
1612
  const atom = {
1626
1613
  type: 'element',
1614
+ index: prevAtom.index + 1,
1627
1615
  jsxNode: element,
1628
1616
  sibling: null,
1629
1617
  child: null,
@@ -1663,7 +1651,7 @@ function createChainByChildren(children, prevAtom, isSvg) {
1663
1651
  return prevAtom;
1664
1652
  }
1665
1653
  function createChildChain(template, isSvg) {
1666
- const beforeAtom = { sibling: null };
1654
+ const beforeAtom = { sibling: null, index: -1 };
1667
1655
  createChainByNode(template, beforeAtom, isSvg);
1668
1656
  return beforeAtom.sibling;
1669
1657
  }
@@ -1726,6 +1714,11 @@ function createTextNode(nativeRenderer, text, isSvg) {
1726
1714
  return nativeRenderer.createTextNode(text, isSvg);
1727
1715
  }
1728
1716
  function updateNativeNodeProperties(nativeRenderer, newVNode, oldVNode, nativeNode, isSvg) {
1717
+ if (newVNode === oldVNode) {
1718
+ return () => {
1719
+ //
1720
+ };
1721
+ }
1729
1722
  const changes = getObjectChanges(newVNode.props, oldVNode.props);
1730
1723
  let unBindRefs;
1731
1724
  let bindRefs;
@@ -1884,7 +1877,7 @@ function viewfly(config) {
1884
1877
  return destroyed ? null : root;
1885
1878
  };
1886
1879
  }), function () {
1887
- if (destroyed) {
1880
+ if (destroyed || !autoUpdate) {
1888
1881
  return;
1889
1882
  }
1890
1883
  nextTick(() => {