ember-source 7.3.0-alpha.5 → 7.3.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.
Files changed (159) hide show
  1. package/build-metadata.json +3 -3
  2. package/dist/dev/packages/@ember/-internals/deprecations/index.js +9 -0
  3. package/dist/dev/packages/@ember/-internals/glimmer/index.js +7 -7
  4. package/dist/dev/packages/@ember/-internals/routing/index.js +2 -2
  5. package/dist/dev/packages/@ember/-internals/runtime/index.js +1 -1
  6. package/dist/dev/packages/@ember/-internals/runtime/lib/ext/rsvp.js +1 -1
  7. package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +4 -0
  8. package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -0
  9. package/dist/dev/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -0
  10. package/dist/dev/packages/@ember/application/index.js +3 -3
  11. package/dist/dev/packages/@ember/application/instance.js +9 -9
  12. package/dist/dev/packages/@ember/component/helper.js +2 -2
  13. package/dist/dev/packages/@ember/component/index.js +3 -3
  14. package/dist/dev/packages/@ember/engine/index.js +3 -3
  15. package/dist/dev/packages/@ember/engine/instance.js +1 -1
  16. package/dist/dev/packages/@ember/helper/index.js +1132 -79
  17. package/dist/dev/packages/@ember/modifier/on.js +1 -1
  18. package/dist/dev/packages/@ember/object/compat.js +0 -32
  19. package/dist/dev/packages/@ember/renderer/index.js +1 -1
  20. package/dist/dev/packages/@ember/routing/-internals.js +2 -2
  21. package/dist/dev/packages/@ember/routing/index.js +11 -28
  22. package/dist/dev/packages/@ember/routing/lib/utils.js +2 -2
  23. package/dist/dev/packages/@ember/routing/route.js +2 -2
  24. package/dist/dev/packages/@ember/routing/router-service.js +9 -9
  25. package/dist/dev/packages/@ember/routing/router.js +2 -2
  26. package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +3 -3
  27. package/dist/dev/packages/@ember/template-compiler/lib/template.js +2 -2
  28. package/dist/dev/packages/@ember/template-factory/index.js +1 -1
  29. package/dist/dev/packages/@glimmer/opcode-compiler/index.js +2 -2
  30. package/dist/dev/packages/@glimmer/program/index.js +3 -3
  31. package/dist/dev/packages/@glimmer/runtime/index.js +7 -7
  32. package/dist/dev/packages/@glimmer/wire-format/index.js +2 -5
  33. package/dist/dev/packages/ember/version.js +1 -1
  34. package/dist/dev/packages/ember-template-compiler/index.js +2 -2
  35. package/dist/dev/packages/router_js/index.js +2 -2
  36. package/dist/dev/packages/rsvp/index.js +1 -2281
  37. package/dist/dev/packages/shared-chunks/{arguments-CDkbOqTS.js → arguments-BVmnQtAM.js} +10 -19
  38. package/dist/dev/packages/shared-chunks/{compiler-QUSl_urU.js → compiler-BHFFl-fv.js} +1 -1
  39. package/dist/dev/packages/shared-chunks/{curly-BbL6STF2.js → curly-qZIwixUW.js} +1 -1
  40. package/dist/dev/packages/shared-chunks/{element-BYLB-q7a.js → element-Cgoi4ldD.js} +0 -24
  41. package/dist/dev/packages/shared-chunks/get-BVBR6Afa.js +40 -0
  42. package/dist/dev/packages/shared-chunks/hash-BcOgEgJg.js +57 -0
  43. package/dist/dev/packages/shared-chunks/{index-DaFzpTIE.js → index-BYUSIu_W.js} +3 -3
  44. package/dist/dev/packages/shared-chunks/{index-Czn34wUZ.js → index-COgCjiy-.js} +193 -77
  45. package/dist/dev/packages/shared-chunks/{invoke-d9sqa50M.js → invoke-BzXY_4h3.js} +1 -1
  46. package/dist/dev/packages/shared-chunks/{not-DYh6AY9Z.js → not-CmLRAsFE.js} +1 -1
  47. package/dist/dev/packages/shared-chunks/{on-DlF0Wy7P.js → on-DXmOUOBH.js} +22 -11
  48. package/dist/dev/packages/shared-chunks/{opcodes-CplRyHl_.js → opcodes-DDajoGhq.js} +0 -4
  49. package/dist/dev/packages/shared-chunks/{outlet-B4qORyui.js → outlet-D6v6ZBvX.js} +3 -3
  50. package/dist/dev/packages/shared-chunks/{program-context-Dq8xN2HI.js → program-context-BBB1Ga5h.js} +2 -2
  51. package/dist/dev/packages/shared-chunks/{render-CtH73XOv.js → render-B5RULomD.js} +2 -2
  52. package/dist/{prod/packages/shared-chunks/rsvp.es-DR7yS7qg.js → dev/packages/shared-chunks/rsvp-aLN_pQtn.js} +152 -148
  53. package/dist/dev/packages/shared-chunks/{setup-registry-h519ZsHS.js → setup-registry-CVtsD0q2.js} +35 -13
  54. package/dist/{prod/packages/shared-chunks/syscall-ops-CN7STuUn.js → dev/packages/shared-chunks/syscall-ops-CkPT1Kfx.js} +1 -2
  55. package/dist/dev/packages/shared-chunks/{textarea-DEvw4ezm.js → textarea-DvS6Xmdh.js} +3 -23
  56. package/dist/dev/packages/shared-chunks/{unique-id-DQOhouG1.js → unique-id-Csxuh1I7.js} +0 -4
  57. package/dist/dev/packages/shared-chunks/{unrecognized-url-error-B8loxkay.js → unrecognized-url-error-cXUp-SK3.js} +1 -1
  58. package/dist/prod/packages/@ember/-internals/deprecations/index.js +9 -0
  59. package/dist/prod/packages/@ember/-internals/glimmer/index.js +7 -7
  60. package/dist/prod/packages/@ember/-internals/routing/index.js +2 -2
  61. package/dist/prod/packages/@ember/-internals/runtime/index.js +1 -1
  62. package/dist/prod/packages/@ember/-internals/runtime/lib/ext/rsvp.js +1 -1
  63. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +4 -0
  64. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -0
  65. package/dist/prod/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -0
  66. package/dist/prod/packages/@ember/application/index.js +3 -3
  67. package/dist/prod/packages/@ember/application/instance.js +9 -9
  68. package/dist/prod/packages/@ember/component/helper.js +2 -2
  69. package/dist/prod/packages/@ember/component/index.js +3 -3
  70. package/dist/prod/packages/@ember/engine/index.js +3 -3
  71. package/dist/prod/packages/@ember/engine/instance.js +1 -1
  72. package/dist/prod/packages/@ember/helper/index.js +1132 -79
  73. package/dist/prod/packages/@ember/modifier/on.js +1 -1
  74. package/dist/prod/packages/@ember/object/compat.js +0 -32
  75. package/dist/prod/packages/@ember/renderer/index.js +1 -1
  76. package/dist/prod/packages/@ember/routing/index.js +10 -27
  77. package/dist/prod/packages/@ember/routing/lib/utils.js +2 -2
  78. package/dist/prod/packages/@ember/routing/route.js +2 -2
  79. package/dist/prod/packages/@ember/routing/router-service.js +9 -9
  80. package/dist/prod/packages/@ember/routing/router.js +2 -2
  81. package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +3 -3
  82. package/dist/prod/packages/@ember/template-compiler/lib/template.js +2 -2
  83. package/dist/prod/packages/@ember/template-factory/index.js +1 -1
  84. package/dist/prod/packages/@glimmer/opcode-compiler/index.js +2 -2
  85. package/dist/prod/packages/@glimmer/program/index.js +3 -3
  86. package/dist/prod/packages/@glimmer/runtime/index.js +7 -7
  87. package/dist/prod/packages/@glimmer/wire-format/index.js +2 -5
  88. package/dist/prod/packages/ember/version.js +1 -1
  89. package/dist/prod/packages/ember-template-compiler/index.js +2 -2
  90. package/dist/prod/packages/router_js/index.js +2 -2
  91. package/dist/prod/packages/rsvp/index.js +1 -2281
  92. package/dist/prod/packages/shared-chunks/{arguments-BzAkZVBa.js → arguments-Carzx7C4.js} +6 -19
  93. package/dist/prod/packages/shared-chunks/{compiler-lBSssiWp.js → compiler-Wt5SWcrF.js} +1 -1
  94. package/dist/prod/packages/shared-chunks/{curly-CU2jYOtm.js → curly-xbTtts9R.js} +1 -1
  95. package/dist/prod/packages/shared-chunks/{element-DgHdPZ8u.js → element-BmBjPjkQ.js} +0 -24
  96. package/dist/prod/packages/shared-chunks/get-ZhOO_1qS.js +40 -0
  97. package/dist/prod/packages/shared-chunks/hash-b373B4IL.js +57 -0
  98. package/dist/prod/packages/shared-chunks/{index-XmtQRWbX.js → index-B-2NDHmt.js} +193 -77
  99. package/dist/prod/packages/shared-chunks/{index-Bf53M8eS.js → index-kwuZeaNz.js} +3 -3
  100. package/dist/prod/packages/shared-chunks/{invoke-DhQ5QRp2.js → invoke-B-r9UQVH.js} +1 -1
  101. package/dist/prod/packages/shared-chunks/{not-BOIVROuv.js → not-DOTpWiG3.js} +1 -1
  102. package/dist/prod/packages/shared-chunks/{on-BZHAxzdq.js → on-B-5KCq9L.js} +22 -11
  103. package/dist/prod/packages/shared-chunks/{opcodes-CplRyHl_.js → opcodes-DDajoGhq.js} +0 -4
  104. package/dist/prod/packages/shared-chunks/{outlet-CsNMfeOj.js → outlet-DDxtxFLV.js} +3 -3
  105. package/dist/prod/packages/shared-chunks/{program-context-COSioH46.js → program-context-WVlzpPdi.js} +2 -2
  106. package/dist/prod/packages/shared-chunks/{render-Bf7GviCY.js → render-OqKpH1Pf.js} +2 -2
  107. package/dist/{dev/packages/shared-chunks/rsvp.es-DR7yS7qg.js → prod/packages/shared-chunks/rsvp-aLN_pQtn.js} +152 -148
  108. package/dist/prod/packages/shared-chunks/{setup-registry-DFSQHIUs.js → setup-registry-CRFWTdVC.js} +35 -13
  109. package/dist/{dev/packages/shared-chunks/syscall-ops-CN7STuUn.js → prod/packages/shared-chunks/syscall-ops-CkPT1Kfx.js} +1 -2
  110. package/dist/prod/packages/shared-chunks/{textarea-DMmdvgk2.js → textarea-B-sssXGa.js} +3 -23
  111. package/dist/prod/packages/shared-chunks/{unique-id-o2pS74go.js → unique-id-BJb1p8EG.js} +0 -4
  112. package/dist/prod/packages/shared-chunks/{unrecognized-url-error-jjQ-FqKB.js → unrecognized-url-error-xC654tCo.js} +1 -1
  113. package/docs/data.json +1237 -1395
  114. package/package.json +5 -7
  115. package/types/stable/@ember/-internals/deprecations/index.d.ts +6 -0
  116. package/types/stable/@ember/-internals/glimmer/index.d.ts +7 -380
  117. package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +1 -1
  118. package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +2 -2
  119. package/types/stable/@ember/-internals/glimmer/lib/helpers/each-in.d.ts +171 -62
  120. package/types/stable/@ember/-internals/glimmer/lib/helpers/element.d.ts +0 -24
  121. package/types/stable/@ember/-internals/glimmer/lib/helpers/mut.d.ts +3 -2
  122. package/types/stable/@ember/-internals/glimmer/lib/helpers/readonly.d.ts +3 -1
  123. package/types/stable/@ember/-internals/glimmer/lib/helpers/unbound.d.ts +6 -2
  124. package/types/stable/@ember/-internals/glimmer/lib/helpers/unique-id.d.ts +0 -3
  125. package/types/stable/@ember/-internals/glimmer/lib/syntax/mount.d.ts +4 -2
  126. package/types/stable/@ember/-internals/glimmer/lib/syntax/outlet.d.ts +7 -2
  127. package/types/stable/@ember/helper/index.d.ts +1113 -73
  128. package/types/stable/@ember/object/compat.d.ts +0 -32
  129. package/types/stable/@ember/object/core.d.ts +1 -1
  130. package/types/stable/@ember/routing/router-service.d.ts +9 -9
  131. package/types/stable/@glimmer/interfaces/lib/compile/wire-format/api.d.ts +1 -9
  132. package/types/stable/@glimmer/interfaces/lib/compile/wire-format/opcodes.d.ts +0 -4
  133. package/types/stable/@glimmer/interfaces/lib/vm-opcodes.d.ts +0 -4
  134. package/types/stable/@glimmer/opcode-compiler/lib/opcode-builder/helpers/conditional.d.ts +1 -1
  135. package/types/stable/@glimmer/opcode-compiler/lib/syntax/statements.d.ts +1 -1
  136. package/types/stable/@glimmer/runtime/lib/helpers/array.d.ts +0 -33
  137. package/types/stable/@glimmer/runtime/lib/helpers/concat.d.ts +0 -25
  138. package/types/stable/@glimmer/runtime/lib/helpers/fn.d.ts +0 -70
  139. package/types/stable/@glimmer/runtime/lib/helpers/get.d.ts +0 -69
  140. package/types/stable/@glimmer/runtime/lib/helpers/hash.d.ts +0 -36
  141. package/types/stable/index.d.ts +0 -14
  142. package/dist/dev/packages/shared-chunks/get-6I3sjd-I.js +0 -135
  143. package/dist/dev/packages/shared-chunks/hash-6NDs_5_f.js +0 -198
  144. package/dist/prod/packages/shared-chunks/get-Dago5uGl.js +0 -135
  145. package/dist/prod/packages/shared-chunks/hash-gEXIsSO4.js +0 -198
  146. package/types/stable/@ember/-internals/glimmer/lib/helpers/array.d.ts +0 -43
  147. package/types/stable/@ember/-internals/glimmer/lib/helpers/component.d.ts +0 -93
  148. package/types/stable/@ember/-internals/glimmer/lib/helpers/concat.d.ts +0 -32
  149. package/types/stable/@ember/-internals/glimmer/lib/helpers/fn.d.ts +0 -77
  150. package/types/stable/@ember/-internals/glimmer/lib/helpers/get.d.ts +0 -94
  151. package/types/stable/@ember/-internals/glimmer/lib/helpers/hash.d.ts +0 -46
  152. package/types/stable/@ember/-internals/glimmer/lib/helpers/helper.d.ts +0 -43
  153. package/types/stable/@ember/-internals/glimmer/lib/helpers/if-unless.d.ts +0 -228
  154. package/types/stable/@ember/-internals/glimmer/lib/helpers/log.d.ts +0 -19
  155. package/types/stable/@ember/-internals/glimmer/lib/helpers/modifier.d.ts +0 -42
  156. package/types/stable/@ember/-internals/glimmer/lib/helpers/page-title.d.ts +0 -24
  157. package/types/stable/@ember/-internals/glimmer/lib/modifiers/on.d.ts +0 -95
  158. package/types/stable/@ember/-internals/glimmer/lib/syntax/in-element.d.ts +0 -49
  159. package/types/stable/@ember/-internals/glimmer/lib/syntax/let.d.ts +0 -43
