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,1259 +1,10 @@
1
- import '../../shared-chunks/debug-to-string-CFb7h0lY.js';
2
- import { g as getLast, b as asPresentArray } from '../../shared-chunks/present-B1rrjAVM.js';
3
- import { assert, scheduleRevalidate } from '../global-context/index.js';
4
-
5
- /* eslint-disable @typescript-eslint/no-non-null-assertion -- @fixme */
6
-
7
- const debug = {};
8
- {
9
- let CONSUMED_TAGS = null;
10
- const TRANSACTION_STACK = [];
11
-
12
- /////////
13
-
14
- const TRANSACTION_ENV = {
15
- debugMessage(obj, keyName) {
16
- let objName;
17
- if (typeof obj === 'function') {
18
- objName = obj.name;
19
- } else if (typeof obj === 'object' && obj !== null) {
20
- let className = obj.constructor.name || '(unknown class)';
21
- objName = `(an instance of ${className})`;
22
- } else if (obj === undefined) {
23
- objName = '(an unknown tag)';
24
- } else {
25
- // eslint-disable-next-line @typescript-eslint/no-base-to-string
26
- objName = String(obj);
27
- }
28
- let dirtyString = keyName ? `\`${keyName}\` on \`${objName}\`` : `\`${objName}\``;
29
- return `You attempted to update ${dirtyString}, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.`;
30
- }
31
- };
32
- debug.setTrackingTransactionEnv = env => Object.assign(TRANSACTION_ENV, env);
33
- debug.beginTrackingTransaction = _debugLabel => {
34
- CONSUMED_TAGS = CONSUMED_TAGS || new WeakMap();
35
- let debugLabel = _debugLabel || undefined;
36
- let parent = TRANSACTION_STACK[TRANSACTION_STACK.length - 1] ?? null;
37
- TRANSACTION_STACK.push({
38
- parent,
39
- debugLabel
40
- });
41
- };
42
- debug.endTrackingTransaction = () => {
43
- if (TRANSACTION_STACK.length === 0) {
44
- throw new Error('attempted to close a tracking transaction, but one was not open');
45
- }
46
- TRANSACTION_STACK.pop();
47
- if (TRANSACTION_STACK.length === 0) {
48
- CONSUMED_TAGS = null;
49
- }
50
- };
51
- debug.resetTrackingTransaction = () => {
52
- let stack = '';
53
- if (TRANSACTION_STACK.length > 0) {
54
- stack = debug.logTrackingStack(TRANSACTION_STACK[TRANSACTION_STACK.length - 1]);
55
- }
56
- TRANSACTION_STACK.splice(0, TRANSACTION_STACK.length);
57
- CONSUMED_TAGS = null;
58
- return stack;
59
- };
60
-
61
- /**
62
- * Creates a global autotracking transaction. This will prevent any backflow
63
- * in any `track` calls within the transaction, even if they are not
64
- * externally consumed.
65
- *
66
- * `runInAutotrackingTransaction` can be called within itself, and it will add
67
- * onto the existing transaction if one exists.
68
- *
69
- * TODO: Only throw an error if the `track` is consumed.
70
- */
71
- debug.runInTrackingTransaction = (fn, debugLabel) => {
72
- debug.beginTrackingTransaction(debugLabel);
73
- let didError = true;
74
- try {
75
- let value = fn();
76
- didError = false;
77
- return value;
78
- } finally {
79
- if (!didError) {
80
- debug.endTrackingTransaction();
81
- }
82
-
83
- // if (id !== TRANSACTION_STACK.length) {
84
- // throw new Error(
85
- // `attempted to close a tracking transaction (${id}), but it was not the last transaction (${TRANSACTION_STACK.length})`
86
- // );
87
- // }
88
- }
89
- };
90
- let nthIndex = (str, pattern, n, startingPos = -1) => {
91
- let i = startingPos;
92
- while (n-- > 0 && i++ < str.length) {
93
- i = str.indexOf(pattern, i);
94
- if (i < 0) break;
95
- }
96
- return i;
97
- };
98
- let makeTrackingErrorMessage = (transaction, obj, keyName) => {
99
- let message = [TRANSACTION_ENV.debugMessage(obj, keyName && String(keyName))];
100
- message.push(`\`${String(keyName)}\` was first used:`);
101
- message.push(debug.logTrackingStack(transaction));
102
- message.push(`Stack trace for the update:`);
103
- return message.join('\n\n');
104
- };
105
- debug.logTrackingStack = transaction => {
106
- let trackingStack = [];
107
- let current = transaction || TRANSACTION_STACK[TRANSACTION_STACK.length - 1];
108
- if (current === undefined) return '';
109
- while (current) {
110
- if (current.debugLabel) {
111
- trackingStack.unshift(current.debugLabel);
112
- }
113
- current = current.parent;
114
- }
115
- return trackingStack.map((label, index) => ' '.repeat(2 * index) + label).join('\n');
116
- };
117
- debug.markTagAsConsumed = _tag => {
118
- if (!CONSUMED_TAGS || CONSUMED_TAGS.has(_tag)) return;
119
- CONSUMED_TAGS.set(_tag, getLast(asPresentArray(TRANSACTION_STACK)));
120
-
121
- // We need to mark the tag and all of its subtags as consumed, so we need to
122
- // cast it and access its internals. In the future this shouldn't be necessary,
123
- // this is only for computed properties.
124
- let subtag = _tag.subtag;
125
- if (!subtag || !debug.markTagAsConsumed) return;
126
- if (Array.isArray(subtag)) {
127
- subtag.forEach(debug.markTagAsConsumed);
128
- } else {
129
- debug.markTagAsConsumed(subtag);
130
- }
131
- };
132
- debug.assertTagNotConsumed = (tag, obj, keyName) => {
133
- if (CONSUMED_TAGS === null) return;
134
- let transaction = CONSUMED_TAGS.get(tag);
135
- if (!transaction) return;
136
-
137
- // This hack makes the assertion message nicer, we can cut off the first
138
- // few lines of the stack trace and let users know where the actual error
139
- // occurred.
140
- try {
141
- assert(false, makeTrackingErrorMessage(transaction, obj, keyName));
142
- } catch (e) {
143
- if (hasStack(e)) {
144
- let updateStackBegin = e.stack.indexOf('Stack trace for the update:');
145
- if (updateStackBegin !== -1) {
146
- let start = nthIndex(e.stack, '\n', 1, updateStackBegin);
147
- let end = nthIndex(e.stack, '\n', 4, updateStackBegin);
148
- e.stack = e.stack.substr(0, start) + e.stack.substr(end);
149
- }
150
- }
151
- throw e;
152
- }
153
- };
154
- }
155
- function hasStack(error) {
156
- return typeof error === 'object' && error !== null && 'stack' in error && typeof error.stack === 'string';
157
- }
158
-
159
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
160
-
161
- function unwrap(val) {
162
- if (val === null || val === undefined) throw new Error(`Expected value to be present`);
163
- return val;
164
- }
165
-
166
- //////////
167
-
168
- const CONSTANT = 0;
169
- const INITIAL = 1;
170
- const VOLATILE = NaN;
171
- let $REVISION = INITIAL;
172
- function bump() {
173
- $REVISION++;
174
- }
175
-
176
- //////////
177
-
178
- const DIRYTABLE_TAG_ID = 0;
179
- const UPDATABLE_TAG_ID = 1;
180
- const COMBINATOR_TAG_ID = 2;
181
- const CONSTANT_TAG_ID = 3;
182
-
183
- //////////
184
-
185
- const COMPUTE = Symbol('TAG_COMPUTE');
186
- Reflect.set(globalThis, 'COMPUTE_SYMBOL', COMPUTE);
187
-
188
- //////////
189
-
190
- /**
191
- * `value` receives a tag and returns an opaque Revision based on that tag. This
192
- * snapshot can then later be passed to `validate` with the same tag to
193
- * determine if the tag has changed at all since the time that `value` was
194
- * called.
195
- *
196
- * @param tag
197
- */
198
- function valueForTag(tag) {
199
- return tag[COMPUTE]();
200
- }
201
-
202
- /**
203
- * `validate` receives a tag and a snapshot from a previous call to `value` with
204
- * the same tag, and determines if the tag is still valid compared to the
205
- * snapshot. If the tag's state has changed at all since then, `validate` will
206
- * return false, otherwise it will return true. This is used to determine if a
207
- * calculation related to the tags should be rerun.
208
- *
209
- * @param tag
210
- * @param snapshot
211
- */
212
- function validateTag(tag, snapshot) {
213
- return snapshot >= tag[COMPUTE]();
214
- }
215
-
216
- //////////
217
-
218
- const TYPE = Symbol('TAG_TYPE');
219
-
220
- // this is basically a const
221
- let ALLOW_CYCLES;
222
- {
223
- ALLOW_CYCLES = new WeakMap();
224
- }
225
- function allowsCycles(tag) {
226
- if (ALLOW_CYCLES === undefined) {
227
- return true;
228
- } else {
229
- return ALLOW_CYCLES.has(tag);
230
- }
231
- }
232
- class MonomorphicTagImpl {
233
- static combine(tags) {
234
- switch (tags.length) {
235
- case 0:
236
- return CONSTANT_TAG;
237
- case 1:
238
- return tags[0];
239
- default:
240
- {
241
- let tag = new MonomorphicTagImpl(COMBINATOR_TAG_ID);
242
- tag.subtag = tags;
243
- return tag;
244
- }
245
- }
246
- }
247
- revision = INITIAL;
248
- lastChecked = INITIAL;
249
- lastValue = INITIAL;
250
- isUpdating = false;
251
- subtag = null;
252
- subtagBufferCache = null;
253
- constructor(type) {
254
- this[TYPE] = type;
255
- }
256
- [COMPUTE]() {
257
- let {
258
- lastChecked
259
- } = this;
260
- if (this.isUpdating) {
261
- if (!allowsCycles(this)) {
262
- throw new Error('Cycles in tags are not allowed');
263
- }
264
- this.lastChecked = ++$REVISION;
265
- } else if (lastChecked !== $REVISION) {
266
- this.isUpdating = true;
267
- this.lastChecked = $REVISION;
268
- try {
269
- let {
270
- subtag,
271
- revision
272
- } = this;
273
- if (subtag !== null) {
274
- if (Array.isArray(subtag)) {
275
- for (const tag of subtag) {
276
- let value = tag[COMPUTE]();
277
- revision = Math.max(value, revision);
278
- }
279
- } else {
280
- let subtagValue = subtag[COMPUTE]();
281
- if (subtagValue === this.subtagBufferCache) {
282
- revision = Math.max(revision, this.lastValue);
283
- } else {
284
- // Clear the temporary buffer cache
285
- this.subtagBufferCache = null;
286
- revision = Math.max(revision, subtagValue);
287
- }
288
- }
289
- }
290
- this.lastValue = revision;
291
- } finally {
292
- this.isUpdating = false;
293
- }
294
- }
295
- return this.lastValue;
296
- }
297
- static updateTag(_tag, _subtag) {
298
- // catch bug by non-TS users
299
-
300
- if (_tag[TYPE] !== UPDATABLE_TAG_ID) {
301
- throw new Error('Attempted to update a tag that was not updatable');
302
- }
303
-
304
- // TODO: TS 3.7 should allow us to do this via assertion
305
- let tag = _tag;
306
- let subtag = _subtag;
307
- if (subtag === CONSTANT_TAG) {
308
- tag.subtag = null;
309
- } else {
310
- // There are two different possibilities when updating a subtag:
311
- //
312
- // 1. subtag[COMPUTE]() <= tag[COMPUTE]();
313
- // 2. subtag[COMPUTE]() > tag[COMPUTE]();
314
- //
315
- // The first possibility is completely fine within our caching model, but
316
- // the second possibility presents a problem. If the parent tag has
317
- // already been read, then it's value is cached and will not update to
318
- // reflect the subtag's greater value. Next time the cache is busted, the
319
- // subtag's value _will_ be read, and it's value will be _greater_ than
320
- // the saved snapshot of the parent, causing the resulting calculation to
321
- // be rerun erroneously.
322
- //
323
- // In order to prevent this, when we first update to a new subtag we store
324
- // its computed value, and then check against that computed value on
325
- // subsequent updates. If its value hasn't changed, then we return the
326
- // parent's previous value. Once the subtag changes for the first time,
327
- // we clear the cache and everything is finally in sync with the parent.
328
- tag.subtagBufferCache = subtag[COMPUTE]();
329
- tag.subtag = subtag;
330
- }
331
- }
332
- static dirtyTag(tag, disableConsumptionAssertion) {
333
- if (// catch bug by non-TS users
334
-
335
- !(tag[TYPE] === UPDATABLE_TAG_ID || tag[TYPE] === DIRYTABLE_TAG_ID)) {
336
- throw new Error('Attempted to dirty a tag that was not dirtyable');
337
- }
338
- if (disableConsumptionAssertion !== true) {
339
- // Usually by this point, we've already asserted with better error information,
340
- // but this is our last line of defense.
341
- unwrap(debug.assertTagNotConsumed)(tag);
342
- }
343
- tag.revision = ++$REVISION;
344
- scheduleRevalidate();
345
- }
346
- }
347
- const DIRTY_TAG = MonomorphicTagImpl.dirtyTag;
348
- const UPDATE_TAG = MonomorphicTagImpl.updateTag;
349
-
350
- //////////
351
-
352
- function createTag() {
353
- return new MonomorphicTagImpl(DIRYTABLE_TAG_ID);
354
- }
355
- function createUpdatableTag() {
356
- return new MonomorphicTagImpl(UPDATABLE_TAG_ID);
357
- }
358
-
359
- //////////
360
-
361
- const CONSTANT_TAG = new MonomorphicTagImpl(CONSTANT_TAG_ID);
362
- function isConstTag(tag) {
363
- return tag === CONSTANT_TAG;
364
- }
365
-
366
- //////////
367
-
368
- const VOLATILE_TAG_ID = 100;
369
- class VolatileTag {
370
- [TYPE] = VOLATILE_TAG_ID;
371
- [COMPUTE]() {
372
- return VOLATILE;
373
- }
374
- }
375
- const VOLATILE_TAG = new VolatileTag();
376
-
377
- //////////
378
-
379
- const CURRENT_TAG_ID = 101;
380
- class CurrentTag {
381
- [TYPE] = CURRENT_TAG_ID;
382
- [COMPUTE]() {
383
- return $REVISION;
384
- }
385
- }
386
- const CURRENT_TAG = new CurrentTag();
387
-
388
- //////////
389
-
390
- const combine = MonomorphicTagImpl.combine;
391
-
392
- // Warm
393
-
394
- let tag1 = createUpdatableTag();
395
- let tag2 = createUpdatableTag();
396
- let tag3 = createUpdatableTag();
397
- valueForTag(tag1);
398
- DIRTY_TAG(tag1);
399
- valueForTag(tag1);
400
- UPDATE_TAG(tag1, combine([tag2, tag3]));
401
- valueForTag(tag1);
402
- DIRTY_TAG(tag2);
403
- valueForTag(tag1);
404
- DIRTY_TAG(tag3);
405
- valueForTag(tag1);
406
- UPDATE_TAG(tag1, tag3);
407
- valueForTag(tag1);
408
- DIRTY_TAG(tag3);
409
- valueForTag(tag1);
410
-
411
- /**
412
- * An object that that tracks @tracked properties that were consumed.
413
- */
414
- class Tracker {
415
- tags = new Set();
416
- last = null;
417
- add(tag) {
418
- if (tag === CONSTANT_TAG) return;
419
- this.tags.add(tag);
420
- {
421
- unwrap(debug.markTagAsConsumed)(tag);
422
- }
423
- this.last = tag;
424
- }
425
- combine() {
426
- let {
427
- tags
428
- } = this;
429
- if (tags.size === 0) {
430
- return CONSTANT_TAG;
431
- } else if (tags.size === 1) {
432
- return this.last;
433
- } else {
434
- return combine(Array.from(this.tags));
435
- }
436
- }
437
- }
438
-
439
- /**
440
- * Whenever a tracked computed property is entered, the current tracker is
441
- * saved off and a new tracker is replaced.
442
- *
443
- * Any tracked properties consumed are added to the current tracker.
444
- *
445
- * When a tracked computed property is exited, the tracker's tags are
446
- * combined and added to the parent tracker.
447
- *
448
- * The consequence is that each tracked computed property has a tag
449
- * that corresponds to the tracked properties consumed inside of
450
- * itself, including child tracked computed properties.
451
- */
452
- let CURRENT_TRACKER = null;
453
- const OPEN_TRACK_FRAMES = [];
454
- function beginTrackFrame(debuggingContext) {
455
- OPEN_TRACK_FRAMES.push(CURRENT_TRACKER);
456
- CURRENT_TRACKER = new Tracker();
457
- {
458
- unwrap(debug.beginTrackingTransaction)(debuggingContext);
459
- }
460
- }
461
- function endTrackFrame() {
462
- let current = CURRENT_TRACKER;
463
- {
464
- if (OPEN_TRACK_FRAMES.length === 0) {
465
- throw new Error('attempted to close a tracking frame, but one was not open');
466
- }
467
- unwrap(debug.endTrackingTransaction)();
468
- }
469
- CURRENT_TRACKER = OPEN_TRACK_FRAMES.pop() || null;
470
- return unwrap(current).combine();
471
- }
472
- function beginUntrackFrame() {
473
- OPEN_TRACK_FRAMES.push(CURRENT_TRACKER);
474
- CURRENT_TRACKER = null;
475
- }
476
- function endUntrackFrame() {
477
- if (OPEN_TRACK_FRAMES.length === 0) {
478
- throw new Error('attempted to close a tracking frame, but one was not open');
479
- }
480
- CURRENT_TRACKER = OPEN_TRACK_FRAMES.pop() || null;
481
- }
482
-
483
- // This function is only for handling errors and resetting to a valid state
484
- function resetTracking() {
485
- while (OPEN_TRACK_FRAMES.length > 0) {
486
- OPEN_TRACK_FRAMES.pop();
487
- }
488
- CURRENT_TRACKER = null;
489
- {
490
- return unwrap(debug.resetTrackingTransaction)();
491
- }
492
- }
493
- function isTracking() {
494
- return CURRENT_TRACKER !== null;
495
- }
496
- function consumeTag(tag) {
497
- if (CURRENT_TRACKER !== null) {
498
- CURRENT_TRACKER.add(tag);
499
- }
500
- }
501
-
502
- // public interface
503
-
504
- const FN = Symbol('FN');
505
- const LAST_VALUE = Symbol('LAST_VALUE');
506
- const TAG = Symbol('TAG');
507
- const SNAPSHOT = Symbol('SNAPSHOT');
508
- const DEBUG_LABEL = Symbol('DEBUG_LABEL');
509
- function createCache(fn, debuggingLabel) {
510
- if (!(typeof fn === 'function')) {
511
- throw new Error(`createCache() must be passed a function as its first parameter. Called with: ${String(fn)}`);
512
- }
513
- let cache = {
514
- [FN]: fn,
515
- [LAST_VALUE]: undefined,
516
- [TAG]: undefined,
517
- [SNAPSHOT]: -1
518
- };
519
- {
520
- cache[DEBUG_LABEL] = debuggingLabel;
521
- }
522
- return cache;
523
- }
524
- function getValue(cache) {
525
- assertCache(cache, 'getValue');
526
- let fn = cache[FN];
527
- let tag = cache[TAG];
528
- let snapshot = cache[SNAPSHOT];
529
- if (tag === undefined || !validateTag(tag, snapshot)) {
530
- beginTrackFrame();
531
- try {
532
- cache[LAST_VALUE] = fn();
533
- } finally {
534
- tag = endTrackFrame();
535
- cache[TAG] = tag;
536
- cache[SNAPSHOT] = valueForTag(tag);
537
- consumeTag(tag);
538
- }
539
- } else {
540
- consumeTag(tag);
541
- }
542
- return cache[LAST_VALUE];
543
- }
544
- function isConst(cache) {
545
- assertCache(cache, 'isConst');
546
- let tag = cache[TAG];
547
- assertTag(tag, cache);
548
- return isConstTag(tag);
549
- }
550
- function assertCache(value, fnName) {
551
- if (!(typeof value === 'object' && FN in value)) {
552
- throw new Error(`${fnName}() can only be used on an instance of a cache created with createCache(). Called with: ${String(
553
- // eslint-disable-next-line @typescript-eslint/no-base-to-string -- @fixme
554
- value)}`);
555
- }
556
- }
557
-
558
- // replace this with `expect` when we can
559
- function assertTag(tag, cache) {
560
- if (tag === undefined) {
561
- throw new Error(`isConst() can only be used on a cache once getValue() has been called at least once. Called with cache function:\n\n${String(cache[FN])}`);
562
- }
563
- }
564
-
565
- //////////
566
-
567
- // Legacy tracking APIs
568
-
569
- // track() shouldn't be necessary at all in the VM once the autotracking
570
- // refactors are merged, and we should generally be moving away from it. It may
571
- // be necessary in Ember for a while longer, but I think we'll be able to drop
572
- // it in favor of cache sooner rather than later.
573
- function track(block, debugLabel) {
574
- beginTrackFrame(debugLabel);
575
- let tag;
576
- try {
577
- block();
578
- } finally {
579
- tag = endTrackFrame();
580
- }
581
- return tag;
582
- }
583
-
584
- // untrack() is currently mainly used to handle places that were previously not
585
- // tracked, and that tracking now would cause backtracking rerender assertions.
586
- // I think once we move everyone forward onto modern APIs, we'll probably be
587
- // able to remove it, but I'm not sure yet.
588
- function untrack(callback) {
589
- beginUntrackFrame();
590
- try {
591
- return callback();
592
- } finally {
593
- endUntrackFrame();
594
- }
595
- }
596
-
597
- /* eslint-disable @typescript-eslint/no-explicit-any */
598
- // Unfortunately, TypeScript's ability to do inference *or* type-checking in a
599
- // `Proxy`'s body is very limited, so we have to use a number of casts `as any`
600
- // to make the internal accesses work. The type safety of these is guaranteed at
601
- // the *call site* instead of within the body: you cannot do `Array.blah` in TS,
602
- // and it will blow up in JS in exactly the same way, so it is safe to assume
603
- // that properties within the getter have the correct type in TS.
604
-
605
- const ARRAY_GETTER_METHODS = new Set([Symbol.iterator, 'concat', 'entries', 'every', 'filter', 'find', 'findIndex', 'flat', 'flatMap', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'map', 'reduce', 'reduceRight', 'slice', 'some', 'values']);
606
-
607
- // For these methods, `Array` itself immediately gets the `.length` to return
608
- // after invoking them.
609
- const ARRAY_WRITE_THEN_READ_METHODS = new Set(['fill', 'push', 'unshift']);
610
- function convertToInt(prop) {
611
- if (typeof prop === 'symbol') return null;
612
- const num = Number(prop);
613
- if (isNaN(num)) return null;
614
- return num % 1 === 0 ? num : null;
615
- }
616
-
617
- // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
618
- class TrackedArray {
619
- #options;
620
- constructor(arr, options) {
621
- this.#options = options;
622
- const clone = arr.slice();
623
- // eslint-disable-next-line @typescript-eslint/no-this-alias
624
- const self = this;
625
- const boundFns = new Map();
626
-
627
- /**
628
- Flag to track whether we have *just* intercepted a call to `.push()` or
629
- `.unshift()`, since in those cases (and only those cases!) the `Array`
630
- itself checks `.length` to return from the function call.
631
- */
632
- let nativelyAccessingLengthFromWriteMethod = false;
633
- return new Proxy(clone, {
634
- get(target, prop /*, _receiver */) {
635
- const index = convertToInt(prop);
636
- if (index !== null) {
637
- self.#readStorageFor(index);
638
- consumeTag(self.#collection);
639
- return target[index];
640
- }
641
- if (prop === 'length') {
642
- // If we are reading `.length`, it may be a normal user-triggered
643
- // read, or it may be a read triggered by Array itself. In the latter
644
- // case, it is because we have just done `.push()` or `.unshift()`; in
645
- // that case it is safe not to mark this as a *read* operation, since
646
- // calling `.push()` or `.unshift()` cannot otherwise be part of a
647
- // "read" operation safely, and if done during an *existing* read
648
- // (e.g. if the user has already checked `.length` *prior* to this),
649
- // that will still trigger the mutation-after-consumption assertion.
650
- if (nativelyAccessingLengthFromWriteMethod) {
651
- nativelyAccessingLengthFromWriteMethod = false;
652
- } else {
653
- consumeTag(self.#collection);
654
- }
655
- return target[prop];
656
- }
657
-
658
- // Here, track that we are doing a `.push()` or `.unshift()` by setting
659
- // the flag to `true` so that when the `.length` is read by `Array` (see
660
- // immediately above), it knows not to dirty the collection.
661
- if (ARRAY_WRITE_THEN_READ_METHODS.has(prop)) {
662
- nativelyAccessingLengthFromWriteMethod = true;
663
- }
664
- if (ARRAY_GETTER_METHODS.has(prop)) {
665
- let fn = boundFns.get(prop);
666
- if (fn === undefined) {
667
- fn = (...args) => {
668
- consumeTag(self.#collection);
669
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
670
- return target[prop](...args);
671
- };
672
- boundFns.set(prop, fn);
673
- }
674
- return fn;
675
- }
676
-
677
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
678
- return target[prop];
679
- },
680
- set(target, prop, value /*, _receiver */) {
681
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
682
- let isUnchanged = self.#options.equals(target[prop], value);
683
- if (isUnchanged) return true;
684
-
685
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
686
- target[prop] = value;
687
- const index = convertToInt(prop);
688
- if (index !== null) {
689
- self.#dirtyStorageFor(index);
690
- self.#dirtyCollection();
691
- } else if (prop === 'length') {
692
- self.#dirtyCollection();
693
- }
694
- return true;
695
- },
696
- getPrototypeOf() {
697
- return TrackedArray.prototype;
698
- }
699
- });
700
- }
701
- #collection = createUpdatableTag();
702
- #storages = new Map();
703
- #readStorageFor(index) {
704
- let storage = this.#storages.get(index);
705
- if (storage === undefined) {
706
- storage = createUpdatableTag();
707
- this.#storages.set(index, storage);
708
- }
709
- consumeTag(storage);
710
- }
711
- #dirtyStorageFor(index) {
712
- const storage = this.#storages.get(index);
713
- if (storage) {
714
- DIRTY_TAG(storage);
715
- }
716
- }
717
- #dirtyCollection() {
718
- DIRTY_TAG(this.#collection);
719
- this.#storages.clear();
720
- }
721
- }
722
-
723
- // This rule is correct in the general case, but it doesn't understand
724
- // declaration merging, which is how we're using the interface here. This says
725
- // `TrackedArray` acts just like `Array<T>`, but also has the properties
726
- // declared via the `class` declaration above -- but without the cost of a
727
- // subclass, which is much slower that the proxied array behavior. That is: a
728
- // `TrackedArray` *is* an `Array`, just with a proxy in front of accessors and
729
- // setters, rather than a subclass of an `Array` which would be de-optimized by
730
- // the browsers.
731
- //
732
-
733
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
734
-
735
- // Ensure instanceof works correctly
736
- Object.setPrototypeOf(TrackedArray.prototype, Array.prototype);
737
- function trackedArray(data, options) {
738
- return new TrackedArray(data ?? [], {
739
- equals: options?.equals ?? Object.is,
740
- description: options?.description
741
- });
742
- }
743
-
744
- /* eslint-disable @typescript-eslint/no-explicit-any */
745
- // Using a Proxy-based approach so that any new methods added to the Map
746
- // interface (like getOrInsert, getOrInsertComputed, etc.) are automatically
747
- // supported without needing to manually re-implement each one.
748
-
749
- function trackedMap(data, options) {
750
- const equals = options?.equals ?? Object.is;
751
- // TypeScript doesn't correctly resolve the overloads for calling the `Map`
752
- // constructor for the no-value constructor. This resolves that.
753
- const target = data instanceof Map ? new Map(data.entries()) : new Map(data ?? []);
754
- const collection = createUpdatableTag();
755
- const storages = new Map();
756
- function storageFor(key) {
757
- let storage = storages.get(key);
758
- if (storage === undefined) {
759
- storage = createUpdatableTag();
760
- storages.set(key, storage);
761
- }
762
- return storage;
763
- }
764
- function dirtyStorageFor(key) {
765
- const storage = storages.get(key);
766
- if (storage) {
767
- DIRTY_TAG(storage);
768
- }
769
- }
770
- const proxy = new Proxy(target, {
771
- get(target, prop, receiver) {
772
- if (prop === 'set') {
773
- return function (key, value) {
774
- const hasExisting = target.has(key);
775
- if (hasExisting) {
776
- const isUnchanged = equals(target.get(key), value);
777
- if (isUnchanged) return proxy;
778
- }
779
- dirtyStorageFor(key);
780
- DIRTY_TAG(collection);
781
- target.set(key, value);
782
- return proxy;
783
- };
784
- }
785
- if (prop === 'delete') {
786
- return function (key) {
787
- if (!target.has(key)) return false;
788
- dirtyStorageFor(key);
789
- DIRTY_TAG(collection);
790
- storages.delete(key);
791
- return target.delete(key);
792
- };
793
- }
794
- if (prop === 'clear') {
795
- return function () {
796
- if (target.size === 0) return;
797
- storages.forEach(s => DIRTY_TAG(s));
798
- storages.clear();
799
- DIRTY_TAG(collection);
800
- target.clear();
801
- };
802
- }
803
- if (prop === 'get') {
804
- return function (key) {
805
- consumeTag(storageFor(key));
806
- return target.get(key);
807
- };
808
- }
809
- if (prop === 'has') {
810
- return function (key) {
811
- consumeTag(storageFor(key));
812
- return target.has(key);
813
- };
814
- }
815
- if (prop === 'size') {
816
- consumeTag(collection);
817
- return target.size;
818
- }
819
-
820
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
821
- const value = Reflect.get(target, prop, receiver);
822
- if (typeof value === 'function') {
823
- return function (...args) {
824
- consumeTag(collection);
825
-
826
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
827
- return value.apply(target, args);
828
- };
829
- }
830
-
831
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
832
- return value;
833
- }
834
- });
835
- return proxy;
836
- }
837
-
838
- class TrackedObject {
839
- #options;
840
- #storages = new Map();
841
- #collection = createUpdatableTag();
842
- #readStorageFor(key) {
843
- let storage = this.#storages.get(key);
844
- if (storage === undefined) {
845
- storage = createUpdatableTag();
846
- this.#storages.set(key, storage);
847
- }
848
- consumeTag(storage);
849
- }
850
- #dirtyStorageFor(key) {
851
- const storage = this.#storages.get(key);
852
- if (storage) {
853
- DIRTY_TAG(storage);
854
- }
855
- }
856
- #dirtyCollection() {
857
- DIRTY_TAG(this.#collection);
858
- }
859
-
860
- /**
861
- * This implementation of trackedObject is far too dynamic for TS to be happy with
862
- */
863
- constructor(obj, options) {
864
- this.#options = options;
865
-
866
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
867
- const proto = Object.getPrototypeOf(obj);
868
- const descs = Object.getOwnPropertyDescriptors(obj);
869
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
870
- const clone = Object.create(proto);
871
- for (const prop in descs) {
872
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
873
- Object.defineProperty(clone, prop, descs[prop]);
874
- }
875
-
876
- // eslint-disable-next-line @typescript-eslint/no-this-alias
877
- const self = this;
878
- return new Proxy(clone, {
879
- get(target, prop) {
880
- self.#readStorageFor(prop);
881
- return target[prop];
882
- },
883
- has(target, prop) {
884
- self.#readStorageFor(prop);
885
- return prop in target;
886
- },
887
- ownKeys(target) {
888
- consumeTag(self.#collection);
889
- return Reflect.ownKeys(target);
890
- },
891
- set(target, prop, value) {
892
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
893
- let isUnchanged = self.#options.equals(target[prop], value);
894
- if (isUnchanged) {
895
- return true;
896
- }
897
-
898
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
899
- target[prop] = value;
900
- self.#dirtyStorageFor(prop);
901
- self.#dirtyCollection();
902
- return true;
903
- },
904
- deleteProperty(target, prop) {
905
- if (prop in target) {
906
- delete target[prop];
907
- self.#dirtyStorageFor(prop);
908
- self.#storages.delete(prop);
909
- self.#dirtyCollection();
910
- }
911
- return true;
912
- },
913
- getPrototypeOf() {
914
- return TrackedObject.prototype;
915
- }
916
- });
917
- }
918
- }
919
- function trackedObject(data, options) {
920
- return new TrackedObject(data ?? {}, {
921
- equals: options?.equals ?? Object.is,
922
- description: options?.description
923
- /**
924
- * SAFETY: we are trying to mimic the same behavior as a plain object, so if anything about
925
- * the object that is returned behaves differently from a native object in a surprising
926
- * way, we should fix that and make the behavior match native objects.
927
- */
928
- });
929
- }
930
-
931
- /* eslint-disable @typescript-eslint/no-explicit-any */
932
- // Using a Proxy-based approach so that any new methods added to the Set
933
- // interface are automatically supported without needing to manually
934
- // re-implement each one.
935
-
936
- function trackedSet(data, options) {
937
- const equals = options?.equals ?? Object.is;
938
- const target = new Set(data ?? []);
939
- const collection = createUpdatableTag();
940
- const storages = new Map();
941
- function storageFor(key) {
942
- let storage = storages.get(key);
943
- if (storage === undefined) {
944
- storage = createUpdatableTag();
945
- storages.set(key, storage);
946
- }
947
- return storage;
948
- }
949
- function dirtyStorageFor(key) {
950
- const storage = storages.get(key);
951
- if (storage) {
952
- DIRTY_TAG(storage);
953
- }
954
- }
955
- const proxy = new Proxy(target, {
956
- get(target, prop, receiver) {
957
- if (prop === 'add') {
958
- return function (value) {
959
- if (target.has(value)) {
960
- const isUnchanged = equals(value, value);
961
- if (isUnchanged) return proxy;
962
- } else {
963
- DIRTY_TAG(collection);
964
- }
965
- dirtyStorageFor(value);
966
- target.add(value);
967
- return proxy;
968
- };
969
- }
970
- if (prop === 'delete') {
971
- return function (value) {
972
- if (!target.has(value)) return false;
973
- dirtyStorageFor(value);
974
- DIRTY_TAG(collection);
975
- storages.delete(value);
976
- return target.delete(value);
977
- };
978
- }
979
- if (prop === 'clear') {
980
- return function () {
981
- if (target.size === 0) return;
982
- storages.forEach(s => DIRTY_TAG(s));
983
- DIRTY_TAG(collection);
984
- storages.clear();
985
- target.clear();
986
- };
987
- }
988
- if (prop === 'has') {
989
- return function (value) {
990
- consumeTag(storageFor(value));
991
- return target.has(value);
992
- };
993
- }
994
- if (prop === 'size') {
995
- consumeTag(collection);
996
- return target.size;
997
- }
998
-
999
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
1000
- const value = Reflect.get(target, prop, receiver);
1001
- if (typeof value === 'function') {
1002
- return function (...args) {
1003
- consumeTag(collection);
1004
-
1005
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
1006
- return value.apply(target, args);
1007
- };
1008
- }
1009
-
1010
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
1011
- return value;
1012
- }
1013
- });
1014
- return proxy;
1015
- }
1016
-
1017
- // Using a Proxy-based approach so that any new methods added to the WeakMap
1018
- // interface (like getOrInsert, getOrInsertComputed, etc.) are automatically
1019
- // supported without needing to manually re-implement each one.
1020
-
1021
- function trackedWeakMap(data, options) {
1022
- const equals = options?.equals ?? Object.is;
1023
- const existing = data ?? [];
1024
- /**
1025
- * SAFETY: note that when passing in an existing weak map, we can't
1026
- * clone it as it is not iterable and not a supported type of structuredClone
1027
- */
1028
- const target = existing instanceof WeakMap ? existing : new WeakMap(existing);
1029
- const storages = new WeakMap();
1030
- function storageFor(key) {
1031
- let storage = storages.get(key);
1032
- if (storage === undefined) {
1033
- storage = createUpdatableTag();
1034
- storages.set(key, storage);
1035
- }
1036
- return storage;
1037
- }
1038
- function dirtyStorageFor(key) {
1039
- const storage = storages.get(key);
1040
- if (storage) {
1041
- DIRTY_TAG(storage);
1042
- }
1043
- }
1044
- const proxy = new Proxy(target, {
1045
- get(target, prop, receiver) {
1046
- if (prop === 'set') {
1047
- return function (key, value) {
1048
- const hasExisting = target.has(key);
1049
- if (hasExisting) {
1050
- const isUnchanged = equals(target.get(key), value);
1051
- if (isUnchanged) return proxy;
1052
- }
1053
- dirtyStorageFor(key);
1054
- target.set(key, value);
1055
- return proxy;
1056
- };
1057
- }
1058
- if (prop === 'delete') {
1059
- return function (key) {
1060
- if (!target.has(key)) return false;
1061
- dirtyStorageFor(key);
1062
- storages.delete(key);
1063
- return target.delete(key);
1064
- };
1065
- }
1066
- if (prop === 'get') {
1067
- return function (key) {
1068
- consumeTag(storageFor(key));
1069
- return target.get(key);
1070
- };
1071
- }
1072
- if (prop === 'has') {
1073
- return function (key) {
1074
- consumeTag(storageFor(key));
1075
- return target.has(key);
1076
- };
1077
- }
1078
-
1079
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
1080
- const value = Reflect.get(target, prop, receiver);
1081
- if (typeof value === 'function') {
1082
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
1083
- return value.bind(target);
1084
- }
1085
-
1086
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
1087
- return value;
1088
- }
1089
- });
1090
- return proxy;
1091
- }
1092
-
1093
- // Using a Proxy-based approach so that any new methods added to the WeakSet
1094
- // interface are automatically supported without needing to manually
1095
- // re-implement each one.
1096
-
1097
- /**
1098
- * NOTE: we cannot pass a WeakSet because WeakSets are not iterable
1099
- */
1100
- /**
1101
- * Creates an instanceof WeakSet from an optional list of entries
1102
- *
1103
- */
1104
- function trackedWeakSet(data, options) {
1105
- const equals = options?.equals ?? Object.is;
1106
- const target = new WeakSet(data ?? []);
1107
- const storages = new WeakMap();
1108
- function storageFor(key) {
1109
- let storage = storages.get(key);
1110
- if (storage === undefined) {
1111
- storage = createUpdatableTag();
1112
- storages.set(key, storage);
1113
- }
1114
- return storage;
1115
- }
1116
- function dirtyStorageFor(key) {
1117
- const storage = storages.get(key);
1118
- if (storage) {
1119
- DIRTY_TAG(storage);
1120
- }
1121
- }
1122
- const proxy = new Proxy(target, {
1123
- get(target, prop, receiver) {
1124
- if (prop === 'add') {
1125
- return function (value) {
1126
- /**
1127
- * In a WeakSet, there is no `.get()`, but if there was,
1128
- * we could assume it's the same value as what we passed.
1129
- *
1130
- * So for a WeakSet, if we try to add something that already exists
1131
- * we no-op.
1132
- *
1133
- * WeakSet already does this internally for us,
1134
- * but we want the ability for the reactive behavior to reflect the same behavior.
1135
- *
1136
- * i.e.: doing weakSet.add(value) should never dirty with the defaults
1137
- * if the `value` is already in the weakSet
1138
- */
1139
- if (target.has(value)) {
1140
- /**
1141
- * This looks a little silly, where a always will === b,
1142
- * but see the note above.
1143
- */
1144
- const isUnchanged = equals(value, value);
1145
- if (isUnchanged) return proxy;
1146
- }
1147
-
1148
- // Add to vals first to get better error message
1149
- target.add(value);
1150
- dirtyStorageFor(value);
1151
- return proxy;
1152
- };
1153
- }
1154
- if (prop === 'delete') {
1155
- return function (value) {
1156
- if (!target.has(value)) return false;
1157
- dirtyStorageFor(value);
1158
- storages.delete(value);
1159
- return target.delete(value);
1160
- };
1161
- }
1162
- if (prop === 'has') {
1163
- return function (value) {
1164
- consumeTag(storageFor(value));
1165
- return target.has(value);
1166
- };
1167
- }
1168
-
1169
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
1170
- const value = Reflect.get(target, prop, receiver);
1171
- if (typeof value === 'function') {
1172
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
1173
- return value.bind(target);
1174
- }
1175
-
1176
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
1177
- return value;
1178
- }
1179
- });
1180
- return proxy;
1181
- }
1182
-
1183
- function isObjectLike(u) {
1184
- return typeof u === 'object' && u !== null || typeof u === 'function';
1185
- }
1186
-
1187
- ///////////
1188
-
1189
- const TRACKED_TAGS = new WeakMap();
1190
- function dirtyTagFor(obj, key, meta) {
1191
- if (!isObjectLike(obj)) {
1192
- throw new Error(`BUG: Can't update a tag for a primitive`);
1193
- }
1194
- let tags = meta === undefined ? TRACKED_TAGS.get(obj) : meta;
1195
-
1196
- // No tags have been setup for this object yet, return
1197
- if (tags === undefined) return;
1198
-
1199
- // Dirty the tag for the specific property if it exists
1200
- let propertyTag = tags.get(key);
1201
- if (propertyTag !== undefined) {
1202
- {
1203
- unwrap(debug.assertTagNotConsumed)(propertyTag, obj, key);
1204
- }
1205
- DIRTY_TAG(propertyTag, true);
1206
- }
1207
- }
1208
- function tagMetaFor(obj) {
1209
- let tags = TRACKED_TAGS.get(obj);
1210
- if (tags === undefined) {
1211
- tags = new Map();
1212
- TRACKED_TAGS.set(obj, tags);
1213
- }
1214
- return tags;
1215
- }
1216
- function tagFor(obj, key, meta) {
1217
- let tags = meta === undefined ? tagMetaFor(obj) : meta;
1218
- let tag = tags.get(key);
1219
- if (tag === undefined) {
1220
- tag = createUpdatableTag();
1221
- tags.set(key, tag);
1222
- }
1223
- return tag;
1224
- }
1225
-
1226
- function trackedData(key, initializer) {
1227
- let values = new WeakMap();
1228
- let hasInitializer = typeof initializer === 'function';
1229
- function getter(self) {
1230
- consumeTag(tagFor(self, key));
1231
- let value;
1232
-
1233
- // If the field has never been initialized, we should initialize it
1234
- if (hasInitializer && !values.has(self)) {
1235
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
1236
- value = initializer.call(self);
1237
- values.set(self, value);
1238
- } else {
1239
- value = values.get(self);
1240
- }
1241
- return value;
1242
- }
1243
- function setter(self, value) {
1244
- dirtyTagFor(self, key);
1245
- values.set(self, value);
1246
- }
1247
- return {
1248
- getter,
1249
- setter
1250
- };
1251
- }
1
+ export { trackedArray, trackedMap, trackedObject, trackedSet, trackedWeakMap, trackedWeakSet } from '../../@ember/reactive/collections.js';
2
+ export { A as ALLOW_CYCLES, C as COMPUTE, a as CONSTANT, b as CONSTANT_TAG, c as CURRENT_TAG, d as CurrentTag, I as INITIAL, V as VOLATILE, e as VOLATILE_TAG, f as VolatileTag, g as beginTrackFrame, h as beginUntrackFrame, i as bump, j as combine, k as consumeTag, l as createCache, m as createTag, n as createUpdatableTag, o as debug, D as dirtyTag, p as endTrackFrame, q as endUntrackFrame, r as getValue, s as isConst, t as isConstTag, u as isTracking, v as resetTracking, w as track, x as untrack, U as updateTag, y as validateTag, z as valueForTag } from '../../shared-chunks/cache-B7dqAS38.js';
3
+ export { d as dirtyTagFor, t as tagFor, a as tagMetaFor } from '../../shared-chunks/meta-BmRXesrk.js';
4
+ export { t as trackedData } from '../../shared-chunks/tracked-data-CGnA4ytZ.js';
1252
5
 
