ember-source 7.1.0-alpha.4 → 7.1.0-beta.1

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 (499) hide show
  1. package/build-metadata.json +3 -3
  2. package/dist/dev/packages/@ember/-internals/container/index.js +4 -401
  3. package/dist/dev/packages/@ember/-internals/deprecations/index.js +1 -1
  4. package/dist/dev/packages/@ember/-internals/environment/index.js +3 -161
  5. package/dist/dev/packages/@ember/-internals/glimmer/index.js +14 -15
  6. package/dist/dev/packages/@ember/-internals/meta/lib/meta.js +0 -1
  7. package/dist/dev/packages/@ember/-internals/metal/index.js +18 -9
  8. package/dist/dev/packages/@ember/-internals/routing/index.js +1 -10
  9. package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +10 -12
  10. package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +1 -10
  11. package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -10
  12. package/dist/dev/packages/@ember/-internals/string/index.js +0 -1
  13. package/dist/dev/packages/@ember/-internals/utils/index.js +8 -3
  14. package/dist/dev/packages/@ember/-internals/views/index.js +0 -1
  15. package/dist/dev/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +0 -1
  16. package/dist/dev/packages/@ember/-internals/views/lib/mixins/action_support.js +3 -12
  17. package/dist/dev/packages/@ember/-internals/views/lib/system/event_dispatcher.js +2 -11
  18. package/dist/dev/packages/@ember/-internals/views/lib/system/utils.js +1 -1
  19. package/dist/dev/packages/@ember/-internals/views/lib/views/core_view.js +2 -19
  20. package/dist/dev/packages/@ember/-internals/views/lib/views/states.js +1 -1
  21. package/dist/dev/packages/@ember/application/index.js +5 -28
  22. package/dist/dev/packages/@ember/application/instance.js +3 -22
  23. package/dist/dev/packages/@ember/application/namespace.js +4 -11
  24. package/dist/dev/packages/@ember/array/index.js +7 -15
  25. package/dist/dev/packages/@ember/array/proxy.js +10 -14
  26. package/dist/dev/packages/@ember/canary-features/index.js +1 -1
  27. package/dist/dev/packages/@ember/component/helper.js +1 -14
  28. package/dist/dev/packages/@ember/component/index.js +1356 -17
  29. package/dist/dev/packages/@ember/component/template-only.js +1 -9
  30. package/dist/dev/packages/@ember/controller/index.js +3 -19
  31. package/dist/dev/packages/@ember/debug/container-debug-adapter.js +0 -19
  32. package/dist/dev/packages/@ember/debug/data-adapter.js +4 -11
  33. package/dist/dev/packages/@ember/debug/index.js +1 -1
  34. package/dist/dev/packages/@ember/debug/lib/deprecate.js +1 -1
  35. package/dist/dev/packages/@ember/engine/index.js +3 -31
  36. package/dist/dev/packages/@ember/engine/instance.js +3 -8
  37. package/dist/dev/packages/@ember/helper/index.js +159 -21
  38. package/dist/dev/packages/@ember/instrumentation/index.js +1 -1
  39. package/dist/dev/packages/@ember/modifier/index.js +2 -16
  40. package/dist/dev/packages/@ember/modifier/on.js +1 -9
  41. package/dist/dev/packages/@ember/object/-internals.js +3 -11
  42. package/dist/dev/packages/@ember/object/compat.js +3 -10
  43. package/dist/dev/packages/@ember/object/computed.js +2 -12
  44. package/dist/dev/packages/@ember/object/core.js +10 -18
  45. package/dist/dev/packages/@ember/object/evented.js +2 -12
  46. package/dist/dev/packages/@ember/object/events.js +1 -11
  47. package/dist/dev/packages/@ember/object/index.js +10 -14
  48. package/dist/dev/packages/@ember/object/internals.js +1 -1
  49. package/dist/dev/packages/@ember/object/lib/computed/computed_macros.js +6 -23
  50. package/dist/dev/packages/@ember/object/lib/computed/reduce_computed_macros.js +3 -12
  51. package/dist/dev/packages/@ember/object/mixin.js +7 -10
  52. package/dist/dev/packages/@ember/object/observable.js +8 -12
  53. package/dist/dev/packages/@ember/object/observers.js +1 -11
  54. package/dist/dev/packages/@ember/object/promise-proxy-mixin.js +3 -13
  55. package/dist/dev/packages/@ember/object/proxy.js +0 -7
  56. package/dist/dev/packages/@ember/reactive/collections.js +591 -1
  57. package/dist/dev/packages/@ember/renderer/index.js +1 -14
  58. package/dist/dev/packages/@ember/routing/-internals.js +1 -10
  59. package/dist/dev/packages/@ember/routing/index.js +614 -14
  60. package/dist/dev/packages/@ember/routing/lib/generate_controller.js +2 -11
  61. package/dist/dev/packages/@ember/routing/lib/routing-service.js +7 -17
  62. package/dist/dev/packages/@ember/routing/lib/utils.js +2 -11
  63. package/dist/dev/packages/@ember/routing/route.js +13 -24
  64. package/dist/dev/packages/@ember/routing/router-service.js +9 -18
  65. package/dist/dev/packages/@ember/routing/router.js +5 -21
  66. package/dist/dev/packages/@ember/runloop/index.js +1 -10
  67. package/dist/dev/packages/@ember/service/index.js +1 -11
  68. package/dist/dev/packages/@ember/template/index.js +1 -14
  69. package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +12 -15
  70. package/dist/dev/packages/@ember/template-compiler/lib/dasherize-component-name.js +0 -1
  71. package/dist/dev/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +13 -60
  72. package/dist/dev/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
  73. package/dist/dev/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +1 -3
  74. package/dist/dev/packages/@ember/template-compiler/lib/template.js +3 -11
  75. package/dist/dev/packages/@ember/template-factory/index.js +1 -8
  76. package/dist/dev/packages/@ember/utils/lib/compare.js +0 -7
  77. package/dist/dev/packages/@ember/utils/lib/is_empty.js +1 -12
  78. package/dist/dev/packages/@glimmer/destroyable/index.js +1 -1
  79. package/dist/dev/packages/@glimmer/manager/index.js +5 -315
  80. package/dist/dev/packages/@glimmer/node/index.js +3 -11
  81. package/dist/dev/packages/@glimmer/opcode-compiler/index.js +2 -7
  82. package/dist/dev/packages/@glimmer/program/index.js +194 -3
  83. package/dist/dev/packages/@glimmer/reference/index.js +4 -5
  84. package/dist/dev/packages/@glimmer/runtime/index.js +15 -10
  85. package/dist/dev/packages/@glimmer/tracking/index.js +2 -11
  86. package/dist/dev/packages/@glimmer/tracking/primitives/cache/index.js +1 -11
  87. package/dist/dev/packages/@glimmer/util/index.js +1 -2
  88. package/dist/dev/packages/@glimmer/validator/index.js +4 -1253
  89. package/dist/dev/packages/@glimmer/vm/index.js +1 -1
  90. package/dist/dev/packages/@glimmer/wire-format/index.js +3 -65
  91. package/dist/dev/packages/ember/version.js +1 -1
  92. package/dist/dev/packages/ember-template-compiler/index.js +7 -7
  93. package/dist/dev/packages/shared-chunks/{alias-CSC0WIbj.js → alias-ZcMQckQV.js} +8 -4
  94. package/dist/dev/packages/shared-chunks/api-BAmlf_CN.js +310 -0
  95. package/dist/dev/packages/shared-chunks/{api-BQMslHhq.js → api-BawZUDYD.js} +5 -6
  96. package/dist/dev/packages/shared-chunks/{args-proxy-DgXMc9b5.js → args-proxy-BNLuRFlO.js} +2 -4
  97. package/dist/dev/packages/shared-chunks/{array-D8PfjQHi.js → array-Bh_kUjzy.js} +2 -1
  98. package/dist/dev/packages/shared-chunks/assert-Zqc4wiAV.js +6 -0
  99. package/dist/dev/packages/shared-chunks/cache-B7dqAS38.js +596 -0
  100. package/dist/dev/packages/shared-chunks/{capabilities-O_xc7Yqk.js → capabilities-CZkuOqqC.js} +0 -5
  101. package/dist/dev/packages/shared-chunks/chain-tags-D6tuFUj_.js +190 -0
  102. package/dist/dev/packages/shared-chunks/{collections-D_nY_0UJ.js → collections-DPkjqeA3.js} +0 -1
  103. package/dist/dev/packages/shared-chunks/{compiler-D1leQ3Gl.js → compiler-QUSl_urU.js} +7043 -235
  104. package/dist/dev/packages/shared-chunks/computed-CJnghmXC.js +980 -0
  105. package/dist/dev/packages/shared-chunks/container-BzzHmCNj.js +404 -0
  106. package/dist/dev/packages/shared-chunks/curly-BBzF_bI8.js +617 -0
  107. package/dist/dev/packages/shared-chunks/curried-BZnYakIg.js +5 -0
  108. package/dist/dev/packages/shared-chunks/{debug-to-string-CFb7h0lY.js → debug-to-string-C6LsA_qz.js} +1 -2
  109. package/dist/dev/packages/shared-chunks/decorator-B5Uh5NFI.js +135 -0
  110. package/dist/dev/packages/shared-chunks/element-DQJOvSlQ.js +109 -0
  111. package/dist/dev/packages/shared-chunks/element-builder--iTIJyCB.js +812 -0
  112. package/dist/dev/packages/shared-chunks/env-g-kaAFLN.js +161 -0
  113. package/dist/dev/packages/shared-chunks/events-6aFVjD4k.js +180 -0
  114. package/dist/dev/packages/shared-chunks/get-D5b5QlqE.js +138 -0
  115. package/dist/dev/packages/shared-chunks/get-debug-name-CSniHBsn.js +45 -0
  116. package/dist/dev/packages/shared-chunks/get_properties-CIm8IAtP.js +55 -0
  117. package/dist/dev/packages/shared-chunks/guid-Cbq2sNV_.js +123 -0
  118. package/dist/dev/packages/shared-chunks/hash-BRRFQJ99.js +192 -0
  119. package/dist/dev/packages/shared-chunks/helper-Do7NCZHI.js +314 -0
  120. package/dist/dev/packages/shared-chunks/index-CwnQYqK5.js +2500 -0
  121. package/dist/dev/packages/shared-chunks/{index-BUPd6pkm.js → index-CyZiGiEI.js} +28 -29
  122. package/dist/dev/packages/shared-chunks/index-D-xTBV4B.js +220 -0
  123. package/dist/dev/packages/shared-chunks/injected_property-B4T-FzZZ.js +70 -0
  124. package/dist/dev/packages/shared-chunks/intern-zquhAEIg.js +51 -0
  125. package/dist/dev/packages/shared-chunks/internal-CAL-jHZt.js +140 -0
  126. package/dist/dev/packages/shared-chunks/internal-helper-Ez7zbEIa.js +7 -0
  127. package/dist/dev/packages/shared-chunks/{neq-DujMPv1k.js → invoke-B8M5fQQS.js} +4 -32
  128. package/dist/{prod/packages/shared-chunks/is_proxy-Cr1qlMv_.js → dev/packages/shared-chunks/is_proxy-Bzg0d4m4.js} +1 -1
  129. package/dist/dev/packages/shared-chunks/libraries-CHBwbR72.js +79 -0
  130. package/dist/dev/packages/shared-chunks/mandatory-setter-BpbAMTzV.js +107 -0
  131. package/dist/dev/packages/shared-chunks/meta-BmRXesrk.js +46 -0
  132. package/dist/{prod/packages/shared-chunks/name-C68GLLO3.js → dev/packages/shared-chunks/name-Clp4Vsod.js} +1 -1
  133. package/dist/dev/packages/shared-chunks/{namespace_search-uT8odThF.js → namespace_search-BfvzEQzN.js} +1 -2
  134. package/dist/dev/packages/shared-chunks/normalize-CKySQVU7.js +84 -0
  135. package/dist/dev/packages/shared-chunks/observers-C2DurkLG.js +199 -0
  136. package/dist/dev/packages/shared-chunks/on-BueSMv9L.js +253 -0
  137. package/dist/dev/packages/shared-chunks/opcodes-CplRyHl_.js +50 -0
  138. package/dist/dev/packages/shared-chunks/or-O0eJQ4K-.js +118 -0
  139. package/dist/{prod/packages/shared-chunks/program-B7SJZ5NF.js → dev/packages/shared-chunks/program-DzAfcWFj.js} +1 -1
  140. package/dist/{prod/packages/shared-chunks/program-context-DFiwaPMR.js → dev/packages/shared-chunks/program-context-CadjldRr.js} +4 -3
  141. package/dist/dev/packages/shared-chunks/property_get-CIBS9umw.js +139 -0
  142. package/dist/dev/packages/shared-chunks/{property_set-DaoZXGM5.js → property_set-D3PKyisF.js} +4 -2
  143. package/dist/dev/packages/shared-chunks/props-fiqxqhAH.js +85 -0
  144. package/dist/dev/packages/shared-chunks/{reference-C3TKDRnP.js → reference-BoPB2LfI.js} +3 -4
  145. package/dist/{prod/packages/shared-chunks/registers-ylirb0dq.js → dev/packages/shared-chunks/registers-C_W2qYHJ.js} +1 -1
  146. package/dist/{prod/packages/shared-chunks/rehydrate-builder-D3t52iGR.js → dev/packages/shared-chunks/rehydrate-builder-DCyIgnCR.js} +7 -4
  147. package/dist/dev/packages/shared-chunks/{render-DCchifOK.js → render-CpKaO-BO.js} +512 -16
  148. package/dist/{prod/packages/shared-chunks/chunk-3SQBS3Y5-Cj4eryg1.js → dev/packages/shared-chunks/runtime-CYyqkz5q-BOdRhmsS.js} +4 -59
  149. package/dist/{prod/packages/shared-chunks/serialize-builder-iXiRs1Pg.js → dev/packages/shared-chunks/serialize-builder-DxgGRvH_.js} +2 -7
  150. package/dist/dev/packages/shared-chunks/set_properties-BghuuGJx.js +48 -0
  151. package/dist/dev/packages/shared-chunks/{setup-registry-DxchCIL2.js → setup-registry-BC5VMvei.js} +34 -14
  152. package/dist/dev/packages/shared-chunks/spec-BXl1reqK.js +16 -0
  153. package/dist/dev/packages/shared-chunks/super-BBBjgF69.js +91 -0
  154. package/dist/dev/packages/shared-chunks/syscall-ops-BPFtDquC.js +133 -0
  155. package/dist/dev/packages/shared-chunks/template-BRrQR6KS.js +16 -0
  156. package/dist/dev/packages/shared-chunks/{template-kM-7TTcc.js → template-R_5UMHhb.js} +1 -1
  157. package/dist/dev/packages/shared-chunks/template-only-BqOt8bDl.js +78 -0
  158. package/dist/dev/packages/shared-chunks/textarea-WSlUEr0y.js +468 -0
  159. package/dist/dev/packages/shared-chunks/tracked-CKE4wnE6.js +148 -0
  160. package/dist/dev/packages/shared-chunks/tracked-data-CGnA4ytZ.js +31 -0
  161. package/dist/dev/packages/shared-chunks/transform-resolutions-h1ik8gqW.js +645 -0
  162. package/dist/dev/packages/shared-chunks/unique-id-CgmHQiwi.js +32 -0
  163. package/dist/{prod/packages/shared-chunks/on-CersD7PL.js → dev/packages/shared-chunks/untouchable-this-B3DVwpHS.js} +215 -1397
  164. package/dist/dev/packages/shared-chunks/vm-ops-ImHv0Wtg.js +12 -0
  165. package/dist/dev/packages/shared-chunks/well-known-_EVO9RaV.js +17 -0
  166. package/dist/prod/packages/@ember/-internals/container/index.js +4 -315
  167. package/dist/prod/packages/@ember/-internals/deprecations/index.js +1 -1
  168. package/dist/prod/packages/@ember/-internals/environment/index.js +3 -158
  169. package/dist/prod/packages/@ember/-internals/glimmer/index.js +14 -13
  170. package/dist/prod/packages/@ember/-internals/meta/lib/meta.js +0 -3
  171. package/dist/prod/packages/@ember/-internals/metal/index.js +18 -13
  172. package/dist/prod/packages/@ember/-internals/routing/index.js +1 -6
  173. package/dist/prod/packages/@ember/-internals/runtime/lib/ext/rsvp.js +0 -1
  174. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +9 -10
  175. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +1 -6
  176. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js +0 -1
  177. package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +2 -6
  178. package/dist/prod/packages/@ember/-internals/string/index.js +0 -2
  179. package/dist/prod/packages/@ember/-internals/utils/index.js +32 -30
  180. package/dist/prod/packages/@ember/-internals/views/index.js +0 -1
  181. package/dist/prod/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +0 -2
  182. package/dist/prod/packages/@ember/-internals/views/lib/mixins/action_support.js +1 -6
  183. package/dist/prod/packages/@ember/-internals/views/lib/system/event_dispatcher.js +2 -7
  184. package/dist/prod/packages/@ember/-internals/views/lib/system/utils.js +1 -2
  185. package/dist/prod/packages/@ember/-internals/views/lib/views/core_view.js +2 -15
  186. package/dist/prod/packages/@ember/-internals/views/lib/views/states.js +0 -2
  187. package/dist/prod/packages/@ember/application/index.js +5 -24
  188. package/dist/prod/packages/@ember/application/instance.js +5 -18
  189. package/dist/prod/packages/@ember/application/namespace.js +4 -8
  190. package/dist/prod/packages/@ember/array/index.js +7 -12
  191. package/dist/prod/packages/@ember/array/proxy.js +9 -10
  192. package/dist/prod/packages/@ember/canary-features/index.js +1 -1
  193. package/dist/prod/packages/@ember/component/helper.js +1 -12
  194. package/dist/prod/packages/@ember/component/index.js +1291 -15
  195. package/dist/prod/packages/@ember/component/template-only.js +1 -6
  196. package/dist/prod/packages/@ember/controller/index.js +3 -16
  197. package/dist/prod/packages/@ember/debug/container-debug-adapter.js +1 -15
  198. package/dist/prod/packages/@ember/debug/data-adapter.js +5 -7
  199. package/dist/prod/packages/@ember/debug/index.js +1 -1
  200. package/dist/prod/packages/@ember/debug/lib/deprecate.js +1 -1
  201. package/dist/prod/packages/@ember/engine/index.js +3 -27
  202. package/dist/prod/packages/@ember/engine/instance.js +3 -9
  203. package/dist/prod/packages/@ember/helper/index.js +159 -19
  204. package/dist/prod/packages/@ember/instrumentation/index.js +1 -1
  205. package/dist/prod/packages/@ember/modifier/index.js +2 -14
  206. package/dist/prod/packages/@ember/modifier/on.js +1 -6
  207. package/dist/prod/packages/@ember/object/-internals.js +2 -6
  208. package/dist/prod/packages/@ember/object/compat.js +3 -7
  209. package/dist/prod/packages/@ember/object/computed.js +2 -8
  210. package/dist/prod/packages/@ember/object/core.js +8 -15
  211. package/dist/prod/packages/@ember/object/evented.js +2 -7
  212. package/dist/prod/packages/@ember/object/events.js +1 -6
  213. package/dist/prod/packages/@ember/object/index.js +10 -12
  214. package/dist/prod/packages/@ember/object/internals.js +2 -6
  215. package/dist/prod/packages/@ember/object/lib/computed/computed_macros.js +5 -20
  216. package/dist/prod/packages/@ember/object/lib/computed/reduce_computed_macros.js +2 -9
  217. package/dist/prod/packages/@ember/object/mixin.js +6 -9
  218. package/dist/prod/packages/@ember/object/observable.js +7 -9
  219. package/dist/prod/packages/@ember/object/observers.js +1 -6
  220. package/dist/prod/packages/@ember/object/promise-proxy-mixin.js +3 -9
  221. package/dist/prod/packages/@ember/object/proxy.js +0 -7
  222. package/dist/prod/packages/@ember/reactive/collections.js +591 -1
  223. package/dist/prod/packages/@ember/renderer/index.js +1 -12
  224. package/dist/prod/packages/@ember/routing/history-location.js +0 -1
  225. package/dist/prod/packages/@ember/routing/index.js +580 -12
  226. package/dist/prod/packages/@ember/routing/lib/dsl.js +0 -2
  227. package/dist/prod/packages/@ember/routing/lib/generate_controller.js +1 -6
  228. package/dist/prod/packages/@ember/routing/lib/routing-service.js +4 -14
  229. package/dist/prod/packages/@ember/routing/lib/utils.js +1 -6
  230. package/dist/prod/packages/@ember/routing/none-location.js +0 -1
  231. package/dist/prod/packages/@ember/routing/route.js +12 -22
  232. package/dist/prod/packages/@ember/routing/router-service.js +6 -15
  233. package/dist/prod/packages/@ember/routing/router.js +4 -17
  234. package/dist/prod/packages/@ember/runloop/index.js +1 -6
  235. package/dist/prod/packages/@ember/service/index.js +1 -7
  236. package/dist/prod/packages/@ember/template/index.js +1 -12
  237. package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +12 -14
  238. package/dist/prod/packages/@ember/template-compiler/lib/dasherize-component-name.js +0 -2
  239. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-against-attrs.js +0 -1
  240. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-against-named-outlets.js +0 -1
  241. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.js +0 -1
  242. package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.js +0 -2
  243. package/dist/prod/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +13 -60
  244. package/dist/prod/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
  245. package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-each-track-array.js +0 -1
  246. package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-in-element.js +0 -1
  247. package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +126 -4
  248. package/dist/prod/packages/@ember/template-compiler/lib/template.js +2 -7
  249. package/dist/prod/packages/@ember/template-factory/index.js +1 -5
  250. package/dist/prod/packages/@ember/utils/lib/compare.js +0 -8
  251. package/dist/prod/packages/@ember/utils/lib/is_empty.js +1 -7
  252. package/dist/prod/packages/@glimmer/manager/index.js +4 -292
  253. package/dist/prod/packages/@glimmer/node/index.js +3 -8
  254. package/dist/prod/packages/@glimmer/opcode-compiler/index.js +2 -5
  255. package/dist/prod/packages/@glimmer/program/index.js +194 -3
  256. package/dist/prod/packages/@glimmer/reference/index.js +4 -4
  257. package/dist/prod/packages/@glimmer/runtime/index.js +14 -8
  258. package/dist/prod/packages/@glimmer/tracking/index.js +2 -7
  259. package/dist/prod/packages/@glimmer/tracking/primitives/cache/index.js +1 -6
  260. package/dist/prod/packages/@glimmer/util/index.js +2 -2
  261. package/dist/prod/packages/@glimmer/validator/index.js +5 -1016
  262. package/dist/prod/packages/@glimmer/vm/index.js +1 -1
  263. package/dist/prod/packages/@glimmer/wire-format/index.js +3 -65
  264. package/dist/prod/packages/ember/version.js +1 -1
  265. package/dist/prod/packages/ember-template-compiler/index.js +4 -7
  266. package/dist/prod/packages/shared-chunks/{alias-BLBQkche.js → alias-DBW_V5vD.js} +7 -6
  267. package/dist/prod/packages/shared-chunks/api-CM1trl_4.js +289 -0
  268. package/dist/prod/packages/shared-chunks/{api-B5UrgITK.js → api-zh_k31vb.js} +4 -5
  269. package/dist/prod/packages/shared-chunks/{args-proxy-Dl0A0YWI.js → args-proxy-BDXbXCF9.js} +2 -2
  270. package/dist/prod/packages/shared-chunks/{array-kVQfzrQn.js → array-D6Couewv.js} +2 -3
  271. package/dist/prod/packages/shared-chunks/assert-Zqc4wiAV.js +6 -0
  272. package/dist/prod/packages/shared-chunks/cache-BIlOoPA7.js +371 -0
  273. package/dist/prod/packages/shared-chunks/{capabilities-DXA-L0iT.js → capabilities-_5e35539.js} +0 -3
  274. package/dist/prod/packages/shared-chunks/chain-tags-C9rFtQ_x.js +178 -0
  275. package/dist/prod/packages/shared-chunks/{compiler-Bbki2GT_.js → compiler-c4yUVrl_.js} +7044 -193
  276. package/dist/prod/packages/shared-chunks/{namespace_search-Dcdalhj6.js → computed-DjCIU_ht.js} +108 -239
  277. package/dist/prod/packages/shared-chunks/container-BYOnjnwz.js +315 -0
  278. package/dist/prod/packages/shared-chunks/curly-ZzX43b50.js +545 -0
  279. package/dist/prod/packages/shared-chunks/curried-BZnYakIg.js +5 -0
  280. package/dist/prod/packages/shared-chunks/debug-render-tree-CF5O4-WI.js +2049 -0
  281. package/dist/prod/packages/shared-chunks/{decorator-BdDDBUd2.js → decorator-9ikVwsjY.js} +0 -1
  282. package/dist/prod/packages/shared-chunks/element-DUOVW5Ho.js +100 -0
  283. package/dist/prod/packages/shared-chunks/{element-builder-CzXb9l1W.js → element-builder-CnlTPNyw.js} +109 -88
  284. package/dist/prod/packages/shared-chunks/env-DXxsTFkM.js +158 -0
  285. package/dist/prod/packages/shared-chunks/events-DYrYz3V8.js +174 -0
  286. package/dist/prod/packages/shared-chunks/get-t0-itmA-.js +138 -0
  287. package/dist/prod/packages/shared-chunks/get_properties-Nn08mLAH.js +55 -0
  288. package/dist/prod/packages/shared-chunks/guid-Cbq2sNV_.js +123 -0
  289. package/dist/prod/packages/shared-chunks/hash-mcs3pEFO.js +192 -0
  290. package/dist/prod/packages/shared-chunks/helper-DLjV2ZZW.js +298 -0
  291. package/dist/prod/packages/shared-chunks/{index-CjaDF9kC.js → index-Bj71BDDA.js} +17 -10
  292. package/dist/prod/packages/shared-chunks/index-D-xTBV4B.js +220 -0
  293. package/dist/prod/packages/shared-chunks/index-qDFz6Mfe.js +2322 -0
  294. package/dist/prod/packages/shared-chunks/{injected_property-CTVs5FPh.js → injected_property--eJunJph.js} +2 -3
  295. package/dist/prod/packages/shared-chunks/intern-zquhAEIg.js +51 -0
  296. package/dist/prod/packages/shared-chunks/internal-DidurjJB.js +137 -0
  297. package/dist/prod/packages/shared-chunks/internal-helper-DIbr1RgC.js +7 -0
  298. package/dist/prod/packages/shared-chunks/{neq-BqdovTuC.js → invoke-Cj5zMqHz.js} +4 -24
  299. package/dist/{dev/packages/shared-chunks/is_proxy-B0smdQy8.js → prod/packages/shared-chunks/is_proxy-Bzg0d4m4.js} +1 -1
  300. package/dist/prod/packages/shared-chunks/libraries-_k-4KK5_.js +59 -0
  301. package/dist/prod/packages/shared-chunks/meta-B9mldqPL.js +36 -0
  302. package/dist/{dev/packages/shared-chunks/name-Z7dpqvzn.js → prod/packages/shared-chunks/name-Clp4Vsod.js} +1 -1
  303. package/dist/prod/packages/shared-chunks/namespace_search-BfvzEQzN.js +134 -0
  304. package/dist/prod/packages/shared-chunks/normalize-D9jDJVGg.js +84 -0
  305. package/dist/prod/packages/shared-chunks/observers-CDkeR0nI.js +199 -0
  306. package/dist/prod/packages/shared-chunks/on-B5NVufs_.js +228 -0
  307. package/dist/prod/packages/shared-chunks/opcodes-CplRyHl_.js +50 -0
  308. package/dist/prod/packages/shared-chunks/or-3AxY5TPj.js +91 -0
  309. package/dist/{dev/packages/shared-chunks/program-DfV0v8aa.js → prod/packages/shared-chunks/program-B7CWdS8W.js} +1 -2
  310. package/dist/{dev/packages/shared-chunks/program-context-sJz0oHOA.js → prod/packages/shared-chunks/program-context-B8HKU7wu.js} +4 -3
  311. package/dist/prod/packages/shared-chunks/property_get-CAFdpRyu.js +121 -0
  312. package/dist/prod/packages/shared-chunks/{property_set-B2sZxeCw.js → property_set-BunbMFtp.js} +3 -5
  313. package/dist/prod/packages/shared-chunks/props-fiqxqhAH.js +85 -0
  314. package/dist/prod/packages/shared-chunks/{reference-BNqcwZWH.js → reference-BshxG6wn.js} +3 -3
  315. package/dist/{dev/packages/shared-chunks/registers-ylirb0dq.js → prod/packages/shared-chunks/registers-C_W2qYHJ.js} +1 -1
  316. package/dist/{dev/packages/shared-chunks/rehydrate-builder-BRH0p0wA.js → prod/packages/shared-chunks/rehydrate-builder-DJ8k-6fg.js} +7 -7
  317. package/dist/prod/packages/shared-chunks/{render-D78XHdek.js → render-DkJJmoI4.js} +488 -12
  318. package/dist/{dev/packages/shared-chunks/chunk-3SQBS3Y5-Cj4eryg1.js → prod/packages/shared-chunks/runtime-CYyqkz5q-BOdRhmsS.js} +4 -59
  319. package/dist/{dev/packages/shared-chunks/serialize-builder-DiO7Ak9_.js → prod/packages/shared-chunks/serialize-builder-R3Ozg0sC.js} +2 -10
  320. package/dist/prod/packages/shared-chunks/set_properties-LT3RzRmJ.js +48 -0
  321. package/dist/prod/packages/shared-chunks/{setup-registry-Cs-7NIJU.js → setup-registry-C2KfZJWI.js} +34 -13
  322. package/dist/prod/packages/shared-chunks/spec-BXl1reqK.js +16 -0
  323. package/dist/prod/packages/shared-chunks/super-BBBjgF69.js +91 -0
  324. package/dist/prod/packages/shared-chunks/syscall-ops-BPFtDquC.js +133 -0
  325. package/dist/prod/packages/shared-chunks/template-BRrQR6KS.js +16 -0
  326. package/dist/prod/packages/shared-chunks/template-only-BtLl0uH0.js +78 -0
  327. package/dist/prod/packages/shared-chunks/textarea-CHqL0Rdh.js +454 -0
  328. package/dist/prod/packages/shared-chunks/{tracked-Cl5l4v8b.js → tracked-DAVrVqJl.js} +5 -4
  329. package/dist/prod/packages/shared-chunks/tracked-data-C83f5V5S.js +31 -0
  330. package/dist/prod/packages/shared-chunks/unique-id-CfHImDRV.js +32 -0
  331. package/dist/prod/packages/shared-chunks/vm-ops-ImHv0Wtg.js +12 -0
  332. package/dist/prod/packages/shared-chunks/well-known-_EVO9RaV.js +17 -0
  333. package/docs/data.json +1237 -1023
  334. package/lib/index.js +0 -1
  335. package/package.json +14 -12
  336. package/types/stable/@ember/-internals/container/lib/registry.d.ts +1 -1
  337. package/types/stable/@ember/-internals/deprecations/index.d.ts +1 -1
  338. package/types/stable/@ember/-internals/glimmer/index.d.ts +1 -1
  339. package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly.d.ts +1 -1
  340. package/types/stable/@ember/-internals/glimmer/lib/component-managers/mount.d.ts +1 -1
  341. package/types/stable/@ember/-internals/glimmer/lib/component-managers/outlet.d.ts +1 -1
  342. package/types/stable/@ember/-internals/glimmer/lib/component-managers/route-template.d.ts +2 -2
  343. package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +9 -7
  344. package/types/stable/@ember/-internals/glimmer/lib/components/abstract-input.d.ts +1 -1
  345. package/types/stable/@ember/-internals/glimmer/lib/dom.d.ts +6 -2
  346. package/types/stable/@ember/-internals/glimmer/lib/environment.d.ts +1 -1
  347. package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +1 -1
  348. package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +3 -3
  349. package/types/stable/@ember/-internals/glimmer/lib/setup-registry.d.ts +1 -1
  350. package/types/stable/@ember/-internals/glimmer/lib/utils/bindings.d.ts +1 -1
  351. package/types/stable/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.d.ts +3 -2
  352. package/types/stable/@ember/-internals/glimmer/lib/utils/iterator.d.ts +1 -1
  353. package/types/stable/@ember/-internals/glimmer/lib/utils/managers.d.ts +2 -1
  354. package/types/stable/@ember/-internals/glimmer/lib/utils/serialization-first-node-helpers.d.ts +1 -1
  355. package/types/stable/@ember/-internals/glimmer/lib/utils/string.d.ts +1 -1
  356. package/types/stable/@ember/-internals/meta/lib/meta.d.ts +3 -2
  357. package/types/stable/@ember/-internals/metal/lib/cache.d.ts +1 -1
  358. package/types/stable/@ember/-internals/metal/lib/chain-tags.d.ts +3 -2
  359. package/types/stable/@ember/-internals/metal/lib/computed.d.ts +1 -1
  360. package/types/stable/@ember/-internals/metal/lib/decorator.d.ts +1 -1
  361. package/types/stable/@ember/-internals/metal/lib/deprecate_property.d.ts +1 -1
  362. package/types/stable/@ember/-internals/metal/lib/events.d.ts +1 -1
  363. package/types/stable/@ember/-internals/metal/lib/observer.d.ts +1 -1
  364. package/types/stable/@ember/-internals/metal/lib/properties.d.ts +1 -1
  365. package/types/stable/@ember/-internals/metal/lib/property_events.d.ts +1 -1
  366. package/types/stable/@ember/-internals/metal/lib/tags.d.ts +2 -1
  367. package/types/stable/@ember/-internals/runtime/lib/mixins/container_proxy.d.ts +1 -1
  368. package/types/stable/@ember/-internals/runtime/lib/mixins/registry_proxy.d.ts +1 -1
  369. package/types/stable/@ember/-internals/utils/lib/is_proxy.d.ts +1 -1
  370. package/types/stable/@ember/-internals/utils/lib/mandatory-setter.d.ts +1 -1
  371. package/types/stable/@ember/-internals/views/index.d.ts +0 -1
  372. package/types/stable/@ember/-internals/views/lib/system/utils.d.ts +1 -1
  373. package/types/stable/@ember/-internals/views/lib/views/core_view.d.ts +2 -2
  374. package/types/stable/@ember/-internals/views/lib/views/states.d.ts +1 -1
  375. package/types/stable/@ember/application/index.d.ts +5 -4
  376. package/types/stable/@ember/application/instance.d.ts +4 -3
  377. package/types/stable/@ember/application/namespace.d.ts +1 -1
  378. package/types/stable/@ember/array/proxy.d.ts +4 -3
  379. package/types/stable/@ember/component/helper.d.ts +1 -1
  380. package/types/stable/@ember/component/index.d.ts +6 -3
  381. package/types/stable/@ember/controller/index.d.ts +2 -2
  382. package/types/stable/@ember/debug/container-debug-adapter.d.ts +1 -1
  383. package/types/stable/@ember/engine/index.d.ts +3 -3
  384. package/types/stable/@ember/engine/instance.d.ts +4 -3
  385. package/types/stable/@ember/helper/index.d.ts +167 -5
  386. package/types/stable/@ember/modifier/index.d.ts +1 -1
  387. package/types/stable/@ember/object/-internals.d.ts +2 -2
  388. package/types/stable/@ember/object/compat.d.ts +2 -2
  389. package/types/stable/@ember/object/computed.d.ts +3 -1
  390. package/types/stable/@ember/object/evented.d.ts +1 -1
  391. package/types/stable/@ember/object/events.d.ts +1 -1
  392. package/types/stable/@ember/object/index.d.ts +8 -2
  393. package/types/stable/@ember/object/lib/computed/computed_macros.d.ts +1 -1
  394. package/types/stable/@ember/object/mixin.d.ts +1 -1
  395. package/types/stable/@ember/object/observers.d.ts +1 -1
  396. package/types/stable/@ember/object/proxy.d.ts +1 -1
  397. package/types/stable/@ember/reactive/collections.d.ts +6 -6
  398. package/types/stable/@ember/renderer/index.d.ts +2 -2
  399. package/types/stable/@ember/routing/index.d.ts +1 -1
  400. package/types/stable/@ember/routing/lib/controller_for.d.ts +2 -2
  401. package/types/stable/@ember/routing/route.d.ts +2 -2
  402. package/types/stable/@ember/routing/router.d.ts +2 -2
  403. package/types/stable/@ember/service/index.d.ts +1 -1
  404. package/types/stable/@ember/template/index.d.ts +1 -1
  405. package/types/stable/@ember/template-compiler/lib/dasherize-component-name.d.ts +1 -1
  406. package/types/stable/@ember/template-compiler/lib/plugins/assert-against-attrs.d.ts +1 -1
  407. package/types/stable/@ember/template-compiler/lib/plugins/assert-against-named-outlets.d.ts +1 -1
  408. package/types/stable/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.d.ts +1 -1
  409. package/types/stable/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.d.ts +1 -1
  410. package/types/stable/@ember/template-compiler/lib/plugins/auto-import-builtins.d.ts +1 -4
  411. package/types/stable/@ember/template-compiler/lib/plugins/transform-action-syntax.d.ts +1 -1
  412. package/types/stable/@ember/template-compiler/lib/plugins/transform-each-in-into-each.d.ts +1 -1
  413. package/types/stable/@ember/template-compiler/lib/plugins/transform-each-track-array.d.ts +1 -1
  414. package/types/stable/@ember/template-compiler/lib/plugins/transform-in-element.d.ts +1 -1
  415. package/types/stable/@ember/template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.d.ts +1 -1
  416. package/types/stable/@ember/template-compiler/lib/plugins/transform-resolutions.d.ts +1 -1
  417. package/types/stable/@ember/template-compiler/lib/plugins/transform-wrap-mount-and-outlet.d.ts +1 -1
  418. package/types/stable/@ember/template-compiler/lib/plugins/utils.d.ts +1 -1
  419. package/types/stable/@ember/template-compiler/lib/system/calculate-location-display.d.ts +1 -1
  420. package/types/stable/@ember/template-compiler/lib/types.d.ts +2 -1
  421. package/types/stable/@ember/template-factory/index.d.ts +1 -1
  422. package/types/stable/@glimmer/compiler/lib/builder/builder-interface.d.ts +2 -2
  423. package/types/stable/@glimmer/compiler/lib/builder/builder.d.ts +2 -2
  424. package/types/stable/@glimmer/compiler/lib/compiler.d.ts +1 -1
  425. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/context.d.ts +2 -1
  426. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/index.d.ts +2 -1
  427. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/impl.d.ts +2 -1
  428. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/curry.d.ts +1 -1
  429. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/dynamic-vars.d.ts +1 -1
  430. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/has-block.d.ts +2 -1
  431. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/if-unless.d.ts +1 -1
  432. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/log.d.ts +1 -1
  433. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/classified.d.ts +1 -1
  434. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/component.d.ts +1 -1
  435. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/simple-element.d.ts +2 -1
  436. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/expressions.d.ts +1 -1
  437. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/statements.d.ts +1 -1
  438. package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/strict-mode.d.ts +1 -1
  439. package/types/stable/@glimmer/compiler/lib/passes/2-encoding/expressions.d.ts +1 -1
  440. package/types/stable/@glimmer/compiler/lib/passes/2-encoding/mir.d.ts +3 -1
  441. package/types/stable/@glimmer/compiler/lib/shared/result.d.ts +1 -1
  442. package/types/stable/@glimmer/manager/lib/public/component.d.ts +1 -1
  443. package/types/stable/@glimmer/manager/lib/util/args-proxy.d.ts +1 -1
  444. package/types/stable/@glimmer/manager/lib/util/capabilities.d.ts +1 -1
  445. package/types/stable/@glimmer/node/lib/node-dom-helper.d.ts +1 -1
  446. package/types/stable/@glimmer/opcode-compiler/lib/opcode-builder/helpers/components.d.ts +1 -1
  447. package/types/stable/@glimmer/runtime/index.d.ts +7 -4
  448. package/types/stable/@glimmer/runtime/lib/compiled/expressions/concat.d.ts +1 -1
  449. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/-debug-strip.d.ts +4 -3
  450. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/component.d.ts +1 -1
  451. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/dom.d.ts +2 -2
  452. package/types/stable/@glimmer/runtime/lib/compiled/opcodes/vm.d.ts +2 -2
  453. package/types/stable/@glimmer/runtime/lib/component/template-only.d.ts +1 -1
  454. package/types/stable/@glimmer/runtime/lib/curried-value.d.ts +1 -1
  455. package/types/stable/@glimmer/runtime/lib/helpers/and.d.ts +3 -0
  456. package/types/stable/@glimmer/runtime/lib/helpers/gt.d.ts +8 -0
  457. package/types/stable/@glimmer/runtime/lib/helpers/gte.d.ts +8 -0
  458. package/types/stable/@glimmer/runtime/lib/helpers/invoke.d.ts +1 -1
  459. package/types/stable/@glimmer/runtime/lib/helpers/lt.d.ts +8 -0
  460. package/types/stable/@glimmer/runtime/lib/helpers/lte.d.ts +8 -0
  461. package/types/stable/@glimmer/runtime/lib/helpers/not.d.ts +3 -0
  462. package/types/stable/@glimmer/runtime/lib/helpers/or.d.ts +3 -0
  463. package/types/stable/@glimmer/runtime/lib/opcodes.d.ts +2 -2
  464. package/types/stable/@glimmer/runtime/lib/references/class-list.d.ts +1 -1
  465. package/types/stable/@glimmer/runtime/lib/references/curry-value.d.ts +1 -1
  466. package/types/stable/@glimmer/runtime/lib/render.d.ts +1 -1
  467. package/types/stable/@glimmer/runtime/lib/scope.d.ts +1 -1
  468. package/types/stable/@glimmer/runtime/lib/vm/append.d.ts +3 -2
  469. package/types/stable/@glimmer/runtime/lib/vm/arguments.d.ts +2 -2
  470. package/types/stable/@glimmer/runtime/lib/vm/content/text.d.ts +1 -1
  471. package/types/stable/@glimmer/runtime/lib/vm/element-builder.d.ts +1 -1
  472. package/types/stable/@glimmer/runtime/lib/vm/low-level.d.ts +2 -1
  473. package/types/stable/@glimmer/runtime/lib/vm/rehydrate-builder.d.ts +1 -1
  474. package/types/stable/@glimmer/runtime/lib/vm/update.d.ts +2 -1
  475. package/types/stable/@glimmer/syntax/lib/keywords.d.ts +2 -2
  476. package/types/stable/@glimmer/tracking/index.d.ts +2 -1
  477. package/types/stable/@glimmer/tracking/primitives/cache.d.ts +1 -1
  478. package/types/stable/index.d.ts +7 -1
  479. package/dist/dev/packages/@ember/-internals/views/lib/component_lookup.js +0 -14
  480. package/dist/dev/packages/shared-chunks/assert-CUCJBR2C.js +0 -19
  481. package/dist/dev/packages/shared-chunks/constants-BbdWMvgs.js +0 -213
  482. package/dist/dev/packages/shared-chunks/dynamic-CgX8M02_.js +0 -3823
  483. package/dist/dev/packages/shared-chunks/element-builder-BpJIoi99.js +0 -404
  484. package/dist/dev/packages/shared-chunks/fragment-Cc5k9Oy4.js +0 -911
  485. package/dist/dev/packages/shared-chunks/index-RzG0Jvjx.js +0 -6306
  486. package/dist/dev/packages/shared-chunks/mandatory-setter-DHZe7-kW.js +0 -425
  487. package/dist/dev/packages/shared-chunks/observers-Bj9qLVau.js +0 -2062
  488. package/dist/dev/packages/shared-chunks/set_properties-kVGzZL_a.js +0 -100
  489. package/dist/dev/packages/shared-chunks/transform-resolutions-D-YtZ0_g.js +0 -7458
  490. package/dist/prod/packages/@ember/-internals/views/lib/component_lookup.js +0 -14
  491. package/dist/prod/packages/shared-chunks/constants-DThhT5fu.js +0 -210
  492. package/dist/prod/packages/shared-chunks/fragment-D7nBU9ae.js +0 -925
  493. package/dist/prod/packages/shared-chunks/index-r-Dz_hzt.js +0 -5931
  494. package/dist/prod/packages/shared-chunks/observers-tZ2aOzr4.js +0 -714
  495. package/dist/prod/packages/shared-chunks/set_properties-C1T46IiN.js +0 -101
  496. package/dist/prod/packages/shared-chunks/super-Cm_a_cLQ.js +0 -275
  497. package/dist/prod/packages/shared-chunks/transform-resolutions-DR4GLmR2.js +0 -6936
  498. package/types/stable/@ember/-internals/views/lib/component_lookup.d.ts +0 -8
  499. package/dist/prod/packages/shared-chunks/{collections-GpG8lT2g.js → collections-C3Y8z_9v.js} +9 -9
