ember-source 5.6.0-alpha.2 → 5.6.0-alpha.4

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.
Files changed (55) hide show
  1. package/build-metadata.json +3 -3
  2. package/dist/dependencies/@glimmer/debug.js +1533 -0
  3. package/dist/dependencies/@glimmer/destroyable.js +30 -59
  4. package/dist/dependencies/@glimmer/encoder.js +13 -24
  5. package/dist/dependencies/@glimmer/global-context.js +38 -41
  6. package/dist/dependencies/@glimmer/manager.js +144 -326
  7. package/dist/dependencies/@glimmer/node.js +14 -46
  8. package/dist/dependencies/@glimmer/opcode-compiler.js +1673 -2478
  9. package/dist/dependencies/@glimmer/owner.js +2 -5
  10. package/dist/dependencies/@glimmer/program.js +102 -185
  11. package/dist/dependencies/@glimmer/reference.js +58 -126
  12. package/dist/dependencies/@glimmer/runtime.js +4674 -5639
  13. package/dist/dependencies/@glimmer/util.js +340 -326
  14. package/dist/dependencies/@glimmer/validator.js +160 -217
  15. package/dist/dependencies/@glimmer/vm.js +174 -23
  16. package/dist/dependencies/@glimmer/wire-format.js +91 -34
  17. package/dist/dependencies/@simple-dom/document.js +1 -1
  18. package/dist/dependencies/backburner.js.js +1 -1
  19. package/dist/dependencies/router_js.js +15 -16
  20. package/dist/dependencies/rsvp.js +89 -88
  21. package/dist/ember-template-compiler.js +8574 -8350
  22. package/dist/ember-template-compiler.map +1 -1
  23. package/dist/ember-testing.js +107 -107
  24. package/dist/ember-testing.map +1 -1
  25. package/dist/ember.debug.js +11216 -9634
  26. package/dist/ember.debug.map +1 -1
  27. package/dist/header/license.js +1 -1
  28. package/dist/packages/@ember/-internals/glimmer/index.js +109 -80
  29. package/dist/packages/@ember/-internals/metal/index.js +5 -4
  30. package/dist/packages/@ember/-internals/utils/index.js +3 -4
  31. package/dist/packages/@ember/array/-internals.js +1 -2
  32. package/dist/packages/@ember/debug/lib/inspect.js +0 -1
  33. package/dist/packages/@ember/object/core.js +0 -1
  34. package/dist/packages/@ember/object/mixin.js +1 -2
  35. package/dist/packages/@ember/routing/route.js +23 -101
  36. package/dist/packages/@ember/routing/router.js +25 -84
  37. package/dist/packages/ember/version.js +1 -1
  38. package/dist/packages/ember-babel.js +13 -0
  39. package/docs/data.json +217 -242
  40. package/lib/index.js +1 -5
  41. package/package.json +26 -21
  42. package/types/stable/@ember/-internals/glimmer/index.d.ts +1 -1
  43. package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly.d.ts +4 -4
  44. package/types/stable/@ember/-internals/glimmer/lib/component-managers/mount.d.ts +3 -3
  45. package/types/stable/@ember/-internals/glimmer/lib/component-managers/outlet.d.ts +5 -8
  46. package/types/stable/@ember/-internals/glimmer/lib/component-managers/root.d.ts +3 -3
  47. package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +3 -3
  48. package/types/stable/@ember/-internals/glimmer/lib/resolver.d.ts +3 -3
  49. package/types/stable/@ember/-internals/glimmer/lib/syntax/utils.d.ts +3 -2
  50. package/types/stable/@ember/-internals/glimmer/lib/utils/iterator.d.ts +2 -2
  51. package/types/stable/@ember/-internals/glimmer/lib/utils/outlet.d.ts +39 -18
  52. package/types/stable/@ember/-internals/utility-types/index.d.ts +1 -0
  53. package/types/stable/@ember/-internals/views/lib/system/utils.d.ts +4 -3
  54. package/types/stable/@ember/routing/route.d.ts +6 -28
  55. package/dist/dependencies/@glimmer/low-level.js +0 -77
@@ -5,5 +5,5 @@
5
5
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
6
  * @license Licensed under MIT license
7
7
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
- * @version 5.6.0-alpha.2
8
+ * @version 5.6.0-alpha.4
9
9
  */
@@ -3,8 +3,8 @@ export { templateFactory as template, templateCacheCounters } from '@glimmer/opc
3
3
  import { hasDOM } from '@ember/-internals/browser-environment';
4
4
  import { assert, warn, debugFreeze, inspect, deprecate } from '@ember/debug';
5
5
  import { action as action$1 } from '@ember/object';
6
- import { valueForRef, isConstRef, createConstRef, isUpdatableRef, updateRef, createComputeRef, createPrimitiveRef, childRefFor, childRefFromParts, isInvokableRef, createUnboundRef, createInvokableRef, createReadOnlyRef, createDebugAliasRef, UNDEFINED_REFERENCE } from '@glimmer/reference';
7
- import { untrack, createCache, consumeTag, tagFor, getValue, valueForTag, beginUntrackFrame, endUntrackFrame, beginTrackFrame, endTrackFrame, validateTag, createTag, dirtyTag, CONSTANT_TAG, isTracking, setTrackingTransactionEnv, createUpdatableTag, CURRENT_TAG } from '@glimmer/validator';
6
+ import { valueForRef, isConstRef, createConstRef, isUpdatableRef, updateRef, createPrimitiveRef, childRefFor, createComputeRef, childRefFromParts, isInvokableRef, createUnboundRef, createInvokableRef, createReadOnlyRef, createDebugAliasRef, UNDEFINED_REFERENCE } from '@glimmer/reference';
7
+ import { untrack, createCache, consumeTag, tagFor, getValue, valueForTag, beginUntrackFrame, endUntrackFrame, beginTrackFrame, endTrackFrame, validateTag, createTag, dirtyTag, CONSTANT_TAG, isTracking, debug, createUpdatableTag, CURRENT_TAG } from '@glimmer/validator';
8
8
  import { tracked, get, PROPERTY_DID_CHANGE, tagForObject, objectAt, tagForProperty, _getProp, _setProp, set } from '@ember/-internals/metal';
