ember-source 5.9.0-alpha.1 → 5.9.0-alpha.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "5.9.0-alpha.1",
2
+ "version": "5.9.0-alpha.2",
3
3
  "buildType": "tag",
4
- "SHA": "71643ac46b9d257062adac5d2478af490d5d2d68",
5
- "assetPath": "/tag/shas/71643ac46b9d257062adac5d2478af490d5d2d68.tgz"
4
+ "SHA": "463a0671f788000883136c32402eaee2af831d12",
5
+ "assetPath": "/tag/shas/463a0671f788000883136c32402eaee2af831d12.tgz"
6
6
  }
@@ -501,18 +501,23 @@ function prepareResult(obj) {
501
501
  }
502
502
 
503
503
  let ROUTE_INFOS = new WeakMap();
504
- function toReadOnlyRouteInfo(routeInfos, queryParams = {}, includeAttributes = false) {
504
+ function toReadOnlyRouteInfo(routeInfos, queryParams = {}, options = { includeAttributes: false, localizeMapUpdates: false }) {
505
+ const LOCAL_ROUTE_INFOS = new WeakMap();
505
506
  return routeInfos.map((info, i) => {
506
507
  let { name, params, paramNames, context, route } = info;
507
508
  // SAFETY: This should be safe since it is just for use as a key
508
509
  let key = info;
509
- if (ROUTE_INFOS.has(key) && includeAttributes) {
510
+ if (ROUTE_INFOS.has(key) && options.includeAttributes) {
510
511
  let routeInfo = ROUTE_INFOS.get(key);
511
512
  routeInfo = attachMetadata(route, routeInfo);
512
513
  let routeInfoWithAttribute = createRouteInfoWithAttributes(routeInfo, context);
513
- ROUTE_INFOS.set(key, routeInfoWithAttribute);
514
+ LOCAL_ROUTE_INFOS.set(key, routeInfo);
515
+ if (!options.localizeMapUpdates) {
516
+ ROUTE_INFOS.set(key, routeInfoWithAttribute);
517
+ }
514
518
  return routeInfoWithAttribute;
515
519
  }
520
+ const routeInfosRef = options.localizeMapUpdates ? LOCAL_ROUTE_INFOS : ROUTE_INFOS;
516
521
  let routeInfo = {
517
522
  find(predicate, thisArg) {
518
523
  let publicInfo;
@@ -520,11 +525,11 @@ function toReadOnlyRouteInfo(routeInfos, queryParams = {}, includeAttributes = f
520
525
  if (predicate.length === 3) {
521
526
  arr = routeInfos.map(
522
527
  // SAFETY: This should be safe since it is just for use as a key
523
- (info) => ROUTE_INFOS.get(info));
528
+ (info) => routeInfosRef.get(info));
524
529
  }
525
530
  for (let i = 0; routeInfos.length > i; i++) {
526
531
  // SAFETY: This should be safe since it is just for use as a key
527
- publicInfo = ROUTE_INFOS.get(routeInfos[i]);
532
+ publicInfo = routeInfosRef.get(routeInfos[i]);
528
533
  if (predicate.call(thisArg, publicInfo, i, arr)) {
529
534
  return publicInfo;
530
535
  }
@@ -546,7 +551,7 @@ function toReadOnlyRouteInfo(routeInfos, queryParams = {}, includeAttributes = f
546
551
  return null;
547
552
  }
548
553
  // SAFETY: This should be safe since it is just for use as a key
549
- return ROUTE_INFOS.get(parent);
554
+ return routeInfosRef.get(parent);
550
555
  },
551
556
  get child() {
552
557
  let child = routeInfos[i + 1];
@@ -554,7 +559,7 @@ function toReadOnlyRouteInfo(routeInfos, queryParams = {}, includeAttributes = f
554
559
  return null;
555
560
  }
556
561
  // SAFETY: This should be safe since it is just for use as a key
557
- return ROUTE_INFOS.get(child);
562
+ return routeInfosRef.get(child);
558
563
  },
559
564
  get localName() {
560
565
  let parts = this.name.split('.');
@@ -567,11 +572,15 @@ function toReadOnlyRouteInfo(routeInfos, queryParams = {}, includeAttributes = f
567
572
  return queryParams;
568
573
  },
569
574
  };
570
- if (includeAttributes) {
575
+ if (options.includeAttributes) {
571
576
  routeInfo = createRouteInfoWithAttributes(routeInfo, context);
572
577
  }
573
578
  // SAFETY: This should be safe since it is just for use as a key
574
- ROUTE_INFOS.set(info, routeInfo);
579
+ LOCAL_ROUTE_INFOS.set(info, routeInfo);
580
+ if (!options.localizeMapUpdates) {
581
+ // SAFETY: This should be safe since it is just for use as a key
582
+ ROUTE_INFOS.set(info, routeInfo);
583
+ }
575
584
  return routeInfo;
576
585
  });
577
586
  }
@@ -1299,7 +1308,10 @@ class Router {
1299
1308
  if (newState === null) {
1300
1309
  return newState;
1301
1310
  }
1302
- let readonlyInfos = toReadOnlyRouteInfo(newState.routeInfos, newState.queryParams);
1311
+ let readonlyInfos = toReadOnlyRouteInfo(newState.routeInfos, newState.queryParams, {
1312
+ includeAttributes: false,
1313
+ localizeMapUpdates: true,
1314
+ });
1303
1315
  return readonlyInfos[readonlyInfos.length - 1];
1304
1316
  }
1305
1317
  recognizeAndLoad(url) {
@@ -1310,7 +1322,10 @@ class Router {
1310
1322
  }
1311
1323
  let newTransition = new Transition(this, intent, newState, undefined);
1312
1324
  return newTransition.then(() => {
1313
- let routeInfosWithAttributes = toReadOnlyRouteInfo(newState.routeInfos, newTransition[QUERY_PARAMS_SYMBOL], true);
1325
+ let routeInfosWithAttributes = toReadOnlyRouteInfo(newState.routeInfos, newTransition[QUERY_PARAMS_SYMBOL], {
1326
+ includeAttributes: true,
1327
+ localizeMapUpdates: false,
1328
+ });
1314
1329
  return routeInfosWithAttributes[routeInfosWithAttributes.length - 1];
1315
1330
  });
1316
1331
  }
@@ -1756,13 +1771,16 @@ class Router {
1756
1771
  }
1757
1772
  fromInfos(newTransition, oldRouteInfos) {
1758
1773
  if (newTransition !== undefined && oldRouteInfos.length > 0) {
1759
- let fromInfos = toReadOnlyRouteInfo(oldRouteInfos, Object.assign({}, this._lastQueryParams), true);
1774
+ let fromInfos = toReadOnlyRouteInfo(oldRouteInfos, Object.assign({}, this._lastQueryParams), {
1775
+ includeAttributes: true,
1776
+ localizeMapUpdates: false,
1777
+ });
1760
1778
  newTransition.from = fromInfos[fromInfos.length - 1] || null;
1761
1779
  }
1762
1780
  }
1763
1781
  toInfos(newTransition, newRouteInfos, includeAttributes = false) {
1764
1782
  if (newTransition !== undefined && newRouteInfos.length > 0) {
1765
- let toInfos = toReadOnlyRouteInfo(newRouteInfos, Object.assign({}, newTransition[QUERY_PARAMS_SYMBOL]), includeAttributes);
1783
+ let toInfos = toReadOnlyRouteInfo(newRouteInfos, Object.assign({}, newTransition[QUERY_PARAMS_SYMBOL]), { includeAttributes, localizeMapUpdates: false });
1766
1784
  newTransition.to = toInfos[toInfos.length - 1] || null;
1767
1785
  }
1768
1786
  }
@@ -6,7 +6,7 @@
6
6
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
7
7
  * @license Licensed under MIT license
8
8
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
9
- * @version 5.9.0-alpha.1
9
+ * @version 5.9.0-alpha.2
10
10
  */
11
11
 
12
12
  /* eslint-disable no-var */
@@ -16577,7 +16577,7 @@ define("ember/version", ["exports"], function (_exports) {
16577
16577
  value: true
16578
16578
  });
16579
16579
  _exports.default = void 0;
16580
- var _default = _exports.default = "5.9.0-alpha.1";
16580
+ var _default = _exports.default = "5.9.0-alpha.2";
16581
16581
  });
16582
16582
  define("simple-html-tokenizer", ["exports"], function (_exports) {
16583
16583
  "use strict";