@@ -1,33 +1,21 @@
1
- import { r as VM_SYSCALL_SIZE, C as CURRIED_COMPONENT, s as VM_CHILD_SCOPE_OP, t as VM_POP_SCOPE_OP, u as VM_PUSH_DYNAMIC_SCOPE_OP, v as VM_POP_DYNAMIC_SCOPE_OP, w as VM_CONSTANT_OP, x as decodeHandle, y as VM_CONSTANT_REFERENCE_OP, z as VM_PRIMITIVE_OP, A as isHandle, B as decodeImmediate, D as VM_PRIMITIVE_REFERENCE_OP, E as VM_DUP_OP, F as VM_POP_OP, G as VM_LOAD_OP, H as VM_FETCH_OP, I as VM_BIND_DYNAMIC_SCOPE_OP, J as VM_ENTER_OP, K as VM_EXIT_OP, L as VM_PUSH_SYMBOL_TABLE_OP, M as VM_PUSH_BLOCK_SCOPE_OP, N as VM_COMPILE_BLOCK_OP, O as VM_INVOKE_YIELD_OP, P as VM_JUMP_IF_OP, Q as VM_JUMP_UNLESS_OP, R as VM_JUMP_EQ_OP, b as VM_ASSERT_SAME_OP, S as VM_TO_BOOLEAN_OP, T as VM_TEXT_OP, U as VM_COMMENT_OP, W as VM_OPEN_ELEMENT_OP, X as VM_OPEN_DYNAMIC_ELEMENT_OP, Y as VM_PUSH_REMOTE_ELEMENT_OP, Z as VM_POP_REMOTE_ELEMENT_OP, _ as VM_FLUSH_ELEMENT_OP, $ as VM_CLOSE_ELEMENT_OP, a0 as VM_MODIFIER_OP, a1 as VM_DYNAMIC_MODIFIER_OP, a2 as VM_STATIC_ATTR_OP, a3 as VM_DYNAMIC_ATTR_OP, a4 as CURRIED_MODIFIER, a5 as VM_PUSH_COMPONENT_DEFINITION_OP, a6 as VM_RESOLVE_DYNAMIC_COMPONENT_OP, f as VM_RESOLVE_CURRIED_COMPONENT_OP, g as VM_PUSH_DYNAMIC_COMPONENT_INSTANCE_OP, a7 as VM_PUSH_ARGS_OP, a8 as VM_PUSH_EMPTY_ARGS_OP, a9 as VM_CAPTURE_ARGS_OP, aa as VM_PREPARE_ARGS_OP, ab as VM_CREATE_COMPONENT_OP, ac as VM_REGISTER_COMPONENT_DESTRUCTOR_OP, ad as VM_BEGIN_COMPONENT_TRANSACTION_OP, ae as VM_PUT_COMPONENT_OPERATIONS_OP, af as VM_COMPONENT_ATTR_OP, ag as VM_STATIC_COMPONENT_ATTR_OP, ah as VM_DID_CREATE_ELEMENT_OP, ai as VM_GET_COMPONENT_SELF_OP, aj as VM_GET_COMPONENT_TAG_NAME_OP, ak as VM_GET_COMPONENT_LAYOUT_OP, V as VM_MAIN_OP, al as VM_POPULATE_LAYOUT_OP, am as VM_VIRTUAL_ROOT_SCOPE_OP, an as VM_SET_NAMED_VARIABLES_OP, ao as VM_SET_BLOCKS_OP, ap as VM_INVOKE_COMPONENT_LAYOUT_OP, aq as VM_DID_RENDER_LAYOUT_OP, ar as VM_COMMIT_COMPONENT_TRANSACTION_OP, as as VM_CURRY_OP, at as VM_DYNAMIC_HELPER_OP, au as CURRIED_HELPER, av as VM_HELPER_OP, aw as VM_GET_VARIABLE_OP, ax as VM_SET_VARIABLE_OP, ay as VM_SET_BLOCK_OP, az as VM_ROOT_SCOPE_OP, aA as VM_GET_PROPERTY_OP, aB as VM_GET_BLOCK_OP, aC as VM_SPREAD_BLOCK_OP, aD as VM_HAS_BLOCK_OP, aE as VM_HAS_BLOCK_PARAMS_OP, aF as VM_CONCAT_OP, aG as VM_IF_INLINE_OP, aH as VM_NOT_OP, aI as VM_GET_DYNAMIC_VAR_OP, aJ as VM_LOG_OP, a as VM_CONTENT_TYPE_OP, aK as VM_DYNAMIC_CONTENT_TYPE_OP, d as VM_APPEND_HTML_OP, h as VM_APPEND_SAFE_HTML_OP, e as VM_APPEND_TEXT_OP, i as VM_APPEND_DOCUMENT_FRAGMENT_OP, j as VM_APPEND_NODE_OP, aL as VM_DEBUGGER_OP, aM as VM_ENTER_LIST_OP, aN as VM_EXIT_LIST_OP, aO as VM_ITERATE_OP } from './fragment-D7nBU9ae.js';
2
- import { u as unwrap, c as isIndexable$1, e as expect, S as StackImpl, d as dict, i as isDict } from './collections-GpG8lT2g.js';
1
+ import { u as unwrap, e as expect, a as isIndexable, d as dict, S as StackImpl } from './collections-DPkjqeA3.js';
3
2
  import { a as assign } from './object-utils-AijlD-JH.js';