9
9
  import { setOwner, getOwner, isFactory } from '@ember/-internals/owner';
10
10
  import { guidFor, enumerableSymbol, getDebugName, isProxy, isObject, uuid } from '@ember/-internals/utils';
@@ -16,16 +16,17 @@ import { flaggedInstrument, _instrumentStart } from '@ember/instrumentation';
16
16
  import { service } from '@ember/service';
17
17
  import { DEBUG } from '@glimmer/env';
18
18
  import { TargetActionSupport, _contentFor } from '@ember/-internals/runtime';
19
- import { reifyPositional, normalizeProperty, EMPTY_ARGS, createCapturedArgs, EMPTY_POSITIONAL, curry, templateOnlyComponent, TEMPLATE_ONLY_COMPONENT_MANAGER, hash, array, concat, fn, get as get$1, on, clientBuilder, runtimeContext, DOMTreeConstruction, DOMChanges, inTransaction, renderMain, rehydrationBuilder } from '@glimmer/runtime';
19
+ import { reifyPositional, normalizeProperty, EMPTY_ARGS, createCapturedArgs, EMPTY_POSITIONAL, curry, templateOnlyComponent, TEMPLATE_ONLY_COMPONENT_MANAGER, hash, array, concat, fn, get as get$1, on, runtimeContext, DOMTreeConstruction, DOMChanges, clientBuilder, inTransaction, renderMain, rehydrationBuilder } from '@glimmer/runtime';
20
20
  export { DOMChanges, DOMTreeConstruction, isSerializationFirstNode } from '@glimmer/runtime';
21
- import { _WeakSet, unwrapTemplate, EMPTY_ARRAY as EMPTY_ARRAY$1, dict } from '@glimmer/util';
21
+ import { unwrapTemplate, EMPTY_ARRAY as EMPTY_ARRAY$1, dict } from '@glimmer/util';
22
22
  import { dasherize } from '@ember/-internals/string';
23
23
  import { registerDestructor, associateDestroyableChild, destroy } from '@glimmer/destroyable';
24
24
  import { join, _backburner, schedule, _getCurrentRunLoop } from '@ember/runloop';
25
25
  import { FrameworkObject } from '@ember/object/-internals';
26
26
  import { getFactoryFor, privatize } from '@ember/-internals/container';
27
27
  import { ENV } from '@ember/-internals/environment';
28
- import { artifacts } from '@glimmer/program';
28
+ import { CurriedType } from '@glimmer/vm';
29
+ import { artifacts, RuntimeOpImpl } from '@glimmer/program';
29
30
  import RSVP from 'rsvp';
30
31
  import { NodeDOMTreeConstruction, serializeBuilder } from '@glimmer/node';
31
32
  export { NodeDOMTreeConstruction } from '@glimmer/node';
@@ -43,13 +44,13 @@ var RootTemplate = templateFactory({
43
44
  });
44
45
 
45
46
  var InputTemplate = templateFactory({
46
- "id": "OGSIkgXP",
47
- "block": "[[[11,\"input\"],[16,1,[30,0,[\"id\"]]],[16,0,[30,0,[\"class\"]]],[17,1],[16,4,[30,0,[\"type\"]]],[16,\"checked\",[30,0,[\"checked\"]]],[16,2,[30,0,[\"value\"]]],[4,[38,0],[\"change\",[30,0,[\"change\"]]],null],[4,[38,0],[\"input\",[30,0,[\"input\"]]],null],[4,[38,0],[\"keyup\",[30,0,[\"keyUp\"]]],null],[4,[38,0],[\"paste\",[30,0,[\"valueDidChange\"]]],null],[4,[38,0],[\"cut\",[30,0,[\"valueDidChange\"]]],null],[12],[13]],[\"&attrs\"],false,[\"on\"]]",
47
+ "id": "ym/FeIbm",
48
+ "block": "[[[11,\"input\"],[16,1,[30,0,[\"id\"]]],[16,0,[30,0,[\"class\"]]],[17,1],[16,4,[30,0,[\"type\"]]],[16,\"checked\",[30,0,[\"checked\"]]],[16,2,[30,0,[\"value\"]]],[4,[38,1],[\"change\",[30,0,[\"change\"]]],null],[4,[38,1],[\"input\",[30,0,[\"input\"]]],null],[4,[38,1],[\"keyup\",[30,0,[\"keyUp\"]]],null],[4,[38,1],[\"paste\",[30,0,[\"valueDidChange\"]]],null],[4,[38,1],[\"cut\",[30,0,[\"valueDidChange\"]]],null],[12],[13]],[\"&attrs\"],false,[\"input\",\"on\"]]",
48
49
  "moduleName": "packages/@ember/-internals/glimmer/lib/templates/input.hbs",
49
50
  "isStrictMode": false
50
51
  });
51
52
 
