ember-source 7.1.0-alpha.3 → 7.1.0-alpha.5
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.
- package/build-metadata.json +3 -3
- package/dist/dev/packages/@ember/-internals/container/index.js +4 -401
- package/dist/dev/packages/@ember/-internals/deprecations/index.js +1 -1
- package/dist/dev/packages/@ember/-internals/environment/index.js +3 -151
- package/dist/dev/packages/@ember/-internals/glimmer/index.js +14 -15
- package/dist/dev/packages/@ember/-internals/meta/lib/meta.js +0 -1
- package/dist/dev/packages/@ember/-internals/metal/index.js +18 -9
- package/dist/dev/packages/@ember/-internals/routing/index.js +1 -10
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +10 -12
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +1 -10
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -10
- package/dist/dev/packages/@ember/-internals/string/index.js +0 -1
- package/dist/dev/packages/@ember/-internals/utils/index.js +8 -3
- package/dist/dev/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +0 -1
- package/dist/dev/packages/@ember/-internals/views/lib/mixins/action_support.js +3 -12
- package/dist/dev/packages/@ember/-internals/views/lib/system/event_dispatcher.js +2 -11
- package/dist/dev/packages/@ember/-internals/views/lib/system/utils.js +1 -1
- package/dist/dev/packages/@ember/-internals/views/lib/views/core_view.js +1 -18
- package/dist/dev/packages/@ember/-internals/views/lib/views/states.js +1 -1
- package/dist/dev/packages/@ember/application/index.js +5 -28
- package/dist/dev/packages/@ember/application/instance.js +3 -22
- package/dist/dev/packages/@ember/application/namespace.js +4 -11
- package/dist/dev/packages/@ember/array/index.js +7 -15
- package/dist/dev/packages/@ember/array/proxy.js +10 -14
- package/dist/dev/packages/@ember/canary-features/index.js +1 -1
- package/dist/dev/packages/@ember/component/helper.js +1 -14
- package/dist/dev/packages/@ember/component/index.js +1355 -16
- package/dist/dev/packages/@ember/component/template-only.js +1 -9
- package/dist/dev/packages/@ember/controller/index.js +3 -19
- package/dist/dev/packages/@ember/debug/container-debug-adapter.js +0 -19
- package/dist/dev/packages/@ember/debug/data-adapter.js +4 -11
- package/dist/dev/packages/@ember/debug/index.js +2 -1
- package/dist/dev/packages/@ember/debug/lib/deprecate.js +1 -1
- package/dist/dev/packages/@ember/engine/index.js +3 -29
- package/dist/dev/packages/@ember/engine/instance.js +3 -8
- package/dist/dev/packages/@ember/helper/index.js +211 -19
- package/dist/dev/packages/@ember/instrumentation/index.js +1 -1
- package/dist/dev/packages/@ember/modifier/index.js +2 -16
- package/dist/dev/packages/@ember/modifier/on.js +1 -9
- package/dist/dev/packages/@ember/object/-internals.js +3 -11
- package/dist/dev/packages/@ember/object/compat.js +3 -10
- package/dist/dev/packages/@ember/object/computed.js +2 -12
- package/dist/dev/packages/@ember/object/core.js +10 -18
- package/dist/dev/packages/@ember/object/evented.js +2 -12
- package/dist/dev/packages/@ember/object/events.js +1 -11
- package/dist/dev/packages/@ember/object/index.js +10 -14
- package/dist/dev/packages/@ember/object/internals.js +1 -1
- package/dist/dev/packages/@ember/object/lib/computed/computed_macros.js +6 -23
- package/dist/dev/packages/@ember/object/lib/computed/reduce_computed_macros.js +3 -12
- package/dist/dev/packages/@ember/object/mixin.js +7 -10
- package/dist/dev/packages/@ember/object/observable.js +8 -12
- package/dist/dev/packages/@ember/object/observers.js +1 -11
- package/dist/dev/packages/@ember/object/promise-proxy-mixin.js +3 -13
- package/dist/dev/packages/@ember/object/proxy.js +0 -7
- package/dist/dev/packages/@ember/reactive/collections.js +589 -1
- package/dist/dev/packages/@ember/renderer/index.js +1 -14
- package/dist/dev/packages/@ember/routing/-internals.js +1 -10
- package/dist/dev/packages/@ember/routing/index.js +614 -14
- package/dist/dev/packages/@ember/routing/lib/generate_controller.js +2 -11
- package/dist/dev/packages/@ember/routing/lib/routing-service.js +7 -17
- package/dist/dev/packages/@ember/routing/lib/utils.js +2 -11
- package/dist/dev/packages/@ember/routing/route.js +12 -23
- package/dist/dev/packages/@ember/routing/router-service.js +8 -17
- package/dist/dev/packages/@ember/routing/router.js +5 -21
- package/dist/dev/packages/@ember/runloop/index.js +1 -10
- package/dist/dev/packages/@ember/service/index.js +1 -11
- package/dist/dev/packages/@ember/template/index.js +1 -14
- package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +14 -15
- package/dist/dev/packages/@ember/template-compiler/lib/dasherize-component-name.js +0 -1
- package/dist/dev/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +13 -42
- package/dist/dev/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
- package/dist/dev/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +1 -3
- package/dist/dev/packages/@ember/template-compiler/lib/template.js +2 -10
- package/dist/dev/packages/@ember/template-factory/index.js +1 -8
- package/dist/dev/packages/@ember/utils/lib/compare.js +0 -7
- package/dist/dev/packages/@ember/utils/lib/is_empty.js +1 -12
- package/dist/dev/packages/@glimmer/manager/index.js +4 -314
- package/dist/dev/packages/@glimmer/node/index.js +3 -11
- package/dist/dev/packages/@glimmer/opcode-compiler/index.js +5 -7
- package/dist/dev/packages/@glimmer/program/index.js +194 -3
- package/dist/dev/packages/@glimmer/reference/index.js +4 -5
- package/dist/dev/packages/@glimmer/runtime/index.js +17 -10
- package/dist/dev/packages/@glimmer/tracking/index.js +2 -11
- package/dist/dev/packages/@glimmer/tracking/primitives/cache/index.js +1 -11
- package/dist/dev/packages/@glimmer/util/index.js +1 -2
- package/dist/dev/packages/@glimmer/validator/index.js +4 -1253
- package/dist/dev/packages/@glimmer/vm/index.js +1 -1
- package/dist/dev/packages/@glimmer/wire-format/index.js +3 -65
- package/dist/dev/packages/ember/version.js +1 -1
- package/dist/dev/packages/ember-template-compiler/index.js +7 -7
- package/dist/dev/packages/shared-chunks/{alias-CSC0WIbj.js → alias-ZcMQckQV.js} +8 -4
- package/dist/dev/packages/shared-chunks/api-AYt3zE12.js +310 -0
- package/dist/dev/packages/shared-chunks/{api-BqXkkT0p.js → api-WvJPuo9z.js} +4 -5
- package/dist/dev/packages/shared-chunks/{args-proxy-DgXMc9b5.js → args-proxy-BNLuRFlO.js} +2 -4
- package/dist/dev/packages/shared-chunks/{array-D8PfjQHi.js → array-Bh_kUjzy.js} +2 -1
- package/dist/dev/packages/shared-chunks/cache-B7dqAS38.js +596 -0
- package/dist/dev/packages/shared-chunks/{capabilities-O_xc7Yqk.js → capabilities-CZkuOqqC.js} +0 -5
- package/dist/dev/packages/shared-chunks/chain-tags-D6tuFUj_.js +190 -0
- package/dist/dev/packages/shared-chunks/{collections-D_nY_0UJ.js → collections-DPkjqeA3.js} +0 -1
- package/dist/dev/packages/shared-chunks/{compiler-D1leQ3Gl.js → compiler-CXB_8GdR.js} +7043 -234
- package/dist/dev/packages/shared-chunks/computed-CJnghmXC.js +980 -0
- package/dist/dev/packages/shared-chunks/container-BzzHmCNj.js +404 -0
- package/dist/dev/packages/shared-chunks/curly-CvC8E_4-.js +617 -0
- package/dist/dev/packages/shared-chunks/{fragment-Cc5k9Oy4.js → curried-BVwSNqpf.js} +5 -288
- package/dist/dev/packages/shared-chunks/decorator-B5Uh5NFI.js +135 -0
- package/dist/dev/packages/shared-chunks/element-C-QcIABg.js +109 -0
- package/dist/dev/packages/shared-chunks/element-builder-kHVx0F__.js +812 -0
- package/dist/dev/packages/shared-chunks/env-g-kaAFLN.js +161 -0
- package/dist/dev/packages/shared-chunks/events-6aFVjD4k.js +180 -0
- package/dist/dev/packages/shared-chunks/get-CpJjYeJO.js +138 -0
- package/dist/dev/packages/shared-chunks/get-debug-name-CSniHBsn.js +45 -0
- package/dist/dev/packages/shared-chunks/get_properties-CIm8IAtP.js +55 -0
- package/dist/dev/packages/shared-chunks/guid-Cbq2sNV_.js +123 -0
- package/dist/dev/packages/shared-chunks/hash-D3BENmhU.js +192 -0
- package/dist/dev/packages/shared-chunks/helper-DlC4YesW.js +314 -0
- package/dist/dev/packages/shared-chunks/index-CTxkmV78.js +2500 -0
- package/dist/dev/packages/shared-chunks/index-D-xTBV4B.js +220 -0
- package/dist/dev/packages/shared-chunks/{index-BUPd6pkm.js → index-DmGmwWPJ.js} +29 -29
- package/dist/dev/packages/shared-chunks/injected_property-B4T-FzZZ.js +70 -0
- package/dist/dev/packages/shared-chunks/intern-zquhAEIg.js +51 -0
- package/dist/dev/packages/shared-chunks/internal-CbQSKXEm.js +140 -0
- package/dist/dev/packages/shared-chunks/internal-helper-Dsl9_7H_.js +7 -0
- package/dist/dev/packages/shared-chunks/{invoke-CgfoEtMT.js → invoke-B6j6DdDz.js} +3 -7
- package/dist/{prod/packages/shared-chunks/is_proxy-Cr1qlMv_.js → dev/packages/shared-chunks/is_proxy-Bzg0d4m4.js} +1 -1
- package/dist/dev/packages/shared-chunks/libraries-CHBwbR72.js +79 -0
- package/dist/dev/packages/shared-chunks/mandatory-setter-BpbAMTzV.js +107 -0
- package/dist/dev/packages/shared-chunks/meta-BmRXesrk.js +46 -0
- package/dist/{prod/packages/shared-chunks/name-C68GLLO3.js → dev/packages/shared-chunks/name-Clp4Vsod.js} +1 -1
- package/dist/dev/packages/shared-chunks/{namespace_search-uT8odThF.js → namespace_search-BfvzEQzN.js} +1 -2
- package/dist/dev/packages/shared-chunks/normalize-CKySQVU7.js +84 -0
- package/dist/dev/packages/shared-chunks/observers-C2DurkLG.js +199 -0
- package/dist/dev/packages/shared-chunks/on-D8QwT-eN.js +253 -0
- package/dist/dev/packages/shared-chunks/opcode-metadata-9iSW5JGP.js +285 -0
- package/dist/dev/packages/shared-chunks/opcodes-CplRyHl_.js +50 -0
- package/dist/dev/packages/shared-chunks/or-DBU9Ge4r.js +118 -0
- package/dist/{prod/packages/shared-chunks/program-B7SJZ5NF.js → dev/packages/shared-chunks/program-DzAfcWFj.js} +1 -1
- package/dist/dev/packages/shared-chunks/{program-context-sJz0oHOA.js → program-context-CqcQMsfa.js} +3 -3
- package/dist/dev/packages/shared-chunks/property_get-CIBS9umw.js +139 -0
- package/dist/dev/packages/shared-chunks/{property_set-DaoZXGM5.js → property_set-D3PKyisF.js} +4 -2
- package/dist/dev/packages/shared-chunks/props-fiqxqhAH.js +85 -0
- package/dist/dev/packages/shared-chunks/{reference-C3TKDRnP.js → reference-BoPB2LfI.js} +3 -4
- package/dist/dev/packages/shared-chunks/{registers-ylirb0dq.js → registers-DoamZwaG.js} +1 -1
- package/dist/{prod/packages/shared-chunks/rehydrate-builder-CUefZL4I.js → dev/packages/shared-chunks/rehydrate-builder-DdzXTaJk.js} +7 -4
- package/dist/dev/packages/shared-chunks/{render-C1HzKUcM.js → render-DDdabL30.js} +510 -15
- package/dist/{prod/packages/shared-chunks/serialize-builder-DgpXSc2Q.js → dev/packages/shared-chunks/serialize-builder-B3u9Wr3n.js} +2 -7
- package/dist/dev/packages/shared-chunks/set_properties-BghuuGJx.js +48 -0
- package/dist/dev/packages/shared-chunks/{setup-registry-B7-RknRf.js → setup-registry-XxD0xvgf.js} +34 -14
- package/dist/dev/packages/shared-chunks/spec-BXl1reqK.js +16 -0
- package/dist/dev/packages/shared-chunks/super-BBBjgF69.js +91 -0
- package/dist/dev/packages/shared-chunks/template-BRrQR6KS.js +16 -0
- package/dist/dev/packages/shared-chunks/template-only-Yluyu0DY.js +78 -0
- package/dist/dev/packages/shared-chunks/textarea-C0Us0PNJ.js +468 -0
- package/dist/dev/packages/shared-chunks/tracked-CKE4wnE6.js +148 -0
- package/dist/dev/packages/shared-chunks/tracked-data-CGnA4ytZ.js +31 -0
- package/dist/dev/packages/shared-chunks/transform-resolutions-h1ik8gqW.js +645 -0
- package/dist/dev/packages/shared-chunks/unique-id-A83bjEE-.js +32 -0
- package/dist/{prod/packages/shared-chunks/on-CLxdmpmk.js → dev/packages/shared-chunks/untouchable-this-cH6_N2LJ.js} +215 -1397
- package/dist/dev/packages/shared-chunks/well-known-_EVO9RaV.js +17 -0
- package/dist/prod/packages/@ember/-internals/container/index.js +5 -315
- package/dist/prod/packages/@ember/-internals/deprecations/index.js +1 -1
- package/dist/prod/packages/@ember/-internals/environment/index.js +3 -148
- package/dist/prod/packages/@ember/-internals/glimmer/index.js +14 -13
- package/dist/prod/packages/@ember/-internals/meta/lib/meta.js +1 -2
- package/dist/prod/packages/@ember/-internals/metal/index.js +19 -13
- package/dist/prod/packages/@ember/-internals/routing/index.js +2 -6
- package/dist/prod/packages/@ember/-internals/runtime/lib/ext/rsvp.js +1 -1
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +10 -10
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +2 -6
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js +1 -1
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -6
- package/dist/prod/packages/@ember/-internals/string/index.js +0 -2
- package/dist/prod/packages/@ember/-internals/utils/index.js +33 -30
- package/dist/prod/packages/@ember/-internals/views/lib/compat/fallback-view-registry.js +0 -2
- package/dist/prod/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -6
- package/dist/prod/packages/@ember/-internals/views/lib/system/event_dispatcher.js +3 -7
- package/dist/prod/packages/@ember/-internals/views/lib/system/utils.js +2 -2
- package/dist/prod/packages/@ember/-internals/views/lib/views/core_view.js +1 -14
- package/dist/prod/packages/@ember/-internals/views/lib/views/states.js +1 -2
- package/dist/prod/packages/@ember/application/index.js +5 -24
- package/dist/prod/packages/@ember/application/instance.js +6 -18
- package/dist/prod/packages/@ember/application/namespace.js +5 -8
- package/dist/prod/packages/@ember/array/index.js +8 -12
- package/dist/prod/packages/@ember/array/proxy.js +10 -10
- package/dist/prod/packages/@ember/canary-features/index.js +1 -1
- package/dist/prod/packages/@ember/component/helper.js +1 -12
- package/dist/prod/packages/@ember/component/index.js +1292 -15
- package/dist/prod/packages/@ember/component/template-only.js +1 -6
- package/dist/prod/packages/@ember/controller/index.js +3 -16
- package/dist/prod/packages/@ember/debug/container-debug-adapter.js +1 -15
- package/dist/prod/packages/@ember/debug/data-adapter.js +5 -7
- package/dist/prod/packages/@ember/debug/index.js +1 -0
- package/dist/prod/packages/@ember/debug/lib/deprecate.js +1 -1
- package/dist/prod/packages/@ember/engine/index.js +4 -25
- package/dist/prod/packages/@ember/engine/instance.js +4 -9
- package/dist/prod/packages/@ember/helper/index.js +211 -17
- package/dist/prod/packages/@ember/instrumentation/index.js +1 -1
- package/dist/prod/packages/@ember/modifier/index.js +2 -14
- package/dist/prod/packages/@ember/modifier/on.js +1 -6
- package/dist/prod/packages/@ember/object/-internals.js +3 -6
- package/dist/prod/packages/@ember/object/compat.js +4 -7
- package/dist/prod/packages/@ember/object/computed.js +2 -8
- package/dist/prod/packages/@ember/object/core.js +9 -15
- package/dist/prod/packages/@ember/object/evented.js +2 -7
- package/dist/prod/packages/@ember/object/events.js +1 -6
- package/dist/prod/packages/@ember/object/index.js +10 -12
- package/dist/prod/packages/@ember/object/internals.js +3 -6
- package/dist/prod/packages/@ember/object/lib/computed/computed_macros.js +6 -20
- package/dist/prod/packages/@ember/object/lib/computed/reduce_computed_macros.js +3 -9
- package/dist/prod/packages/@ember/object/mixin.js +7 -9
- package/dist/prod/packages/@ember/object/observable.js +8 -9
- package/dist/prod/packages/@ember/object/observers.js +1 -6
- package/dist/prod/packages/@ember/object/promise-proxy-mixin.js +3 -9
- package/dist/prod/packages/@ember/object/proxy.js +0 -7
- package/dist/prod/packages/@ember/reactive/collections.js +589 -1
- package/dist/prod/packages/@ember/renderer/index.js +1 -12
- package/dist/prod/packages/@ember/routing/history-location.js +1 -1
- package/dist/prod/packages/@ember/routing/index.js +581 -12
- package/dist/prod/packages/@ember/routing/lib/dsl.js +1 -1
- package/dist/prod/packages/@ember/routing/lib/generate_controller.js +2 -6
- package/dist/prod/packages/@ember/routing/lib/routing-service.js +5 -14
- package/dist/prod/packages/@ember/routing/lib/utils.js +2 -6
- package/dist/prod/packages/@ember/routing/none-location.js +1 -1
- package/dist/prod/packages/@ember/routing/route.js +12 -21
- package/dist/prod/packages/@ember/routing/router-service.js +6 -14
- package/dist/prod/packages/@ember/routing/router.js +5 -17
- package/dist/prod/packages/@ember/runloop/index.js +2 -6
- package/dist/prod/packages/@ember/service/index.js +1 -7
- package/dist/prod/packages/@ember/template/index.js +1 -12
- package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +15 -14
- package/dist/prod/packages/@ember/template-compiler/lib/dasherize-component-name.js +0 -2
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-against-attrs.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-against-named-outlets.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/auto-import-builtins.js +13 -42
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/index.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-each-track-array.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-in-element.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/plugins/transform-resolutions.js +127 -4
- package/dist/prod/packages/@ember/template-compiler/lib/template.js +2 -7
- package/dist/prod/packages/@ember/template-factory/index.js +1 -5
- package/dist/prod/packages/@ember/utils/lib/compare.js +1 -8
- package/dist/prod/packages/@ember/utils/lib/is_empty.js +1 -7
- package/dist/prod/packages/@glimmer/manager/index.js +4 -292
- package/dist/prod/packages/@glimmer/node/index.js +3 -8
- package/dist/prod/packages/@glimmer/opcode-compiler/index.js +5 -5
- package/dist/prod/packages/@glimmer/program/index.js +194 -3
- package/dist/prod/packages/@glimmer/reference/index.js +4 -4
- package/dist/prod/packages/@glimmer/runtime/index.js +16 -8
- package/dist/prod/packages/@glimmer/tracking/index.js +2 -7
- package/dist/prod/packages/@glimmer/tracking/primitives/cache/index.js +1 -6
- package/dist/prod/packages/@glimmer/util/index.js +2 -2
- package/dist/prod/packages/@glimmer/validator/index.js +5 -1016
- package/dist/prod/packages/@glimmer/vm/index.js +1 -1
- package/dist/prod/packages/@glimmer/wire-format/index.js +3 -65
- package/dist/prod/packages/ember/version.js +1 -1
- package/dist/prod/packages/ember-template-compiler/index.js +5 -7
- package/dist/prod/packages/shared-chunks/{alias-BLBQkche.js → alias-CLuFeKoV.js} +8 -6
- package/dist/prod/packages/shared-chunks/api-CM1trl_4.js +289 -0
- package/dist/prod/packages/shared-chunks/{api-DtWa0ZaF.js → api-zh_k31vb.js} +4 -5
- package/dist/prod/packages/shared-chunks/{args-proxy-Dl0A0YWI.js → args-proxy-BDXbXCF9.js} +2 -2
- package/dist/prod/packages/shared-chunks/{array-kVQfzrQn.js → array-DHdr4__s.js} +3 -3
- package/dist/prod/packages/shared-chunks/assert-CUCJBR2C.js +19 -0
- package/dist/prod/packages/shared-chunks/cache-BIlOoPA7.js +371 -0
- package/dist/prod/packages/shared-chunks/{capabilities-DXA-L0iT.js → capabilities-_5e35539.js} +0 -3
- package/dist/prod/packages/shared-chunks/chain-tags-BJqcuCM1.js +179 -0
- package/dist/prod/packages/shared-chunks/{compiler-Bbki2GT_.js → compiler-DjQtTQGk.js} +7045 -193
- package/dist/prod/packages/shared-chunks/{namespace_search-Dcdalhj6.js → computed-2Udcmflw.js} +109 -239
- package/dist/prod/packages/shared-chunks/container-D5NwW5Fd.js +316 -0
- package/dist/prod/packages/shared-chunks/curly-BsqvV8G0.js +546 -0
- package/dist/prod/packages/shared-chunks/{fragment-D7nBU9ae.js → curried-BVwSNqpf.js} +6 -303
- package/dist/prod/packages/shared-chunks/debug-render-tree-BLtnOSbb.js +2049 -0
- package/dist/prod/packages/shared-chunks/{decorator-BdDDBUd2.js → decorator-DBCISop4.js} +1 -1
- package/dist/prod/packages/shared-chunks/element-BjFr0tO0.js +101 -0
- package/dist/prod/packages/shared-chunks/{element-builder-BmLF0C-1.js → element-builder-BPjq0rxK.js} +109 -88
- package/dist/prod/packages/shared-chunks/env-DXxsTFkM.js +158 -0
- package/dist/prod/packages/shared-chunks/events-970OxD6Q.js +175 -0
- package/dist/prod/packages/shared-chunks/get-D5wxdTkY.js +138 -0
- package/dist/prod/packages/shared-chunks/get_properties-BcAC5sGx.js +55 -0
- package/dist/prod/packages/shared-chunks/guid-Cbq2sNV_.js +123 -0
- package/dist/prod/packages/shared-chunks/hash-DcUe-meU.js +192 -0
- package/dist/prod/packages/shared-chunks/helper-Da672z4a.js +299 -0
- package/dist/prod/packages/shared-chunks/{index-CjaDF9kC.js → index--2U-v2nf.js} +18 -10
- package/dist/prod/packages/shared-chunks/index-D-xTBV4B.js +220 -0
- package/dist/prod/packages/shared-chunks/index-D87qoERP.js +2322 -0
- package/dist/prod/packages/shared-chunks/{injected_property-CTVs5FPh.js → injected_property-D9B-fPiH.js} +3 -3
- package/dist/prod/packages/shared-chunks/intern-zquhAEIg.js +51 -0
- package/dist/prod/packages/shared-chunks/internal-DidurjJB.js +137 -0
- package/dist/prod/packages/shared-chunks/internal-helper-DIbr1RgC.js +7 -0
- package/dist/prod/packages/shared-chunks/{invoke-BdJCXD-b.js → invoke-Dr_CRwA_.js} +3 -5
- package/dist/{dev/packages/shared-chunks/is_proxy-B0smdQy8.js → prod/packages/shared-chunks/is_proxy-Bzg0d4m4.js} +1 -1
- package/dist/prod/packages/shared-chunks/libraries-DaXpIDYN.js +60 -0
- package/dist/prod/packages/shared-chunks/meta-B9mldqPL.js +36 -0
- package/dist/{dev/packages/shared-chunks/name-Z7dpqvzn.js → prod/packages/shared-chunks/name-Clp4Vsod.js} +1 -1
- package/dist/prod/packages/shared-chunks/namespace_search-BfvzEQzN.js +134 -0
- package/dist/prod/packages/shared-chunks/normalize-D9jDJVGg.js +84 -0
- package/dist/prod/packages/shared-chunks/observers-Co4JALkS.js +199 -0
- package/dist/prod/packages/shared-chunks/on-C3ZQiUUD.js +228 -0
- package/dist/prod/packages/shared-chunks/opcode-metadata-9iSW5JGP.js +285 -0
- package/dist/prod/packages/shared-chunks/opcodes-CplRyHl_.js +50 -0
- package/dist/prod/packages/shared-chunks/or-oTVMuHc8.js +91 -0
- package/dist/{dev/packages/shared-chunks/program-DfV0v8aa.js → prod/packages/shared-chunks/program-B7CWdS8W.js} +1 -2
- package/dist/prod/packages/shared-chunks/{program-context-DFiwaPMR.js → program-context-CGMN-aQM.js} +3 -3
- package/dist/prod/packages/shared-chunks/property_get-hWJ0nGhW.js +122 -0
- package/dist/prod/packages/shared-chunks/{property_set-B2sZxeCw.js → property_set-Dj5-ScWk.js} +4 -5
- package/dist/prod/packages/shared-chunks/props-fiqxqhAH.js +85 -0
- package/dist/prod/packages/shared-chunks/{reference-BNqcwZWH.js → reference-BshxG6wn.js} +3 -3
- package/dist/prod/packages/shared-chunks/{registers-ylirb0dq.js → registers-DoamZwaG.js} +1 -1
- package/dist/{dev/packages/shared-chunks/rehydrate-builder-CEk2KOIk.js → prod/packages/shared-chunks/rehydrate-builder-BKg2X6Lo.js} +7 -7
- package/dist/prod/packages/shared-chunks/{render-BlriW61t.js → render-nx5-PsDW.js} +487 -12
- package/dist/{dev/packages/shared-chunks/serialize-builder-CPKxdfiH.js → prod/packages/shared-chunks/serialize-builder-BGbC30SN.js} +2 -10
- package/dist/prod/packages/shared-chunks/set_properties-oPyURk67.js +48 -0
- package/dist/prod/packages/shared-chunks/{setup-registry-DeObnZ2Z.js → setup-registry-TiaKLj5k.js} +35 -13
- package/dist/prod/packages/shared-chunks/spec-BXl1reqK.js +16 -0
- package/dist/prod/packages/shared-chunks/super-BBBjgF69.js +91 -0
- package/dist/prod/packages/shared-chunks/template-BRrQR6KS.js +16 -0
- package/dist/prod/packages/shared-chunks/template-only-BtLl0uH0.js +78 -0
- package/dist/prod/packages/shared-chunks/textarea-CPKZ1c_O.js +455 -0
- package/dist/prod/packages/shared-chunks/{tracked-Cl5l4v8b.js → tracked-CffAABMz.js} +6 -4
- package/dist/prod/packages/shared-chunks/tracked-data-C83f5V5S.js +31 -0
- package/dist/prod/packages/shared-chunks/unique-id-CfHImDRV.js +32 -0
- package/dist/prod/packages/shared-chunks/well-known-_EVO9RaV.js +17 -0
- package/docs/data.json +1368 -1031
- package/package.json +1 -1
- package/types/stable/@ember/-internals/container/lib/registry.d.ts +1 -1
- package/types/stable/@ember/-internals/deprecations/index.d.ts +1 -1
- package/types/stable/@ember/-internals/environment/lib/env.d.ts +11 -0
- package/types/stable/@ember/-internals/glimmer/index.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/mount.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/outlet.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/route-template.d.ts +2 -2
- package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +9 -7
- package/types/stable/@ember/-internals/glimmer/lib/components/abstract-input.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/dom.d.ts +6 -2
- package/types/stable/@ember/-internals/glimmer/lib/environment.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +3 -3
- package/types/stable/@ember/-internals/glimmer/lib/setup-registry.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/utils/bindings.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.d.ts +3 -2
- package/types/stable/@ember/-internals/glimmer/lib/utils/iterator.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/utils/managers.d.ts +2 -1
- package/types/stable/@ember/-internals/glimmer/lib/utils/serialization-first-node-helpers.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/utils/string.d.ts +1 -1
- package/types/stable/@ember/-internals/meta/lib/meta.d.ts +3 -2
- package/types/stable/@ember/-internals/metal/lib/cache.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/chain-tags.d.ts +3 -2
- package/types/stable/@ember/-internals/metal/lib/computed.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/decorator.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/deprecate_property.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/events.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/observer.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/properties.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/property_events.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/tags.d.ts +2 -1
- package/types/stable/@ember/-internals/runtime/lib/mixins/container_proxy.d.ts +1 -1
- package/types/stable/@ember/-internals/runtime/lib/mixins/registry_proxy.d.ts +1 -1
- package/types/stable/@ember/-internals/utils/lib/is_proxy.d.ts +1 -1
- package/types/stable/@ember/-internals/utils/lib/mandatory-setter.d.ts +1 -1
- package/types/stable/@ember/-internals/views/lib/system/utils.d.ts +1 -1
- package/types/stable/@ember/-internals/views/lib/views/core_view.d.ts +2 -2
- package/types/stable/@ember/-internals/views/lib/views/states.d.ts +1 -1
- package/types/stable/@ember/application/index.d.ts +5 -4
- package/types/stable/@ember/application/instance.d.ts +4 -3
- package/types/stable/@ember/application/namespace.d.ts +1 -1
- package/types/stable/@ember/array/proxy.d.ts +4 -3
- package/types/stable/@ember/component/helper.d.ts +1 -1
- package/types/stable/@ember/component/index.d.ts +6 -3
- package/types/stable/@ember/controller/index.d.ts +2 -2
- package/types/stable/@ember/debug/container-debug-adapter.d.ts +1 -1
- package/types/stable/@ember/engine/index.d.ts +3 -3
- package/types/stable/@ember/engine/instance.d.ts +4 -3
- package/types/stable/@ember/helper/index.d.ts +223 -3
- package/types/stable/@ember/modifier/index.d.ts +1 -1
- package/types/stable/@ember/object/-internals.d.ts +2 -2
- package/types/stable/@ember/object/compat.d.ts +2 -2
- package/types/stable/@ember/object/computed.d.ts +3 -1
- package/types/stable/@ember/object/evented.d.ts +1 -1
- package/types/stable/@ember/object/events.d.ts +1 -1
- package/types/stable/@ember/object/index.d.ts +8 -2
- package/types/stable/@ember/object/lib/computed/computed_macros.d.ts +1 -1
- package/types/stable/@ember/object/mixin.d.ts +1 -1
- package/types/stable/@ember/object/observers.d.ts +1 -1
- package/types/stable/@ember/object/proxy.d.ts +1 -1
- package/types/stable/@ember/reactive/collections.d.ts +6 -6
- package/types/stable/@ember/renderer/index.d.ts +2 -2
- package/types/stable/@ember/routing/index.d.ts +1 -1
- package/types/stable/@ember/routing/lib/controller_for.d.ts +2 -2
- package/types/stable/@ember/routing/route.d.ts +2 -2
- package/types/stable/@ember/routing/router.d.ts +2 -2
- package/types/stable/@ember/service/index.d.ts +1 -1
- package/types/stable/@ember/template/index.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/dasherize-component-name.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/assert-against-attrs.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/assert-against-named-outlets.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/assert-input-helper-without-block.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/assert-reserved-named-arguments.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/auto-import-builtins.d.ts +1 -4
- package/types/stable/@ember/template-compiler/lib/plugins/transform-action-syntax.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-each-in-into-each.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-each-track-array.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-in-element.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-resolutions.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/transform-wrap-mount-and-outlet.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/plugins/utils.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/system/calculate-location-display.d.ts +1 -1
- package/types/stable/@ember/template-compiler/lib/types.d.ts +2 -1
- package/types/stable/@ember/template-factory/index.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/builder/builder-interface.d.ts +2 -2
- package/types/stable/@glimmer/compiler/lib/builder/builder.d.ts +2 -2
- package/types/stable/@glimmer/compiler/lib/compiler.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/context.d.ts +2 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/index.d.ts +2 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/impl.d.ts +2 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/curry.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/dynamic-vars.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/has-block.d.ts +2 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/if-unless.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/keywords/utils/log.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/classified.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/component.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/element/simple-element.d.ts +2 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/expressions.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/statements.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/1-normalization/visitors/strict-mode.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/2-encoding/expressions.d.ts +1 -1
- package/types/stable/@glimmer/compiler/lib/passes/2-encoding/mir.d.ts +3 -1
- package/types/stable/@glimmer/compiler/lib/shared/result.d.ts +1 -1
- package/types/stable/@glimmer/manager/lib/public/component.d.ts +1 -1
- package/types/stable/@glimmer/manager/lib/util/args-proxy.d.ts +1 -1
- package/types/stable/@glimmer/manager/lib/util/capabilities.d.ts +1 -1
- package/types/stable/@glimmer/node/lib/node-dom-helper.d.ts +1 -1
- package/types/stable/@glimmer/opcode-compiler/lib/opcode-builder/helpers/components.d.ts +1 -1
- package/types/stable/@glimmer/runtime/index.d.ts +9 -4
- package/types/stable/@glimmer/runtime/lib/compiled/expressions/concat.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/compiled/opcodes/-debug-strip.d.ts +4 -3
- package/types/stable/@glimmer/runtime/lib/compiled/opcodes/component.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/compiled/opcodes/dom.d.ts +2 -2
- package/types/stable/@glimmer/runtime/lib/compiled/opcodes/vm.d.ts +2 -2
- package/types/stable/@glimmer/runtime/lib/component/template-only.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/curried-value.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/helpers/and.d.ts +3 -0
- package/types/stable/@glimmer/runtime/lib/helpers/eq.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/gt.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/gte.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/invoke.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/helpers/lt.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/lte.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/neq.d.ts +8 -0
- package/types/stable/@glimmer/runtime/lib/helpers/not.d.ts +3 -0
- package/types/stable/@glimmer/runtime/lib/helpers/or.d.ts +3 -0
- package/types/stable/@glimmer/runtime/lib/opcodes.d.ts +2 -2
- package/types/stable/@glimmer/runtime/lib/references/class-list.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/references/curry-value.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/render.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/scope.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/vm/append.d.ts +3 -2
- package/types/stable/@glimmer/runtime/lib/vm/arguments.d.ts +2 -2
- package/types/stable/@glimmer/runtime/lib/vm/content/text.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/vm/element-builder.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/vm/low-level.d.ts +2 -1
- package/types/stable/@glimmer/runtime/lib/vm/rehydrate-builder.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/vm/update.d.ts +2 -1
- package/types/stable/@glimmer/syntax/lib/keywords.d.ts +2 -2
- package/types/stable/@glimmer/tracking/index.d.ts +2 -1
- package/types/stable/@glimmer/tracking/primitives/cache.d.ts +1 -1
- package/types/stable/index.d.ts +9 -0
- package/dist/dev/packages/shared-chunks/constants-p7AL-pog.js +0 -213
- package/dist/dev/packages/shared-chunks/dynamic-BfDKO5NI.js +0 -3823
- package/dist/dev/packages/shared-chunks/element-builder-DO43ztVP.js +0 -404
- package/dist/dev/packages/shared-chunks/index-QZstta6s.js +0 -6306
- package/dist/dev/packages/shared-chunks/mandatory-setter-DHZe7-kW.js +0 -425
- package/dist/dev/packages/shared-chunks/observers-Bj9qLVau.js +0 -2062
- package/dist/dev/packages/shared-chunks/set_properties-kVGzZL_a.js +0 -100
- package/dist/dev/packages/shared-chunks/transform-resolutions-D-YtZ0_g.js +0 -7458
- package/dist/prod/packages/shared-chunks/constants-2M371WiB.js +0 -210
- package/dist/prod/packages/shared-chunks/index-6pnzcm45.js +0 -5931
- package/dist/prod/packages/shared-chunks/observers-tZ2aOzr4.js +0 -714
- package/dist/prod/packages/shared-chunks/set_properties-C1T46IiN.js +0 -101
- package/dist/prod/packages/shared-chunks/super-Cm_a_cLQ.js +0 -275
- package/dist/prod/packages/shared-chunks/transform-resolutions-DR4GLmR2.js +0 -6936
- package/dist/prod/packages/shared-chunks/{collections-GpG8lT2g.js → collections-C3Y8z_9v.js} +9 -9
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { setOwner } from '../@ember/-internals/owner/index.js';
|
|
2
|
+
import { FrameworkObject } from '../@ember/object/-internals.js';
|
|
3
|
+
import { g as getDebugName } from './get-debug-name-BDxIL2Y1.js';
|
|
4
|
+
import './env-DXxsTFkM.js';
|
|
5
|
+
import { join } from '../@ember/runloop/index.js';
|
|
6
|
+
import { a as getInternalHelperManager, i as helperCapabilities } from './api-zh_k31vb.js';
|
|
7
|
+
import { b as setHelperManager } from './api-CM1trl_4.js';
|
|
8
|
+
import { p as createTag, D as DIRTY_TAG, a as consumeTag } from './cache-BIlOoPA7.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
@module @ember/component
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const RECOMPUTE_TAG = Symbol('RECOMPUTE_TAG');
|
|
15
|
+
|
|
16
|
+
// Signature type utilities
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
19
|
+
|
|
20
|
+
// Implements Ember's `Factory` interface and tags it for narrowing/checking.
|
|
21
|
+
|
|
22
|
+
const IS_CLASSIC_HELPER = Symbol('IS_CLASSIC_HELPER');
|
|
23
|
+
|
|
24
|
+
// A zero-runtime-overhead private symbol to use in branding the component to
|
|
25
|
+
// preserve its type parameter.
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
Ember Helpers are functions that can compute values, and are used in templates.
|
|
29
|
+
For example, this code calls a helper named `format-currency`:
|
|
30
|
+
|
|
31
|
+
```app/templates/application.hbs
|
|
32
|
+
<Cost @cents={{230}} />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```app/components/cost.hbs
|
|
36
|
+
<div>{{format-currency @cents currency="$"}}</div>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Additionally a helper can be called as a nested helper.
|
|
40
|
+
In this example, we show the formatted currency value if the `showMoney`
|
|
41
|
+
named argument is truthy.
|
|
42
|
+
|
|
43
|
+
```handlebars
|
|
44
|
+
{{if @showMoney (format-currency @cents currency="$")}}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Helpers defined using a class must provide a `compute` function. For example:
|
|
48
|
+
|
|
49
|
+
```app/helpers/format-currency.js
|
|
50
|
+
import Helper from '@ember/component/helper';
|
|
51
|
+
|
|
52
|
+
export default class extends Helper {
|
|
53
|
+
compute([cents], { currency }) {
|
|
54
|
+
return `${currency}${cents * 0.01}`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Each time the input to a helper changes, the `compute` function will be
|
|
60
|
+
called again.
|
|
61
|
+
|
|
62
|
+
As instances, these helpers also have access to the container and will accept
|
|
63
|
+
injected dependencies.
|
|
64
|
+
|
|
65
|
+
Additionally, class helpers can call `recompute` to force a new computation.
|
|
66
|
+
|
|
67
|
+
@class Helper
|
|
68
|
+
@extends CoreObject
|
|
69
|
+
@public
|
|
70
|
+
@since 1.13.0
|
|
71
|
+
*/
|
|
72
|
+
// ESLint doesn't understand declaration merging.
|
|
73
|
+
/* eslint-disable import/export */
|
|
74
|
+
|
|
75
|
+
class Helper extends FrameworkObject {
|
|
76
|
+
static isHelperFactory = true;
|
|
77
|
+
static [IS_CLASSIC_HELPER] = true;
|
|
78
|
+
|
|
79
|
+
// `packages/ember/index.js` was setting `Helper.helper`. This seems like
|
|
80
|
+
// a bad idea and probably not something we want. We've moved that definition
|
|
81
|
+
// here, but it should definitely be reviewed and probably removed.
|
|
82
|
+
/** @deprecated */
|
|
83
|
+
static helper = helper;
|
|
84
|
+
|
|
85
|
+
// SAFETY: this is initialized in `init`, rather than `constructor`. It is
|
|
86
|
+
// safe to `declare` like this *if and only if* nothing uses the constructor
|
|
87
|
+
// directly in this class, since nothing else can run before `init`.
|
|
88
|
+
|
|
89
|
+
// SAFETY: this has no runtime existence whatsoever; it is a "phantom type"
|
|
90
|
+
// here to preserve the type param.
|
|
91
|
+
|
|
92
|
+
init(properties) {
|
|
93
|
+
super.init(properties);
|
|
94
|
+
this[RECOMPUTE_TAG] = createTag();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
On a class-based helper, it may be useful to force a recomputation of that
|
|
99
|
+
helpers value. This is akin to `rerender` on a component.
|
|
100
|
+
In most cases, `recompute` is not needed because accessing tracked
|
|
101
|
+
properties in `compute` will automatically re-run the helper when
|
|
102
|
+
those properties change. Use `recompute` only when you need to
|
|
103
|
+
trigger a recomputation imperatively, for example in response to an
|
|
104
|
+
external event:
|
|
105
|
+
```app/helpers/current-time.js
|
|
106
|
+
import Helper from '@ember/component/helper';
|
|
107
|
+
export default class CurrentTimeHelper extends Helper {
|
|
108
|
+
interval = null;
|
|
109
|
+
compute() {
|
|
110
|
+
return new Date().toLocaleTimeString();
|
|
111
|
+
}
|
|
112
|
+
constructor() {
|
|
113
|
+
super(...arguments);
|
|
114
|
+
this.interval = setInterval(() => this.recompute(), 1000);
|
|
115
|
+
}
|
|
116
|
+
willDestroy() {
|
|
117
|
+
super.willDestroy();
|
|
118
|
+
clearInterval(this.interval);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
@method recompute
|
|
123
|
+
@public
|
|
124
|
+
@since 1.13.0
|
|
125
|
+
*/
|
|
126
|
+
recompute() {
|
|
127
|
+
join(() => DIRTY_TAG(this[RECOMPUTE_TAG]));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/* eslint-enable import/export */
|
|
131
|
+
|
|
132
|
+
function isClassicHelper(obj) {
|
|
133
|
+
return obj[IS_CLASSIC_HELPER] === true;
|
|
134
|
+
}
|
|
135
|
+
class ClassicHelperManager {
|
|
136
|
+
capabilities = helperCapabilities('3.23', {
|
|
137
|
+
hasValue: true,
|
|
138
|
+
hasDestroyable: true
|
|
139
|
+
});
|
|
140
|
+
ownerInjection;
|
|
141
|
+
constructor(owner) {
|
|
142
|
+
let ownerInjection = {};
|
|
143
|
+
setOwner(ownerInjection, owner);
|
|
144
|
+
this.ownerInjection = ownerInjection;
|
|
145
|
+
}
|
|
146
|
+
createHelper(definition, args) {
|
|
147
|
+
let instance = isFactoryManager(definition) ? definition.create() : definition.create(this.ownerInjection);
|
|
148
|
+
return {
|
|
149
|
+
instance,
|
|
150
|
+
args
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
getDestroyable({
|
|
154
|
+
instance
|
|
155
|
+
}) {
|
|
156
|
+
return instance;
|
|
157
|
+
}
|
|
158
|
+
getValue({
|
|
159
|
+
instance,
|
|
160
|
+
args
|
|
161
|
+
}) {
|
|
162
|
+
let {
|
|
163
|
+
positional,
|
|
164
|
+
named
|
|
165
|
+
} = args;
|
|
166
|
+
let ret = instance.compute(positional, named);
|
|
167
|
+
consumeTag(instance[RECOMPUTE_TAG]);
|
|
168
|
+
return ret;
|
|
169
|
+
}
|
|
170
|
+
getDebugName(definition) {
|
|
171
|
+
return getDebugName((definition.class || definition)['prototype']);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function isFactoryManager(obj) {
|
|
175
|
+
return obj != null && 'class' in obj;
|
|
176
|
+
}
|
|
177
|
+
setHelperManager(owner => {
|
|
178
|
+
return new ClassicHelperManager(owner);
|
|
179
|
+
}, Helper);
|
|
180
|
+
const CLASSIC_HELPER_MANAGER = getInternalHelperManager(Helper);
|
|
181
|
+
|
|
182
|
+
///////////
|
|
183
|
+
|
|
184
|
+
class Wrapper {
|
|
185
|
+
isHelperFactory = true;
|
|
186
|
+
constructor(compute) {
|
|
187
|
+
this.compute = compute;
|
|
188
|
+
}
|
|
189
|
+
create() {
|
|
190
|
+
// needs new instance or will leak containers
|
|
191
|
+
return {
|
|
192
|
+
compute: this.compute
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
class SimpleClassicHelperManager {
|
|
197
|
+
capabilities = helperCapabilities('3.23', {
|
|
198
|
+
hasValue: true
|
|
199
|
+
});
|
|
200
|
+
createHelper(definition, args) {
|
|
201
|
+
return () => definition.compute.call(null, args.positional, args.named);
|
|
202
|
+
}
|
|
203
|
+
getValue(fn) {
|
|
204
|
+
return fn();
|
|
205
|
+
}
|
|
206
|
+
getDebugName(definition) {
|
|
207
|
+
return getDebugName(definition.compute);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const SIMPLE_CLASSIC_HELPER_MANAGER = new SimpleClassicHelperManager();
|
|
211
|
+
setHelperManager(() => SIMPLE_CLASSIC_HELPER_MANAGER, Wrapper.prototype);
|
|
212
|
+
|
|
213
|
+
/*
|
|
214
|
+
Function-based helpers need to present with a constructor signature so that
|
|
215
|
+
type parameters can be preserved when `helper()` is passed a generic function
|
|
216
|
+
(this is particularly key for checking helper invocations with Glint).
|
|
217
|
+
Accordingly, we define an abstract class and declaration merge it with the
|
|
218
|
+
interface; this inherently provides an `abstract` constructor. Since it is
|
|
219
|
+
`abstract`, it is not callable, which is important since end users should not
|
|
220
|
+
be able to do `let myHelper = helper(someFn); new myHelper()`.
|
|
221
|
+
*/
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The type of a function-based helper.
|
|
225
|
+
*
|
|
226
|
+
* @note This is *not* user-constructible: it is exported only so that the type
|
|
227
|
+
* returned by the `helper` function can be named (and indeed can be exported
|
|
228
|
+
* like `export default helper(...)` safely).
|
|
229
|
+
*/
|
|
230
|
+
// Making `FunctionBasedHelper` an alias this way allows callers to name it in
|
|
231
|
+
// terms meaningful to *them*, while preserving the type behavior described on
|
|
232
|
+
// the `abstract class FunctionBasedHelperInstance` below.
|
|
233
|
+
|
|
234
|
+
// This abstract class -- specifically, its `protected abstract __concrete__`
|
|
235
|
+
// member -- prevents subclasses from doing `class X extends helper(..)`, since
|
|
236
|
+
// that is an error at runtime. While it is rare that people would type that, it
|
|
237
|
+
// is not impossible and we use this to give them early signal via the types for
|
|
238
|
+
// a behavior which will break (and in a somewhat inscrutable way!) at runtime.
|
|
239
|
+
//
|
|
240
|
+
// This is needful because we lie about what this actually is for Glint's sake:
|
|
241
|
+
// a function-based helper returns a `Factory<SimpleHelper>`, which is designed
|
|
242
|
+
// to be "opaque" from a consumer's POV, i.e. not user-callable or constructible
|
|
243
|
+
// but only useable in a template (or via `invokeHelper()` which also treats it
|
|
244
|
+
// as a fully opaque `object` from a type POV). But Glint needs a `Helper<S>` to
|
|
245
|
+
// make it work the same way as class-based helpers. (Note that this does not
|
|
246
|
+
// hold for plain functions as helpers, which it can handle distinctly.) This
|
|
247
|
+
// signature thus makes it so that the item is usable *as* a `Helper` in Glint,
|
|
248
|
+
// but without letting end users treat it as a helper class instance.
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
In many cases it is not necessary to use the full `Helper` class.
|
|
252
|
+
The `helper` method create pure-function helpers without instances.
|
|
253
|
+
For example:
|
|
254
|
+
|
|
255
|
+
```app/helpers/format-currency.js
|
|
256
|
+
import { helper } from '@ember/component/helper';
|
|
257
|
+
|
|
258
|
+
export default helper(function([cents], {currency}) {
|
|
259
|
+
return `${currency}${cents * 0.01}`;
|
|
260
|
+
});
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
@static
|
|
264
|
+
@param {Function} helper The helper function
|
|
265
|
+
@method helper
|
|
266
|
+
@for @ember/component/helper
|
|
267
|
+
@public
|
|
268
|
+
@since 1.13.0
|
|
269
|
+
*/
|
|
270
|
+
// This overload allows users to write types directly on the callback passed to
|
|
271
|
+
// the `helper` function and infer the resulting type correctly.
|
|
272
|
+
|
|
273
|
+
// This overload allows users to provide a `Signature` type explicitly at the
|
|
274
|
+
// helper definition site, e.g. `helper<Sig>((pos, named) => {...})`. **Note:**
|
|
275
|
+
// this overload must appear second, since TS' inference engine will not
|
|
276
|
+
// correctly infer the type of `S` here from the types on the supplied callback.
|
|
277
|
+
|
|
278
|
+
function helper(helperFn) {
|
|
279
|
+
// SAFETY: this is completely lies, in two ways:
|
|
280
|
+
//
|
|
281
|
+
// 1. `Wrapper` is a `Factory<SimpleHelper<S>>`, but from the perspective of
|
|
282
|
+
// any external callers (i.e. Ember *users*), it is quite important that
|
|
283
|
+
// the `Factory` relationship be hidden, because it is not public API for
|
|
284
|
+
// an end user to call `.create()` on a helper created this way. Instead,
|
|
285
|
+
// we provide them an `abstract new` signature (which means it cannot be
|
|
286
|
+
// directly constructed by calling `new` on it) and which does not have the
|
|
287
|
+
// `.create()` signature on it anymore.
|
|
288
|
+
//
|
|
289
|
+
// 2. The produced type here ends up being a subtype of `Helper`, which is not
|
|
290
|
+
// strictly true. This is necessary for the sake of Glint, which provides
|
|
291
|
+
// its information by way of a "declaration merge" with `Helper<S>` in the
|
|
292
|
+
// case of items produced by `helper()`.
|
|
293
|
+
//
|
|
294
|
+
// Long-term, this entire construct can go away in favor of deprecating the
|
|
295
|
+
// `helper()` invocation in favor of using plain functions.
|
|
296
|
+
return new Wrapper(helperFn);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export { CLASSIC_HELPER_MANAGER as C, Helper as H, helper as h, isClassicHelper as i };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { z as VM_PRIMITIVE_OP, m as VM_RETURN_OP, aP as encodeHandle, aQ as isMachineOp, aF as VM_CONCAT_OP, aw as VM_GET_VARIABLE_OP, y as VM_CONSTANT_REFERENCE_OP, aA as VM_GET_PROPERTY_OP, aD as VM_HAS_BLOCK_OP, aC as VM_SPREAD_BLOCK_OP, N as VM_COMPILE_BLOCK_OP, aE as VM_HAS_BLOCK_PARAMS_OP, aG as VM_IF_INLINE_OP, aH as VM_NOT_OP, aI as VM_GET_DYNAMIC_VAR_OP, q as VM_PUSH_FRAME_OP, aJ as VM_LOG_OP, p as VM_POP_FRAME_OP, H as VM_FETCH_OP, D as VM_PRIMITIVE_REFERENCE_OP, av as VM_HELPER_OP, E as VM_DUP_OP, at as VM_DYNAMIC_HELPER_OP, F as VM_POP_OP, a9 as VM_CAPTURE_ARGS_OP, as as VM_CURRY_OP, aR as isSmallInt, aS as encodeImmediate, u as VM_PUSH_DYNAMIC_SCOPE_OP, I as VM_BIND_DYNAMIC_SCOPE_OP, v as VM_POP_DYNAMIC_SCOPE_OP, aB as VM_GET_BLOCK_OP, O as VM_INVOKE_YIELD_OP, t as VM_POP_SCOPE_OP, s as VM_CHILD_SCOPE_OP, ax as VM_SET_VARIABLE_OP, o as VM_INVOKE_VIRTUAL_OP, w as VM_CONSTANT_OP, M as VM_PUSH_BLOCK_SCOPE_OP, L as VM_PUSH_SYMBOL_TABLE_OP, a8 as VM_PUSH_EMPTY_ARGS_OP, a7 as VM_PUSH_ARGS_OP, J as VM_ENTER_OP, R as VM_JUMP_EQ_OP, n as VM_JUMP_OP, K as VM_EXIT_OP, l as VM_RETURN_TO_OP, Q as VM_JUMP_UNLESS_OP, a5 as VM_PUSH_COMPONENT_DEFINITION_OP, G as VM_LOAD_OP, ad as VM_BEGIN_COMPONENT_TRANSACTION_OP, ab as VM_CREATE_COMPONENT_OP, ac as VM_REGISTER_COMPONENT_DESTRUCTOR_OP, ai as VM_GET_COMPONENT_SELF_OP, az as VM_ROOT_SCOPE_OP, ay as VM_SET_BLOCK_OP, aq as VM_DID_RENDER_LAYOUT_OP, ar as VM_COMMIT_COMPONENT_TRANSACTION_OP, aa as VM_PREPARE_ARGS_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, ae as VM_PUT_COMPONENT_OPERATIONS_OP, X as VM_OPEN_DYNAMIC_ELEMENT_OP, ah as VM_DID_CREATE_ELEMENT_OP, _ as VM_FLUSH_ELEMENT_OP, $ as VM_CLOSE_ELEMENT_OP, f as VM_RESOLVE_CURRIED_COMPONENT_OP, a6 as VM_RESOLVE_DYNAMIC_COMPONENT_OP, g as VM_PUSH_DYNAMIC_COMPONENT_INSTANCE_OP, ak as VM_GET_COMPONENT_LAYOUT_OP, al as VM_POPULATE_LAYOUT_OP, aj as VM_GET_COMPONENT_TAG_NAME_OP, U as VM_COMMENT_OP, a0 as VM_MODIFIER_OP, a1 as VM_DYNAMIC_MODIFIER_OP, a2 as VM_STATIC_ATTR_OP, ag as VM_STATIC_COMPONENT_ATTR_OP, a3 as VM_DYNAMIC_ATTR_OP, af as VM_COMPONENT_ATTR_OP, W as VM_OPEN_ELEMENT_OP, aL as VM_DEBUGGER_OP, T as VM_TEXT_OP, k as VM_INVOKE_STATIC_OP, aK as VM_DYNAMIC_CONTENT_TYPE_OP, Y as VM_PUSH_REMOTE_ELEMENT_OP, Z as VM_POP_REMOTE_ELEMENT_OP, S as VM_TO_BOOLEAN_OP, aM as VM_ENTER_LIST_OP, aO as VM_ITERATE_OP, aN as VM_EXIT_LIST_OP } from './fragment-D7nBU9ae.js';
|
|
2
|
-
import '../@glimmer/validator/index.js';
|
|
3
|
-
import './reference-BNqcwZWH.js';
|
|
4
|
-
import { e as expect, u as unwrap, S as StackImpl, a as isPresentArray, d as dict } from './collections-GpG8lT2g.js';
|
|
5
|
-
import { SexpOpcodes as opcodes } from '../@glimmer/wire-format/index.js';
|
|
6
|
-
import { e as $v0, c as $fp, $ as $s0, d as $sp, h as $s1 } from './registers-ylirb0dq.js';
|
|
7
|
-
import { b as EMPTY_STRING_ARRAY, E as EMPTY_ARRAY, e as enumerate, r as reverse } from './array-utils-CZQxrdD3.js';
|
|
8
|
-
import { ContentType } from '../@glimmer/vm/index.js';
|
|
9
|
-
import { h as hasCapability } from './capabilities-DXA-L0iT.js';
|
|
10
|
-
import { A as ARG_SHIFT, M as MACHINE_MASK, I as InternalComponentCapabilities } from './flags-B9qxc-pB.js';
|
|
11
1
|
import { a as assign } from './object-utils-AijlD-JH.js';
|
|
2
|
+
import { b as EMPTY_STRING_ARRAY, E as EMPTY_ARRAY, e as enumerate, r as reverse } from './array-utils-CZQxrdD3.js';
|
|
3
|
+
import { s as VM_PRIMITIVE_OP, aG as VM_RETURN_OP, aM as encodeHandle, aN as isMachineOp, aw as VM_CONCAT_OP, an as VM_GET_VARIABLE_OP, r as VM_CONSTANT_REFERENCE_OP, ar as VM_GET_PROPERTY_OP, au as VM_HAS_BLOCK_OP, at as VM_SPREAD_BLOCK_OP, F as VM_COMPILE_BLOCK_OP, av as VM_HAS_BLOCK_PARAMS_OP, ax as VM_IF_INLINE_OP, ay as VM_NOT_OP, az as VM_GET_DYNAMIC_VAR_OP, aK as VM_PUSH_FRAME_OP, aA as VM_LOG_OP, aJ as VM_POP_FRAME_OP, z as VM_FETCH_OP, v as VM_PRIMITIVE_REFERENCE_OP, am as VM_HELPER_OP, w as VM_DUP_OP, al as VM_DYNAMIC_HELPER_OP, x as VM_POP_OP, a0 as VM_CAPTURE_ARGS_OP, ak as VM_CURRY_OP, aO as isSmallInt, aP as encodeImmediate, n as VM_PUSH_DYNAMIC_SCOPE_OP, A as VM_BIND_DYNAMIC_SCOPE_OP, o as VM_POP_DYNAMIC_SCOPE_OP, as as VM_GET_BLOCK_OP, G as VM_INVOKE_YIELD_OP, m as VM_POP_SCOPE_OP, l as VM_CHILD_SCOPE_OP, ao as VM_SET_VARIABLE_OP, aI as VM_INVOKE_VIRTUAL_OP, p as VM_CONSTANT_OP, E as VM_PUSH_BLOCK_SCOPE_OP, D as VM_PUSH_SYMBOL_TABLE_OP, $ as VM_PUSH_EMPTY_ARGS_OP, _ as VM_PUSH_ARGS_OP, B as VM_ENTER_OP, J as VM_JUMP_EQ_OP, aH as VM_JUMP_OP, C as VM_EXIT_OP, aF as VM_RETURN_TO_OP, I as VM_JUMP_UNLESS_OP, Y as VM_PUSH_COMPONENT_DEFINITION_OP, y as VM_LOAD_OP, a4 as VM_BEGIN_COMPONENT_TRANSACTION_OP, a2 as VM_CREATE_COMPONENT_OP, a3 as VM_REGISTER_COMPONENT_DESTRUCTOR_OP, a9 as VM_GET_COMPONENT_SELF_OP, aq as VM_ROOT_SCOPE_OP, ap as VM_SET_BLOCK_OP, ah as VM_DID_RENDER_LAYOUT_OP, ai as VM_COMMIT_COMPONENT_TRANSACTION_OP, a1 as VM_PREPARE_ARGS_OP, ad as VM_VIRTUAL_ROOT_SCOPE_OP, ae as VM_SET_NAMED_VARIABLES_OP, af as VM_SET_BLOCKS_OP, ag as VM_INVOKE_COMPONENT_LAYOUT_OP, a5 as VM_PUT_COMPONENT_OPERATIONS_OP, O as VM_OPEN_DYNAMIC_ELEMENT_OP, a8 as VM_DID_CREATE_ELEMENT_OP, R as VM_FLUSH_ELEMENT_OP, S as VM_CLOSE_ELEMENT_OP, e as VM_RESOLVE_CURRIED_COMPONENT_OP, Z as VM_RESOLVE_DYNAMIC_COMPONENT_OP, f as VM_PUSH_DYNAMIC_COMPONENT_INSTANCE_OP, ab as VM_GET_COMPONENT_LAYOUT_OP, ac as VM_POPULATE_LAYOUT_OP, aa as VM_GET_COMPONENT_TAG_NAME_OP, M as VM_COMMENT_OP, T as VM_MODIFIER_OP, U as VM_DYNAMIC_MODIFIER_OP, W as VM_STATIC_ATTR_OP, a7 as VM_STATIC_COMPONENT_ATTR_OP, X as VM_DYNAMIC_ATTR_OP, a6 as VM_COMPONENT_ATTR_OP, N as VM_OPEN_ELEMENT_OP, aj as VM_DEBUGGER_OP, L as VM_TEXT_OP, j as VM_INVOKE_STATIC_OP, aB as VM_DYNAMIC_CONTENT_TYPE_OP, P as VM_PUSH_REMOTE_ELEMENT_OP, Q as VM_POP_REMOTE_ELEMENT_OP, K as VM_TO_BOOLEAN_OP, aC as VM_ENTER_LIST_OP, aE as VM_ITERATE_OP, aD as VM_EXIT_LIST_OP } from './opcode-metadata-9iSW5JGP.js';
|
|
4
|
+
import './curried-BVwSNqpf.js';
|
|
5
|
+
import './reference-BshxG6wn.js';
|
|
6
|
+
import { e as expect, u as unwrap, S as StackImpl, a as isPresentArray, d as dict } from './collections-C3Y8z_9v.js';
|
|
7
|
+
import { a as assert } from './assert-CUCJBR2C.js';
|
|
12
8
|
import { InstructionEncoderImpl } from '../@glimmer/encoder/index.js';
|
|
9
|
+
import { A as ARG_SHIFT, M as MACHINE_MASK, I as InternalComponentCapabilities } from './flags-B9qxc-pB.js';
|
|
10
|
+
import { o as opcodes } from './opcodes-CplRyHl_.js';
|
|
11
|
+
import { a as $v0, f as $fp, $ as $s0, e as $sp, d as $s1 } from './registers-DoamZwaG.js';
|
|
12
|
+
import { ContentType } from '../@glimmer/vm/index.js';
|
|
13
|
+
import { h as hasCapability } from './capabilities-_5e35539.js';
|
|
13
14
|
|
|
14
15
|
function isGetLikeTuple(opcode) {
|
|
15
16
|
return Array.isArray(opcode) && opcode.length === 2;
|
|
@@ -35,6 +36,7 @@ function assertResolverInvariants(meta) {
|
|
|
35
36
|
* <Foo @arg={{true}} />
|
|
36
37
|
*/
|
|
37
38
|
function resolveComponent(resolver, constants, meta, [, expr, then]) {
|
|
39
|
+
assert(isGetFreeComponent(expr));
|
|
38
40
|
let type = expr[0];
|
|
39
41
|
if (type === opcodes.GetLexicalSymbol) {
|
|
40
42
|
let {
|
|
@@ -66,6 +68,7 @@ function resolveComponent(resolver, constants, meta, [, expr, then]) {
|
|
|
66
68
|
* (helper arg)
|
|
67
69
|
*/
|
|
68
70
|
function resolveHelper(resolver, constants, meta, [, expr, then]) {
|
|
71
|
+
assert(isGetFreeHelper(expr));
|
|
69
72
|
let type = expr[0];
|
|
70
73
|
if (type === opcodes.GetLexicalSymbol) {
|
|
71
74
|
let {
|
|
@@ -96,6 +99,7 @@ function resolveHelper(resolver, constants, meta, [, expr, then]) {
|
|
|
96
99
|
* <Foo {{modifier}}/>
|
|
97
100
|
*/
|
|
98
101
|
function resolveModifier(resolver, constants, meta, [, expr, then]) {
|
|
102
|
+
assert(isGetFreeModifier(expr));
|
|
99
103
|
let type = expr[0];
|
|
100
104
|
if (type === opcodes.GetLexicalSymbol) {
|
|
101
105
|
let {
|
|
@@ -139,6 +143,7 @@ function resolveComponentOrHelper(resolver, constants, meta, [, expr, {
|
|
|
139
143
|
ifComponent,
|
|
140
144
|
ifHelper
|
|
141
145
|
}]) {
|
|
146
|
+
assert(isGetFreeComponentOrHelper(expr));
|
|
142
147
|
let type = expr[0];
|
|
143
148
|
if (type === opcodes.GetLexicalSymbol) {
|
|
144
149
|
let {
|
|
@@ -186,6 +191,7 @@ function resolveOptionalComponentOrHelper(resolver, constants, meta, [, expr, {
|
|
|
186
191
|
ifHelper,
|
|
187
192
|
ifValue
|
|
188
193
|
}]) {
|
|
194
|
+
assert(isGetFreeComponentOrHelper(expr));
|
|
189
195
|
let type = expr[0];
|
|
190
196
|
if (type === opcodes.GetLexicalSymbol) {
|
|
191
197
|
let {
|
|
@@ -347,6 +353,7 @@ class Labels {
|
|
|
347
353
|
} of targets) {
|
|
348
354
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
|
|
349
355
|
let address = labels[target] - at;
|
|
356
|
+
assert(heap.getbyaddr(at) === -1);
|
|
350
357
|
heap.setbyaddr(at, address);
|
|
351
358
|
}
|
|
352
359
|
}
|
|
@@ -507,6 +514,7 @@ class Compilers {
|
|
|
507
514
|
let name = sexp[0];
|
|
508
515
|
let index = unwrap(this.names[name]);
|
|
509
516
|
let func = this.funcs[index];
|
|
517
|
+
assert(func, `expected an implementation for ${sexp[0]}`);
|
|
510
518
|
func(op, sexp);
|
|
511
519
|
}
|
|
512
520
|
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@module @ember/template
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
A wrapper around a string that has been marked as "trusted". **When
|
|
7
|
+
rendered in HTML, Ember will not perform any escaping.**
|
|
8
|
+
|
|
9
|
+
Note:
|
|
10
|
+
|
|
11
|
+
1. This does not *make* the string safe; it means that some code in your
|
|
12
|
+
application has *marked* it as trusted using the `trustHTML()` function.
|
|
13
|
+
|
|
14
|
+
2. The only public API for getting a `TrustedHTML` is calling `trustHTML()`. It
|
|
15
|
+
is *not* user-constructible.
|
|
16
|
+
|
|
17
|
+
If a string contains user inputs or other untrusted data, you must sanitize
|
|
18
|
+
the string before using the `trustHTML` method. Otherwise your code is
|
|
19
|
+
vulnerable to [Cross-Site Scripting][xss]. There are many open source
|
|
20
|
+
sanitization libraries to choose from, both for front end and server-side
|
|
21
|
+
sanitization.
|
|
22
|
+
|
|
23
|
+
[xss]: https://owasp.org/www-community/attacks/DOM_Based_XSS
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
import { trustHTML } from '@ember/template';
|
|
27
|
+
|
|
28
|
+
let someTrustedOrSanitizedString = "<div>Hello!</div>"
|
|
29
|
+
|
|
30
|
+
trustHTML(someTrustedorSanitizedString);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
@for @ember/template
|
|
34
|
+
@class TrustedHTML
|
|
35
|
+
@since 6.7.0
|
|
36
|
+
@public
|
|
37
|
+
*/
|
|
38
|
+
class TrustedHTML {
|
|
39
|
+
__string;
|
|
40
|
+
constructor(string) {
|
|
41
|
+
this.__string = string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
Get the string back to use as a string.
|
|
46
|
+
@public
|
|
47
|
+
@method toString
|
|
48
|
+
@returns {String} The string marked as trusted
|
|
49
|
+
*/
|
|
50
|
+
toString() {
|
|
51
|
+
return `${this.__string}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
Get the wrapped string as HTML to use without escaping.
|
|
56
|
+
@public
|
|
57
|
+
@method toHTML
|
|
58
|
+
@returns {String} the trusted string, without any escaping applied
|
|
59
|
+
*/
|
|
60
|
+
toHTML() {
|
|
61
|
+
return this.toString();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
A wrapper around a string that has been marked as safe ("trusted"). **When
|
|
67
|
+
rendered in HTML, Ember will not perform any escaping.**
|
|
68
|
+
|
|
69
|
+
Note:
|
|
70
|
+
|
|
71
|
+
1. This does not *make* the string safe; it means that some code in your
|
|
72
|
+
application has *marked* it as safe using the `htmlSafe()` function.
|
|
73
|
+
|
|
74
|
+
2. The only public API for getting a `SafeString` is calling `htmlSafe()`. It
|
|
75
|
+
is *not* user-constructible.
|
|
76
|
+
|
|
77
|
+
If a string contains user inputs or other untrusted data, you must sanitize
|
|
78
|
+
the string before using the `htmlSafe` method. Otherwise your code is
|
|
79
|
+
vulnerable to [Cross-Site Scripting][xss]. There are many open source
|
|
80
|
+
sanitization libraries to choose from, both for front end and server-side
|
|
81
|
+
sanitization.
|
|
82
|
+
|
|
83
|
+
[xss]: https://owasp.org/www-community/attacks/DOM_Based_XSS
|
|
84
|
+
|
|
85
|
+
```javascript
|
|
86
|
+
import { htmlSafe } from '@ember/template';
|
|
87
|
+
|
|
88
|
+
let someTrustedOrSanitizedString = "<div>Hello!</div>"
|
|
89
|
+
|
|
90
|
+
htmlSafe(someTrustedorSanitizedString);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
@for @ember/template
|
|
94
|
+
@class SafeString
|
|
95
|
+
@since 4.12.0
|
|
96
|
+
@public
|
|
97
|
+
*/
|
|
98
|
+
const SafeString = TrustedHTML;
|
|
99
|
+
/**
|
|
100
|
+
Use this method to indicate that a string should be rendered as HTML
|
|
101
|
+
when the string is used in a template. To say this another way,
|
|
102
|
+
strings marked with `htmlSafe` will not be HTML escaped.
|
|
103
|
+
|
|
104
|
+
A word of warning - The `htmlSafe` method does not make the string safe;
|
|
105
|
+
it only tells the framework to treat the string as if it is safe to render
|
|
106
|
+
as HTML. If a string contains user inputs or other untrusted
|
|
107
|
+
data, you must sanitize the string before using the `htmlSafe` method.
|
|
108
|
+
Otherwise your code is vulnerable to
|
|
109
|
+
[Cross-Site Scripting](https://owasp.org/www-community/attacks/DOM_Based_XSS).
|
|
110
|
+
There are many open source sanitization libraries to choose from,
|
|
111
|
+
both for front end and server-side sanitization.
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
import { htmlSafe } from '@ember/template';
|
|
115
|
+
|
|
116
|
+
const someTrustedOrSanitizedString = "<div>Hello!</div>"
|
|
117
|
+
|
|
118
|
+
htmlSafe(someTrustedorSanitizedString)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
@method htmlSafe
|
|
122
|
+
@for @ember/template
|
|
123
|
+
@param str {String} The string to treat as trusted.
|
|
124
|
+
@static
|
|
125
|
+
@return {SafeString} A string that will not be HTML escaped by Handlebars.
|
|
126
|
+
@public
|
|
127
|
+
*/
|
|
128
|
+
const htmlSafe = trustHTML;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
Use this method to indicate that a string should be rendered as HTML
|
|
132
|
+
without escaping when the string is used in a template. To say this another way,
|
|
133
|
+
strings marked with `trustHTML` will not be HTML escaped.
|
|
134
|
+
|
|
135
|
+
A word of warning - The `trustHTML` method does not make the string safe;
|
|
136
|
+
it only tells the framework to treat the string as if it is safe to render
|
|
137
|
+
as HTML - that we trust its contents to be safe. If a string contains user inputs or other untrusted
|
|
138
|
+
data, you must sanitize the string before using the `trustHTML` method.
|
|
139
|
+
Otherwise your code is vulnerable to
|
|
140
|
+
[Cross-Site Scripting](https://owasp.org/www-community/attacks/DOM_Based_XSS).
|
|
141
|
+
There are many open source sanitization libraries to choose from,
|
|
142
|
+
both for front end and server-side sanitization.
|
|
143
|
+
|
|
144
|
+
```glimmer-js
|
|
145
|
+
import { trustHTML } from '@ember/template';
|
|
146
|
+
|
|
147
|
+
const someTrustedOrSanitizedString = "<div>Hello!</div>"
|
|
148
|
+
|
|
149
|
+
<template>
|
|
150
|
+
{{trustHTML someTrustedOrSanitizedString}}
|
|
151
|
+
</template>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
@method trustHTML
|
|
155
|
+
@for @ember/template
|
|
156
|
+
@param str {String} The string to treat as trusted.
|
|
157
|
+
@static
|
|
158
|
+
@return {TrustedHTML} A string that will not be HTML escaped by Handlebars.
|
|
159
|
+
@public
|
|
160
|
+
*/
|
|
161
|
+
function trustHTML(str) {
|
|
162
|
+
if (str === null || str === undefined) {
|
|
163
|
+
str = '';
|
|
164
|
+
} else if (typeof str !== 'string') {
|
|
165
|
+
str = String(str);
|
|
166
|
+
}
|
|
167
|
+
return new TrustedHTML(str);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
Detects if a string was decorated using `htmlSafe`.
|
|
172
|
+
|
|
173
|
+
```javascript
|
|
174
|
+
import { htmlSafe, isHTMLSafe } from '@ember/template';
|
|
175
|
+
|
|
176
|
+
let plainString = 'plain string';
|
|
177
|
+
let safeString = htmlSafe('<div>someValue</div>');
|
|
178
|
+
|
|
179
|
+
isHTMLSafe(plainString); // false
|
|
180
|
+
isHTMLSafe(safeString); // true
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
@method isHTMLSafe
|
|
184
|
+
@for @ember/template
|
|
185
|
+
@static
|
|
186
|
+
@return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise.
|
|
187
|
+
@public
|
|
188
|
+
*/
|
|
189
|
+
const isHTMLSafe = isTrustedHTML;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
Detects if a string was decorated using `trustHTML`.
|
|
193
|
+
|
|
194
|
+
```javascript
|
|
195
|
+
import { trustHTML, isTrustedHTML } from '@ember/template';
|
|
196
|
+
|
|
197
|
+
let plainString = 'plain string';
|
|
198
|
+
let safeString = trustHTML('<div>someValue</div>');
|
|
199
|
+
|
|
200
|
+
isTrustedHTML(plainString); // false
|
|
201
|
+
isTrustedHTML(safeString); // true
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
@method isTrustedHTML
|
|
205
|
+
@for @ember/template
|
|
206
|
+
@static
|
|
207
|
+
@return {Boolean} `true` if the string was decorated with `htmlSafe`, `false` otherwise.
|
|
208
|
+
@public
|
|
209
|
+
*/
|
|
210
|
+
function isTrustedHTML(str) {
|
|
211
|
+
return (
|
|
212
|
+
// SAFETY: cast `as SafeString` only present to make this check "legal"; we
|
|
213
|
+
// can further improve this by changing the behavior to do an `in` check
|
|
214
|
+
// instead, but that's worth landing as a separate change for bisecting if
|
|
215
|
+
// it happens to have an impact on e.g. perf.
|
|
216
|
+
str !== null && typeof str === 'object' && typeof str.toHTML === 'function'
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export { SafeString as S, TrustedHTML as T, isTrustedHTML as a, htmlSafe as h, isHTMLSafe as i, trustHTML as t };
|