4
- import { toBool, setPath, getPath } from '../@glimmer/global-context/index.js';
5
- import { CONSTANT_TAG, INITIAL, validateTag, consumeTag, valueForTag, beginTrackFrame, endTrackFrame, CURRENT_TAG, createUpdatableTag } from '../@glimmer/validator/index.js';
6
- import { c as createComputeRef, v as valueForRef, a as createConstRef, d as createPrimitiveRef, i as isConstRef, U as UNDEFINED_REFERENCE, N as NULL_REFERENCE, T as TRUE_REFERENCE, F as FALSE_REFERENCE, R as REFERENCE, b as childRefFor, e as isInvokableRef, u as updateRef } from './reference-BNqcwZWH.js';
7
- import { e as $v0, f as $t1, g as $t0, a as $pc, b as $ra, c as $fp, d as $sp, h as $s1, $ as $s0 } from './registers-ylirb0dq.js';
8
- import { registerDestructor, destroy, associateDestroyableChild, _hasDestroyableChildren } from '../@glimmer/destroyable/index.js';
9
- import { d as getInternalModifierManager, g as getInternalHelperManager, h as hasInternalComponentManager, f as hasInternalHelperManager, s as setInternalComponentManager, i as setInternalHelperManager, j as setInternalModifierManager } from './api-B5UrgITK.js';
10
- import { m as managerHasCapability } from './capabilities-DXA-L0iT.js';
11
- import { ContentType } from '../@glimmer/vm/index.js';
12
- import { createIteratorRef } from '../@glimmer/reference/index.js';
3
+ import { a as $v0, b as $t1, c as $t0, d as $pc, e as $ra, f as $fp, g as $sp, h as $s1, $ as $s0 } from './registers-C_W2qYHJ.js';
13
4
  import { s as setLocalDebugType } from './debug-brand-B1TWjOCH.js';