52
- function NOOP() {}
53
+ function NOOP$2() {}
53
54
  class InternalComponent {
54
55
  // Override this
55
56
  static toString() {
@@ -102,7 +103,7 @@ class InternalComponent {
102
103
  assert(`The \`@${name}\` argument to the <${this.constructor}> component must be a function`, typeof listener === 'function');
103
104
  return listener;
104
105
  } else {
105
- return NOOP;
106
+ return NOOP$2;
106
107
  }
107
108
  }
108
109
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -137,7 +138,7 @@ function deopaquify(opaque) {
137
138
  assert(`[BUG] Invalid internal component constructor: ${opaque}`, constructor);
138
139
  return constructor;
139
140
  }
140
- const CAPABILITIES = {
141
+ const CAPABILITIES$2 = {
141
142
  dynamicLayout: false,
142
143
  dynamicTag: false,
143
144
  prepareArgs: false,
@@ -154,7 +155,7 @@ const CAPABILITIES = {
154
155
  };
155
156
  class InternalManager {
156
157
  getCapabilities() {
157
- return CAPABILITIES;
158
+ return CAPABILITIES$2;
158
159
  }
159
160
  create(owner, definition, args, _env, _dynamicScope, caller) {
160
161
  assert('caller must be const', isConstRef(caller));
@@ -179,7 +180,7 @@ class InternalManager {
179
180
  }
180
181
  const INTERNAL_COMPONENT_MANAGER = new InternalManager();
181
182
 
182
- var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {
183
+ var __decorate$3 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
183
184
  var c = arguments.length,
184
185
  r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
185
186
  d;
@@ -219,7 +220,7 @@ class LocalValue {
219
220
  this.value = value;
220
221
  }
221
222
  }
222
- __decorate([tracked], LocalValue.prototype, "value", void 0);
223
+ __decorate$3([tracked], LocalValue.prototype, "value", void 0);
223
224
  class UpstreamValue {
224
225
  constructor(reference) {
225
226
  this.reference = reference;
@@ -313,10 +314,10 @@ class AbstractInput extends InternalComponent {
313
314
  return virtualEvents.indexOf(name) !== -1;
314
315
  }
315
316
  }
316
- __decorate([action$1], AbstractInput.prototype, "valueDidChange", null);
317
- __decorate([action$1], AbstractInput.prototype, "keyUp", null);
317
+ __decorate$3([action$1], AbstractInput.prototype, "valueDidChange", null);
318
+ __decorate$3([action$1], AbstractInput.prototype, "keyUp", null);
318
319
 
319
- var __decorate$1 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
320
+ var __decorate$2 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
320
321
  var c = arguments.length,
321
322
  r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
322
323
  d;
@@ -532,19 +533,19 @@ class _Input extends AbstractInput {
532
533
  return supportedArguments.indexOf(name) !== -1 || super.isSupportedArgument(name);
533
534
  }
534
535
  }
535
- __decorate$1([action$1], _Input.prototype, "change", null);
536
- __decorate$1([action$1], _Input.prototype, "input", null);
537
- __decorate$1([action$1], _Input.prototype, "checkedDidChange", null);
536
+ __decorate$2([action$1], _Input.prototype, "change", null);
537
+ __decorate$2([action$1], _Input.prototype, "input", null);
538
+ __decorate$2([action$1], _Input.prototype, "checkedDidChange", null);
538
539
  const Input = opaquify(_Input, InputTemplate);
539
540
 
540
541
  var LinkToTemplate = templateFactory({
541
- "id": "CVwkBtGh",
542
- "block": "[[[11,3],[16,1,[30,0,[\"id\"]]],[16,0,[30,0,[\"class\"]]],[16,\"role\",[30,0,[\"role\"]]],[16,\"title\",[30,0,[\"title\"]]],[16,\"rel\",[30,0,[\"rel\"]]],[16,\"tabindex\",[30,0,[\"tabindex\"]]],[16,\"target\",[30,0,[\"target\"]]],[17,1],[16,6,[30,0,[\"href\"]]],[4,[38,0],[\"click\",[30,0,[\"click\"]]],null],[12],[18,2,null],[13]],[\"&attrs\",\"&default\"],false,[\"on\",\"yield\"]]",
542
+ "id": "Mc9zTgGM",
543
+ "block": "[[[11,3],[16,1,[30,0,[\"id\"]]],[16,0,[30,0,[\"class\"]]],[16,\"role\",[30,0,[\"role\"]]],[16,\"title\",[30,0,[\"title\"]]],[16,\"rel\",[30,0,[\"rel\"]]],[16,\"tabindex\",[30,0,[\"tabindex\"]]],[16,\"target\",[30,0,[\"target\"]]],[17,1],[16,6,[30,0,[\"href\"]]],[4,[38,1],[\"click\",[30,0,[\"click\"]]],null],[12],[18,2,null],[13]],[\"&attrs\",\"&default\"],false,[\"a\",\"on\",\"yield\"]]",
543
544
  "moduleName": "packages/@ember/-internals/glimmer/lib/templates/link-to.hbs",
544
545
  "isStrictMode": false
545
546
  });
546
547
 
547
- var __decorate$2 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
548
+ var __decorate$1 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
548
549
  var c = arguments.length,
549
550
  r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
550
551
  d;
@@ -1020,8 +1021,8 @@ class _LinkTo extends InternalComponent {
1020
1021
  return supportedArguments.indexOf(name) !== -1 || super.isSupportedArgument(name);
1021
1022
  }
1022
1023
  }
1023
- __decorate$2([service('-routing')], _LinkTo.prototype, "routing", void 0);
1024
- __decorate$2([action$1], _LinkTo.prototype, "click", null);
1024
+ __decorate$1([service('-routing')], _LinkTo.prototype, "routing", void 0);
1025
+ __decorate$1([action$1], _LinkTo.prototype, "click", null);
1025
1026
  let {
1026
1027
  prototype
1027
1028
  } = _LinkTo;
@@ -1108,13 +1109,13 @@ let descriptorFor = (target, property) => {
1108
1109
  const LinkTo = opaquify(_LinkTo, LinkToTemplate);
1109
1110
 
1110
1111
  var TextareaTemplate = templateFactory({
1111
- "id": "OpzctQXz",
1112
- "block": "[[[11,\"textarea\"],[16,1,[30,0,[\"id\"]]],[16,0,[30,0,[\"class\"]]],[17,1],[16,2,[30,0,[\"value\"]]],[4,[38,0],[\"change\",[30,0,[\"change\"]]],null],[4,[38,0],[\"input\",[30,0,[\"input\"]]],null],[4,[38,0],[\"keyup\",[30,0,[\"keyUp\"]]],null],[4,[38,0],[\"paste\",[30,0,[\"valueDidChange\"]]],null],[4,[38,0],[\"cut\",[30,0,[\"valueDidChange\"]]],null],[12],[13]],[\"&attrs\"],false,[\"on\"]]",
1112
+ "id": "q3u1N7CF",
1113
+ "block": "[[[11,\"textarea\"],[16,1,[30,0,[\"id\"]]],[16,0,[30,0,[\"class\"]]],[17,1],[16,2,[30,0,[\"value\"]]],[4,[38,1],[\"change\",[30,0,[\"change\"]]],null],[4,[38,1],[\"input\",[30,0,[\"input\"]]],null],[4,[38,1],[\"keyup\",[30,0,[\"keyUp\"]]],null],[4,[38,1],[\"paste\",[30,0,[\"valueDidChange\"]]],null],[4,[38,1],[\"cut\",[30,0,[\"valueDidChange\"]]],null],[12],[13]],[\"&attrs\"],false,[\"textarea\",\"on\"]]",
1113
1114
  "moduleName": "packages/@ember/-internals/glimmer/lib/templates/textarea.hbs",
1114
1115
  "isStrictMode": false
1115
1116
  });
1116
1117
 
1117
- var __decorate$3 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
1118
+ var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {
1118
1119
  var c = arguments.length,
1119
1120
  r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
1120
1121
  d;
@@ -1271,8 +1272,8 @@ class _Textarea extends AbstractInput {
1271
1272
  return supportedArguments.indexOf(name) !== -1 || super.isSupportedArgument(name);
1272
1273
  }
1273
1274
  }
1274
- __decorate$3([action$1], _Textarea.prototype, "change", null);
1275
- __decorate$3([action$1], _Textarea.prototype, "input", null);
1275
+ __decorate([action$1], _Textarea.prototype, "change", null);
1276
+ __decorate([action$1], _Textarea.prototype, "input", null);
1276
1277
  const Textarea = opaquify(_Textarea, TextareaTemplate);
1277
1278
 
1278
1279
  function isTemplateFactory(template) {
@@ -1418,7 +1419,7 @@ function internalHelper(helper) {
1418
1419
  /**
1419
1420
  @module ember
1420
1421
  */
1421
- const ACTIONS = new _WeakSet();
1422
+ const ACTIONS = new WeakSet();
1422
1423
  /**
1423
1424
  The `{{action}}` helper provides a way to pass triggers for behavior (usually
1424
1425
  just a function) between components, and into components from controllers.
@@ -1700,12 +1701,19 @@ var action = internalHelper(args => {
1700
1701
  if (isInvokableRef(action)) {
1701
1702
  fn = makeClosureAction(action, action, invokeRef, processArgs, debugKey);
1702
1703
  } else {
1703
- fn = makeDynamicClosureAction(valueForRef(context), target, action, processArgs, debugKey);
1704
+ fn = makeDynamicClosureAction(valueForRef(context),
1705
+ // SAFETY: glimmer-vm should expose narrowing utilities for references
1706
+ // as is, `target` is still `Reference<unknown>`.
1707
+ // however, we never even tried to narrow `target`, so this is potentially risky code.
1708
+ target,
1709
+ // SAFETY: glimmer-vm should expose narrowing utilities for references
1710
+ // as is, `action` is still `Reference<unknown>`
1711
+ action, processArgs, debugKey);
1704
1712
  }
1705
1713
  ACTIONS.add(fn);
1706
1714
  return createUnboundRef(fn, '(result of an `action` helper)');
1707
1715
  });
1708
- function NOOP$2(args) {
1716
+ function NOOP(args) {
1709
1717
  return args;
1710
1718
  }
1711
1719
  function makeArgsProcessor(valuePathRef, actionArgsRef) {
@@ -1730,16 +1738,17 @@ function makeArgsProcessor(valuePathRef, actionArgsRef) {
1730
1738
  return readValue(mergeArgs(args));
1731
1739
  };
1732
1740
  } else {
1733
- return mergeArgs || readValue || NOOP$2;
1741
+ return mergeArgs || readValue || NOOP;
1734
1742
  }
1735
1743
  }
1736
1744
  function makeDynamicClosureAction(context, targetRef, actionRef, processArgs, debugKey) {
1745
+ const action = valueForRef(actionRef);
1737
1746
  // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions
1738
1747
  if (DEBUG) {
1739
- makeClosureAction(context, valueForRef(targetRef), valueForRef(actionRef), processArgs, debugKey);
1748
+ makeClosureAction(context, valueForRef(targetRef), action, processArgs, debugKey);
1740
1749
  }
1741
1750
  return (...args) => {
1742
- return makeClosureAction(context, valueForRef(targetRef), valueForRef(actionRef), processArgs, debugKey)(...args);
1751
+ return makeClosureAction(context, valueForRef(targetRef), action, processArgs, debugKey)(...args);
1743
1752
  };
1744
1753
  }
1745
1754
  function makeClosureAction(context, target, action, processArgs, debugKey) {
@@ -1747,9 +1756,12 @@ function makeClosureAction(context, target, action, processArgs, debugKey) {
1747
1756
  let fn;
1748
1757
  assert(`Action passed is null or undefined in (action) from ${target}.`, action !== undefined && action !== null);
1749
1758
  if (typeof action === 'string') {
1759
+ assert('target must be an object', target !== null && typeof target === 'object');
1750
1760
  self = target;
1751
- fn = target.actions && target.actions[action];
1752
- assert(`An action named '${action}' was not found in ${target}`, Boolean(fn));
1761
+ let value = target.actions?.[action];
1762
+ assert(`An action named '${action}' was not found in ${target}`, Boolean(value));
1763
+ assert(`An action named '${action}' was found in ${target}, but is not a function`, typeof value === 'function');
1764
+ fn = value;
1753
1765
  } else if (typeof action === 'function') {
1754
1766
  self = context;
1755
1767
  fn = action;
@@ -2386,7 +2398,7 @@ Helper[_a] = true;
2386
2398
  // a bad idea and probably not something we want. We've moved that definition
2387
2399
  // here, but it should definitely be reviewed and probably removed.
2388
2400
  /** @deprecated */
2389
- Helper.helper = helper;
2401
+ Helper.helper = helper$1;
2390
2402
  /* eslint-enable import/export */
2391
2403
  function isClassicHelper(obj) {
2392
2404
  return obj[IS_CLASSIC_HELPER] === true;
@@ -2474,7 +2486,7 @@ class SimpleClassicHelperManager {
2474
2486
  }
2475
2487
  const SIMPLE_CLASSIC_HELPER_MANAGER = new SimpleClassicHelperManager();
2476
2488
  setHelperManager(() => SIMPLE_CLASSIC_HELPER_MANAGER, Wrapper.prototype);
2477
- function helper(helperFn
2489
+ function helper$1(helperFn
2478
2490
  // At the implementation site, we don't care about the actual underlying type
2479
2491
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2480
2492
  ) {
@@ -2661,9 +2673,10 @@ function isHTMLSafe(str) {
2661
2673
  return str !== null && typeof str === 'object' && 'toHTML' in str && typeof str.toHTML === 'function';
2662
2674
  }
2663
2675
 
2664
- function instrumentationPayload(def) {
2676
+ function instrumentationPayload$1(def) {
2677
+ // "main" used to be the outlet name, keeping it around for compatibility
2665
2678
  return {
2666
- object: `${def.name}:${def.outlet}`
2679
+ object: `${def.name}:main`
2667
2680
  };
2668
2681
  }
2669
2682
  const CAPABILITIES$1 = {
@@ -2688,12 +2701,10 @@ class OutletComponentManager {
2688
2701
  dynamicScope.set('outletState', currentStateRef);
2689
2702
  let state = {
2690
2703
  self: createConstRef(definition.controller, 'this'),
2691
- finalize: _instrumentStart('render.outlet', instrumentationPayload, definition)
2704
+ finalize: _instrumentStart('render.outlet', instrumentationPayload$1, definition)
2692
2705
  };
2693
2706
  if (env.debugRenderTree !== undefined) {
2694
- state.outlet = {
2695
- name: definition.outlet
2696
- };
2707
+ state.outletBucket = {};
2697
2708
  let parentState = valueForRef(parentStateRef);
2698
2709
  let parentOwner = parentState && parentState.render && parentState.render.owner;
2699
2710
  let currentOwner = valueForRef(currentStateRef).render.owner;
@@ -2717,16 +2728,16 @@ class OutletComponentManager {
2717
2728
  }
2718
2729
  getDebugCustomRenderTree(definition, state, args) {
2719
2730
  let nodes = [];
2720
- if (state.outlet) {
2721
- nodes.push({
2722
- bucket: state.outlet,
2723
- type: 'outlet',
2724
- name: state.outlet.name,
2725
- args: EMPTY_ARGS,
2726
- instance: undefined,
2727
- template: undefined
2728
- });
2729
- }
2731
+ assert('[BUG] outletBucket must be set', state.outletBucket);
2732
+ nodes.push({
2733
+ bucket: state.outletBucket,
2734
+ type: 'outlet',
2735
+ // "main" used to be the outlet name, keeping it around for compatibility
2736
+ name: 'main',
2737
+ args: EMPTY_ARGS,
2738
+ instance: undefined,
2739
+ template: undefined
2740
+ });
2730
2741
  if (state.engineBucket) {
2731
2742
  nodes.push({
2732
2743
  bucket: state.engineBucket,
@@ -3330,7 +3341,7 @@ setGlobalContext({
3330
3341
  }
3331
3342
  });
3332
3343
  if (DEBUG) {
3333
- setTrackingTransactionEnv?.({
3344
+ debug?.setTrackingTransactionEnv?.({
3334
3345
  debugMessage(obj, keyName) {
3335
3346
  let dirtyString = keyName ? `\`${keyName}\` on \`${getDebugName?.(obj)}\`` : `\`${getDebugName?.(obj)}\``;
3336
3347
  return `You attempted to update ${dirtyString}, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.`;
@@ -3392,9 +3403,9 @@ var disallowDynamicResolution = internalHelper(({
3392
3403
  });
3393
3404
  });
3394
3405
 
3395
- let helper$1;
3406
+ let helper;
3396
3407
  if (DEBUG) {
3397
- helper$1 = args => {
3408
+ helper = args => {
3398
3409
  const inner = args.positional[0];
3399
3410
  assert('expected at least one positional arg', inner);
3400
3411
  return createComputeRef(() => {
@@ -3404,13 +3415,13 @@ if (DEBUG) {
3404
3415
  });
3405
3416
  };
3406
3417
  } else {
3407
- helper$1 = args => {
3418
+ helper = args => {
3408
3419
  let arg = args.positional[0];
3409
3420
  assert('expected at least one positional arg', arg);
3410
3421
  return arg;
3411
3422
  };
3412
3423
  }
3413
- var inElementNullCheckHelper = internalHelper(helper$1);
3424
+ var inElementNullCheckHelper = internalHelper(helper);
3414
3425
 
3415
3426
  var normalizeClassHelper = internalHelper(({
3416
3427
  positional
@@ -3735,6 +3746,11 @@ var unbound = internalHelper(({
3735
3746
  @module ember
3736
3747
  */
3737
3748
  var uniqueId = internalHelper(() => {
3749
+ // SAFETY: glimmer-vm should change the signature of createUnboundRef to use a generic
3750
+ // so that the type param to `Reference<?>` can infer from the first argument.
3751
+ //
3752
+ // NOTE: constRef is an optimization so we don't let the VM create extra wrappers,
3753
+ // tracking frames, etc.
3738
3754
  return createConstRef(uniqueId$1(), 'unique-id');
3739
3755
  });
3740
3756
  // From https://gist.github.com/selfish/fef2c0ba6cdfe07af76e64cecd74888b
@@ -3961,7 +3977,7 @@ class ActionModifierManager {
3961
3977
  const ACTION_MODIFIER_MANAGER = new ActionModifierManager();
3962
3978
  var actionModifier = setInternalModifierManager(ACTION_MODIFIER_MANAGER, {});
3963
3979
 
3964
- const CAPABILITIES$2 = {
3980
+ const CAPABILITIES = {
3965
3981
  dynamicLayout: true,
3966
3982
  dynamicTag: false,
3967
3983
  prepareArgs: false,
@@ -3982,7 +3998,7 @@ class MountManager {
3982
3998
  return unwrapTemplate(templateFactory(state.engine)).asLayout();
3983
3999
  }
3984
4000
  getCapabilities() {
3985
- return CAPABILITIES$2;
4001
+ return CAPABILITIES;
3986
4002
  }
3987
4003
  getOwner(state) {
3988
4004
  return state.engine;
@@ -4084,7 +4100,7 @@ class MountDefinition {
4084
4100
  this.handle = -1;
4085
4101
  this.manager = MOUNT_MANAGER;
4086
4102
  this.compilable = null;
4087
- this.capabilities = capabilityFlagsFrom(CAPABILITIES$2);
4103
+ this.capabilities = capabilityFlagsFrom(CAPABILITIES);
4088
4104
  this.state = {
4089
4105
  name: resolvedName
4090
4106
  };
@@ -4151,7 +4167,7 @@ const mountHelper = internalHelper((args, owner) => {
4151
4167
  }
4152
4168
  assert(`You used \`{{mount '${name}'}}\`, but the engine '${name}' can not be found.`, owner.hasRegistration(`engine:${name}`));
4153
4169
  lastName = name;
4154
- lastDef = curry(0 /* CurriedType.Component */, new MountDefinition(name), owner, captured, true);
4170
+ lastDef = curry(CurriedType.Component, new MountDefinition(name), owner, captured, true);
4155
4171
  return lastDef;
4156
4172
  } else {
4157
4173
  assert(`Invalid engine name '${name}' specified, engine name must be either a string, null or undefined.`, name === null || name === undefined);
@@ -4191,8 +4207,7 @@ const outletHelper = internalHelper((_args, owner, scope) => {
4191
4207
  assert('Expected dynamic scope to be present. You may have attempted to use the {{outlet}} keyword dynamically. This keyword cannot be used dynamically.', scope);
4192
4208
  let outletRef = createComputeRef(() => {
4193
4209
  let state = valueForRef(scope.get('outletState'));
4194
- let outlets = state !== undefined ? state.outlets : undefined;
4195
- return outlets !== undefined ? outlets['main'] : undefined;
4210
+ return state?.outlets?.main;
4196
4211
  });
4197
4212
  let lastState = null;
4198
4213
  let definition = null;
@@ -4223,7 +4238,7 @@ const outletHelper = internalHelper((_args, owner, scope) => {
4223
4238
  named['model'] = createDebugAliasRef('@model', named['model']);
4224
4239
  }
4225
4240
  let args = createCapturedArgs(named, EMPTY_POSITIONAL);
4226
- definition = curry(0 /* CurriedType.Component */, new OutletComponentDefinition(state), outletState?.render?.owner ?? owner, args, true);
4241
+ definition = curry(CurriedType.Component, new OutletComponentDefinition(state), outletState?.render?.owner ?? owner, args, true);
4227
4242
  } else {
4228
4243
  definition = null;
4229
4244
  }
@@ -4237,15 +4252,28 @@ function stateFor(ref, outlet) {
4237
4252
  if (render === undefined) return null;
4238
4253
  let template = render.template;
4239
4254
  if (template === undefined) return null;
4240
- // this guard can be removed once @ember/test-helpers@1.6.0 has "aged out"
4241
- // and is no longer considered supported
4242
4255
  if (isTemplateFactory(template)) {
4243
4256
  template = template(render.owner);
4257
+ if (DEBUG) {
4258
+ let message = 'The `template` property of `OutletState` should be a ' + '`Template` rather than a `TemplateFactory`. This is known to be a ' + "problem in older versions of `@ember/test-helpers`. If you haven't " + 'done so already, try upgrading to the latest version.\n\n';
4259
+ if (template.result === 'ok' && typeof template.moduleName === 'string') {
4260
+ message += 'The offending template has a moduleName `' + template.moduleName + '`, which might be helpful for identifying ' + 'source of this issue.\n\n';
4261
+ }
4262
+ message += 'Please note that `OutletState` is a private API in Ember.js ' + "and not meant to be used outside of the framework's internal code.";
4263
+ deprecate(message, false, {
4264
+ id: 'outlet-state-template-factory',
4265
+ until: '5.9.0',
4266
+ for: 'ember-source',
4267
+ since: {
4268
+ available: '5.6.0',
4269
+ enabled: '5.6.0'
4270
+ }
4271
+ });
4272
+ }
4244
4273
  }
4245
4274
  return {
4246
4275
  ref,
4247
4276
  name: render.name,
4248
- outlet: render.outlet,
4249
4277
  template,
4250
4278
  controller: render.controller,
4251
4279
  model: render.model
@@ -4261,7 +4289,7 @@ function validate(state, lastState) {
4261
4289
  return state.template === lastState.template && state.controller === lastState.controller;
4262
4290
  }
4263
4291
 
4264
- function instrumentationPayload$1(name) {
4292
+ function instrumentationPayload(name) {
4265
4293
  return {
4266
4294
  object: `component:${name}`
4267
4295
  };
@@ -4338,7 +4366,7 @@ const BUILTIN_MODIFIERS = {
4338
4366
  ...BUILTIN_KEYWORD_MODIFIERS,
4339
4367
  on
4340
4368
  };
4341
- const CLASSIC_HELPER_MANAGER_ASSOCIATED = new _WeakSet();
4369
+ const CLASSIC_HELPER_MANAGER_ASSOCIATED = new WeakSet();
4342
4370
  class ResolverImpl {
4343
4371
  constructor() {
4344
4372
  this.componentDefinitionCache = new Map();
@@ -4415,7 +4443,7 @@ class ResolverImpl {
4415
4443
  if (template === null && pair.layout !== null) {
4416
4444
  template = pair.layout(owner);
4417
4445
  }
4418
- let finalizer = _instrumentStart('render.getComponentDefinition', instrumentationPayload$1, name);
4446
+ let finalizer = _instrumentStart('render.getComponentDefinition', instrumentationPayload, name);
4419
4447
  let definition = null;
4420
4448
  if (pair.component === null) {
4421
4449
  if (ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS) {
@@ -4452,8 +4480,10 @@ class ResolverImpl {
4452
4480
  }
4453
4481
 
4454
4482
  // We use the `InternalOwner` notion here because we actually need all of its
4483
+ // API for using with renderers (normally, it will be `EngineInstance`).
4484
+ // We use `getOwner` from our internal home for it rather than the narrower
4485
+ // public API for the same reason.
4455
4486
  const TOP_LEVEL_NAME = '-top-level';
4456
- const TOP_LEVEL_OUTLET = 'main';
4457
4487
  class OutletView {
4458
4488
  static extend(injections) {
4459
4489
  return class extends OutletView {
@@ -4493,7 +4523,7 @@ class OutletView {
4493
4523
  render: {
4494
4524
  owner: owner,
4495
4525
  into: undefined,
4496
- outlet: TOP_LEVEL_OUTLET,
4526
+ outlet: 'main',
4497
4527
  name: TOP_LEVEL_NAME,
4498
4528
  controller: undefined,
4499
4529
  model: undefined,
@@ -4510,7 +4540,6 @@ class OutletView {
4510
4540
  this.state = {
4511
4541
  ref,
4512
4542
  name: TOP_LEVEL_NAME,
4513
- outlet: TOP_LEVEL_OUTLET,
4514
4543
  template,
4515
4544
  controller: undefined,
4516
4545
  model: undefined
@@ -4725,7 +4754,7 @@ class Renderer {
4725
4754
  // resolver is exposed for tests
4726
4755
  let resolver = this._runtimeResolver = new ResolverImpl();
4727
4756
  let sharedArtifacts = artifacts();
4728
- this._context = programCompilationContext(sharedArtifacts, resolver);
4757
+ this._context = programCompilationContext(sharedArtifacts, resolver, heap => new RuntimeOpImpl(heap));
4729
4758
  let runtimeEnvironmentDelegate = new EmberEnvironmentDelegate(owner, env.isInteractive);
4730
4759
  this._runtime = runtimeContext({
4731
4760
  appendOperations: env.hasDOM ? new DOMTreeConstruction(document) : new NodeDOMTreeConstruction(document),
@@ -4742,11 +4771,11 @@ class Renderer {
4742
4771
  // renderer HOOKS
4743
4772
  appendOutletView(view, target) {
4744
4773
  let definition = createRootOutlet(view);
4745
- this._appendDefinition(view, curry(0 /* CurriedType.Component */, definition, view.owner, null, true), target);
4774
+ this._appendDefinition(view, curry(CurriedType.Component, definition, view.owner, null, true), target);
4746
4775
  }
4747
4776
  appendTo(view, target) {
4748
4777
  let definition = new RootComponentDefinition(view);
4749
- this._appendDefinition(view, curry(0 /* CurriedType.Component */, definition, this._owner, null, true), target);
4778
+ this._appendDefinition(view, curry(CurriedType.Component, definition, this._owner, null, true), target);
4750
4779
  }
4751
4780
  _appendDefinition(root, definition, target) {
4752
4781
  let self = createConstRef(definition, 'this');
@@ -5002,4 +5031,4 @@ function setComponentManager(manager, obj) {
5002
5031
  let componentCapabilities = componentCapabilities$1;
5003
5032
  let modifierCapabilities = modifierCapabilities$1;
5004
5033
 
5005
- export { Component, Helper, Input, LinkTo, OutletView, Renderer, RootTemplate, SafeString, Textarea, _resetRenderers, componentCapabilities, escapeExpression, getTemplate, getTemplates, hasTemplate, helper, htmlSafe, isHTMLSafe, modifierCapabilities, renderSettled, setComponentManager, setTemplate, setTemplates, setupApplicationRegistry, setupEngineRegistry, uniqueId$1 as uniqueId };
5034
+ export { Component, Helper, Input, LinkTo, OutletView, Renderer, RootTemplate, SafeString, Textarea, _resetRenderers, componentCapabilities, escapeExpression, getTemplate, getTemplates, hasTemplate, helper$1 as helper, htmlSafe, isHTMLSafe, modifierCapabilities, renderSettled, setComponentManager, setTemplate, setTemplates, setupApplicationRegistry, setupEngineRegistry, uniqueId$1 as uniqueId };
@@ -5,7 +5,6 @@ import { registerDestructor, isDestroyed } from '@glimmer/destroyable';
5
5
  import { DEBUG } from '@glimmer/env';
6
6
  import { tagMetaFor, valueForTag, CURRENT_TAG, validateTag, tagFor, CONSTANT_TAG, dirtyTagFor, combine, createUpdatableTag, updateTag, untrack, ALLOW_CYCLES, consumeTag, track, isTracking, trackedData, createCache, getValue } from '@glimmer/validator';
7
7
  export { createCache, getValue, isConst } from '@glimmer/validator';
8
- import { _WeakSet } from '@glimmer/util';
9
8
  import { ENV, context } from '@ember/-internals/environment';
10
9
  import { schedule } from '@ember/runloop';
11
10
  import { getCustomTagFor } from '@glimmer/manager';
@@ -598,7 +597,7 @@ function removeArrayObserver(array, target, opts) {
598
597
  return arrayObserversHelper(array, target, opts, removeListener);
599
598
  }
600
599
 
601
- const CHAIN_PASS_THROUGH = new _WeakSet();
600
+ const CHAIN_PASS_THROUGH = new WeakSet();
602
601
  function finishLazyChains(meta, key, value) {
603
602
  let lazyTags = meta.readableLazyChainsFor(key);
604
603
  if (lazyTags === undefined) {
@@ -775,7 +774,7 @@ class ComputedDescriptor {
775
774
  }
776
775
  let COMPUTED_GETTERS;
777
776
  if (DEBUG) {
778
- COMPUTED_GETTERS = new _WeakSet();
777
+ COMPUTED_GETTERS = new WeakSet();
779
778
  }
780
779
  function DESCRIPTOR_GETTER_FUNCTION(name, descriptor) {
781
780
  function getter() {
@@ -793,7 +792,7 @@ function DESCRIPTOR_SETTER_FUNCTION(name, descriptor) {
793
792
  COMPUTED_SETTERS.add(set);
794
793
  return set;
795
794
  }
796
- const COMPUTED_SETTERS = new _WeakSet();
795
+ const COMPUTED_SETTERS = new WeakSet();
797
796
  function makeComputedDecorator(desc, DecoratorClass) {
798
797
  let decorator = function COMPUTED_DECORATOR(target, key, propertyDesc, maybeMeta, isClassicDecorator) {
799
798
  assert(`Only one computed property decorator can be applied to a class field or accessor, but '${key}' was decorated twice. You may have added the decorator to both a getter and setter, which is unnecessary.`, isClassicDecorator || !propertyDesc || !propertyDesc.get || !COMPUTED_GETTERS.has(propertyDesc.get));
@@ -2058,6 +2057,8 @@ class TrackedDescriptor {
2058
2057
  }
2059
2058
 
2060
2059
  // NOTE: copied from: https://github.com/glimmerjs/glimmer.js/pull/358
2060
+ // Both glimmerjs/glimmer.js and emberjs/ember.js have the exact same implementation
2061
+ // of @cached, so any changes made to one should also be made to the other
2061
2062
  /**
2062
2063
  * @decorator
2063
2064
  *
@@ -1,5 +1,4 @@
1
1
  import { DEBUG } from '@glimmer/env';
2
- import { _WeakSet } from '@glimmer/util';
3
2
  import { assert } from '@ember/debug';
4
3
 
5
4
  /**
@@ -306,7 +305,7 @@ function setListeners(func, listeners) {
306
305
  let meta = createObserverListenerMetaFor(func);
307
306
  meta.listeners = listeners;
308
307
  }
309
- const IS_WRAPPED_FUNCTION_SET = new _WeakSet();
308
+ const IS_WRAPPED_FUNCTION_SET = new WeakSet();
310
309
  /**
311
310
  Wraps the passed function so that `this._super` will point to the superFunc
312
311
  when the function is invoked. This is the primitive we use to implement
@@ -424,7 +423,7 @@ function toString(obj) {
424
423
  return objectToString.call(obj);
425
424
  }
426
425
 
427
- const PROXIES = new _WeakSet();
426
+ const PROXIES = new WeakSet();
428
427
  function isProxy(value) {
429
428
  if (isObject(value)) {
430
429
  return PROXIES.has(value);
@@ -485,7 +484,7 @@ function isPositiveInt(num) {
485
484
  return num >= 0 && num % 1 === 0;
486
485
  }
487
486
  if (DEBUG) {
488
- let SEEN_TAGS = new _WeakSet();
487
+ let SEEN_TAGS = new WeakSet();
489
488
  let MANDATORY_SETTERS = new WeakMap();
490
489
  let propertyIsEnumerable = function (obj, key) {
491
490
  return Object.prototype.propertyIsEnumerable.call(obj, key);
@@ -1,5 +1,4 @@
1
- import { _WeakSet } from '@glimmer/util';
2
- const EMBER_ARRAYS = new _WeakSet();
1
+ const EMBER_ARRAYS = new WeakSet();
3
2
  export function setEmberArray(obj) {
4
3
  EMBER_ARRAYS.add(obj);
5
4
  }
@@ -1,4 +1,3 @@
1
- import { _WeakSet as WeakSet } from '@glimmer/util';
2
1
  import { assert } from '@ember/debug';
3
2
  const {
4
3
  toString: objectToString
@@ -11,7 +11,6 @@ import { ActionHandler } from '@ember/-internals/runtime';
11
11
  import { makeArray } from '@ember/array';
12
12
  import { assert } from '@ember/debug';
13
13
  import { DEBUG } from '@glimmer/env';
14
- import { _WeakSet as WeakSet } from '@glimmer/util';
15
14
  import { destroy, isDestroying, isDestroyed, registerDestructor } from '@glimmer/destroyable';
16
15
  import { OWNER } from '@glimmer/owner';
17
16
  function hasSetUnknownProperty(val) {
@@ -6,7 +6,6 @@ import { meta as metaFor, peekMeta } from '@ember/-internals/meta';
6
6
  import { guidFor, observerListenerMetaFor, ROOT, wrap } from '@ember/-internals/utils';
7
7
  import { assert } from '@ember/debug';
8
8
  import { DEBUG } from '@glimmer/env';
9
- import { _WeakSet } from '@glimmer/util';
10
9
  import { isClassicDecorator } from '@ember/-internals/metal';
11
10
  import { ComputedProperty, descriptorForDecorator, makeComputedDecorator, nativeDescDecorator, setUnprocessedMixins, addObserver, removeObserver, revalidateObservers, defineDecorator, defineValue } from '@ember/-internals/metal';
12
11
  import { addListener, removeListener } from '@ember/object/events';
@@ -295,7 +294,7 @@ export function mixin(obj, ...args) {
295
294
  applyMixin(obj, args);
296
295
  return obj;
297
296
  }
298
- const MIXINS = new _WeakSet();
297
+ const MIXINS = new WeakSet();
299
298
  /**
300
299
  The `Mixin` class allows you to create mixins, whose properties can be
301
300
  added to other classes. For instance,