1253
6
  const GLIMMER_VALIDATOR_REGISTRATION = Symbol('GLIMMER_VALIDATOR_REGISTRATION');
1254
7
  if (Reflect.has(globalThis, GLIMMER_VALIDATOR_REGISTRATION)) {
1255
8
  throw new Error('The `@glimmer/validator` library has been included twice in this application. It could be different versions of the package, or the same version included twice by mistake. `@glimmer/validator` depends on having a single copy of the package in use at any time in an application, even if they are the same version. You must dedupe your build to remove the duplicate packages in order to prevent this error.');
1256
9
  }
1257
10
  Reflect.set(globalThis, GLIMMER_VALIDATOR_REGISTRATION, true);
1258
-
1259
- export { ALLOW_CYCLES, COMPUTE, CONSTANT, CONSTANT_TAG, CURRENT_TAG, CurrentTag, INITIAL, VOLATILE, VOLATILE_TAG, VolatileTag, beginTrackFrame, beginUntrackFrame, bump, combine, consumeTag, createCache, createTag, createUpdatableTag, debug, DIRTY_TAG as dirtyTag, dirtyTagFor, endTrackFrame, endUntrackFrame, getValue, isConst, isConstTag, isTracking, resetTracking, tagFor, tagMetaFor, track, trackedArray, trackedData, trackedMap, trackedObject, trackedSet, trackedWeakMap, trackedWeakSet, untrack, UPDATE_TAG as updateTag, validateTag, valueForTag };