5
+ import { a as createComputeRef, v as valueForRef, c as createConstRef, e as createPrimitiveRef, i as isConstRef, U as UNDEFINED_REFERENCE, N as NULL_REFERENCE, T as TRUE_REFERENCE, F as FALSE_REFERENCE, R as REFERENCE, h as createDebugAliasRef } from './reference-BoPB2LfI.js';
14
6
  import { b as EMPTY_STRING_ARRAY, e as enumerate, c as emptyArray } from './array-utils-CZQxrdD3.js';
15
- import { a as unwrapTemplate } from './constants-DThhT5fu.js';
7
+ import { b as CONSTANT_TAG, I as INITIAL, y as validateTag, k as consumeTag, z as valueForTag, g as beginTrackFrame, p as endTrackFrame, c as CURRENT_TAG } from './cache-B7dqAS38.js';
8
+ import { C as CURRIED_MODIFIER, a as CURRIED_COMPONENT } from './curried-BZnYakIg.js';
9
+ 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-BPFtDquC.js';
10
+ import { d as debugToString } from './debug-to-string-C6LsA_qz.js';
11
+ import { a as assert } from './assert-Zqc4wiAV.js';
12
+ import { u as unwrapTemplate } from './template-BRrQR6KS.js';
13
+ import { registerDestructor, destroy, associateDestroyableChild } from '../@glimmer/destroyable/index.js';
14
+ import { m as managerHasCapability } from './capabilities-CZkuOqqC.js';
16
15
  import { I as InternalComponentCapabilities } from './flags-B9qxc-pB.js';
17
-
18
- /* eslint-disable @typescript-eslint/no-empty-object-type */
19
- function buildUntouchableThis(source) {
20
- let context = null;
21
- return context;
22
- }
23
-
24
- const ELEMENT_NODE = 1;
25
- const TEXT_NODE = 3;
26
- const COMMENT_NODE = 8;
27
- const NS_MATHML = 'http://www.w3.org/1998/Math/MathML';
28
- const NS_SVG = 'http://www.w3.org/2000/svg';
29
- const INSERT_BEFORE_BEGIN = 'beforebegin';
30
- const INSERT_BEFORE_END = 'beforeend';
16
+ import { n as normalizeStringValue, C as ConcreteBounds } from './normalize-CKySQVU7.js';
17
+ import { b as getInternalModifierManager } from './api-BawZUDYD.js';
18
+ import { toBool } from '../@glimmer/global-context/index.js';
31
19
 
32
20
  function CheckInstanceof(Class) {
33
21
  }