@@ -5,16 +5,16 @@ import { c as createComputeRef, v as valueForRef, a as createConstRef, e as crea
5
5
  import { b as EMPTY_STRING_ARRAY, e as enumerate, c as emptyArray } from './array-utils-CZQxrdD3.js';
6
6
  import { C as CONSTANT_TAG, I as INITIAL, v as validateTag, c as consumeTag, a as valueForTag, o as beginTrackFrame, s as endTrackFrame, k as CURRENT_TAG } from './cache-DGDPVCpC.js';
7
7
  import { C as CURRIED_MODIFIER, a as CURRIED_COMPONENT } from './curried-BZnYakIg.js';
8
- import { j as VM_SYSCALL_SIZE, k as VM_CHILD_SCOPE_OP, l as VM_POP_SCOPE_OP, m as VM_PUSH_DYNAMIC_SCOPE_OP, n as VM_POP_DYNAMIC_SCOPE_OP, o as VM_CONSTANT_OP, p as decodeHandle, q as VM_CONSTANT_REFERENCE_OP, r as VM_PRIMITIVE_OP, s as isHandle, t as decodeImmediate, u as VM_PRIMITIVE_REFERENCE_OP, v as VM_DUP_OP, w as VM_POP_OP, x as VM_LOAD_OP, y as VM_FETCH_OP, z as VM_BIND_DYNAMIC_SCOPE_OP, A as VM_ENTER_OP, B as VM_EXIT_OP, C as VM_PUSH_SYMBOL_TABLE_OP, D as VM_PUSH_BLOCK_SCOPE_OP, E as VM_COMPILE_BLOCK_OP, F as VM_INVOKE_YIELD_OP, G as VM_JUMP_IF_OP, H as VM_JUMP_UNLESS_OP, I as VM_JUMP_EQ_OP, b as VM_ASSERT_SAME_OP, J as VM_TO_BOOLEAN_OP, K as VM_TEXT_OP, L as VM_COMMENT_OP, M as VM_OPEN_ELEMENT_OP, N as VM_OPEN_DYNAMIC_ELEMENT_OP, O as VM_PUSH_REMOTE_ELEMENT_OP, P as VM_POP_REMOTE_ELEMENT_OP, Q as VM_FLUSH_ELEMENT_OP, R as VM_CLOSE_ELEMENT_OP, S as VM_MODIFIER_OP, T as VM_DYNAMIC_MODIFIER_OP, U as VM_STATIC_ATTR_OP, W as VM_DYNAMIC_ATTR_OP, X as VM_PUSH_COMPONENT_DEFINITION_OP, Y as VM_RESOLVE_DYNAMIC_COMPONENT_OP, e as VM_RESOLVE_CURRIED_COMPONENT_OP, f as VM_PUSH_DYNAMIC_COMPONENT_INSTANCE_OP, Z as VM_PUSH_ARGS_OP, _ as VM_PUSH_EMPTY_ARGS_OP, $ as VM_CAPTURE_ARGS_OP, a0 as VM_PREPARE_ARGS_OP, a1 as VM_CREATE_COMPONENT_OP, a2 as VM_REGISTER_COMPONENT_DESTRUCTOR_OP, a3 as VM_BEGIN_COMPONENT_TRANSACTION_OP, a4 as VM_PUT_COMPONENT_OPERATIONS_OP, a5 as VM_COMPONENT_ATTR_OP, a6 as VM_STATIC_COMPONENT_ATTR_OP, a7 as VM_DID_CREATE_ELEMENT_OP, a8 as VM_GET_COMPONENT_SELF_OP, a9 as VM_GET_COMPONENT_TAG_NAME_OP, aa as VM_GET_COMPONENT_LAYOUT_OP, V as VM_MAIN_OP, ab as VM_POPULATE_LAYOUT_OP, ac as VM_VIRTUAL_ROOT_SCOPE_OP, ad as VM_SET_NAMED_VARIABLES_OP, ae as VM_SET_BLOCKS_OP, af as VM_INVOKE_COMPONENT_LAYOUT_OP, ag as VM_DID_RENDER_LAYOUT_OP, ah as VM_COMMIT_COMPONENT_TRANSACTION_OP } from './syscall-ops-CN7STuUn.js';
8
+ import { j as VM_SYSCALL_SIZE, k as VM_CHILD_SCOPE_OP, l as VM_POP_SCOPE_OP, m as VM_PUSH_DYNAMIC_SCOPE_OP, n as VM_POP_DYNAMIC_SCOPE_OP, o as VM_CONSTANT_OP, p as decodeHandle, q as VM_CONSTANT_REFERENCE_OP, r as VM_PRIMITIVE_OP, s as isHandle, t as decodeImmediate, u as VM_PRIMITIVE_REFERENCE_OP, v as VM_DUP_OP, w as VM_POP_OP, x as VM_LOAD_OP, y as VM_FETCH_OP, z as VM_BIND_DYNAMIC_SCOPE_OP, A as VM_ENTER_OP, B as VM_EXIT_OP, C as VM_PUSH_SYMBOL_TABLE_OP, D as VM_PUSH_BLOCK_SCOPE_OP, E as VM_COMPILE_BLOCK_OP, F as VM_INVOKE_YIELD_OP, G as VM_JUMP_UNLESS_OP, H as VM_JUMP_EQ_OP, b as VM_ASSERT_SAME_OP, I as VM_TO_BOOLEAN_OP, J as VM_TEXT_OP, K as VM_COMMENT_OP, L as VM_OPEN_ELEMENT_OP, M as VM_OPEN_DYNAMIC_ELEMENT_OP, N as VM_PUSH_REMOTE_ELEMENT_OP, O as VM_POP_REMOTE_ELEMENT_OP, P as VM_FLUSH_ELEMENT_OP, Q as VM_CLOSE_ELEMENT_OP, R as VM_MODIFIER_OP, S as VM_DYNAMIC_MODIFIER_OP, T as VM_STATIC_ATTR_OP, U as VM_DYNAMIC_ATTR_OP, W as VM_PUSH_COMPONENT_DEFINITION_OP, X as VM_RESOLVE_DYNAMIC_COMPONENT_OP, e as VM_RESOLVE_CURRIED_COMPONENT_OP, f as VM_PUSH_DYNAMIC_COMPONENT_INSTANCE_OP, Y as VM_PUSH_ARGS_OP, Z as VM_PUSH_EMPTY_ARGS_OP, _ as VM_CAPTURE_ARGS_OP, $ as VM_PREPARE_ARGS_OP, a0 as VM_CREATE_COMPONENT_OP, a1 as VM_REGISTER_COMPONENT_DESTRUCTOR_OP, a2 as VM_BEGIN_COMPONENT_TRANSACTION_OP, a3 as VM_PUT_COMPONENT_OPERATIONS_OP, a4 as VM_COMPONENT_ATTR_OP, a5 as VM_STATIC_COMPONENT_ATTR_OP, a6 as VM_DID_CREATE_ELEMENT_OP, a7 as VM_GET_COMPONENT_SELF_OP, a8 as VM_GET_COMPONENT_TAG_NAME_OP, a9 as VM_GET_COMPONENT_LAYOUT_OP, V as VM_MAIN_OP, aa as VM_POPULATE_LAYOUT_OP, ab as VM_VIRTUAL_ROOT_SCOPE_OP, ac as VM_SET_NAMED_VARIABLES_OP, ad as VM_SET_BLOCKS_OP, ae as VM_INVOKE_COMPONENT_LAYOUT_OP, af as VM_DID_RENDER_LAYOUT_OP, ag as VM_COMMIT_COMPONENT_TRANSACTION_OP } from './syscall-ops-CkPT1Kfx.js';
9
9
  import { d as debugToString } from './debug-to-string-C6LsA_qz.js';
10
10
  import { a as assert } from './assert-Zqc4wiAV.js';
11
11
  import { u as unwrapTemplate } from './template-BRrQR6KS.js';
12
12
  import { registerDestructor, destroy, associateDestroyableChild } from '../@glimmer/destroyable/index.js';
13
+ import { b as getInternalModifierManager, c as hasInternalComponentManager } from './api-DuLOZMO_.js';
13
14
  import { m as managerHasCapability } from './capabilities-CajW4QjE.js';
14
15
  import { a as assign } from './object-utils-AijlD-JH.js';
15
16
  import { I as InternalComponentCapabilities } from './flags-BZxHQ0yn.js';
16
17
  import { n as normalizeStringValue, C as ConcreteBounds } from './normalize-CKySQVU7.js';
17
- import { b as getInternalModifierManager } from './api-DuLOZMO_.js';
18
18
  import { toBool } from '../@glimmer/global-context/index.js';
19
19
 
20
20
  function CheckInstanceof(Class) {
@@ -498,22 +498,6 @@ APPEND_OPCODES.add(VM_INVOKE_YIELD_OP, vm => {
498
498
  vm.pushScope(invokingScope);
499
499
  vm.call(handle);
500
500
  });
501
- APPEND_OPCODES.add(VM_JUMP_IF_OP, (vm, {
502
- op1: target
503
- }) => {
504
- let reference = check(vm.stack.pop());
505
- let value = Boolean(valueForRef(reference));
506
- if (isConstRef(reference)) {
507
- if (value) {
508
- vm.lowlevel.goto(target);
509
- }
510
- } else {
511
- if (value) {
512
- vm.lowlevel.goto(target);
513
- }
514
- vm.updateWith(new Assert(reference));
515
- }
516
- });
517
501
  APPEND_OPCODES.add(VM_JUMP_UNLESS_OP, (vm, {
518
502
  op1: target
519
503
  }) => {
@@ -815,7 +799,11 @@ APPEND_OPCODES.add(VM_DYNAMIC_MODIFIER_OP, vm => {
815
799
  }
816
800
  }
817
801
  if (!isConstRef(ref) || tag) {
818
- return vm.updateWith(new UpdateDynamicModifierOpcode(tag, instance, instanceRef));
802
+ let updateOpcode = new UpdateDynamicModifierOpcode(tag, instance, instanceRef);
803
+
804
+ // The block must own this opcode, or instances created on update are never destroyed.
805
+ vm.associateDestroyable(updateOpcode);
806
+ return vm.updateWith(updateOpcode);
819
807
  }
820
808
  });
821
809
  class UpdateModifierOpcode {
@@ -972,6 +960,9 @@ APPEND_OPCODES.add(VM_RESOLVE_DYNAMIC_COMPONENT_OP, (vm, {
972
960
  let isStrict = constants.getValue(_isStrict);
973
961
  vm.loadValue($t1, null); // Clear the temp register
974
962
 
963
+ {
964
+ assert(component === null || component === undefined || typeof component === 'string' || isCurriedValue(component) || (typeof component === 'object' || typeof component === 'function') && hasInternalComponentManager(component));
965
+ }
975
966
  let definition;
976
967
  if (typeof component === 'string') {
977
968
  if (isStrict) {
@@ -5,7 +5,7 @@ import { s as setLocalDebugType } from './debug-brand-B1TWjOCH.js';
5
5
  import { a as assign } from './object-utils-AijlD-JH.js';
6
6
  import { i as isVoidTag, b as build, v as voidMap, P as Printer } from './transform-resolutions-h1ik8gqW.js';
7
7
  import { u as unwrap, e as expect, d as dict, b as exhausted } from './collections-DPkjqeA3.js';
8
- import { o as opcodes } from './opcodes-CplRyHl_.js';
8
+ import { o as opcodes } from './opcodes-DDajoGhq.js';
9
9
  import { C as CURRIED_MODIFIER, b as CURRIED_HELPER, a as CURRIED_COMPONENT } from './curried-BZnYakIg.js';
10
10
  import { a as WellKnownTagNames, W as WellKnownAttrNames } from './well-known-_EVO9RaV.js';
11
11
 
@@ -4,7 +4,7 @@ import { getViewElement, clearElementView, clearViewElement, addChildView, setVi
4
4
  import { debugFreeze } from '../@ember/debug/index.js';
5
5
  import { _instrumentStart } from '../@ember/instrumentation/index.js';
6
6
  import { c as createComputeRef, v as valueForRef, e as createPrimitiveRef, f as childRefFor, g as childRefFromParts, a as createConstRef, d as isUpdatableRef, u as updateRef } from './reference-BqOLhKFy.js';
7
- import { f as reifyPositional } from './arguments-CDkbOqTS.js';
7
+ import { f as reifyPositional } from './arguments-BVmnQtAM.js';
8
8
  import { E as EMPTY_ARRAY } from './array-utils-CZQxrdD3.js';
9
9
  import { a as valueForTag, p as beginUntrackFrame, w as endUntrackFrame, o as beginTrackFrame, s as endTrackFrame, c as consumeTag, v as validateTag } from './cache-DGDPVCpC.js';
10
10
  import { g as get } from './property_get-DXwpgTe7.js';
@@ -67,30 +67,6 @@ function getElementDefinition(tagName) {
67
67
 
68
68
  // ============ Element Helper ============
69
69
 
70
- /**
71
- The `element` helper lets you dynamically set the tag name of an element.
72
-
73
- ```handlebars
74
- {{#let (element @tagName) as |Tag|}}
75
- <Tag class="my-element">Hello</Tag>
76
- {{/let}}
77
- ```
78
-
79
- When `@tagName` is `"h1"`, this renders `<h1 class="my-element">Hello</h1>`.
80
-
81
- When `@tagName` is an empty string `""`, the block content is rendered without
82
- a wrapping element.
83
-
84
- Passing `null`, `undefined`, or non-string values will throw an assertion error.
85
-
86
- Changing the tag name will tear down and recreate the element and its contents.
87
-
88
- The `element` helper is built-in and does not need to be imported.
89
-
90
- @method element
91
- @for Ember.Templates.helpers
92
- @public
93
- */
94
70
  const element = internalHelper(({
95
71
  positional,
96
72
  named
@@ -0,0 +1,40 @@
1
+ import { c as createComputeRef, U as UNDEFINED_REFERENCE, v as valueForRef } from './reference-BqOLhKFy.js';
2
+ import { f as reifyPositional } from './arguments-BVmnQtAM.js';
3
+ import { i as internalHelper } from './hash-BcOgEgJg.js';
4
+ import { setPath, getPath } from '../@glimmer/global-context/index.js';
5
+ import { i as isDict } from './collections-DPkjqeA3.js';
6
+
7
+ const isEmpty = value => {
8
+ return value === null || value === undefined || typeof value.toString !== 'function';
9
+ };
10
+ const normalizeTextValue = value => {
11
+ if (isEmpty(value)) {
12
+ return '';
13
+ }
14
+ return String(value);
15
+ };
16
+ const concat = internalHelper(({
17
+ positional
18
+ }) => {
19
+ return createComputeRef(() => reifyPositional(positional).map(normalizeTextValue).join(''), null, 'concat');
20
+ });
21
+
22
+ const get = internalHelper(({
23
+ positional
24
+ }) => {
25
+ let sourceRef = positional[0] ?? UNDEFINED_REFERENCE;
26
+ let pathRef = positional[1] ?? UNDEFINED_REFERENCE;
27
+ return createComputeRef(() => {
28
+ let source = valueForRef(sourceRef);
29
+ if (isDict(source)) {
30
+ return getPath(source, String(valueForRef(pathRef)));
31
+ }
32
+ }, value => {
33
+ let source = valueForRef(sourceRef);
34
+ if (isDict(source)) {
35
+ return setPath(source, String(valueForRef(pathRef)), value);
36
+ }
37
+ }, 'get');
38
+ });
39
+
40
+ export { concat as c, get as g };
@@ -0,0 +1,57 @@
1
+ import { c as createComputeRef, b as isInvokableRef, u as updateRef, v as valueForRef } from './reference-BqOLhKFy.js';
2
+ import { f as reifyPositional, g as buildUntouchableThis, h as check, e as reifyNamed } from './arguments-BVmnQtAM.js';
3
+ import { j as setInternalHelperManager } from './api-DuLOZMO_.js';
4
+
5
+ function internalHelper(helper) {
6
+ return setInternalHelperManager(helper, {});
7
+ }
8
+
9
+ const array = internalHelper(({
10
+ positional
11
+ }) => {
12
+ return createComputeRef(() => reifyPositional(positional), null, 'array');
13
+ });
14
+
15
+ const context = buildUntouchableThis('`fn` helper');
16
+ const fn = internalHelper(({
17
+ positional
18
+ }) => {
19
+ let callbackRef = check(positional[0]);
20
+ return createComputeRef(() => {
21
+ return (...invocationArgs) => {
22
+ let [fn, ...args] = reifyPositional(positional);
23
+ assertCallbackIsFn(callbackRef);
24
+ if (isInvokableRef(callbackRef)) {
25
+ let value = args.length > 0 ? args[0] : invocationArgs[0];
26
+ return void updateRef(callbackRef, value);
27
+ } else {
28
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return -- @fixme
29
+ return fn.call(context, ...args, ...invocationArgs);
30
+ }
31
+ };
32
+ }, null, 'fn');
33
+ });
34
+ function assertCallbackIsFn(callbackRef) {
35
+ if (!(callbackRef && (isInvokableRef(callbackRef) || typeof valueForRef(callbackRef) === 'function'))) {
36
+ throw new Error(`You must pass a function as the \`fn\` helper's first argument, you passed ${callbackRef ? valueForRef(callbackRef) : callbackRef}. While rendering:\n\n${callbackRef?.debugLabel}`);
37
+ }
38
+ }
39
+
40
+ const hash = internalHelper(({
41
+ named
42
+ }) => {
43
+ let ref = createComputeRef(() => {
44
+ return reifyNamed(named);
45
+ }, null, 'hash');
46
+
47
+ // Setup the children so that templates can bypass getting the value of
48
+ // the reference and treat children lazily
49
+ let children = new Map();
50
+ for (let name in named) {
51
+ children.set(name, named[name]);
52
+ }
53
+ ref.children = children;
54
+ return ref;
55
+ });
56
+
57
+ export { array as a, fn as f, hash as h, internalHelper as i };
@@ -1,6 +1,6 @@
1
1
  import { a as assign } from './object-utils-AijlD-JH.js';
2
2
  import { b as EMPTY_STRING_ARRAY, E as EMPTY_ARRAY, e as enumerate, r as reverse } from './array-utils-CZQxrdD3.js';
3
- import { r as VM_PRIMITIVE_OP, aE as encodeHandle, au as VM_CONCAT_OP, al as VM_GET_VARIABLE_OP, q as VM_CONSTANT_REFERENCE_OP, ap as VM_GET_PROPERTY_OP, as as VM_HAS_BLOCK_OP, ar as VM_SPREAD_BLOCK_OP, E as VM_COMPILE_BLOCK_OP, at as VM_HAS_BLOCK_PARAMS_OP, av as VM_IF_INLINE_OP, aw as VM_NOT_OP, ax as VM_GET_DYNAMIC_VAR_OP, ay as VM_LOG_OP, y as VM_FETCH_OP, u as VM_PRIMITIVE_REFERENCE_OP, ak as VM_HELPER_OP, v as VM_DUP_OP, aj as VM_DYNAMIC_HELPER_OP, w as VM_POP_OP, $ as VM_CAPTURE_ARGS_OP, ai as VM_CURRY_OP, aF as isSmallInt, aG as encodeImmediate, m as VM_PUSH_DYNAMIC_SCOPE_OP, z as VM_BIND_DYNAMIC_SCOPE_OP, n as VM_POP_DYNAMIC_SCOPE_OP, aq as VM_GET_BLOCK_OP, F as VM_INVOKE_YIELD_OP, l as VM_POP_SCOPE_OP, k as VM_CHILD_SCOPE_OP, am as VM_SET_VARIABLE_OP, o as VM_CONSTANT_OP, D as VM_PUSH_BLOCK_SCOPE_OP, C as VM_PUSH_SYMBOL_TABLE_OP, _ as VM_PUSH_EMPTY_ARGS_OP, Z as VM_PUSH_ARGS_OP, A as VM_ENTER_OP, I as VM_JUMP_EQ_OP, B as VM_EXIT_OP, H as VM_JUMP_UNLESS_OP, X as VM_PUSH_COMPONENT_DEFINITION_OP, x as VM_LOAD_OP, a3 as VM_BEGIN_COMPONENT_TRANSACTION_OP, a1 as VM_CREATE_COMPONENT_OP, a2 as VM_REGISTER_COMPONENT_DESTRUCTOR_OP, a8 as VM_GET_COMPONENT_SELF_OP, ao as VM_ROOT_SCOPE_OP, an as VM_SET_BLOCK_OP, ag as VM_DID_RENDER_LAYOUT_OP, ah as VM_COMMIT_COMPONENT_TRANSACTION_OP, a0 as VM_PREPARE_ARGS_OP, ac as VM_VIRTUAL_ROOT_SCOPE_OP, ad as VM_SET_NAMED_VARIABLES_OP, ae as VM_SET_BLOCKS_OP, af as VM_INVOKE_COMPONENT_LAYOUT_OP, a4 as VM_PUT_COMPONENT_OPERATIONS_OP, N as VM_OPEN_DYNAMIC_ELEMENT_OP, a7 as VM_DID_CREATE_ELEMENT_OP, Q as VM_FLUSH_ELEMENT_OP, R as VM_CLOSE_ELEMENT_OP, e as VM_RESOLVE_CURRIED_COMPONENT_OP, Y as VM_RESOLVE_DYNAMIC_COMPONENT_OP, f as VM_PUSH_DYNAMIC_COMPONENT_INSTANCE_OP, aa as VM_GET_COMPONENT_LAYOUT_OP, ab as VM_POPULATE_LAYOUT_OP, a9 as VM_GET_COMPONENT_TAG_NAME_OP, L as VM_COMMENT_OP, S as VM_MODIFIER_OP, T as VM_DYNAMIC_MODIFIER_OP, U as VM_STATIC_ATTR_OP, a6 as VM_STATIC_COMPONENT_ATTR_OP, W as VM_DYNAMIC_ATTR_OP, a5 as VM_COMPONENT_ATTR_OP, M as VM_OPEN_ELEMENT_OP, aA as VM_DEBUGGER_OP, K as VM_TEXT_OP, b as VM_ASSERT_SAME_OP, az as VM_DYNAMIC_CONTENT_TYPE_OP, O as VM_PUSH_REMOTE_ELEMENT_OP, P as VM_POP_REMOTE_ELEMENT_OP, J as VM_TO_BOOLEAN_OP, aB as VM_ENTER_LIST_OP, aD as VM_ITERATE_OP, aC as VM_EXIT_LIST_OP } from './syscall-ops-CN7STuUn.js';
3
+ import { r as VM_PRIMITIVE_OP, aD as encodeHandle, at as VM_CONCAT_OP, ak as VM_GET_VARIABLE_OP, q as VM_CONSTANT_REFERENCE_OP, ao as VM_GET_PROPERTY_OP, ar as VM_HAS_BLOCK_OP, aq as VM_SPREAD_BLOCK_OP, E as VM_COMPILE_BLOCK_OP, as as VM_HAS_BLOCK_PARAMS_OP, au as VM_IF_INLINE_OP, av as VM_NOT_OP, aw as VM_GET_DYNAMIC_VAR_OP, ax as VM_LOG_OP, y as VM_FETCH_OP, u as VM_PRIMITIVE_REFERENCE_OP, aj as VM_HELPER_OP, v as VM_DUP_OP, ai as VM_DYNAMIC_HELPER_OP, w as VM_POP_OP, _ as VM_CAPTURE_ARGS_OP, ah as VM_CURRY_OP, aE as isSmallInt, aF as encodeImmediate, m as VM_PUSH_DYNAMIC_SCOPE_OP, z as VM_BIND_DYNAMIC_SCOPE_OP, n as VM_POP_DYNAMIC_SCOPE_OP, ap as VM_GET_BLOCK_OP, F as VM_INVOKE_YIELD_OP, l as VM_POP_SCOPE_OP, k as VM_CHILD_SCOPE_OP, al as VM_SET_VARIABLE_OP, o as VM_CONSTANT_OP, D as VM_PUSH_BLOCK_SCOPE_OP, C as VM_PUSH_SYMBOL_TABLE_OP, Z as VM_PUSH_EMPTY_ARGS_OP, Y as VM_PUSH_ARGS_OP, A as VM_ENTER_OP, H as VM_JUMP_EQ_OP, B as VM_EXIT_OP, G as VM_JUMP_UNLESS_OP, W as VM_PUSH_COMPONENT_DEFINITION_OP, x as VM_LOAD_OP, a2 as VM_BEGIN_COMPONENT_TRANSACTION_OP, a0 as VM_CREATE_COMPONENT_OP, a1 as VM_REGISTER_COMPONENT_DESTRUCTOR_OP, a7 as VM_GET_COMPONENT_SELF_OP, an as VM_ROOT_SCOPE_OP, am as VM_SET_BLOCK_OP, af as VM_DID_RENDER_LAYOUT_OP, ag as VM_COMMIT_COMPONENT_TRANSACTION_OP, $ as VM_PREPARE_ARGS_OP, ab as VM_VIRTUAL_ROOT_SCOPE_OP, ac as VM_SET_NAMED_VARIABLES_OP, ad as VM_SET_BLOCKS_OP, ae as VM_INVOKE_COMPONENT_LAYOUT_OP, a3 as VM_PUT_COMPONENT_OPERATIONS_OP, M as VM_OPEN_DYNAMIC_ELEMENT_OP, a6 as VM_DID_CREATE_ELEMENT_OP, P as VM_FLUSH_ELEMENT_OP, Q as VM_CLOSE_ELEMENT_OP, e as VM_RESOLVE_CURRIED_COMPONENT_OP, X as VM_RESOLVE_DYNAMIC_COMPONENT_OP, f as VM_PUSH_DYNAMIC_COMPONENT_INSTANCE_OP, a9 as VM_GET_COMPONENT_LAYOUT_OP, aa as VM_POPULATE_LAYOUT_OP, a8 as VM_GET_COMPONENT_TAG_NAME_OP, K as VM_COMMENT_OP, R as VM_MODIFIER_OP, S as VM_DYNAMIC_MODIFIER_OP, T as VM_STATIC_ATTR_OP, a5 as VM_STATIC_COMPONENT_ATTR_OP, U as VM_DYNAMIC_ATTR_OP, a4 as VM_COMPONENT_ATTR_OP, L as VM_OPEN_ELEMENT_OP, az as VM_DEBUGGER_OP, J as VM_TEXT_OP, b as VM_ASSERT_SAME_OP, ay as VM_DYNAMIC_CONTENT_TYPE_OP, N as VM_PUSH_REMOTE_ELEMENT_OP, O as VM_POP_REMOTE_ELEMENT_OP, I as VM_TO_BOOLEAN_OP, aA as VM_ENTER_LIST_OP, aC as VM_ITERATE_OP, aB as VM_EXIT_LIST_OP } from './syscall-ops-CkPT1Kfx.js';
4
4
  import { b as VM_RETURN_OP, i as isMachineOp, f as VM_PUSH_FRAME_OP, e as VM_POP_FRAME_OP, d as VM_INVOKE_VIRTUAL_OP, c as VM_JUMP_OP, a as VM_RETURN_TO_OP, V as VM_INVOKE_STATIC_OP } from './vm-ops-ImHv0Wtg.js';
5
5
  import { e as expect, u as unwrap, S as StackImpl, d as dict } from './collections-DPkjqeA3.js';
6
6
  import { i as isPresentArray } from './present-B1rrjAVM.js';
@@ -8,7 +8,7 @@ import { a as assert } from './assert-Zqc4wiAV.js';
8
8
  import { InstructionEncoderImpl } from '../@glimmer/encoder/index.js';
9
9
  import { a as TYPE_SIZE, A as ARG_SHIFT, M as MACHINE_MASK, I as InternalComponentCapabilities } from './flags-BZxHQ0yn.js';
10
10
  import { d as debugToString } from './debug-to-string-C6LsA_qz.js';
11
- import { o as opcodes } from './opcodes-CplRyHl_.js';
11
+ import { o as opcodes } from './opcodes-DDajoGhq.js';
12
12
  import { a as $v0, f as $fp, $ as $s0, g as $sp, h as $s1 } from './registers-C_W2qYHJ.js';
13
13
  import { ContentType } from '../@glimmer/vm/index.js';
14
14
  import { h as hasCapability } from './capabilities-CajW4QjE.js';
@@ -1054,7 +1054,7 @@ function SwitchCases(op, bootstrap, matcher) {
1054
1054
  * # Updating Execution
1055
1055
  *
1056
1056
  * Updating execution for this `replayable` occurs if the `body` added an
1057
- * assertion, via one of the `JumpIf`, `JumpUnless` or `AssertSame` opcodes.
1057
+ * assertion, via one of the `JumpUnless`, `JumpEq` or `AssertSame` opcodes.
1058
1058
  *
1059
1059
  * If, during updating executon, the assertion fails, the initial VM is
1060
1060
  * restored, and the stored arguments are pushed onto the stack. The DOM
@@ -5,7 +5,7 @@ import { associateDestroyableChild, destroy, registerDestructor, isDestroyed, is
5
5
  import { artifacts } from '../@glimmer/program/index.js';
6
6
  import { R as RuntimeOpImpl } from './program-DlgjqLa6.js';
7
7
  import { c as clientBuilder } from './api-Dz70AUL_.js';
8
- import { g as runtimeOptions, i as inTransaction, r as renderComponent$1 } from './render-CtH73XOv.js';
8
+ import { g as runtimeOptions, i as inTransaction, r as renderComponent$1 } from './render-B5RULomD.js';
9
9
  import { c as consumeTag, z as isTracking, e as debug, a as valueForTag, k as CURRENT_TAG, v as validateTag } from './cache-DGDPVCpC.js';
10
10
  import { h as hasDOM } from './index-BGP1rw3B.js';
11
11
  import { g as get$1, b as _getProp } from './property_get-DXwpgTe7.js';
@@ -28,15 +28,15 @@ import { isFactory } from '../@ember/-internals/owner/index.js';
28
28
  import { _instrumentStart } from '../@ember/instrumentation/index.js';
29
29
  import { g as getComponentTemplate } from './template-R_5UMHhb.js';
30
30
  import { a as getInternalHelperManager, j as setInternalHelperManager, g as getInternalComponentManager } from './api-DuLOZMO_.js';
31
- import { h as hash, f as fn, a as array } from './hash-6NDs_5_f.js';
32
- import { g as get, c as concat } from './get-6I3sjd-I.js';
33
- import { o as on } from './on-DlF0Wy7P.js';
31
+ import { h as hash, f as fn, a as array } from './hash-BcOgEgJg.js';
32
+ import { g as get, c as concat } from './get-BVBR6Afa.js';
33
+ import { o as on } from './on-DXmOUOBH.js';
34
34
  import { T as TEMPLATE_ONLY_COMPONENT_MANAGER, t as templateOnlyComponent } from './template-only-Cu639ICT.js';
35
35
  import { i as isCurlyManager } from './curly-brand-B_F79Dep.js';
36
36
  import { i as isClassicHelper } from './helper-brand-C9_8vvOf.js';
37
37
  import { dasherize } from '../@ember/-internals/string/index.js';
38
- import { a as uniqueId } from './unique-id-DQOhouG1.js';
39
- import { E as EvaluationContextImpl } from './program-context-Dq8xN2HI.js';
38
+ import { a as uniqueId } from './unique-id-Csxuh1I7.js';
39
+ import { E as EvaluationContextImpl } from './program-context-BBB1Ga5h.js';
40
40
 
41
41
  /**
42
42
  @module ember
@@ -150,7 +150,7 @@ const trackArray = internalHelper(({
150
150
  });
151
151
 
152
152
  /**
153
- @module ember
153
+ @module @ember/helper
154
154
  */
155
155
 
156
156
  /**
@@ -160,46 +160,91 @@ const trackArray = internalHelper(({
160
160
  The default behavior of `{{#each}}` is to yield its inner block once for every
161
161
  item in an array passing the item as the first block parameter.
162
162
 
163
- Assuming the `@developers` argument contains this array:
163
+ ```gjs {data-filename="app/components/developer-list.gjs"}
164
+ import Component from '@glimmer/component';
164
165
 
165
- ```javascript
166
- [{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
167
- ```
166
+ export default class DeveloperList extends Component {
167
+ developers = [
168
+ { name: 'Yehuda' },
169
+ { name: 'Tom' },
170
+ { name: 'Paul' },
171
+ ];
168
172
 
169
- ```handlebars
170
- <ul>
171
- {{#each @developers as |person|}}
172
- <li>Hello, {{person.name}}!</li>
173
- {{/each}}
174
- </ul>
173
+ <template>
174
+ <ul>
175
+ {{#each this.developers as |person|}}
176
+ <li>Hello, {{person.name}}!</li>
177
+ {{/each}}
178
+ </ul>
179
+ </template>
180
+ }
175
181
  ```
176
182
 
177
- The same rules apply to arrays of primitives.
183
+ The same rules apply to arrays of primitives:
184
+
185
+ ```gjs {data-filename="app/components/developer-names.gjs"}
186
+ import Component from '@glimmer/component';
187
+
188
+ export default class DeveloperNames extends Component {
189
+ developerNames = ['Yehuda', 'Tom', 'Paul'];
178
190
 
179
- ```javascript
180
- ['Yehuda', 'Tom', 'Paul']
191
+ <template>
192
+ <ul>
193
+ {{#each this.developerNames as |name|}}
194
+ <li>Hello, {{name}}!</li>
195
+ {{/each}}
196
+ </ul>
197
+ </template>
198
+ }
181
199
  ```
182
200
 
183
- ```handlebars
184
- <ul>
185
- {{#each @developerNames as |name|}}
186
- <li>Hello, {{name}}!</li>
187
- {{/each}}
188
- </ul>
201
+ `{{#each}}` also supports native JavaScript [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set)
202
+ values and other iterables:
203
+
204
+ ```gjs {data-filename="app/components/developer-set.gjs"}
205
+ import Component from '@glimmer/component';
206
+
207
+ export default class DeveloperSet extends Component {
208
+ developers = new Set([
209
+ { name: 'Yehuda' },
210
+ { name: 'Tom' },
211
+ { name: 'Paul' },
212
+ ]);
213
+
214
+ <template>
215
+ <ul>
216
+ {{#each this.developers as |person|}}
217
+ <li>Hello, {{person.name}}!</li>
218
+ {{/each}}
219
+ </ul>
220
+ </template>
221
+ }
189
222
  ```
190
223
 
191
- During iteration, the index of each item in the array is provided as a second block
192
- parameter.
224
+ During iteration, the index of each item in the array is provided as a second
225
+ block parameter:
193
226
 
194
- ```handlebars
195
- <ul>
196
- {{#each @developers as |person index|}}
197
- <li>Hello, {{person.name}}! You're number {{index}} in line</li>
198
- {{/each}}
199
- </ul>
227
+ ```gjs {data-filename="app/components/developer-list-with-index.gjs"}
228
+ import Component from '@glimmer/component';
229
+
230
+ export default class DeveloperListWithIndex extends Component {
231
+ developers = [
232
+ { name: 'Yehuda' },
233
+ { name: 'Tom' },
234
+ { name: 'Paul' },
235
+ ];
236
+
237
+ <template>
238
+ <ul>
239
+ {{#each this.developers as |person index|}}
240
+ <li>Hello, {{person.name}}! You're number {{index}} in line</li>
241
+ {{/each}}
242
+ </ul>
243
+ </template>
244
+ }
200
245
  ```
201
-
202
- `#each` is a keyword and does not need to be imported.
246
+
247
+ `#each` is a keyword and does not need to be imported.
203
248
 
204
249
  ### Specifying Keys
205
250
 
@@ -215,30 +260,38 @@ const trackArray = internalHelper(({
215
260
  needed. However, in some rare cases, the objects' identities may change even
216
261
  though they represent the same underlying data.
217
262
 
218
- For example:
263
+ For example, mapping over `people` produces a new array of new objects on each
264
+ render. Use `key` so Ember can match items across those renders:
219
265
 
220
- ```javascript
221
- people.map(person => {
222
- return { ...person, type: 'developer' };
223
- });
224
- ```
266
+ ```gjs {data-filename="app/components/mapped-developers.gjs"}
267
+ import Component from '@glimmer/component';
225
268
 
226
- In this case, each time the `people` array is `map`-ed over, it will produce
227
- an new array with completely different objects between renders. In these cases,
228
- you can help Ember determine how these objects related to each other with the
229
- `key` option:
269
+ export default class MappedDevelopers extends Component {
270
+ people = [
271
+ { name: 'Yehuda' },
272
+ { name: 'Tom' },
273
+ { name: 'Paul' },
274
+ ];
230
275
 
231
- ```handlebars
232
- <ul>
233
- {{#each @developers key="name" as |person|}}
234
- <li>Hello, {{person.name}}!</li>
235
- {{/each}}
236
- </ul>
276
+ get developers() {
277
+ return this.people.map((person) => {
278
+ return { ...person, type: 'developer' };
279
+ });
280
+ }
281
+
282
+ <template>
283
+ <ul>
284
+ {{#each this.developers key="name" as |person|}}
285
+ <li>Hello, {{person.name}}!</li>
286
+ {{/each}}
287
+ </ul>
288
+ </template>
289
+ }
237
290
  ```
238
291
 
239
292
  By doing so, Ember will use the value of the property specified (`person.name`
240
293
  in the example) to find a "match" from the previous render. That is, if Ember
241
- has previously seen an object from the `@developers` array with a matching
294
+ has previously seen an object from the `developers` array with a matching
242
295
  name, its DOM elements will be re-used.
243
296
 
244
297
  There are two special values for `key`:
@@ -251,36 +304,47 @@ const trackArray = internalHelper(({
251
304
  `{{#each}}` can have a matching `{{else}}`. The contents of this block will render
252
305
  if the collection is empty.
253
306
 
254
- ```handlebars
255
- <ul>
256
- {{#each @developers as |person|}}
257
- <li>{{person.name}} is available!</li>
258
- {{else}}
259
- <li>Sorry, nobody is available for this task.</li>
260
- {{/each}}
261
- </ul>
307
+ ```gjs {data-filename="app/components/available-developers.gjs"}
308
+ import Component from '@glimmer/component';
309
+
310
+ export default class AvailableDevelopers extends Component {
311
+ developers = [];
312
+
313
+ <template>
314
+ <ul>
315
+ {{#each this.developers as |person|}}
316
+ <li>{{person.name}} is available!</li>
317
+ {{else}}
318
+ <li>Sorry, nobody is available for this task.</li>
319
+ {{/each}}
320
+ </ul>
321
+ </template>
322
+ }
262
323
  ```
263
324
 
264
325
  @method each
265
- @for Ember.Templates.helpers
326
+ @for Keywords
327
+ @static
328
+ @noimport
266
329
  @public
267
330
  */
268
331
 
269
332
  /**
270
- The `{{#each-in}}` keyword loops over properties on an object.
333
+ The `{{#each-in}}` keyword loops over properties on an object, or entries in a
334
+ native JavaScript [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map).
271
335
 
272
336
  For example, given this component definition:
273
337
 
274
- ```app/components/developer-details.gjs
338
+ ```gjs {data-filename="app/components/developer-details.gjs"}
275
339
  import Component from '@glimmer/component';
276
340
  import { tracked } from '@glimmer/tracking';
277
341
 
278
- export default class extends Component {
342
+ export default class DeveloperDetails extends Component {
279
343
  @tracked developer = {
280
- "name": "Shelly Sails",
281
- "age": 42
344
+ name: 'Shelly Sails',
345
+ age: 42,
282
346
  };
283
-
347
+
284
348
  <template>
285
349
  <ul>
286
350
  {{#each-in this.developer as |key value|}}
@@ -300,11 +364,56 @@ const trackArray = internalHelper(({
300
364
  <li>age: 42</li>
301
365
  </ul>
302
366
  ```
303
-
367
+
368
+ The same pattern works with a `Map`:
369
+
370
+ ```gjs {data-filename="app/components/developer-map.gjs"}
371
+ import Component from '@glimmer/component';
372
+
373
+ export default class DeveloperMap extends Component {
374
+ map = new Map([
375
+ ['name', 'Shelly Sails'],
376
+ ['age', 42],
377
+ ]);
378
+
379
+ <template>
380
+ <ul>
381
+ {{#each-in this.map as |key value|}}
382
+ <li>{{key}}: {{value}}</li>
383
+ {{/each-in}}
384
+ </ul>
385
+ </template>
386
+ }
387
+ ```
388
+
389
+ When a `Map` uses object keys, you can pass `key="@identity"` to explicitly
390
+ track entries across re-renders using the JavaScript identity of each key:
391
+
392
+ ```gjs {data-filename="app/components/object-keyed-map.gjs"}
393
+ import Component from '@glimmer/component';
394
+
395
+ export default class ObjectKeyedMap extends Component {
396
+ map = new Map([
397
+ [{ name: 'one' }, 'foo'],
398
+ [{ name: 'two' }, 'bar'],
399
+ ]);
400
+
401
+ <template>
402
+ <ul>
403
+ {{#each-in this.map key="@identity" as |key value|}}
404
+ <li>{{key.name}}: {{value}}</li>
405
+ {{/each-in}}
406
+ </ul>
407
+ </template>
408
+ }
409
+ ```
410
+
304
411
  `#each-in` is a keyword and does not need to be imported.
305
412
 
306
413
  @method each-in
307
- @for Ember.Templates.helpers
414
+ @static
415
+ @noimport
416
+ @for Keywords
308
417
  @public
309
418
  @since 2.1.0
310
419
  */
@@ -331,7 +440,7 @@ const eachIn = internalHelper(({
331
440
  });
332
441
 
333
442
  /**
334
- @module ember
443
+ @module @ember/helper
335
444
  */
336
445
 
337
446
  /**
@@ -351,7 +460,7 @@ const eachIn = internalHelper(({
351
460
 
352
461
  The child `Component` would invoke the function with the new click count:
353
462
 
354
- ```app/components/my-child.gjs
463
+ ```gjs {data-filename="app/components/my-child.gjs"}
355
464
  import Component from '@glimmer/component';
356
465
  import { action } from '@ember/object';
357
466
 
@@ -373,7 +482,8 @@ const eachIn = internalHelper(({
373
482
 
374
483
  @method mut
375
484
  @param {Object} [attr] the "two-way" attribute that can be modified.
376
- @for Ember.Templates.helpers
485
+ @static
486
+ @for Keywords
377
487
  @public
378
488
  */
379
489
 
@@ -398,7 +508,7 @@ const mut = internalHelper(({
398
508
  });
399
509
 
400
510
  /**
401
- @module ember
511
+ @module @ember/helper
402
512
  */
403
513
 
404
514
 
@@ -510,7 +620,9 @@ const mut = internalHelper(({
510
620
 
511
621
  @method readonly
512
622
  @param {Object} [attr] the read-only attribute.
513
- @for Ember.Templates.helpers
623
+ @for Keywords
624
+ @noimport
625
+ @static
514
626
  @private
515
627
  */
516
628
  const readonly = internalHelper(({
@@ -522,7 +634,7 @@ const readonly = internalHelper(({
522
634
  });
523
635
 
524
636
  /**
525
- @module ember
637
+ @module @ember/helper
526
638
  */
527
639
 
528
640
 
@@ -548,9 +660,13 @@ const readonly = internalHelper(({
548
660
 
549
661
  The `unbound` helper only accepts a single argument, and it return an
550
662
  unbound value.
663
+
664
+ `unbound` is a template keyword and does not need to be imported.
551
665
 
552
666
  @method unbound
553
- @for Ember.Templates.helpers
667
+ @static
668
+ @noimport
669
+ @for Keywords
554
670
  @public
555
671
  */
556
672