@@ -77,8 +65,10 @@ class AppendOpcodes {
77
65
  evaluate(vm, opcode, type) {
78
66
  let operation = unwrap(this.evaluateOpcode[type]);
79
67
  if (operation.syscall) {
68
+ assert(!opcode.isMachine, `BUG: Mismatch between operation.syscall (${operation.syscall}) and opcode.isMachine (${opcode.isMachine}) for ${opcode.type}`);
80
69
  operation.evaluate(vm, opcode);
81
70
  } else {
71
+ assert(opcode.isMachine, `BUG: Mismatch between operation.syscall (${operation.syscall}) and opcode.isMachine (${opcode.isMachine}) for ${opcode.type}`);
82
72
  operation.evaluate(vm.lowlevel, opcode);
83
73
  }
84
74
  }
@@ -163,79 +153,6 @@ function curry(type, spec, owner, args, resolved = false) {
163
153
  return new CurriedValue(type, spec, owner, args, resolved);
164
154
  }
165
155
 
166
- function createCurryRef(type, inner, owner, args, resolver, isStrict) {
167
- let lastValue, curriedDefinition;
168
- return createComputeRef(() => {
169
- let value = valueForRef(inner);
170
- if (value === lastValue) {
171
- return curriedDefinition;
172
- }
173
- if (isCurriedType(value, type)) {
174
- curriedDefinition = args ? curry(type, value, owner, args) : args;
175
- } else if (type === CURRIED_COMPONENT && typeof value === 'string' && value) {
176
- curriedDefinition = curry(type, value, owner, args);
177
- } else if (isIndexable$1(value)) {
178
- curriedDefinition = curry(type, value, owner, args);
179
- } else {
180
- curriedDefinition = null;
181
- }
182
- lastValue = value;
183
- return curriedDefinition;
184
- });
185
- }
186
-
187
- class CursorImpl {
188
- constructor(element, nextSibling) {
189
- this.element = element;
190
- this.nextSibling = nextSibling;
191
- setLocalDebugType('cursor', this);
192
- }
193
- }
194
- class ConcreteBounds {
195
- constructor(parentNode, first, last) {
196
- this.parentNode = parentNode;
197
- this.first = first;
198
- this.last = last;
199
- }
200
- parentElement() {
201
- return this.parentNode;
202
- }
203
- firstNode() {
204
- return this.first;
205
- }
206
- lastNode() {
207
- return this.last;
208
- }
209
- }
210
- function move(bounds, reference) {
211
- let parent = bounds.parentElement();
212
- let first = bounds.firstNode();
213
- let last = bounds.lastNode();
214
- let current = first;
215
- while (true) {
216
- let next = current.nextSibling;
217
- parent.insertBefore(current, reference);
218
- if (current === last) {
219
- return next;
220
- }
221
- current = expect(next);
222
- }
223
- }
224
- function clear(bounds) {
225
- let parent = bounds.parentElement();
226
- let first = bounds.firstNode();
227
- let last = bounds.lastNode();
228
- let current = first;
229
- while (true) {
230
- let next = current.nextSibling;
231
- parent.removeChild(current);
232
- if (current === last) {
233
- return next;
234
- }
235
- current = expect(next);
236
- }
237
- }
238
-
239
156
  /** @internal */
240
157
  function hasCustomDebugRenderTreeLifecycle(manager) {
241
158
  return 'getDebugCustomRenderTree' in manager;
@@ -243,190 +160,14 @@ function hasCustomDebugRenderTreeLifecycle(manager) {
243
160
 
244
161
  function resolveComponent(resolver, constants, name, owner) {
245
162
  let definition = resolver?.lookupComponent?.(name, expect(owner)) ?? null;
163
+ if (!definition) {
164
+ throw new Error(`Attempted to resolve \`${name}\`, which was expected to be a component, but nothing was found.`);
165
+ }
246
166
 
247
167
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
248
168
  return constants.resolvedComponent(definition, name);
249
169
  }
250
170
 
251
- let GUID = 0;
252
- class Ref {
253
- id = GUID++;
254
- value;
255
- constructor(value) {
256
- this.value = value;
257
- }
258
- get() {
259
- return this.value;
260
- }
261
- release() {
262
- this.value = null;
263
- }
264
- toString() {
265
- let label = `Ref ${this.id}`;
266
- if (this.value === null) {
267
- return `${label} (released)`;
268
- } else {
269
- try {
270
- // eslint-disable-next-line @typescript-eslint/no-base-to-string
271
- return `${label}: ${this.value}`;
272
- } catch {
273
- return label;
274
- }
275
- }
276
- }
277
- }
278
- class DebugRenderTreeImpl {
279
- stack = new StackImpl();
280
- refs = new WeakMap();
281
- roots = new Set();
282
- nodes = new WeakMap();
283
- begin() {
284
- this.reset();
285
- }
286
- create(state, node) {
287
- let internalNode = assign({}, node, {
288
- bounds: null,
289
- refs: new Set()
290
- });
291
- this.nodes.set(state, internalNode);
292
- this.appendChild(internalNode, state);
293
- this.enter(state);
294
- }
295
- update(state) {
296
- this.enter(state);
297
- }
298
- didRender(state, bounds) {
299
- this.nodeFor(state).bounds = bounds;
300
- this.exit();
301
- }
302
- willDestroy(state) {
303
- expect(this.refs.get(state)).release();
304
- }
305
- commit() {
306
- this.reset();
307
- }
308
- capture() {
309
- return this.captureRefs(this.roots);
310
- }
311
- reset() {
312
- if (this.stack.size !== 0) {
313
- // We probably encountered an error during the rendering loop. This will
314
- // likely trigger undefined behavior and memory leaks as the error left
315
- // things in an inconsistent state. It is recommended that the user
316
- // refresh the page.
317
-
318
- // TODO: We could warn here? But this happens all the time in our tests?
319
-
320
- // Clean up the root reference to prevent errors from happening if we
321
- // attempt to capture the render tree (Ember Inspector may do this)
322
- let root = expect(this.stack.toArray()[0]);
323
- let ref = this.refs.get(root);
324
- if (ref !== undefined) {
325
- this.roots.delete(ref);
326
- }
327
- while (!this.stack.isEmpty()) {
328
- this.stack.pop();
329
- }
330
- }
331
- }
332
- enter(state) {
333
- this.stack.push(state);
334
- }
335
- exit() {
336
- this.stack.pop();
337
- }
338
- nodeFor(state) {
339
- return expect(this.nodes.get(state));
340
- }
341
- appendChild(node, state) {
342
- let parent = this.stack.current;
343
- let ref = new Ref(state);
344
- this.refs.set(state, ref);
345
- if (parent) {
346
- let parentNode = this.nodeFor(parent);
347
- parentNode.refs.add(ref);
348
- node.parent = parentNode;
349
- } else {
350
- this.roots.add(ref);
351
- }
352
- }
353
- captureRefs(refs) {
354
- let captured = [];
355
- refs.forEach(ref => {
356
- let state = ref.get();
357
- if (state) {
358
- captured.push(this.captureNode(`render-node:${ref.id}`, state));
359
- } else {
360
- refs.delete(ref);
361
- }
362
- });
363
- return captured;
364
- }
365
- captureNode(id, state) {
366
- let node = this.nodeFor(state);
367
- let {
368
- type,
369
- name,
370
- args,
371
- instance,
372
- refs
373
- } = node;
374
- let bounds = this.captureBounds(node);
375
- let children = this.captureRefs(refs);
376
- return {
377
- id,
378
- type,
379
- name,
380
- args: reifyArgsDebug(args),
381
- instance,
382
- bounds,
383
- children
384
- };
385
- }
386
- captureBounds(node) {
387
- let bounds = expect(node.bounds);
388
- let parentElement = bounds.parentElement();
389
- let firstNode = bounds.firstNode();
390
- let lastNode = bounds.lastNode();
391
- return {
392
- parentElement,
393
- firstNode,
394
- lastNode
395
- };
396
- }
397
- }
398
- function getDebugName(definition, manager = definition.manager) {
399
- return definition.resolvedName ?? definition.debugName ?? manager.getDebugName(definition.state);
400
- }
401
-
402
- function normalizeStringValue(value) {
403
- if (isEmpty$1(value)) {
404
- return '';
405
- }
406
- return String(value);
407
- }
408
- function shouldCoerce(value) {
409
- return isString(value) || isEmpty$1(value) || typeof value === 'boolean' || typeof value === 'number';
410
- }
411
- function isEmpty$1(value) {
412
- return value === null || value === undefined || typeof value.toString !== 'function';
413
- }
414
- function isIndexable(value) {
415
- return value !== null && typeof value === 'object';
416
- }
417
- function isSafeString(value) {
418
- return isIndexable(value) && typeof value['toHTML'] === 'function';
419
- }
420
- function isNode(value) {
421
- return isIndexable(value) && typeof value['nodeType'] === 'number';
422
- }
423
- function isFragment(value) {
424
- return isIndexable(value) && value['nodeType'] === 11;
425
- }
426
- function isString(value) {
427
- return typeof value === 'string';
428
- }
429
-
430
171
  function createClassListRef(list) {
431
172
  return createComputeRef(() => {
432
173
  let ret = [];
@@ -450,7 +191,7 @@ APPEND_OPCODES.add(VM_CONSTANT_OP, (vm, {
450
191
  APPEND_OPCODES.add(VM_CONSTANT_REFERENCE_OP, (vm, {
451
192
  op1: other
452
193
  }) => {
453
- vm.stack.push(createConstRef(vm.constants.getValue(decodeHandle(other))));
194
+ vm.stack.push(createConstRef(vm.constants.getValue(decodeHandle(other)), false));
454
195
  });
455
196
  APPEND_OPCODES.add(VM_PRIMITIVE_OP, (vm, {
456
197
  op1: primitive
@@ -546,6 +287,7 @@ APPEND_OPCODES.add(VM_INVOKE_YIELD_OP, vm => {
546
287
  let table = check(stack.pop());
547
288
  let args = check(stack.pop());
548
289
  if (table === null || handle === null) {
290
+ // To balance the pop{Frame,Scope}
549
291
  vm.lowlevel.pushFrame();
550
292
  vm.pushScope(scope ?? vm.scope());
551
293
  return;
@@ -831,7 +573,7 @@ APPEND_OPCODES.add(VM_DYNAMIC_MODIFIER_OP, vm => {
831
573
  let instanceRef = createComputeRef(() => {
832
574
  let value = valueForRef(ref);
833
575
  let owner;
834
- if (!isIndexable$1(value)) {
576
+ if (!isIndexable(value)) {
835
577
  return;
836
578
  }
837
579
  let hostDefinition;
@@ -855,10 +597,10 @@ APPEND_OPCODES.add(VM_DYNAMIC_MODIFIER_OP, vm => {
855
597
  hostDefinition = value;
856
598
  owner = initialOwner;
857
599
  }
858
- let manager = getInternalModifierManager(hostDefinition);
600
+ let manager = getInternalModifierManager(hostDefinition, true);
859
601
  if (manager === null) {
860
602
  {
861
- throw new Error('BUG: modifier manager expected');
603
+ throw new Error(`Expected a dynamic modifier definition, but received an object or function that did not have a modifier manager associated with it. The dynamic invocation was \`{{${ref.debugLabel}}}\`, and the incorrect definition is the value at the path \`${ref.debugLabel}\`, which was: ${debugToString?.(hostDefinition)}`);
862
604
  }
863
605
  }
864
606
  let definition = {
@@ -1038,11 +780,14 @@ APPEND_OPCODES.add(VM_RESOLVE_DYNAMIC_COMPONENT_OP, (vm, {
1038
780
  let component = check(valueForRef(ref));
1039
781
  let constants = vm.constants;
1040
782
  let owner = vm.getOwner();
1041
- constants.getValue(_isStrict);
783
+ let isStrict = constants.getValue(_isStrict);
1042
784
  vm.loadValue($t1, null); // Clear the temp register
1043
785
 
1044
786
  let definition;
1045
787
  if (typeof component === 'string') {
788
+ if (isStrict) {
789
+ throw new Error(`Attempted to resolve a dynamic component with a string definition, \`${component}\` in a strict mode template. In strict mode, using strings to resolve component definitions is prohibited. You can instead import the component definition and use it directly.`);
790
+ }
1046
791
  let resolvedDefinition = resolveComponent(vm.context.resolver, constants, component, owner);
1047
792
  definition = expect(resolvedDefinition);
1048
793
  } else if (isCurriedValue(component)) {
@@ -1050,6 +795,12 @@ APPEND_OPCODES.add(VM_RESOLVE_DYNAMIC_COMPONENT_OP, (vm, {
1050
795
  } else {
1051
796
  definition = constants.component(component, owner);
1052
797
  }
798
+ if (!isCurriedValue(definition) && !definition.resolvedName && !definition.debugName) {
799
+ let debugLabel = ref.debugLabel;
800
+ if (debugLabel) {
801
+ definition.debugName = debugLabel;
802
+ }
803
+ }
1053
804
  stack.push(definition);
1054
805
  });
1055
806
  APPEND_OPCODES.add(VM_RESOLVE_CURRIED_COMPONENT_OP, vm => {
@@ -1058,10 +809,22 @@ APPEND_OPCODES.add(VM_RESOLVE_CURRIED_COMPONENT_OP, vm => {
1058
809
  let value = valueForRef(ref);
1059
810
  let constants = vm.constants;
1060
811
  let definition;
812
+ if (!(typeof value === 'function' || typeof value === 'object' && value !== null)) {
813
+ throw new Error(`Expected a component definition, but received ${value}. You may have accidentally done <${ref.debugLabel}>, where "${ref.debugLabel}" was a string instead of a curried component definition. You must either use the component definition directly, or use the {{component}} helper to create a curried component definition when invoking dynamically.`);
814
+ }
1061
815
  if (isCurriedValue(value)) {
1062
816
  definition = value;
1063
817
  } else {
1064
818
  definition = constants.component(value, vm.getOwner(), true);
819
+ if (definition === null) {
820
+ throw new Error(`Expected a dynamic component definition, but received an object or function that did not have a component manager associated with it. The dynamic invocation was \`<${ref.debugLabel}>\` or \`{{${ref.debugLabel}}}\`, and the incorrect definition is the value at the path \`${ref.debugLabel}\`, which was: ${debugToString?.(value) ?? value}`);
821
+ }
822
+ }
823
+ if (definition && !isCurriedValue(definition) && !definition.resolvedName && !definition.debugName) {
824
+ let debugLabel = ref.debugLabel;
825
+ if (debugLabel) {
826
+ definition.debugName = debugLabel;
827
+ }
1065
828
  }
1066
829
  stack.push(definition);
1067
830
  });
@@ -1121,6 +884,7 @@ APPEND_OPCODES.add(VM_PREPARE_ARGS_OP, (vm, {
1121
884
  definition
1122
885
  } = instance;
1123
886
  if (isCurriedType(definition, CURRIED_COMPONENT)) {
887
+ assert(!definition.manager);
1124
888
  let constants = vm.constants;
1125
889
  let {
1126
890
  definition: resolvedDefinition,
@@ -1236,12 +1000,22 @@ APPEND_OPCODES.add(VM_REGISTER_COMPONENT_DESTRUCTOR_OP, (vm, {
1236
1000
  capabilities
1237
1001
  } = check(vm.fetchValue(check(register, CheckRegister)));
1238
1002
  let d = manager.getDestroyable(state);
1003
+ if (!managerHasCapability(manager, capabilities, InternalComponentCapabilities.willDestroy) && d !== null && "string" in d) {
1004
+ throw new Error('BUG: Destructor has willDestroy, but the willDestroy capability was not enabled for this component. Pre-destruction hooks must be explicitly opted into');
1005
+ }
1239
1006
  if (d) vm.associateDestroyable(d);
1240
1007
  });
1241
1008
  APPEND_OPCODES.add(VM_BEGIN_COMPONENT_TRANSACTION_OP, (vm, {
1242
1009
  op1: register
1243
1010
  }) => {
1244
1011
  let name;
1012
+ {
1013
+ let {
1014
+ definition,
1015
+ manager
1016
+ } = check(vm.fetchValue(check(register, CheckRegister)));
1017
+ name = getDebugName(definition, manager);
1018
+ }
1245
1019
  vm.beginCacheGroup(name);
1246
1020
  vm.tree().pushAppendingBlock();
1247
1021
  });
@@ -1421,6 +1195,7 @@ APPEND_OPCODES.add(VM_GET_COMPONENT_SELF_OP, (vm, {
1421
1195
  }
1422
1196
  let compilable = definition.compilable;
1423
1197
  if (compilable === null) {
1198
+ assert(managerHasCapability(manager, instance.capabilities, InternalComponentCapabilities.dynamicLayout));
1424
1199
  let resolver = vm.context.resolver;
1425
1200
  compilable = resolver === null ? null : manager.getDynamicLayout(state, resolver);
1426
1201
  }
@@ -1491,6 +1266,7 @@ APPEND_OPCODES.add(VM_GET_COMPONENT_LAYOUT_OP, (vm, {
1491
1266
  let {
1492
1267
  capabilities
1493
1268
  } = instance;
1269
+ assert(managerHasCapability(manager, capabilities, InternalComponentCapabilities.dynamicLayout));
1494
1270
  let resolver = vm.context.resolver;
1495
1271
  compilable = resolver === null ? null : manager.getDynamicLayout(instance.state, resolver);
1496
1272
  if (compilable === null) {
@@ -1937,7 +1713,8 @@ class NamedArgumentsImpl {
1937
1713
  }
1938
1714
  let ref = stack.get(idx, base);
1939
1715
  {
1940
- return ref;
1716
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
1717
+ return createDebugAliasRef(atNames ? name : `@${name}`, ref);
1941
1718
  }
1942
1719
  }
1943
1720
  capture() {
@@ -1948,7 +1725,8 @@ class NamedArgumentsImpl {
1948
1725
  let map = dict();
1949
1726
  for (const [i, name] of enumerate(names)) {
1950
1727
  {
1951
- map[name] = unwrap(references[i]);
1728
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
1729
+ map[name] = createDebugAliasRef(`@${name}`, unwrap(references[i]));
1952
1730
  }
1953
1731
  }
1954
1732
  return map;
@@ -2154,1153 +1932,193 @@ const EMPTY_NAMED = Object.freeze(Object.create(null));
2154
1932
  const EMPTY_POSITIONAL = EMPTY_REFERENCES;
2155
1933
  const EMPTY_ARGS = createCapturedArgs(EMPTY_NAMED, EMPTY_POSITIONAL);
2156
1934
 
2157
- function createConcatRef(partsRefs) {
2158
- return createComputeRef(() => {
2159
- const parts = [];
2160
- for (const ref of partsRefs) {
2161
- const value = valueForRef(ref);
2162
- if (value !== null && value !== undefined) {
2163
- parts.push(castToString(value));
2164
- }
1935
+ let GUID = 0;
1936
+ class Ref {
1937
+ id = GUID++;
1938
+ value;
1939
+ constructor(value) {
1940
+ this.value = value;
1941
+ }
1942
+ get() {
1943
+ return this.value;
1944
+ }
1945
+ release() {
1946
+ if (this.value === null) {
1947
+ throw new Error('BUG: double release?');
2165
1948
  }
2166
- if (parts.length > 0) {
2167
- return parts.join('');
1949
+ this.value = null;
1950
+ }
1951
+ toString() {
1952
+ let label = `Ref ${this.id}`;
1953
+ if (this.value === null) {
1954
+ return `${label} (released)`;
1955
+ } else {
1956
+ try {
1957
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
1958
+ return `${label}: ${this.value}`;
1959
+ } catch {
1960
+ return label;
1961
+ }
2168
1962
  }
2169
- return null;
2170
- });
2171
- }
2172
- function castToString(value) {
2173
- if (typeof value === 'string') {
2174
- return value;
2175
- } else if (typeof value.toString !== 'function') {
2176
- return '';
2177
1963
  }
2178
-
2179
- // eslint-disable-next-line @typescript-eslint/no-base-to-string -- @fixme
2180
- return String(value);
2181
1964
  }
2182
-
2183
- APPEND_OPCODES.add(VM_CURRY_OP, (vm, {
2184
- op1: type,
2185
- op2: _isStrict
2186
- }) => {
2187
- let stack = vm.stack;
2188
- let definition = check(stack.pop());
2189
- let capturedArgs = check(stack.pop());
2190
- let owner = vm.getOwner();
2191
- vm.context.resolver;
2192
- vm.loadValue($v0, createCurryRef(type, definition, owner, capturedArgs));
2193
- });
2194
- APPEND_OPCODES.add(VM_DYNAMIC_HELPER_OP, vm => {
2195
- let stack = vm.stack;
2196
- let ref = check(stack.pop());
2197
- let args = check(stack.pop()).capture();
2198
- let helperRef;
2199
- let initialOwner = vm.getOwner();
2200
- let helperInstanceRef = createComputeRef(() => {
2201
- if (helperRef !== undefined) {
2202
- destroy(helperRef);
2203
- }
2204
- let definition = valueForRef(ref);
2205
- if (isCurriedType(definition, CURRIED_HELPER)) {
2206
- let {
2207
- definition: resolvedDef,
2208
- owner,
2209
- positional,
2210
- named
2211
- } = resolveCurriedValue(definition);
2212
- let helper = resolveHelper(resolvedDef);
2213
- if (named !== undefined) {
2214
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2215
- args.named = assign({}, ...named, args.named);
2216
- }
2217
- if (positional !== undefined) {
2218
- args.positional = positional.concat(args.positional);
2219
- }
2220
- helperRef = helper(args, owner);
2221
- associateDestroyableChild(helperInstanceRef, helperRef);
2222
- } else if (isIndexable$1(definition)) {
2223
- let helper = resolveHelper(definition);
2224
- helperRef = helper(args, initialOwner);
2225
- if (_hasDestroyableChildren(helperRef)) {
2226
- associateDestroyableChild(helperInstanceRef, helperRef);
2227
- }
2228
- } else {
2229
- helperRef = UNDEFINED_REFERENCE;
2230
- }
2231
- });
2232
- let helperValueRef = createComputeRef(() => {
2233
- valueForRef(helperInstanceRef);
2234
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
2235
- return valueForRef(helperRef);
2236
- });
2237
- vm.associateDestroyable(helperInstanceRef);
2238
- vm.loadValue($v0, helperValueRef);
2239
- });
2240
- function resolveHelper(definition, ref) {
2241
- let managerOrHelper = getInternalHelperManager(definition, true);
2242
- let helper;
2243
- if (managerOrHelper === null) {
2244
- helper = null;
2245
- } else {
2246
- helper = typeof managerOrHelper === 'function' ? managerOrHelper : managerOrHelper.getHelper(definition);
2247
- }
2248
- return helper;
2249
- }
2250
- APPEND_OPCODES.add(VM_HELPER_OP, (vm, {
2251
- op1: handle
2252
- }) => {
2253
- let stack = vm.stack;
2254
- let helper = check(vm.constants.getValue(handle));
2255
- let args = check(stack.pop());
2256
- let value = helper(args.capture(), vm.getOwner(), vm.dynamicScope());
2257
- if (_hasDestroyableChildren(value)) {
2258
- vm.associateDestroyable(value);
2259
- }
2260
- vm.loadValue($v0, value);
2261
- });
2262
- APPEND_OPCODES.add(VM_GET_VARIABLE_OP, (vm, {
2263
- op1: symbol
2264
- }) => {
2265
- let expr = vm.referenceForSymbol(symbol);
2266
- vm.stack.push(expr);
2267
- });
2268
- APPEND_OPCODES.add(VM_SET_VARIABLE_OP, (vm, {
2269
- op1: symbol
2270
- }) => {
2271
- let expr = check(vm.stack.pop());
2272
- vm.scope().bindSymbol(symbol, expr);
2273
- });
2274
- APPEND_OPCODES.add(VM_SET_BLOCK_OP, (vm, {
2275
- op1: symbol
2276
- }) => {
2277
- let handle = check(vm.stack.pop());
2278
- let scope = check(vm.stack.pop());
2279
- let table = check(vm.stack.pop());
2280
- vm.scope().bindBlock(symbol, [handle, scope, table]);
2281
- });
2282
- APPEND_OPCODES.add(VM_ROOT_SCOPE_OP, (vm, {
2283
- op1: size
2284
- }) => {
2285
- vm.pushRootScope(size, vm.getOwner());
2286
- });
2287
- APPEND_OPCODES.add(VM_GET_PROPERTY_OP, (vm, {
2288
- op1: _key
2289
- }) => {
2290
- let key = vm.constants.getValue(_key);
2291
- let expr = check(vm.stack.pop());
2292
- vm.stack.push(childRefFor(expr, key));
2293
- });
2294
- APPEND_OPCODES.add(VM_GET_BLOCK_OP, (vm, {
2295
- op1: _block
2296
- }) => {
2297
- let {
2298
- stack
2299
- } = vm;
2300
- let block = vm.scope().getBlock(_block);
2301
- stack.push(block);
2302
- });
2303
- APPEND_OPCODES.add(VM_SPREAD_BLOCK_OP, vm => {
2304
- let {
2305
- stack
2306
- } = vm;
2307
- let block = check(stack.pop());
2308
- if (block && !isUndefinedReference(block)) {
2309
- let [handleOrCompilable, scope, table] = block;
2310
- stack.push(table);
2311
- stack.push(scope);
2312
- stack.push(handleOrCompilable);
2313
- } else {
2314
- stack.push(null);
2315
- stack.push(null);
2316
- stack.push(null);
2317
- }
2318
- });
2319
- function isUndefinedReference(input) {
2320
- return input === UNDEFINED_REFERENCE;
2321
- }
2322
- APPEND_OPCODES.add(VM_HAS_BLOCK_OP, vm => {
2323
- let {
2324
- stack
2325
- } = vm;
2326
- let block = check(stack.pop());
2327
- if (block && !isUndefinedReference(block)) {
2328
- stack.push(TRUE_REFERENCE);
2329
- } else {
2330
- stack.push(FALSE_REFERENCE);
2331
- }
2332
- });
2333
- APPEND_OPCODES.add(VM_HAS_BLOCK_PARAMS_OP, vm => {
2334
- // FIXME(mmun): should only need to push the symbol table
2335
- vm.stack.pop();
2336
- vm.stack.pop();
2337
- let table = check(vm.stack.pop());
2338
- let hasBlockParams = table && table.parameters.length;
2339
- vm.stack.push(hasBlockParams ? TRUE_REFERENCE : FALSE_REFERENCE);
2340
- });
2341
- APPEND_OPCODES.add(VM_CONCAT_OP, (vm, {
2342
- op1: count
2343
- }) => {
2344
- let out = new Array(count);
2345
- for (let i = count; i > 0; i--) {
2346
- let offset = i - 1;
2347
- out[offset] = check(vm.stack.pop());
2348
- }
2349
- vm.stack.push(createConcatRef(out));
2350
- });
2351
- APPEND_OPCODES.add(VM_IF_INLINE_OP, vm => {
2352
- let condition = check(vm.stack.pop());
2353
- let truthy = check(vm.stack.pop());
2354
- let falsy = check(vm.stack.pop());
2355
- vm.stack.push(createComputeRef(() => {
2356
- if (toBool(valueForRef(condition))) {
2357
- return valueForRef(truthy);
2358
- } else {
2359
- return valueForRef(falsy);
2360
- }
2361
- }));
2362
- });
2363
- APPEND_OPCODES.add(VM_NOT_OP, vm => {
2364
- let ref = check(vm.stack.pop());
2365
- vm.stack.push(createComputeRef(() => {
2366
- return !toBool(valueForRef(ref));
2367
- }));
2368
- });
2369
- APPEND_OPCODES.add(VM_GET_DYNAMIC_VAR_OP, vm => {
2370
- let scope = vm.dynamicScope();
2371
- let stack = vm.stack;
2372
- let nameRef = check(stack.pop());
2373
- stack.push(createComputeRef(() => {
2374
- let name = String(valueForRef(nameRef));
2375
- return valueForRef(scope.get(name));
2376
- }));
2377
- });
2378
- APPEND_OPCODES.add(VM_LOG_OP, vm => {
2379
- let {
2380
- positional
2381
- } = check(vm.stack.pop()).capture();
2382
- vm.loadValue($v0, createComputeRef(() => {
2383
- // eslint-disable-next-line no-console
2384
- console.log(...reifyPositional(positional));
2385
- }));
2386
- });
2387
-
2388
- class DynamicTextContent {
2389
- constructor(node, reference, lastValue) {
2390
- this.node = node;
2391
- this.reference = reference;
2392
- this.lastValue = lastValue;
2393
- }
2394
- evaluate() {
2395
- let value = valueForRef(this.reference);
2396
- let {
2397
- lastValue
2398
- } = this;
2399
- if (value === lastValue) return;
2400
- let normalized;
2401
- if (isEmpty$1(value)) {
2402
- normalized = '';
2403
- } else if (isString(value)) {
2404
- normalized = value;
2405
- } else {
2406
- normalized = String(value);
2407
- }
2408
- if (normalized !== lastValue) {
2409
- let textNode = this.node;
2410
- textNode.nodeValue = this.lastValue = normalized;
2411
- }
2412
- }
2413
- }
2414
-
2415
- function toContentType(value) {
2416
- if (shouldCoerce(value)) {
2417
- return ContentType.String;
2418
- } else if (isCurriedType(value, CURRIED_COMPONENT) || hasInternalComponentManager(value)) {
2419
- return ContentType.Component;
2420
- } else if (isCurriedType(value, CURRIED_HELPER) || hasInternalHelperManager(value)) {
2421
- return ContentType.Helper;
2422
- } else if (isSafeString(value)) {
2423
- return ContentType.SafeString;
2424
- } else if (isFragment(value)) {
2425
- return ContentType.Fragment;
2426
- } else if (isNode(value)) {
2427
- return ContentType.Node;
2428
- } else {
2429
- return ContentType.String;
2430
- }
2431
- }
2432
- function toDynamicContentType(value) {
2433
- if (!isIndexable$1(value)) {
2434
- return ContentType.String;
2435
- }
2436
- if (isCurriedType(value, CURRIED_COMPONENT) || hasInternalComponentManager(value)) {
2437
- return ContentType.Component;
2438
- } else {
2439
- return ContentType.Helper;
2440
- }
2441
- }
2442
- APPEND_OPCODES.add(VM_CONTENT_TYPE_OP, vm => {
2443
- let reference = check(vm.stack.peek());
2444
- vm.stack.push(toContentType(valueForRef(reference)));
2445
- if (!isConstRef(reference)) {
2446
- vm.updateWith(new AssertFilter(reference, toContentType));
2447
- }
2448
- });
2449
- APPEND_OPCODES.add(VM_DYNAMIC_CONTENT_TYPE_OP, vm => {
2450
- let reference = check(vm.stack.peek());
2451
- vm.stack.push(toDynamicContentType(valueForRef(reference)));
2452
- if (!isConstRef(reference)) {
2453
- vm.updateWith(new AssertFilter(reference, toDynamicContentType));
1965
+ class DebugRenderTreeImpl {
1966
+ stack = new StackImpl();
1967
+ refs = new WeakMap();
1968
+ roots = new Set();
1969
+ nodes = new WeakMap();
1970
+ begin() {
1971
+ this.reset();
2454
1972
  }
2455
- });
2456
- APPEND_OPCODES.add(VM_APPEND_HTML_OP, vm => {
2457
- let reference = check(vm.stack.pop());
2458
- let rawValue = valueForRef(reference);
2459
- let value = isEmpty$1(rawValue) ? '' : String(rawValue);
2460
- vm.tree().appendDynamicHTML(value);
2461
- });
2462
- APPEND_OPCODES.add(VM_APPEND_SAFE_HTML_OP, vm => {
2463
- let reference = check(vm.stack.pop());
2464
- let rawValue = check(valueForRef(reference)).toHTML();
2465
- let value = isEmpty$1(rawValue) ? '' : check(rawValue);
2466
- vm.tree().appendDynamicHTML(value);
2467
- });
2468
- APPEND_OPCODES.add(VM_APPEND_TEXT_OP, vm => {
2469
- let reference = check(vm.stack.pop());
2470
- let rawValue = valueForRef(reference);
2471
- let value = isEmpty$1(rawValue) ? '' : String(rawValue);
2472
- let node = vm.tree().appendDynamicText(value);
2473
- if (!isConstRef(reference)) {
2474
- vm.updateWith(new DynamicTextContent(node, reference, value));
1973
+ create(state, node) {
1974
+ let internalNode = assign({}, node, {
1975
+ bounds: null,
1976
+ refs: new Set()
1977
+ });
1978
+ this.nodes.set(state, internalNode);
1979
+ this.appendChild(internalNode, state);
1980
+ this.enter(state);
2475
1981
  }
2476
- });
2477
- APPEND_OPCODES.add(VM_APPEND_DOCUMENT_FRAGMENT_OP, vm => {
2478
- let reference = check(vm.stack.pop());
2479
- let value = check(valueForRef(reference));
2480
- vm.tree().appendDynamicFragment(value);
2481
- });
2482
- APPEND_OPCODES.add(VM_APPEND_NODE_OP, vm => {
2483
- let reference = check(vm.stack.pop());
2484
- let value = check(valueForRef(reference));
2485
- vm.tree().appendDynamicNode(value);
2486
- });
2487
-
2488
- // Allow the contents of `debugCallback` without extra annotations
2489
- /* eslint-disable @typescript-eslint/no-unused-expressions */
2490
-
2491
- function debugCallback(context, get) {
2492
- // eslint-disable-next-line no-console
2493
- console.info('Use `context`, and `get(<path>)` to debug this template.');
2494
-
2495
- // for example...
2496
- context === get('this');
2497
-
2498
- // eslint-disable-next-line no-debugger
2499
- debugger;
2500
- }
2501
- let callback = debugCallback;
2502
-
2503
- // For testing purposes
2504
- function setDebuggerCallback(cb) {
2505
- callback = cb;
2506
- }
2507
- function resetDebuggerCallback() {
2508
- callback = debugCallback;
2509
- }
2510
- class ScopeInspector {
2511
- #symbols;
2512
- constructor(scope, symbols) {
2513
- this.scope = scope;
2514
- this.#symbols = symbols;
1982
+ update(state) {
1983
+ this.enter(state);
2515
1984
  }
2516
- get(path) {
2517
- let {
2518
- scope
2519
- } = this;
2520
- let symbols = this.#symbols;
2521
- let parts = path.split('.');
2522
- let [head, ...tail] = path.split('.');
2523
- let ref;
2524
- if (head === 'this') {
2525
- ref = scope.getSelf();
2526
- } else if (symbols.locals[head]) {
2527
- ref = unwrap(scope.getSymbol(symbols.locals[head]));
2528
- } else {
2529
- ref = this.scope.getSelf();
2530
- tail = parts;
1985
+ didRender(state, bounds) {
1986
+ if (this.stack.current !== state) {
1987
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
1988
+ throw new Error(`BUG: expecting ${this.stack.current}, got ${state}`);
2531
1989
  }
2532
- return tail.reduce((r, part) => childRefFor(r, part), ref);
2533
- }
2534
- }
2535
- APPEND_OPCODES.add(VM_DEBUGGER_OP, (vm, {
2536
- op1: _debugInfo
2537
- }) => {
2538
- let debuggerInfo = vm.constants.getValue(decodeHandle(_debugInfo));
2539
- let inspector = new ScopeInspector(vm.scope(), debuggerInfo);
2540
- callback(valueForRef(vm.getSelf()), path => valueForRef(inspector.get(path)));
2541
- });
2542
-
2543
- APPEND_OPCODES.add(VM_ENTER_LIST_OP, (vm, {
2544
- op1: relativeStart,
2545
- op2: elseTarget
2546
- }) => {
2547
- let stack = vm.stack;
2548
- let listRef = check(stack.pop());
2549
- let keyRef = check(stack.pop());
2550
- let keyValue = valueForRef(keyRef);
2551
- // eslint-disable-next-line @typescript-eslint/no-base-to-string -- @fixme
2552
- let key = keyValue === null ? '@identity' : String(keyValue);
2553
- let iteratorRef = createIteratorRef(listRef, key);
2554
- let iterator = valueForRef(iteratorRef);
2555
- vm.updateWith(new AssertFilter(iteratorRef, iterator => iterator.isEmpty()));
2556
- if (iterator.isEmpty()) {
2557
- // TODO: Fix this offset, should be accurate
2558
- vm.lowlevel.goto(elseTarget + 1);
2559
- } else {
2560
- vm.enterList(iteratorRef, relativeStart);
2561
- vm.stack.push(iterator);
2562
- }
2563
- });
2564
- APPEND_OPCODES.add(VM_EXIT_LIST_OP, vm => {
2565
- vm.exitList();
2566
- });
2567
- APPEND_OPCODES.add(VM_ITERATE_OP, (vm, {
2568
- op1: breaks
2569
- }) => {
2570
- let stack = vm.stack;
2571
- let iterator = check(stack.peek());
2572
- let item = iterator.next();
2573
- if (item !== null) {
2574
- vm.registerItem(vm.enterItem(item));
2575
- } else {
2576
- vm.lowlevel.goto(breaks);
1990
+ this.nodeFor(state).bounds = bounds;
1991
+ this.exit();
2577
1992
  }
2578
- });
2579
-
2580
- const CAPABILITIES = {
2581
- dynamicLayout: false,
2582
- dynamicTag: false,
2583
- prepareArgs: false,
2584
- createArgs: false,
2585
- attributeHook: false,
2586
- elementHook: false,
2587
- createCaller: false,
2588
- dynamicScope: false,
2589
- updateHook: false,
2590
- createInstance: false,
2591
- wrapped: false,
2592
- willDestroy: false,
2593
- hasSubOwner: false
2594
- };
2595
- class TemplateOnlyComponentManager {
2596
- getCapabilities() {
2597
- return CAPABILITIES;
2598
- }
2599
- getDebugName({
2600
- name
2601
- }) {
2602
- return name;
2603
- }
2604
- getSelf() {
2605
- return NULL_REFERENCE;
2606
- }
2607
- getDestroyable() {
2608
- return null;
1993
+ willDestroy(state) {
1994
+ expect(this.refs.get(state)).release();
2609
1995
  }
2610
- }
2611
- const TEMPLATE_ONLY_COMPONENT_MANAGER = new TemplateOnlyComponentManager();
2612
-
2613
- // This is only exported for types, don't use this class directly
2614
- class TemplateOnlyComponentDefinition {
2615
- constructor(moduleName = '@glimmer/component/template-only', name = '(unknown template-only component)') {
2616
- this.moduleName = moduleName;
2617
- this.name = name;
1996
+ commit() {
1997
+ this.reset();
2618
1998
  }
2619
- toString() {
2620
- return this.moduleName;
1999
+ capture() {
2000
+ return this.captureRefs(this.roots);
2621
2001
  }
2622
- }
2623
- setInternalComponentManager(TEMPLATE_ONLY_COMPONENT_MANAGER, TemplateOnlyComponentDefinition.prototype);
2624
-
2625
- /**
2626
- This utility function is used to declare a given component has no backing class. When the rendering engine detects this it
2627
- is able to perform a number of optimizations. Templates that are associated with `templateOnly()` will be rendered _as is_
2628
- without adding a wrapping `<div>` (or any of the other element customization behaviors of [@ember/component](/ember/release/classes/Component)).
2629
- Specifically, this means that the template will be rendered as "outer HTML".
2630
-
2631
- In general, this method will be used by build time tooling and would not be directly written in an application. However,
2632
- at times it may be useful to use directly to leverage the "outer HTML" semantics mentioned above. For example, if an addon would like
2633
- to use these semantics for its templates but cannot be certain it will only be consumed by applications that have enabled the
2634
- `template-only-glimmer-components` optional feature.
2635
-
2636
- @example
2637
-
2638
- ```js
2639
- import { templateOnlyComponent } from '@glimmer/runtime';
2640
-
2641
- export default templateOnlyComponent();
2642
- ```
2643
-
2644
- @public
2645
- @method templateOnly
2646
- @param {String} moduleName the module name that the template only component represents, this will be used for debugging purposes
2647
- @category EMBER_GLIMMER_SET_COMPONENT_TEMPLATE
2648
- */
2649
-
2650
- function templateOnlyComponent(moduleName, name) {
2651
- return new TemplateOnlyComponentDefinition(moduleName, name);
2652
- }
2653
-
2654
- // http://www.w3.org/TR/html/syntax.html#html-integration-point
2655
- const SVG_INTEGRATION_POINTS = {
2656
- foreignObject: 1,
2657
- desc: 1,
2658
- title: 1
2659
- };
2660
-
2661
- // http://www.w3.org/TR/html/syntax.html#adjust-svg-attributes
2662
- // TODO: Adjust SVG attributes
2663
-
2664
- // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign
2665
- // TODO: Adjust SVG elements
2666
-
2667
- // http://www.w3.org/TR/html/syntax.html#parsing-main-inforeign
2668
- const BLACKLIST_TABLE = Object.create(null);
2669
- class DOMOperations {
2670
- // Set by this.setupUselessElement() in constructor
2002
+ reset() {
2003
+ if (this.stack.size !== 0) {
2004
+ // We probably encountered an error during the rendering loop. This will
2005
+ // likely trigger undefined behavior and memory leaks as the error left
2006
+ // things in an inconsistent state. It is recommended that the user
2007
+ // refresh the page.
2671
2008
 
2672
- constructor(document) {
2673
- this.document = document;
2674
- this.setupUselessElement();
2675
- }
2009
+ // TODO: We could warn here? But this happens all the time in our tests?
2676
2010
 
2677
- // split into separate method so that NodeDOMTreeConstruction
2678
- // can override it.
2679
- setupUselessElement() {
2680
- this.uselessElement = this.document.createElement('div');
2681
- }
2682
- createElement(tag, context) {
2683
- let isElementInSVGNamespace, isHTMLIntegrationPoint, isElementInMathMlNamespace, ns;
2684
- if (context) {
2685
- isElementInSVGNamespace = context.namespaceURI === NS_SVG || tag === 'svg';
2686
- isElementInMathMlNamespace = context.namespaceURI === NS_MATHML || tag === 'math';
2687
- isHTMLIntegrationPoint = !!SVG_INTEGRATION_POINTS[context.tagName];
2688
- } else {
2689
- isElementInSVGNamespace = tag === 'svg';
2690
- isElementInMathMlNamespace = tag === 'math';
2691
- isHTMLIntegrationPoint = false;
2692
- }
2693
- if ((isElementInMathMlNamespace || isElementInSVGNamespace) && !isHTMLIntegrationPoint) {
2694
- // FIXME: This does not properly handle <font> with color, face, or
2695
- // size attributes, which is also disallowed by the spec. We should fix
2696
- // this.
2697
- if (BLACKLIST_TABLE[tag]) {
2698
- throw new Error(`Cannot create a ${tag} inside an SVG context`);
2011
+ // Clean up the root reference to prevent errors from happening if we
2012
+ // attempt to capture the render tree (Ember Inspector may do this)
2013
+ let root = expect(this.stack.toArray()[0]);
2014
+ let ref = this.refs.get(root);
2015
+ if (ref !== undefined) {
2016
+ this.roots.delete(ref);
2699
2017
  }
2700
- if (isElementInMathMlNamespace) {
2701
- ns = NS_MATHML;
2702
- } else {
2703
- ns = NS_SVG;
2018
+ while (!this.stack.isEmpty()) {
2019
+ this.stack.pop();
2704
2020
  }
2705
- return this.document.createElementNS(ns, tag);
2706
- } else {
2707
- return this.document.createElement(tag);
2708
- }
2709
- }
2710
- insertBefore(parent, node, reference) {
2711
- parent.insertBefore(node, reference);
2712
- }
2713
- insertHTMLBefore(parent, nextSibling, html) {
2714
- if (html === '') {
2715
- const comment = this.createComment('');
2716
- parent.insertBefore(comment, nextSibling);
2717
- return new ConcreteBounds(parent, comment, comment);
2718
- }
2719
- const prev = nextSibling ? nextSibling.previousSibling : parent.lastChild;
2720
- let last;
2721
- if (nextSibling === null) {
2722
- parent.insertAdjacentHTML(INSERT_BEFORE_END, html);
2723
- last = expect(parent.lastChild);
2724
- } else if (nextSibling instanceof HTMLElement) {
2725
- nextSibling.insertAdjacentHTML('beforebegin', html);
2726
- last = expect(nextSibling.previousSibling);
2727
- } else {
2728
- // Non-element nodes do not support insertAdjacentHTML, so add an
2729
- // element and call it on that element. Then remove the element.
2730
- const {
2731
- uselessElement
2732
- } = this;
2733
- parent.insertBefore(uselessElement, nextSibling);
2734
- uselessElement.insertAdjacentHTML(INSERT_BEFORE_BEGIN, html);
2735
- last = expect(uselessElement.previousSibling);
2736
- parent.removeChild(uselessElement);
2737
2021
  }
2738
- const first = expect(prev ? prev.nextSibling : parent.firstChild);
2739
- return new ConcreteBounds(parent, first, last);
2740
- }
2741
- createTextNode(text) {
2742
- return this.document.createTextNode(text);
2743
- }
2744
- createComment(data) {
2745
- return this.document.createComment(data);
2746
- }
2747
- }
2748
-
2749
- ['b', 'big', 'blockquote', 'body', 'br', 'center', 'code', 'dd', 'div', 'dl', 'dt', 'em', 'embed', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'i', 'img', 'li', 'listing', 'main', 'meta', 'nobr', 'ol', 'p', 'pre', 'ruby', 's', 'small', 'span', 'strong', 'strike', 'sub', 'sup', 'table', 'tt', 'u', 'ul', 'var'].forEach(tag => BLACKLIST_TABLE[tag] = 1);
2750
- const WHITESPACE = /[\t\n\v\f\r \xa0\u{1680}\u{180e}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}\u{feff}]/u;
2751
- function isWhitespace(string) {
2752
- return WHITESPACE.test(string);
2753
- }
2754
- class DOMChangesImpl extends DOMOperations {
2755
- namespace;
2756
- constructor(document) {
2757
- super(document);
2758
- this.document = document;
2759
- this.namespace = null;
2760
- }
2761
- setAttribute(element, name, value) {
2762
- element.setAttribute(name, value);
2763
- }
2764
- removeAttribute(element, name) {
2765
- element.removeAttribute(name);
2766
2022
  }
2767
- insertAfter(element, node, reference) {
2768
- this.insertBefore(element, node, reference.nextSibling);
2769
- }
2770
- }
2771
- const DOMChanges = DOMChangesImpl;
2772
-
2773
- function internalHelper(helper) {
2774
- return setInternalHelperManager(helper, {});
2775
- }
2776
-
2777
- /**
2778
- Use the `{{array}}` helper to create an array to pass as an option to your
2779
- components.
2780
-
2781
- ```handlebars
2782
- <MyComponent @people={{array
2783
- 'Tom Dale'
2784
- 'Yehuda Katz'
2785
- this.myOtherPerson}}
2786
- />
2787
- ```
2788
- or
2789
- ```handlebars
2790
- {{my-component people=(array
2791
- 'Tom Dale'
2792
- 'Yehuda Katz'
2793
- this.myOtherPerson)
2794
- }}
2795
- ```
2796
-
2797
- Would result in an object such as:
2798
-
2799
- ```js
2800
- ['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]
2801
- ```
2802
-
2803
- Where the 3rd item in the array is bound to updates of the `myOtherPerson` property.
2804
-
2805
- @method array
2806
- @param {Array} options
2807
- @return {Array} Array
2808
- @public
2809
- */
2810
-
2811
- const array = internalHelper(({
2812
- positional
2813
- }) => {
2814
- return createComputeRef(() => reifyPositional(positional), null, 'array');
2815
- });
2816
-
2817
- const isEmpty = value => {
2818
- return value === null || value === undefined || typeof value.toString !== 'function';
2819
- };
2820
- const normalizeTextValue = value => {
2821
- if (isEmpty(value)) {
2822
- return '';
2823
- }
2824
- return String(value);
2825
- };
2826
-
2827
- /**
2828
- Concatenates the given arguments into a string.
2829
-
2830
- Example:
2831
-
2832
- ```handlebars
2833
- {{some-component name=(concat firstName " " lastName)}}
2834
-
2835
- {{! would pass name="<first name value> <last name value>" to the component}}
2836
- ```
2837
-
2838
- or for angle bracket invocation, you actually don't need concat at all.
2839
-
2840
- ```handlebars
2841
- <SomeComponent @name="{{firstName}} {{lastName}}" />
2842
- ```
2843
-
2844
- @public
2845
- @method concat
2846
- */
2847
- const concat = internalHelper(({
2848
- positional
2849
- }) => {
2850
- return createComputeRef(() => reifyPositional(positional).map(normalizeTextValue).join(''), null, 'concat');
2851
- });
2852
-
2853
- const context = buildUntouchableThis();
2854
-
2855
- /**
2856
- The `fn` helper allows you to ensure a function that you are passing off
2857
- to another component, helper, or modifier has access to arguments that are
2858
- available in the template.
2859
-
2860
- For example, if you have an `each` helper looping over a number of items, you
2861
- may need to pass a function that expects to receive the item as an argument
2862
- to a component invoked within the loop. Here's how you could use the `fn`
2863
- helper to pass both the function and its arguments together:
2864
-
2865
- ```app/templates/components/items-listing.hbs
2866
- {{#each @items as |item|}}
2867
- <DisplayItem @item=item @select={{fn this.handleSelected item}} />
2868
- {{/each}}
2869
- ```
2870
-
2871
- ```app/components/items-list.js
2872
- import Component from '@glimmer/component';
2873
- import { action } from '@ember/object';
2874
-
2875
- export default class ItemsList extends Component {
2876
- handleSelected = (item) => {
2877
- // ...snip...
2878
- }
2023
+ enter(state) {
2024
+ this.stack.push(state);
2879
2025
  }
2880
- ```
2881
-
2882
- In this case the `display-item` component will receive a normal function
2883
- that it can invoke. When it invokes the function, the `handleSelected`
2884
- function will receive the `item` and any arguments passed, thanks to the
2885
- `fn` helper.
2886
-
2887
- Let's take look at what that means in a couple circumstances:
2888
-
2889
- - When invoked as `this.args.select()` the `handleSelected` function will
2890
- receive the `item` from the loop as its first and only argument.
2891
- - When invoked as `this.args.select('foo')` the `handleSelected` function
2892
- will receive the `item` from the loop as its first argument and the
2893
- string `'foo'` as its second argument.
2894
-
2895
- In the example above, we used an arrow function to ensure that
2896
- `handleSelected` is properly bound to the `items-list`, but let's explore what
2897
- happens if we left out the arrow function:
2898
-
2899
- ```app/components/items-list.js
2900
- import Component from '@glimmer/component';
2901
-
2902
- export default class ItemsList extends Component {
2903
- handleSelected(item) {
2904
- // ...snip...
2026
+ exit() {
2027
+ if (this.stack.size === 0) {
2028
+ throw new Error('BUG: unbalanced pop');
2905
2029
  }
2030
+ this.stack.pop();
2906
2031
  }
2907
- ```
2908
-
2909
- In this example, when `handleSelected` is invoked inside the `display-item`
2910
- component, it will **not** have access to the component instance. In other
2911
- words, it will have no `this` context, so please make sure your functions
2912
- are bound (via an arrow function or other means) before passing into `fn`!
2913
-
2914
- See also [partial application](https://en.wikipedia.org/wiki/Partial_application).
2915
-
2916
- @method fn
2917
- @public
2918
- */
2919
- const fn = internalHelper(({
2920
- positional
2921
- }) => {
2922
- let callbackRef = check(positional[0]);
2923
- return createComputeRef(() => {
2924
- return (...invocationArgs) => {
2925
- let [fn, ...args] = reifyPositional(positional);
2926
- if (isInvokableRef(callbackRef)) {
2927
- let value = args.length > 0 ? args[0] : invocationArgs[0];
2928
- return void updateRef(callbackRef, value);
2929
- } else {
2930
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return -- @fixme
2931
- return fn.call(context, ...args, ...invocationArgs);
2932
- }
2933
- };
2934
- }, null, 'fn');
2935
- });
2936
-
2937
- /**
2938
- Dynamically look up a property on an object. The second argument to `{{get}}`
2939
- should have a string value, although it can be bound.
2940
-
2941
- For example, these two usages are equivalent:
2942
-
2943
- ```app/components/developer-detail.js
2944
- import Component from '@glimmer/component';
2945
- import { tracked } from '@glimmer/tracking';
2946
-
2947
- export default class extends Component {
2948
- @tracked developer = {
2949
- name: "Sandi Metz",
2950
- language: "Ruby"
2951
- }
2032
+ nodeFor(state) {
2033
+ return expect(this.nodes.get(state));
2952
2034
  }
2953
- ```
2954
-
2955
- ```handlebars
2956
- {{this.developer.name}}
2957
- {{get this.developer "name"}}
2958
- ```
2959
-
2960
- If there were several facts about a person, the `{{get}}` helper can dynamically
2961
- pick one:
2962
-
2963
- ```app/templates/application.hbs
2964
- <DeveloperDetail @factName="language" />
2965
- ```
2966
-
2967
- ```handlebars
2968
- {{get this.developer @factName}}
2969
- ```
2970
-
2971
- For a more complex example, this template would allow the user to switch
2972
- between showing the user's height and weight with a click:
2973
-
2974
- ```app/components/developer-detail.js
2975
- import Component from '@glimmer/component';
2976
- import { tracked } from '@glimmer/tracking';
2977
-
2978
- export default class extends Component {
2979
- @tracked developer = {
2980
- name: "Sandi Metz",
2981
- language: "Ruby"
2035
+ appendChild(node, state) {
2036
+ if (this.refs.has(state)) {
2037
+ throw new Error('BUG: child already appended');
2982
2038
  }
2983
-
2984
- @tracked currentFact = 'name'
2985
-
2986
- showFact = (fact) => {
2987
- this.currentFact = fact;
2039
+ let parent = this.stack.current;
2040
+ let ref = new Ref(state);
2041
+ this.refs.set(state, ref);
2042
+ if (parent) {
2043
+ let parentNode = this.nodeFor(parent);
2044
+ parentNode.refs.add(ref);
2045
+ node.parent = parentNode;
2046
+ } else {
2047
+ this.roots.add(ref);
2988
2048
  }
2989
2049
  }
2990
- ```
2991
-
2992
- ```app/components/developer-detail.js
2993
- {{get this.developer this.currentFact}}
2994
-
2995
- <button {{on 'click' (fn this.showFact "name")}}>Show name</button>
2996
- <button {{on 'click' (fn this.showFact "language")}}>Show language</button>
2997
- ```
2998
-
2999
- The `{{get}}` helper can also respect mutable values itself. For example:
3000
-
3001
- ```app/components/developer-detail.js
3002
- <Input @value={{mut (get this.person this.currentFact)}} />
3003
-
3004
- <button {{on 'click' (fn this.showFact "name")}}>Show name</button>
3005
- <button {{on 'click' (fn this.showFact "language")}}>Show language</button>
3006
- ```
3007
-
3008
- Would allow the user to swap what fact is being displayed, and also edit
3009
- that fact via a two-way mutable binding.
3010
-
3011
- @public
3012
- @method get
3013
- */
3014
- const get = internalHelper(({
3015
- positional
3016
- }) => {
3017
- let sourceRef = positional[0] ?? UNDEFINED_REFERENCE;
3018
- let pathRef = positional[1] ?? UNDEFINED_REFERENCE;
3019
- return createComputeRef(() => {
3020
- let source = valueForRef(sourceRef);
3021
- if (isDict(source)) {
3022
- return getPath(source, String(valueForRef(pathRef)));
3023
- }
3024
- }, value => {
3025
- let source = valueForRef(sourceRef);
3026
- if (isDict(source)) {
3027
- return setPath(source, String(valueForRef(pathRef)), value);
3028
- }
3029
- }, 'get');
3030
- });
3031
-
3032
- /**
3033
- Use the `{{hash}}` helper to create a hash to pass as an option to your
3034
- components. This is specially useful for contextual components where you can
3035
- just yield a hash:
3036
-
3037
- ```handlebars
3038
- {{yield (hash
3039
- name='Sarah'
3040
- title=office
3041
- )}}
3042
- ```
3043
-
3044
- Would result in an object such as:
3045
-
3046
- ```js
3047
- { name: 'Sarah', title: this.get('office') }
3048
- ```
3049
-
3050
- Where the `title` is bound to updates of the `office` property.
3051
-
3052
- Note that the hash is an empty object with no prototype chain, therefore
3053
- common methods like `toString` are not available in the resulting hash.
3054
- If you need to use such a method, you can use the `call` or `apply`
3055
- approach:
3056
-
3057
- ```js
3058
- function toString(obj) {
3059
- return Object.prototype.toString.apply(obj);
3060
- }
3061
- ```
3062
-
3063
- @method hash
3064
- @param {Object} options
3065
- @return {Object} Hash
3066
- @public
3067
- */
3068
- const hash = internalHelper(({
3069
- named
3070
- }) => {
3071
- let ref = createComputeRef(() => {
3072
- return reifyNamed(named);
3073
- }, null, 'hash');
3074
-
3075
- // Setup the children so that templates can bypass getting the value of
3076
- // the reference and treat children lazily
3077
- let children = new Map();
3078
- for (let name in named) {
3079
- children.set(name, named[name]);
3080
- }
3081
- ref.children = children;
3082
- return ref;
3083
- });
3084
-
3085
- class OnModifierState {
3086
- tag = createUpdatableTag();
3087
- element;
3088
- args;
3089
- listener = null;
3090
- constructor(element, args) {
3091
- this.element = element;
3092
- this.args = args;
3093
- registerDestructor(this, () => {
3094
- let {
3095
- element,
3096
- listener
3097
- } = this;
3098
- if (listener) {
3099
- let {
3100
- eventName,
3101
- callback,
3102
- options
3103
- } = listener;
3104
- removeEventListener(element, eventName, callback, options);
2050
+ captureRefs(refs) {
2051
+ let captured = [];
2052
+ refs.forEach(ref => {
2053
+ let state = ref.get();
2054
+ if (state) {
2055
+ captured.push(this.captureNode(`render-node:${ref.id}`, state));
2056
+ } else {
2057
+ refs.delete(ref);
3105
2058
  }
3106
2059
  });
2060
+ return captured;
3107
2061
  }
3108
-
3109
- // Update this.listener if needed
3110
- updateListener() {
2062
+ captureNode(id, state) {
2063
+ let node = this.nodeFor(state);
3111
2064
  let {
3112
- element,
2065
+ type,
2066
+ name,
3113
2067
  args,
3114
- listener
3115
- } = this;
3116
- let arg0 = args.positional[0];
3117
- let eventName = check(arg0 ? valueForRef(arg0) : undefined);
3118
- let arg1 = args.positional[1];
3119
- let userProvidedCallback = check(arg1 ? valueForRef(arg1) : undefined);
3120
- let once = undefined;
3121
- let passive = undefined;
3122
- let capture = undefined;
3123
- {
3124
- let {
3125
- once: _once,
3126
- passive: _passive,
3127
- capture: _capture
3128
- } = args.named;
3129
- if (_once) {
3130
- once = valueForRef(_once);
3131
- }
3132
- if (_passive) {
3133
- passive = valueForRef(_passive);
3134
- }
3135
- if (_capture) {
3136
- capture = valueForRef(_capture);
3137
- }
3138
- }
3139
- let shouldUpdate = false;
3140
- if (listener === null) {
3141
- shouldUpdate = true;
3142
- } else {
3143
- shouldUpdate = eventName !== listener.eventName || userProvidedCallback !== listener.userProvidedCallback || once !== listener.once || passive !== listener.passive || capture !== listener.capture;
3144
- }
3145
- let options = undefined;
3146
-
3147
- // we want to handle both `true` and `false` because both have a meaning:
3148
- // https://bugs.chromium.org/p/chromium/issues/detail?id=770208
3149
- if (shouldUpdate) {
3150
- if (once !== undefined || passive !== undefined || capture !== undefined) {
3151
- options = {
3152
- once,
3153
- passive,
3154
- capture
3155
- };
3156
- }
3157
- }
3158
- if (shouldUpdate) {
3159
- let callback = userProvidedCallback;
3160
- this.listener = {
3161
- eventName,
3162
- callback,
3163
- userProvidedCallback,
3164
- once,
3165
- passive,
3166
- capture,
3167
- options
3168
- };
3169
- if (listener) {
3170
- removeEventListener(element, listener.eventName, listener.callback, listener.options);
3171
- }
3172
- addEventListener(element, eventName, callback, options);
3173
- }
2068
+ instance,
2069
+ refs
2070
+ } = node;
2071
+ let bounds = this.captureBounds(node);
2072
+ let children = this.captureRefs(refs);
2073
+ return {
2074
+ id,
2075
+ type,
2076
+ name,
2077
+ args: reifyArgsDebug(args),
2078
+ instance,
2079
+ bounds,
2080
+ children
2081
+ };
2082
+ }
2083
+ captureBounds(node) {
2084
+ let bounds = expect(node.bounds);
2085
+ let parentElement = bounds.parentElement();
2086
+ let firstNode = bounds.firstNode();
2087
+ let lastNode = bounds.lastNode();
2088
+ return {
2089
+ parentElement,
2090
+ firstNode,
2091
+ lastNode
2092
+ };
3174
2093
  }
3175
2094
  }
3176
- let adds = 0;
3177
- let removes = 0;
3178
- function removeEventListener(element, eventName, callback, options) {
3179
- removes++;
3180
- element.removeEventListener(eventName, callback, options);
3181
- }
3182
- function addEventListener(element, eventName, callback, options) {
3183
- adds++;
3184
- element.addEventListener(eventName, callback, options);
2095
+ function getDebugName(definition, manager = definition.manager) {
2096
+ return definition.resolvedName ?? definition.debugName ?? manager.getDebugName(definition.state);
3185
2097
  }
3186
2098
 
3187
- /**
3188
- The `{{on}}` modifier lets you easily add event listeners (it uses
3189
- [EventTarget.addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
3190
- internally).
3191
-
3192
- For example, if you'd like to run a function on your component when a `<button>`
3193
- in the components template is clicked you might do something like:
3194
-
3195
- ```app/components/like-post.hbs
3196
- <button {{on 'click' this.saveLike}}>Like this post!</button>
3197
- ```
3198
-
3199
- ```app/components/like-post.js
3200
- import Component from '@glimmer/component';
3201
- import { action } from '@ember/object';
3202
-
3203
- export default class LikePostComponent extends Component {
3204
- saveLike = () => {
3205
- // someone likes your post!
3206
- // better send a request off to your server...
3207
- }
3208
- }
3209
- ```
3210
-
3211
- ### Arguments
3212
-
3213
- `{{on}}` accepts two positional arguments, and a few named arguments.
3214
-
3215
- The positional arguments are:
3216
-
3217
- - `event` -- the name to use when calling `addEventListener`
3218
- - `callback` -- the function to be passed to `addEventListener`
3219
-
3220
- The named arguments are:
3221
-
3222
- - capture -- a `true` value indicates that events of this type will be dispatched
3223
- to the registered listener before being dispatched to any EventTarget beneath it
3224
- in the DOM tree.
3225
- - once -- indicates that the listener should be invoked at most once after being
3226
- added. If true, the listener would be automatically removed when invoked.
3227
- - passive -- if `true`, indicates that the function specified by listener will never
3228
- call preventDefault(). If a passive listener does call preventDefault(), the user
3229
- agent will do nothing other than generate a console warning. See
3230
- [Improving scrolling performance with passive listeners](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Improving_scrolling_performance_with_passive_listeners)
3231
- to learn more.
3232
-
3233
- The callback function passed to `{{on}}` will receive any arguments that are passed
3234
- to the event handler. Most commonly this would be the `event` itself.
3235
-
3236
- If you would like to pass additional arguments to the function you should use
3237
- the `{{fn}}` helper.
3238
-
3239
- For example, in our example case above if you'd like to pass in the post that
3240
- was being liked when the button is clicked you could do something like:
3241
-
3242
- ```app/components/like-post.hbs
3243
- <button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
3244
- ```
3245
-
3246
- In this case, the `saveLike` function will receive two arguments: the click event
3247
- and the value of `@post`.
3248
-
3249
- ### Function Context
3250
-
3251
- In the example above, we used an arrow function to ensure that `likePost` is
3252
- properly bound to the `items-list`, but let's explore what happens if we
3253
- left out the arrow function:
3254
-
3255
- ```app/components/like-post.js
3256
- import Component from '@glimmer/component';
3257
-
3258
- export default class LikePostComponent extends Component {
3259
- saveLike() {
3260
- // ...snip...
3261
- }
3262
- }
3263
- ```
3264
-
3265
- In this example, when the button is clicked `saveLike` will be invoked,
3266
- it will **not** have access to the component instance. In other
3267
- words, it will have no `this` context, so please make sure your functions
3268
- are bound (via an arrow function or other means) before passing into `on`!
3269
-
3270
- @method on
3271
- @public
3272
- */
3273
- class OnModifierManager {
3274
- getDebugName() {
3275
- return 'on';
3276
- }
3277
- getDebugInstance() {
3278
- return null;
3279
- }
3280
- get counters() {
3281
- return {
3282
- adds,
3283
- removes
2099
+ /* eslint-disable @typescript-eslint/no-empty-object-type */
2100
+ function buildUntouchableThis(source) {
2101
+ let context = null;
2102
+ {
2103
+ let assertOnProperty = property => {
2104
+ let access = typeof property === 'symbol' || typeof property === 'number' ? `[${String(property)}]` : `.${property}`;
2105
+ throw new Error(`You accessed \`this${access}\` from a function passed to the ${source}, but the function itself was not bound to a valid \`this\` context. Consider updating to use a bound function (for instance, use an arrow function, \`() => {}\`).`);
3284
2106
  };
2107
+ context = new Proxy({}, {
2108
+ get(_target, property) {
2109
+ assertOnProperty(property);
2110
+ },
2111
+ set(_target, property) {
2112
+ assertOnProperty(property);
2113
+ return false;
2114
+ },
2115
+ has(_target, property) {
2116
+ assertOnProperty(property);
2117
+ return false;
2118
+ }
2119
+ });
3285
2120
  }
3286
- create(_owner, element, _state, args) {
3287
- return new OnModifierState(element, args);
3288
- }
3289
- getTag({
3290
- tag
3291
- }) {
3292
- return tag;
3293
- }
3294
- install(state) {
3295
- state.updateListener();
3296
- }
3297
- update(state) {
3298
- state.updateListener();
3299
- }
3300
- getDestroyable(state) {
3301
- return state;
3302
- }
2121
+ return context;
3303
2122
  }
3304
- const on = setInternalModifierManager(new OnModifierManager(), {});
3305
2123
 
3306
- export { DOMOperations as A, isSafeString as B, ConcreteBounds as C, DOMChanges as D, EMPTY_ARGS as E, normalizeStringValue as F, DebugRenderTreeImpl as G, isArgumentError as H, APPEND_OPCODES as I, move as J, externs as K, JumpIfNotModifiedOpcode as L, BeginTrackFrameOpcode as M, NS_SVG as N, EndTrackFrameOpcode as O, TEMPLATE_ONLY_COMPONENT_MANAGER as T, VMArgumentsImpl as V, CurriedValue as a, CursorImpl as b, EMPTY_NAMED as c, EMPTY_POSITIONAL as d, DOMChangesImpl as e, TemplateOnlyComponentDefinition as f, TemplateOnlyComponentManager as g, array as h, clear as i, concat as j, createCapturedArgs as k, curry as l, fn as m, get as n, hash as o, isWhitespace as p, on as q, reifyArgs as r, reifyNamed as s, reifyPositional as t, resetDebuggerCallback as u, setDebuggerCallback as v, templateOnlyComponent as w, COMMENT_NODE as x, TEXT_NODE as y, ELEMENT_NODE as z };
2124
+ export { APPEND_OPCODES as A, BeginTrackFrameOpcode as B, CurriedValue as C, DebugRenderTreeImpl as D, EMPTY_ARGS as E, JumpIfNotModifiedOpcode as J, VMArgumentsImpl as V, EMPTY_NAMED as a, EMPTY_POSITIONAL as b, createCapturedArgs as c, curry as d, reifyNamed as e, reifyPositional as f, buildUntouchableThis as g, check as h, isArgumentError as i, isCurriedType as j, resolveCurriedValue as k, AssertFilter as l, externs as m, EndTrackFrameOpcode as n, reifyArgs as r };