ember-source 7.2.0-alpha.3 → 7.2.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.
- package/README.md +0 -1
- package/blueprints/-addon-import.js +4 -6
- package/blueprints/-utils.js +6 -9
- package/build-metadata.json +3 -3
- package/dist/dev/packages/@ember/-internals/glimmer/index.js +11 -11
- package/dist/dev/packages/@ember/-internals/metal/index.js +15 -15
- package/dist/dev/packages/@ember/-internals/routing/index.js +3 -3
- package/dist/dev/packages/@ember/-internals/runtime/index.js +1 -1
- package/dist/dev/packages/@ember/-internals/runtime/lib/ext/rsvp.js +1 -1
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +7 -7
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +1 -1
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -3
- package/dist/dev/packages/@ember/-internals/views/lib/mixins/action_support.js +1 -1
- package/dist/dev/packages/@ember/-internals/views/lib/system/event_dispatcher.js +2 -2
- package/dist/dev/packages/@ember/-internals/views/lib/views/core_view.js +1 -1
- package/dist/dev/packages/@ember/application/index.js +5 -6
- package/dist/dev/packages/@ember/application/instance.js +3 -3
- package/dist/dev/packages/@ember/application/namespace.js +1 -1
- package/dist/dev/packages/@ember/array/index.js +10 -64
- package/dist/dev/packages/@ember/array/lib/is-array.js +71 -0
- package/dist/dev/packages/@ember/array/proxy.js +8 -8
- package/dist/dev/packages/@ember/component/helper.js +1 -1
- package/dist/dev/packages/@ember/component/index.js +18 -12
- package/dist/dev/packages/@ember/component/template-only.js +1 -1
- package/dist/dev/packages/@ember/controller/index.js +3 -3
- package/dist/dev/packages/@ember/debug/data-adapter.js +3 -3
- package/dist/dev/packages/@ember/engine/index.js +5 -5
- package/dist/dev/packages/@ember/engine/instance.js +1 -1
- package/dist/dev/packages/@ember/helper/index.js +8 -27
- package/dist/dev/packages/@ember/modifier/index.js +2 -2
- package/dist/dev/packages/@ember/modifier/on.js +1 -1
- package/dist/dev/packages/@ember/object/compat.js +2 -2
- package/dist/dev/packages/@ember/object/computed.js +2 -2
- package/dist/dev/packages/@ember/object/core.js +4 -4
- package/dist/dev/packages/@ember/object/index.js +28 -23
- package/dist/dev/packages/@ember/object/lib/computed/computed_macros.js +4 -4
- package/dist/dev/packages/@ember/object/lib/computed/reduce_computed_macros.js +2 -2
- package/dist/dev/packages/@ember/object/mixin.js +2 -2
- package/dist/dev/packages/@ember/object/observable.js +6 -6
- package/dist/dev/packages/@ember/object/observers.js +1 -1
- package/dist/dev/packages/@ember/object/promise-proxy-mixin.js +3 -3
- package/dist/dev/packages/@ember/reactive/collections.js +153 -153
- package/dist/dev/packages/@ember/renderer/index.js +1 -1
- package/dist/dev/packages/@ember/routing/-internals.js +3 -3
- package/dist/dev/packages/@ember/routing/index.js +12 -8
- package/dist/dev/packages/@ember/routing/lib/generate_controller.js +2 -3
- package/dist/dev/packages/@ember/routing/lib/routing-service.js +4 -4
- package/dist/dev/packages/@ember/routing/lib/utils.js +3 -3
- package/dist/dev/packages/@ember/routing/route.js +11 -11
- package/dist/dev/packages/@ember/routing/router-service.js +24 -17
- package/dist/dev/packages/@ember/routing/router.js +5 -5
- package/dist/dev/packages/@ember/runloop/index.js +1 -1
- package/dist/dev/packages/@ember/service/index.js +1 -1
- package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +3 -3
- package/dist/dev/packages/@ember/template-compiler/lib/template.js +1 -1
- package/dist/dev/packages/@ember/template-factory/index.js +1 -1
- package/dist/dev/packages/@ember/utils/lib/is_empty.js +1 -1
- package/dist/dev/packages/@glimmer/encoder/index.js +1 -1
- package/dist/dev/packages/@glimmer/manager/index.js +4 -4
- package/dist/dev/packages/@glimmer/node/index.js +2 -2
- package/dist/dev/packages/@glimmer/opcode-compiler/index.js +2 -2
- package/dist/dev/packages/@glimmer/program/index.js +7 -7
- package/dist/dev/packages/@glimmer/reference/index.js +3 -3
- package/dist/dev/packages/@glimmer/runtime/index.js +12 -12
- package/dist/dev/packages/@glimmer/tracking/index.js +2 -2
- package/dist/dev/packages/@glimmer/tracking/primitives/cache/index.js +1 -1
- package/dist/dev/packages/@glimmer/validator/index.js +3 -3
- package/dist/dev/packages/@glimmer/vm/index.js +1 -1
- package/dist/dev/packages/ember/version.js +1 -1
- package/dist/dev/packages/router_js/index.js +2 -2
- package/dist/dev/packages/rsvp/index.js +2281 -1
- package/dist/dev/packages/shared-chunks/{alias-ZcMQckQV.js → alias-DpqL1qx6.js} +6 -6
- package/dist/dev/packages/shared-chunks/{api-BAmlf_CN.js → api-BlZDPg1n.js} +5 -5
- package/dist/dev/packages/shared-chunks/{element-builder--iTIJyCB.js → api-C0PAtEgQ.js} +137 -118
- package/dist/dev/packages/shared-chunks/{api-BawZUDYD.js → api-DuLOZMO_.js} +3 -3
- package/dist/dev/packages/shared-chunks/{args-proxy-BNLuRFlO.js → args-proxy-CS5Brs3_.js} +2 -2
- package/dist/dev/packages/shared-chunks/{untouchable-this-B3DVwpHS.js → arguments-CDkbOqTS.js} +230 -230
- package/dist/dev/packages/shared-chunks/{array-Bh_kUjzy.js → array-CVEnNWng.js} +1 -1
- package/dist/dev/packages/shared-chunks/{cache-B7dqAS38.js → cache-DGDPVCpC.js} +1 -2
- package/dist/dev/packages/shared-chunks/{capabilities-CZkuOqqC.js → capabilities-CajW4QjE.js} +1 -1
- package/dist/dev/packages/shared-chunks/{chain-tags-D6tuFUj_.js → chain-tags-uWSImHzB.js} +3 -3
- package/dist/dev/packages/shared-chunks/{computed-CJnghmXC.js → computed-BPCtuOxQ.js} +4 -4
- package/dist/dev/packages/shared-chunks/{curly-BBzF_bI8.js → curly-Ei5G8jhk.js} +4 -4
- package/dist/dev/packages/shared-chunks/{element-DQJOvSlQ.js → element-BYLB-q7a.js} +5 -3
- package/dist/dev/packages/shared-chunks/{flags-B9qxc-pB.js → flags-BZxHQ0yn.js} +1 -1
- package/dist/dev/packages/shared-chunks/{get-D5b5QlqE.js → get-6I3sjd-I.js} +32 -35
- package/dist/{prod/packages/shared-chunks/get_properties-Nn08mLAH.js → dev/packages/shared-chunks/get_properties-Cm2sWt5f.js} +1 -1
- package/dist/dev/packages/shared-chunks/{hash-BRRFQJ99.js → hash-6NDs_5_f.js} +18 -12
- package/dist/dev/packages/shared-chunks/{helper-Do7NCZHI.js → helper-DIj85_-f.js} +21 -9
- package/dist/dev/packages/shared-chunks/{index-CwnQYqK5.js → index-B3pPx1fL.js} +111 -132
- package/dist/dev/packages/shared-chunks/{index-CyZiGiEI.js → index-DaFzpTIE.js} +4 -3
- package/dist/dev/packages/shared-chunks/{injected_property-B4T-FzZZ.js → injected_property-CbBLr5jt.js} +1 -1
- package/dist/dev/packages/shared-chunks/{internal-CAL-jHZt.js → internal-DTOXyEGM.js} +3 -3
- package/dist/dev/packages/shared-chunks/{internal-helper-Ez7zbEIa.js → internal-helper-CKrni0b_.js} +1 -1
- package/dist/dev/packages/shared-chunks/{invoke-B8M5fQQS.js → invoke-d9sqa50M.js} +3 -3
- package/dist/dev/packages/shared-chunks/{libraries-CHBwbR72.js → libraries-DwffpMGE.js} +1 -1
- package/dist/dev/packages/shared-chunks/{meta-BmRXesrk.js → meta-BqC7f9Ia.js} +1 -1
- package/dist/dev/packages/shared-chunks/{or-O0eJQ4K-.js → not-DYh6AY9Z.js} +36 -36
- package/dist/dev/packages/shared-chunks/{observers-C2DurkLG.js → observers-DMlX2nCi.js} +3 -3
- package/dist/dev/packages/shared-chunks/{on-BueSMv9L.js → on-DlF0Wy7P.js} +10 -10
- package/dist/dev/packages/shared-chunks/{program-DzAfcWFj.js → program-DlgjqLa6.js} +1 -1
- package/dist/dev/packages/shared-chunks/{program-context-CadjldRr.js → program-context-Dq8xN2HI.js} +3 -2
- package/dist/dev/packages/shared-chunks/{property_get-CIBS9umw.js → property_get-CRP7MFz_.js} +2 -2
- package/dist/dev/packages/shared-chunks/{property_set-D3PKyisF.js → property_set-qCUylPEK.js} +2 -2
- package/dist/dev/packages/shared-chunks/{reference-BoPB2LfI.js → reference-BqOLhKFy.js} +3 -3
- package/dist/dev/packages/shared-chunks/{rehydrate-builder-DCyIgnCR.js → rehydrate-builder-C6k1XhET.js} +1 -1
- package/dist/dev/packages/shared-chunks/{render-CpKaO-BO.js → render-87_sKZ_k.js} +86 -86
- package/dist/dev/packages/shared-chunks/{rsvp-CnCSY930.js → rsvp.es-DR7yS7qg.js} +150 -154
- package/dist/dev/packages/shared-chunks/{serialize-builder-DxgGRvH_.js → serialize-builder-BlxBjwO-.js} +1 -1
- package/dist/dev/packages/shared-chunks/{set_properties-BghuuGJx.js → set_properties-C4TSebH6.js} +2 -2
- package/dist/dev/packages/shared-chunks/{setup-registry-BC5VMvei.js → setup-registry-9DCmHTFF.js} +18 -18
- package/dist/dev/packages/shared-chunks/{syscall-ops-BPFtDquC.js → syscall-ops-CN7STuUn.js} +1 -1
- package/dist/dev/packages/shared-chunks/{template-only-BqOt8bDl.js → template-only-Cu639ICT.js} +2 -4
- package/dist/dev/packages/shared-chunks/{textarea-WSlUEr0y.js → textarea-C4lYkaHj.js} +11 -7
- package/dist/dev/packages/shared-chunks/{tracked-CKE4wnE6.js → tracked-DEyf0T_X.js} +4 -4
- package/dist/dev/packages/shared-chunks/{tracked-data-CGnA4ytZ.js → tracked-data-DgqqRdYO.js} +2 -2
- package/dist/dev/packages/shared-chunks/{unique-id-CgmHQiwi.js → unique-id-DQOhouG1.js} +2 -2
- package/dist/dev/packages/shared-chunks/{unrecognized-url-error-B3wUTorp.js → unrecognized-url-error-BJHjL30Q.js} +1 -1
- package/dist/prod/packages/@ember/-internals/glimmer/index.js +11 -11
- package/dist/prod/packages/@ember/-internals/metal/index.js +15 -15
- package/dist/prod/packages/@ember/-internals/routing/index.js +3 -3
- package/dist/prod/packages/@ember/-internals/runtime/index.js +1 -1
- package/dist/prod/packages/@ember/-internals/runtime/lib/ext/rsvp.js +1 -1
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +7 -7
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +1 -1
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -3
- package/dist/prod/packages/@ember/-internals/views/lib/mixins/action_support.js +1 -1
- package/dist/prod/packages/@ember/-internals/views/lib/system/event_dispatcher.js +2 -2
- package/dist/prod/packages/@ember/-internals/views/lib/views/core_view.js +1 -1
- package/dist/prod/packages/@ember/application/index.js +5 -6
- package/dist/prod/packages/@ember/application/instance.js +3 -3
- package/dist/prod/packages/@ember/application/namespace.js +1 -1
- package/dist/prod/packages/@ember/array/index.js +11 -58
- package/dist/prod/packages/@ember/array/lib/is-array.js +64 -0
- package/dist/prod/packages/@ember/array/proxy.js +8 -8
- package/dist/prod/packages/@ember/component/helper.js +1 -1
- package/dist/prod/packages/@ember/component/index.js +18 -12
- package/dist/prod/packages/@ember/component/template-only.js +1 -1
- package/dist/prod/packages/@ember/controller/index.js +3 -3
- package/dist/prod/packages/@ember/debug/data-adapter.js +3 -3
- package/dist/prod/packages/@ember/engine/index.js +5 -5
- package/dist/prod/packages/@ember/engine/instance.js +1 -1
- package/dist/prod/packages/@ember/helper/index.js +8 -27
- package/dist/prod/packages/@ember/modifier/index.js +2 -2
- package/dist/prod/packages/@ember/modifier/on.js +1 -1
- package/dist/prod/packages/@ember/object/compat.js +2 -2
- package/dist/prod/packages/@ember/object/computed.js +2 -2
- package/dist/prod/packages/@ember/object/core.js +4 -4
- package/dist/prod/packages/@ember/object/index.js +28 -23
- package/dist/prod/packages/@ember/object/lib/computed/computed_macros.js +4 -4
- package/dist/prod/packages/@ember/object/lib/computed/reduce_computed_macros.js +2 -2
- package/dist/prod/packages/@ember/object/mixin.js +2 -2
- package/dist/prod/packages/@ember/object/observable.js +6 -6
- package/dist/prod/packages/@ember/object/observers.js +1 -1
- package/dist/prod/packages/@ember/object/promise-proxy-mixin.js +3 -3
- package/dist/prod/packages/@ember/reactive/collections.js +153 -153
- package/dist/prod/packages/@ember/renderer/index.js +1 -1
- package/dist/prod/packages/@ember/routing/index.js +12 -8
- package/dist/prod/packages/@ember/routing/lib/generate_controller.js +1 -2
- package/dist/prod/packages/@ember/routing/lib/routing-service.js +4 -4
- package/dist/prod/packages/@ember/routing/lib/utils.js +3 -3
- package/dist/prod/packages/@ember/routing/route.js +11 -11
- package/dist/prod/packages/@ember/routing/router-service.js +24 -17
- package/dist/prod/packages/@ember/routing/router.js +5 -5
- package/dist/prod/packages/@ember/runloop/index.js +1 -1
- package/dist/prod/packages/@ember/service/index.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +3 -3
- package/dist/prod/packages/@ember/template-compiler/lib/template.js +2 -2
- package/dist/prod/packages/@ember/template-factory/index.js +1 -1
- package/dist/prod/packages/@ember/utils/lib/is_empty.js +1 -1
- package/dist/prod/packages/@glimmer/encoder/index.js +1 -1
- package/dist/prod/packages/@glimmer/manager/index.js +4 -4
- package/dist/prod/packages/@glimmer/node/index.js +3 -3
- package/dist/prod/packages/@glimmer/opcode-compiler/index.js +2 -2
- package/dist/prod/packages/@glimmer/program/index.js +8 -8
- package/dist/prod/packages/@glimmer/reference/index.js +4 -4
- package/dist/prod/packages/@glimmer/runtime/index.js +13 -13
- package/dist/prod/packages/@glimmer/tracking/index.js +2 -2
- package/dist/prod/packages/@glimmer/tracking/primitives/cache/index.js +1 -1
- package/dist/prod/packages/@glimmer/util/index.js +2 -2
- package/dist/prod/packages/@glimmer/validator/index.js +3 -3
- package/dist/prod/packages/@glimmer/vm/index.js +1 -1
- package/dist/prod/packages/ember/version.js +1 -1
- package/dist/prod/packages/ember-template-compiler/index.js +2 -2
- package/dist/prod/packages/router_js/index.js +2 -2
- package/dist/prod/packages/rsvp/index.js +2281 -1
- package/dist/prod/packages/shared-chunks/{alias-DBW_V5vD.js → alias-Bod6qdNp.js} +6 -6
- package/dist/prod/packages/shared-chunks/{api-CM1trl_4.js → api-B_poQGXS.js} +5 -5
- package/dist/prod/packages/shared-chunks/{element-builder-CnlTPNyw.js → api-CQexacBn.js} +137 -118
- package/dist/prod/packages/shared-chunks/{api-zh_k31vb.js → api-DlJKfm_f.js} +3 -3
- package/dist/prod/packages/shared-chunks/{args-proxy-BDXbXCF9.js → args-proxy-CCoFtYLS.js} +2 -2
- package/dist/prod/packages/shared-chunks/{debug-render-tree-CF5O4-WI.js → arguments-BzAkZVBa.js} +193 -193
- package/dist/prod/packages/shared-chunks/{array-D6Couewv.js → array-BzReKMeW.js} +1 -1
- package/dist/prod/packages/shared-chunks/{cache-BIlOoPA7.js → cache-CofLhaS4.js} +1 -2
- package/dist/prod/packages/shared-chunks/{capabilities-_5e35539.js → capabilities-BuVYh-vx.js} +1 -1
- package/dist/prod/packages/shared-chunks/{chain-tags-C9rFtQ_x.js → chain-tags-B2J7DsxO.js} +3 -3
- package/dist/prod/packages/shared-chunks/{compiler-c4yUVrl_.js → compiler-lBSssiWp.js} +1 -1
- package/dist/prod/packages/shared-chunks/{computed-DjCIU_ht.js → computed-DtIStxvq.js} +4 -4
- package/dist/prod/packages/shared-chunks/{curly-ZzX43b50.js → curly-IY06zACp.js} +4 -4
- package/dist/prod/packages/shared-chunks/{element-DUOVW5Ho.js → element-DgHdPZ8u.js} +5 -3
- package/dist/prod/packages/shared-chunks/{flags-B9qxc-pB.js → flags-BZxHQ0yn.js} +1 -1
- package/dist/prod/packages/shared-chunks/{get-t0-itmA-.js → get-Dago5uGl.js} +33 -36
- package/dist/{dev/packages/shared-chunks/get_properties-CIm8IAtP.js → prod/packages/shared-chunks/get_properties-Dg3xFpiS.js} +1 -1
- package/dist/prod/packages/shared-chunks/{hash-mcs3pEFO.js → hash-gEXIsSO4.js} +24 -18
- package/dist/prod/packages/shared-chunks/{helper-DLjV2ZZW.js → helper-DkXiTBjc.js} +21 -9
- package/dist/prod/packages/shared-chunks/{index-Bj71BDDA.js → index-Bf53M8eS.js} +5 -4
- package/dist/prod/packages/shared-chunks/{index-qDFz6Mfe.js → index-CslMfEpb.js} +110 -131
- package/dist/prod/packages/shared-chunks/{injected_property--eJunJph.js → injected_property-Y-FadDej.js} +1 -1
- package/dist/prod/packages/shared-chunks/{internal-DidurjJB.js → internal-BQ7zHrqS.js} +3 -3
- package/dist/prod/packages/shared-chunks/{internal-helper-DIbr1RgC.js → internal-helper-Bz1lpDXr.js} +1 -1
- package/dist/prod/packages/shared-chunks/{invoke-Cj5zMqHz.js → invoke-DhQ5QRp2.js} +3 -3
- package/dist/prod/packages/shared-chunks/{libraries-_k-4KK5_.js → libraries-DBql0hdn.js} +1 -1
- package/dist/prod/packages/shared-chunks/{meta-B9mldqPL.js → meta-BJtIZDir.js} +1 -1
- package/dist/prod/packages/shared-chunks/{normalize-D9jDJVGg.js → normalize-C_IStty9.js} +1 -1
- package/dist/prod/packages/shared-chunks/{or-3AxY5TPj.js → not-BOIVROuv.js} +28 -28
- package/dist/prod/packages/shared-chunks/{observers-CDkeR0nI.js → observers-BmobpXAF.js} +3 -3
- package/dist/prod/packages/shared-chunks/{on-B5NVufs_.js → on-BZHAxzdq.js} +10 -10
- package/dist/prod/packages/shared-chunks/{program-B7CWdS8W.js → program-BAh__OXZ.js} +2 -2
- package/dist/prod/packages/shared-chunks/{program-context-B8HKU7wu.js → program-context-COSioH46.js} +3 -2
- package/dist/prod/packages/shared-chunks/{property_get-CAFdpRyu.js → property_get-DAKgbeJX.js} +2 -2
- package/dist/prod/packages/shared-chunks/{property_set-BunbMFtp.js → property_set-BaQJdVfS.js} +2 -2
- package/dist/prod/packages/shared-chunks/{reference-BshxG6wn.js → reference-CG0yPgLy.js} +3 -3
- package/dist/prod/packages/shared-chunks/{rehydrate-builder-DJ8k-6fg.js → rehydrate-builder-Blt1x9MP.js} +3 -3
- package/dist/prod/packages/shared-chunks/{render-DkJJmoI4.js → render-Dx7lr1hR.js} +88 -88
- package/dist/prod/packages/shared-chunks/{rsvp-CnCSY930.js → rsvp.es-DR7yS7qg.js} +150 -154
- package/dist/prod/packages/shared-chunks/{serialize-builder-R3Ozg0sC.js → serialize-builder-BvAXYHTr.js} +2 -2
- package/dist/prod/packages/shared-chunks/{set_properties-LT3RzRmJ.js → set_properties-Qxhw4qzw.js} +2 -2
- package/dist/prod/packages/shared-chunks/{setup-registry-C2KfZJWI.js → setup-registry-U-6VaNQG.js} +18 -18
- package/dist/prod/packages/shared-chunks/{syscall-ops-BPFtDquC.js → syscall-ops-CN7STuUn.js} +1 -1
- package/dist/prod/packages/shared-chunks/{template-only-BtLl0uH0.js → template-only-DKNcKM5b.js} +2 -4
- package/dist/prod/packages/shared-chunks/{textarea-CHqL0Rdh.js → textarea-DOmZ1x0E.js} +11 -7
- package/dist/prod/packages/shared-chunks/{tracked-DAVrVqJl.js → tracked-B9380JtC.js} +4 -4
- package/dist/prod/packages/shared-chunks/{tracked-data-C83f5V5S.js → tracked-data-CHq42QHb.js} +2 -2
- package/dist/prod/packages/shared-chunks/{unique-id-CfHImDRV.js → unique-id-o2pS74go.js} +2 -2
- package/dist/prod/packages/shared-chunks/{unrecognized-url-error-DDBwfzdm.js → unrecognized-url-error-EgNrnFu_.js} +1 -1
- package/docs/data.json +316 -334
- package/package.json +6 -4
- package/types/stable/@ember/-internals/glimmer/index.d.ts +165 -121
- 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.d.ts +8 -2
- package/types/stable/@ember/-internals/glimmer/lib/glimmer-tracking-docs.d.ts +12 -12
- package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +18 -6
- package/types/stable/@ember/-internals/glimmer/lib/helpers/array.d.ts +3 -1
- package/types/stable/@ember/-internals/glimmer/lib/helpers/component.d.ts +65 -121
- package/types/stable/@ember/-internals/glimmer/lib/helpers/concat.d.ts +8 -4
- package/types/stable/@ember/-internals/glimmer/lib/helpers/each-in.d.ts +16 -14
- package/types/stable/@ember/-internals/glimmer/lib/helpers/element.d.ts +2 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/fn.d.ts +11 -7
- package/types/stable/@ember/-internals/glimmer/lib/helpers/get.d.ts +23 -29
- package/types/stable/@ember/-internals/glimmer/lib/helpers/hash.d.ts +3 -1
- package/types/stable/@ember/-internals/glimmer/lib/helpers/if-unless.d.ts +95 -49
- package/types/stable/@ember/-internals/glimmer/lib/helpers/mut.d.ts +23 -54
- package/types/stable/@ember/-internals/glimmer/lib/helpers/page-title.d.ts +6 -2
- package/types/stable/@ember/-internals/glimmer/lib/helpers/readonly.d.ts +4 -8
- package/types/stable/@ember/-internals/glimmer/lib/modifiers/on.d.ts +10 -10
- package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +1 -2
- package/types/stable/@ember/-internals/glimmer/lib/syntax/in-element.d.ts +2 -0
- package/types/stable/@ember/-internals/glimmer/lib/syntax/let.d.ts +2 -14
- package/types/stable/@ember/-internals/glimmer/lib/syntax/mount.d.ts +15 -11
- package/types/stable/@ember/-internals/glimmer/lib/syntax/outlet.d.ts +17 -10
- package/types/stable/@ember/-internals/runtime/lib/mixins/target_action_support.d.ts +1 -1
- package/types/stable/@ember/array/index.d.ts +6 -29
- package/types/stable/@ember/array/lib/is-array.d.ts +35 -0
- package/types/stable/@ember/component/template-only.d.ts +1 -3
- package/types/stable/@ember/controller/index.d.ts +1 -1
- package/types/stable/@ember/helper/index.d.ts +0 -19
- package/types/stable/@ember/object/index.d.ts +4 -3
- package/types/stable/@ember/object/observable.d.ts +4 -0
- package/types/stable/@ember/reactive/collections.d.ts +0 -6
- package/types/stable/@ember/routing/lib/generate_controller.d.ts +1 -1
- package/types/stable/@ember/routing/route.d.ts +2 -2
- package/types/stable/@ember/routing/router-service.d.ts +20 -12
- package/types/stable/@glimmer/runtime/lib/component/template-only.d.ts +0 -2
- package/types/stable/@glimmer/runtime/lib/dom/sanitized-values.d.ts +2 -2
- package/types/stable/@glimmer/runtime/lib/helpers/array.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/helpers/concat.d.ts +8 -3
- package/types/stable/@glimmer/runtime/lib/helpers/fn.d.ts +13 -7
- package/types/stable/@glimmer/runtime/lib/helpers/get.d.ts +21 -29
- package/types/stable/@glimmer/runtime/lib/helpers/hash.d.ts +1 -1
- package/types/stable/@glimmer/syntax/lib/get-template-locals.d.ts +1 -1
- package/types/stable/@glimmer/tracking/index.d.ts +12 -12
- package/types/stable/index.d.ts +1 -0
- package/dist/prod/packages/shared-chunks/{collections-C3Y8z_9v.js → collections-GpG8lT2g.js} +9 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as reifyPositional } from './
|
|
3
|
-
import { i as internalHelper } from './hash-
|
|
1
|
+
import { c as createComputeRef, U as UNDEFINED_REFERENCE, v as valueForRef } from './reference-BqOLhKFy.js';
|
|
2
|
+
import { f as reifyPositional } from './arguments-CDkbOqTS.js';
|
|
3
|
+
import { i as internalHelper } from './hash-6NDs_5_f.js';
|
|
4
4
|
import { setPath, getPath } from '../@glimmer/global-context/index.js';
|
|
5
5
|
import { i as isDict } from './collections-DPkjqeA3.js';
|
|
6
6
|
|
|
@@ -19,10 +19,15 @@ const normalizeTextValue = value => {
|
|
|
19
19
|
|
|
20
20
|
Example:
|
|
21
21
|
|
|
22
|
-
```handlebars
|
|
23
|
-
{{some-component name=(concat firstName " " lastName)}}
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
```gjs
|
|
24
|
+
import { concat } from '@ember/helper';
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
{{yield (concat firstName " " lastName)}}
|
|
28
|
+
|
|
29
|
+
{{! would yield name="<first name value> <last name value>" to the component}}
|
|
30
|
+
</template>
|
|
26
31
|
```
|
|
27
32
|
|
|
28
33
|
or for angle bracket invocation, you actually don't need concat at all.
|
|
@@ -46,28 +51,31 @@ const concat = internalHelper(({
|
|
|
46
51
|
|
|
47
52
|
For example, these two usages are equivalent:
|
|
48
53
|
|
|
49
|
-
```app/components/developer-detail.
|
|
54
|
+
```app/components/developer-detail.gjs
|
|
50
55
|
import Component from '@glimmer/component';
|
|
51
56
|
import { tracked } from '@glimmer/tracking';
|
|
57
|
+
import { get } from '@ember/object';
|
|
52
58
|
|
|
53
59
|
export default class extends Component {
|
|
54
60
|
@tracked developer = {
|
|
55
61
|
name: "Sandi Metz",
|
|
56
62
|
language: "Ruby"
|
|
57
63
|
}
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
{{this.developer.name}}
|
|
67
|
+
{{get this.developer "name"}}
|
|
68
|
+
</template>
|
|
58
69
|
}
|
|
59
70
|
```
|
|
60
71
|
|
|
61
|
-
```handlebars
|
|
62
|
-
{{this.developer.name}}
|
|
63
|
-
{{get this.developer "name"}}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
72
|
If there were several facts about a person, the `{{get}}` helper can dynamically
|
|
67
73
|
pick one:
|
|
68
74
|
|
|
69
|
-
```app/templates/application.
|
|
70
|
-
<
|
|
75
|
+
```app/templates/application.gjs
|
|
76
|
+
<template>
|
|
77
|
+
<DeveloperDetail @factName="language" />
|
|
78
|
+
</template>
|
|
71
79
|
```
|
|
72
80
|
|
|
73
81
|
```handlebars
|
|
@@ -77,10 +85,11 @@ const concat = internalHelper(({
|
|
|
77
85
|
For a more complex example, this template would allow the user to switch
|
|
78
86
|
between showing the user's height and weight with a click:
|
|
79
87
|
|
|
80
|
-
```app/components/developer-detail.
|
|
88
|
+
```app/components/developer-detail.gjs
|
|
81
89
|
import Component from '@glimmer/component';
|
|
82
90
|
import { tracked } from '@glimmer/tracking';
|
|
83
|
-
|
|
91
|
+
import { get } from '@ember/object';
|
|
92
|
+
|
|
84
93
|
export default class extends Component {
|
|
85
94
|
@tracked developer = {
|
|
86
95
|
name: "Sandi Metz",
|
|
@@ -92,28 +101,16 @@ const concat = internalHelper(({
|
|
|
92
101
|
showFact = (fact) => {
|
|
93
102
|
this.currentFact = fact;
|
|
94
103
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```app/components/developer-detail.js
|
|
99
|
-
{{get this.developer this.currentFact}}
|
|
100
|
-
|
|
101
|
-
<button {{on 'click' (fn this.showFact "name")}}>Show name</button>
|
|
102
|
-
<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
|
|
103
|
-
```
|
|
104
|
+
|
|
105
|
+
<template>
|
|
106
|
+
{{get this.developer this.currentFact}}
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<button {{on 'click' (fn this.showFact "name")}}>Show name</button>
|
|
111
|
-
<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
|
|
108
|
+
<button {{on 'click' (fn this.showFact "name")}}>Show name</button>
|
|
109
|
+
<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
|
|
110
|
+
</template>
|
|
111
|
+
}
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
Would allow the user to swap what fact is being displayed, and also edit
|
|
115
|
-
that fact via a two-way mutable binding.
|
|
116
|
-
|
|
117
114
|
@public
|
|
118
115
|
@method get
|
|
119
116
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as reifyPositional, g as buildUntouchableThis, h as check, e as reifyNamed } from './
|
|
3
|
-
import { j as setInternalHelperManager } from './api-
|
|
1
|
+
import { c as createComputeRef, b as isInvokableRef, u as updateRef, v as valueForRef } from './reference-BqOLhKFy.js';
|
|
2
|
+
import { f as reifyPositional, g as buildUntouchableThis, h as check, e as reifyNamed } from './arguments-CDkbOqTS.js';
|
|
3
|
+
import { j as setInternalHelperManager } from './api-DuLOZMO_.js';
|
|
4
4
|
|
|
5
5
|
function internalHelper(helper) {
|
|
6
6
|
return setInternalHelperManager(helper, {});
|
|
@@ -19,7 +19,7 @@ function internalHelper(helper) {
|
|
|
19
19
|
```
|
|
20
20
|
or
|
|
21
21
|
```handlebars
|
|
22
|
-
{{
|
|
22
|
+
{{yield people=(array
|
|
23
23
|
'Tom Dale'
|
|
24
24
|
'Yehuda Katz'
|
|
25
25
|
this.myOtherPerson)
|
|
@@ -58,13 +58,17 @@ const context = buildUntouchableThis('`fn` helper');
|
|
|
58
58
|
to a component invoked within the loop. Here's how you could use the `fn`
|
|
59
59
|
helper to pass both the function and its arguments together:
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
```app/components/items-listing.gjs
|
|
62
|
+
import DisplayItem from './display-item';
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
{{#each @items as |item|}}
|
|
66
|
+
<DisplayItem @item=item @select={{fn this.handleSelected item}} />
|
|
67
|
+
{{/each}}
|
|
68
|
+
</template>
|
|
65
69
|
```
|
|
66
70
|
|
|
67
|
-
```app/components/items-list.
|
|
71
|
+
```app/components/items-list.gjs
|
|
68
72
|
import Component from '@glimmer/component';
|
|
69
73
|
import { action } from '@ember/object';
|
|
70
74
|
|
|
@@ -75,7 +79,7 @@ const context = buildUntouchableThis('`fn` helper');
|
|
|
75
79
|
}
|
|
76
80
|
```
|
|
77
81
|
|
|
78
|
-
In this case the `
|
|
82
|
+
In this case the `DisplayItem` component will receive a normal function
|
|
79
83
|
that it can invoke. When it invokes the function, the `handleSelected`
|
|
80
84
|
function will receive the `item` and any arguments passed, thanks to the
|
|
81
85
|
`fn` helper.
|
|
@@ -92,7 +96,7 @@ const context = buildUntouchableThis('`fn` helper');
|
|
|
92
96
|
`handleSelected` is properly bound to the `items-list`, but let's explore what
|
|
93
97
|
happens if we left out the arrow function:
|
|
94
98
|
|
|
95
|
-
```app/components/items-list.
|
|
99
|
+
```app/components/items-list.gjs
|
|
96
100
|
import Component from '@glimmer/component';
|
|
97
101
|
|
|
98
102
|
export default class ItemsList extends Component {
|
|
@@ -109,6 +113,8 @@ const context = buildUntouchableThis('`fn` helper');
|
|
|
109
113
|
|
|
110
114
|
See also [partial application](https://en.wikipedia.org/wiki/Partial_application).
|
|
111
115
|
|
|
116
|
+
`fn` is built-in and does not require any additional imports.
|
|
117
|
+
|
|
112
118
|
@method fn
|
|
113
119
|
@public
|
|
114
120
|
*/
|
|
@@ -138,7 +144,7 @@ function assertCallbackIsFn(callbackRef) {
|
|
|
138
144
|
|
|
139
145
|
/**
|
|
140
146
|
Use the `{{hash}}` helper to create a hash to pass as an option to your
|
|
141
|
-
components. This is
|
|
147
|
+
components. This is especially useful for contextual components where you can
|
|
142
148
|
just yield a hash:
|
|
143
149
|
|
|
144
150
|
```handlebars
|
|
@@ -3,9 +3,9 @@ import { FrameworkObject } from '../@ember/object/-internals.js';
|
|
|
3
3
|
import { g as getDebugName } from './get-debug-name-CSniHBsn.js';
|
|
4
4
|
import '../@ember/debug/index.js';
|
|
5
5
|
import { join } from '../@ember/runloop/index.js';
|
|
6
|
-
import { a as getInternalHelperManager, i as helperCapabilities } from './api-
|
|
7
|
-
import { b as setHelperManager } from './api-
|
|
8
|
-
import {
|
|
6
|
+
import { a as getInternalHelperManager, i as helperCapabilities } from './api-DuLOZMO_.js';
|
|
7
|
+
import { b as setHelperManager } from './api-BlZDPg1n.js';
|
|
8
|
+
import { r as createTag, D as DIRTY_TAG, c as consumeTag } from './cache-DGDPVCpC.js';
|
|
9
9
|
import { assert } from '../@ember/debug/lib/assert.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -29,20 +29,32 @@ const IS_CLASSIC_HELPER = Symbol('IS_CLASSIC_HELPER');
|
|
|
29
29
|
Ember Helpers are functions that can compute values, and are used in templates.
|
|
30
30
|
For example, this code calls a helper named `format-currency`:
|
|
31
31
|
|
|
32
|
-
```app/templates/application.
|
|
33
|
-
|
|
32
|
+
```app/templates/application.gjs
|
|
33
|
+
import Cost from '../components/cost';
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<Cost @cents={{230}} />
|
|
37
|
+
</template>
|
|
34
38
|
```
|
|
35
39
|
|
|
36
|
-
```app/components/cost.
|
|
37
|
-
|
|
40
|
+
```app/components/cost.gjs
|
|
41
|
+
import formatCurrency from '../helpers/format-currency';
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<div>{{formatCurrency @cents currency="$"}}</div>
|
|
45
|
+
</template>
|
|
38
46
|
```
|
|
39
47
|
|
|
40
48
|
Additionally a helper can be called as a nested helper.
|
|
41
49
|
In this example, we show the formatted currency value if the `showMoney`
|
|
42
50
|
named argument is truthy.
|
|
43
51
|
|
|
44
|
-
```
|
|
45
|
-
|
|
52
|
+
```gjs
|
|
53
|
+
import formatCurrency from '../helpers/format-currency';
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
{{if @showMoney (formatCurrency @cents currency="$")}}
|
|
57
|
+
</template>
|
|
46
58
|
```
|
|
47
59
|
|
|
48
60
|
Helpers defined using a class must provide a `compute` function. For example:
|
|
@@ -7,49 +7,44 @@ import { deprecate, warn } from '../@ember/debug/index.js';
|
|
|
7
7
|
import { schedule, _backburner, _getCurrentRunLoop } from '../@ember/runloop/index.js';
|
|
8
8
|
import { associateDestroyableChild, isDestroyed, destroy, registerDestructor, isDestroying } from '../@glimmer/destroyable/index.js';
|
|
9
9
|
import { artifacts } from '../@glimmer/program/index.js';
|
|
10
|
-
import { R as RuntimeOpImpl } from './program-
|
|
11
|
-
import { v as valueForRef, U as UNDEFINED_REFERENCE,
|
|
12
|
-
import { c as clientBuilder } from './
|
|
13
|
-
import { E as EMPTY_ARGS, c as createCapturedArgs, b as EMPTY_POSITIONAL, d as curry } from './
|
|
14
|
-
import { g as runtimeOptions, i as inTransaction, r as renderComponent$1, d as renderMain } from './render-
|
|
10
|
+
import { R as RuntimeOpImpl } from './program-DlgjqLa6.js';
|
|
11
|
+
import { v as valueForRef, U as UNDEFINED_REFERENCE, c as createComputeRef, i as isConstRef, a as createConstRef, d as isUpdatableRef, j as createInvokableRef, k as createReadOnlyRef, l as createUnboundRef, h as createDebugAliasRef, g as childRefFromParts, u as updateRef } from './reference-BqOLhKFy.js';
|
|
12
|
+
import { c as clientBuilder } from './api-C0PAtEgQ.js';
|
|
13
|
+
import { E as EMPTY_ARGS, c as createCapturedArgs, b as EMPTY_POSITIONAL, d as curry } from './arguments-CDkbOqTS.js';
|
|
14
|
+
import { g as runtimeOptions, i as inTransaction, r as renderComponent$1, d as renderMain } from './render-87_sKZ_k.js';
|
|
15
15
|
import { d as dict } from './collections-DPkjqeA3.js';
|
|
16
|
-
import { u as unwrapTemplate, a as CurlyComponentManager, i as initialRenderInstrumentDetails, p as processComponentInitializationAssertions, b as ComponentStateBucket, D as DIRTY_TAG, c as isCurlyManager, B as BOUNDS } from './curly-
|
|
17
|
-
import {
|
|
18
|
-
import { a as RSVP } from './rsvp-CnCSY930.js';
|
|
16
|
+
import { u as unwrapTemplate, a as CurlyComponentManager, i as initialRenderInstrumentDetails, p as processComponentInitializationAssertions, b as ComponentStateBucket, D as DIRTY_TAG, c as isCurlyManager, B as BOUNDS } from './curly-Ei5G8jhk.js';
|
|
17
|
+
import { C as CONSTANT_TAG, c as consumeTag, z as isTracking, e as debug, D as DIRTY_TAG$1, r as createTag, a as valueForTag, k as CURRENT_TAG, v as validateTag } from './cache-DGDPVCpC.js';
|
|
19
18
|
import { h as hasDOM } from './index-BGP1rw3B.js';
|
|
20
|
-
import EngineInstance from '../@ember/engine/instance.js';
|
|
21
19
|
import { _instrumentStart } from '../@ember/instrumentation/index.js';
|
|
22
|
-
import { c as capabilityFlagsFrom } from './capabilities-
|
|
23
|
-
import { t as templateFactory } from './index-
|
|
20
|
+
import { c as capabilityFlagsFrom } from './capabilities-CajW4QjE.js';
|
|
21
|
+
import { t as templateFactory } from './index-DaFzpTIE.js';
|
|
24
22
|
import { assert } from '../@ember/debug/lib/assert.js';
|
|
25
23
|
import { g as getFactoryFor } from './container-BzzHmCNj.js';
|
|
26
|
-
import { g as get, b as _getProp } from './property_get-
|
|
27
|
-
import { _ as _setProp, s as set } from './property_set-
|
|
24
|
+
import { g as get, b as _getProp } from './property_get-CRP7MFz_.js';
|
|
25
|
+
import { _ as _setProp, s as set } from './property_set-qCUylPEK.js';
|
|
28
26
|
import { g as getDebugName } from './get-debug-name-CSniHBsn.js';
|
|
29
27
|
import setGlobalContext from '../@glimmer/global-context/index.js';
|
|
30
|
-
import { t as tagForObject, o as objectAt, a as tagForProperty } from './chain-tags-
|
|
28
|
+
import { t as tagForObject, o as objectAt, a as tagForProperty } from './chain-tags-uWSImHzB.js';
|
|
31
29
|
import { isEmberArray } from '../@ember/array/-internals.js';
|
|
32
30
|
import { i as isObject } from './spec-BXl1reqK.js';
|
|
33
|
-
import { t as tagFor } from './meta-
|
|
31
|
+
import { t as tagFor } from './meta-BqC7f9Ia.js';
|
|
34
32
|
import { contentFor } from '../@ember/-internals/runtime/lib/mixins/-proxy.js';
|
|
35
33
|
import { i as isProxy } from './is_proxy-Bzg0d4m4.js';
|
|
36
|
-
import { i as internalHelper } from './internal-helper-
|
|
34
|
+
import { i as internalHelper } from './internal-helper-CKrni0b_.js';
|
|
37
35
|
import { i as isHTMLSafe } from './index-D-xTBV4B.js';
|
|
38
|
-
import
|
|
36
|
+
import isArray from '../@ember/array/lib/is-array.js';
|
|
39
37
|
import { g as getComponentTemplate } from './template-R_5UMHhb.js';
|
|
40
|
-
import { c as hasInternalComponentManager, j as setInternalHelperManager, g as getInternalComponentManager } from './api-
|
|
41
|
-
import { h as hash, f as fn, a as array } from './hash-
|
|
42
|
-
import { g as get$1, c as concat } from './get-
|
|
43
|
-
import { o as on } from './on-
|
|
44
|
-
import { T as TEMPLATE_ONLY_COMPONENT_MANAGER, t as templateOnlyComponent } from './template-only-
|
|
45
|
-
import { i as isClassicHelper, C as CLASSIC_HELPER_MANAGER } from './helper-
|
|
38
|
+
import { c as hasInternalComponentManager, j as setInternalHelperManager, g as getInternalComponentManager } from './api-DuLOZMO_.js';
|
|
39
|
+
import { h as hash, f as fn, a as array } from './hash-6NDs_5_f.js';
|
|
40
|
+
import { g as get$1, c as concat } from './get-6I3sjd-I.js';
|
|
41
|
+
import { o as on } from './on-DlF0Wy7P.js';
|
|
42
|
+
import { T as TEMPLATE_ONLY_COMPONENT_MANAGER, t as templateOnlyComponent } from './template-only-Cu639ICT.js';
|
|
43
|
+
import { i as isClassicHelper, C as CLASSIC_HELPER_MANAGER } from './helper-DIj85_-f.js';
|
|
46
44
|
import { dasherize } from '../@ember/-internals/string/index.js';
|
|
47
|
-
import { a as uniqueId } from './unique-id-
|
|
48
|
-
import '../route-recognizer/index.js';
|
|
49
|
-
import './unrecognized-url-error-B3wUTorp.js';
|
|
50
|
-
import '../@ember/routing/lib/routing-service.js';
|
|
45
|
+
import { a as uniqueId } from './unique-id-DQOhouG1.js';
|
|
51
46
|
import { generateControllerFactory } from '../@ember/routing/lib/generate_controller.js';
|
|
52
|
-
import { E as EvaluationContextImpl } from './program-context-
|
|
47
|
+
import { E as EvaluationContextImpl } from './program-context-Dq8xN2HI.js';
|
|
53
48
|
|
|
54
49
|
function instrumentationPayload$1(def) {
|
|
55
50
|
// "main" used to be the outlet name, keeping it around for compatibility
|
|
@@ -92,14 +87,15 @@ class OutletComponentManager {
|
|
|
92
87
|
let currentState = valueForRef(currentStateRef);
|
|
93
88
|
let currentOwner = currentState?.render?.owner;
|
|
94
89
|
if (parentOwner && parentOwner !== currentOwner) {
|
|
95
|
-
(!(currentOwner
|
|
90
|
+
(!(currentOwner != null && 'buildChildEngineInstance' in currentOwner) && assert('Expected currentOwner to be an EngineInstance', currentOwner != null && 'buildChildEngineInstance' in currentOwner));
|
|
91
|
+
let engineInstance = currentOwner;
|
|
96
92
|
let {
|
|
97
93
|
mountPoint
|
|
98
|
-
} =
|
|
94
|
+
} = engineInstance;
|
|
99
95
|
if (mountPoint) {
|
|
100
96
|
state.engine = {
|
|
101
97
|
mountPoint,
|
|
102
|
-
instance:
|
|
98
|
+
instance: engineInstance
|
|
103
99
|
};
|
|
104
100
|
}
|
|
105
101
|
}
|
|
@@ -246,7 +242,7 @@ class RootComponentDefinition {
|
|
|
246
242
|
*/
|
|
247
243
|
|
|
248
244
|
/**
|
|
249
|
-
The `{{#each}}`
|
|
245
|
+
The `{{#each}}` keyword loops over elements in a collection. It is an extension
|
|
250
246
|
of the base Handlebars `{{#each}}` helper.
|
|
251
247
|
|
|
252
248
|
The default behavior of `{{#each}}` is to yield its inner block once for every
|
|
@@ -290,6 +286,8 @@ class RootComponentDefinition {
|
|
|
290
286
|
{{/each}}
|
|
291
287
|
</ul>
|
|
292
288
|
```
|
|
289
|
+
|
|
290
|
+
`#each` is a keyword and does not need to be imported.
|
|
293
291
|
|
|
294
292
|
### Specifying Keys
|
|
295
293
|
|
|
@@ -357,11 +355,11 @@ class RootComponentDefinition {
|
|
|
357
355
|
*/
|
|
358
356
|
|
|
359
357
|
/**
|
|
360
|
-
The `{{each-in}}`
|
|
358
|
+
The `{{#each-in}}` keyword loops over properties on an object.
|
|
361
359
|
|
|
362
360
|
For example, given this component definition:
|
|
363
361
|
|
|
364
|
-
```app/components/developer-details.
|
|
362
|
+
```app/components/developer-details.gjs
|
|
365
363
|
import Component from '@glimmer/component';
|
|
366
364
|
import { tracked } from '@glimmer/tracking';
|
|
367
365
|
|
|
@@ -370,21 +368,19 @@ class RootComponentDefinition {
|
|
|
370
368
|
"name": "Shelly Sails",
|
|
371
369
|
"age": 42
|
|
372
370
|
};
|
|
371
|
+
|
|
372
|
+
<template>
|
|
373
|
+
<ul>
|
|
374
|
+
{{#each-in this.developer as |key value|}}
|
|
375
|
+
<li>{{key}}: {{value}}</li>
|
|
376
|
+
{{/each-in}}
|
|
377
|
+
</ul>
|
|
378
|
+
</template>
|
|
373
379
|
}
|
|
374
380
|
```
|
|
375
381
|
|
|
376
382
|
This template would display all properties on the `developer`
|
|
377
|
-
object in a list:
|
|
378
|
-
|
|
379
|
-
```app/components/developer-details.hbs
|
|
380
|
-
<ul>
|
|
381
|
-
{{#each-in this.developer as |key value|}}
|
|
382
|
-
<li>{{key}}: {{value}}</li>
|
|
383
|
-
{{/each-in}}
|
|
384
|
-
</ul>
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
Outputting their name and age:
|
|
383
|
+
object in a list, outputting their name and age:
|
|
388
384
|
|
|
389
385
|
```html
|
|
390
386
|
<ul>
|
|
@@ -392,6 +388,8 @@ class RootComponentDefinition {
|
|
|
392
388
|
<li>age: 42</li>
|
|
393
389
|
</ul>
|
|
394
390
|
```
|
|
391
|
+
|
|
392
|
+
`#each-in` is a keyword and does not need to be imported.
|
|
395
393
|
|
|
396
394
|
@method each-in
|
|
397
395
|
@for Ember.Templates.helpers
|
|
@@ -861,73 +859,42 @@ const trackArray = internalHelper(({
|
|
|
861
859
|
*/
|
|
862
860
|
|
|
863
861
|
/**
|
|
864
|
-
The `mut` helper
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
862
|
+
The `mut` helper is a shortcut for updating for args.
|
|
863
|
+
|
|
864
|
+
However, defining update functions on your backing class is preferable to using `mut`.
|
|
865
|
+
|
|
866
|
+
More directly: Don't use `mut`.
|
|
868
867
|
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
or
|
|
874
|
-
|
|
875
|
-
```handlebars
|
|
876
|
-
{{my-child childClickCount=(mut totalClicks)}}
|
|
877
|
-
```
|
|
878
|
-
|
|
879
|
-
The child `Component` can then modify the parent's value just by modifying its own
|
|
880
|
-
property:
|
|
881
|
-
|
|
882
|
-
```javascript
|
|
883
|
-
// my-child.js
|
|
884
|
-
export default class MyChild extends Component {
|
|
885
|
-
click() {
|
|
886
|
-
this.incrementProperty('childClickCount');
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
```
|
|
890
|
-
|
|
891
|
-
Note that for curly components (`{{my-component}}`) the bindings are already mutable,
|
|
892
|
-
making the `mut` unnecessary.
|
|
893
|
-
|
|
894
|
-
Additionally, the `mut` helper can be combined with the `fn` helper to
|
|
895
|
-
mutate a value. For example:
|
|
896
|
-
|
|
897
|
-
```handlebars
|
|
898
|
-
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
|
|
899
|
-
```
|
|
900
|
-
|
|
901
|
-
or
|
|
868
|
+
The `mut` helper, when used with `fn`, will return a function that
|
|
869
|
+
sets the value passed to `mut` to its first argument. As an example, we can create a
|
|
870
|
+
button that increments a value passing the value directly to the `fn`:
|
|
902
871
|
|
|
903
872
|
```handlebars
|
|
904
|
-
|
|
873
|
+
<MyChild @childClickCount={{this.totalClicks}} @clickCountChange={{fn (mut this.totalClicks)}} />
|
|
905
874
|
```
|
|
906
875
|
|
|
907
|
-
The child `Component` would invoke the function with the new click
|
|
876
|
+
The child `Component` would invoke the function with the new click count:
|
|
908
877
|
|
|
909
|
-
```
|
|
910
|
-
|
|
878
|
+
```app/components/my-child.gjs
|
|
879
|
+
import Component from '@glimmer/component';
|
|
880
|
+
import { action } from '@ember/object';
|
|
881
|
+
|
|
911
882
|
export default class MyChild extends Component {
|
|
912
|
-
|
|
913
|
-
|
|
883
|
+
@action
|
|
884
|
+
update() {
|
|
885
|
+
this.args.clickCountChange(this.args.childClickCount + 1);
|
|
914
886
|
}
|
|
887
|
+
|
|
888
|
+
<template>
|
|
889
|
+
<button {{on "click" this.update}}>
|
|
890
|
+
Click me!
|
|
891
|
+
</button>
|
|
892
|
+
</template>
|
|
915
893
|
}
|
|
916
894
|
```
|
|
917
895
|
|
|
918
896
|
The `mut` helper changes the `totalClicks` value to what was provided as the `fn` argument.
|
|
919
897
|
|
|
920
|
-
The `mut` helper, when used with `fn`, will return a function that
|
|
921
|
-
sets the value passed to `mut` to its first argument. As an example, we can create a
|
|
922
|
-
button that increments a value passing the value directly to the `fn`:
|
|
923
|
-
|
|
924
|
-
```handlebars
|
|
925
|
-
{{! inc helper is not provided by Ember }}
|
|
926
|
-
<button onclick={{fn (mut count) (inc count)}}>
|
|
927
|
-
Increment count
|
|
928
|
-
</button>
|
|
929
|
-
```
|
|
930
|
-
|
|
931
898
|
@method mut
|
|
932
899
|
@param {Object} [attr] the "two-way" attribute that can be modified.
|
|
933
900
|
@for Ember.Templates.helpers
|
|
@@ -962,6 +929,10 @@ const mut = internalHelper(({
|
|
|
962
929
|
/**
|
|
963
930
|
The `readonly` helper let's you specify that a binding is one-way only,
|
|
964
931
|
instead of two-way.
|
|
932
|
+
|
|
933
|
+
This is a vestigial helper from the days of `@ember/component` and does not apply to
|
|
934
|
+
components extending from `@glimmer/component`.
|
|
935
|
+
|
|
965
936
|
When you pass a `readonly` binding from an outer context (e.g. parent component),
|
|
966
937
|
to to an inner context (e.g. child component), you are saying that changing that
|
|
967
938
|
property in the inner context does not change the value in the outer context.
|
|
@@ -974,14 +945,6 @@ const mut = internalHelper(({
|
|
|
974
945
|
}
|
|
975
946
|
```
|
|
976
947
|
|
|
977
|
-
```app/templates/components/my-parent.hbs
|
|
978
|
-
{{log totalClicks}} // -> 3
|
|
979
|
-
<MyChild @childClickCount={{readonly totalClicks}} />
|
|
980
|
-
```
|
|
981
|
-
```
|
|
982
|
-
{{my-child childClickCount=(readonly totalClicks)}}
|
|
983
|
-
```
|
|
984
|
-
|
|
985
948
|
Now, when you update `childClickCount`:
|
|
986
949
|
|
|
987
950
|
```app/components/my-child.js
|
|
@@ -1156,7 +1119,7 @@ class MountManager {
|
|
|
1156
1119
|
// mount is a runtime helper, this shouldn't use dynamic layout
|
|
1157
1120
|
// we should resolve the engine app template in the helper
|
|
1158
1121
|
// it also should use the owner that looked up the mount helper.
|
|
1159
|
-
(!(
|
|
1122
|
+
(!('buildChildEngineInstance' in owner) && assert('Expected owner to be an EngineInstance', 'buildChildEngineInstance' in owner));
|
|
1160
1123
|
let engine = owner.buildChildEngineInstance(name);
|
|
1161
1124
|
engine.boot();
|
|
1162
1125
|
let applicationFactory = engine.factoryFor(`controller:application`);
|
|
@@ -1265,15 +1228,14 @@ class MountDefinition {
|
|
|
1265
1228
|
|
|
1266
1229
|
For example, the following template mounts the `ember-chat` engine:
|
|
1267
1230
|
|
|
1268
|
-
```
|
|
1269
|
-
{{! application.hbs }}
|
|
1231
|
+
```app/templates/application.gjs
|
|
1270
1232
|
{{mount "ember-chat"}}
|
|
1271
1233
|
```
|
|
1272
1234
|
|
|
1273
1235
|
Additionally, you can also pass in a `model` argument that will be
|
|
1274
1236
|
set as the engines model. This can be an existing object:
|
|
1275
1237
|
|
|
1276
|
-
```
|
|
1238
|
+
```hbs
|
|
1277
1239
|
<div>
|
|
1278
1240
|
{{mount 'admin' model=userSettings}}
|
|
1279
1241
|
</div>
|
|
@@ -1281,15 +1243,20 @@ class MountDefinition {
|
|
|
1281
1243
|
|
|
1282
1244
|
Or an inline `hash`, and you can even pass components:
|
|
1283
1245
|
|
|
1246
|
+
```gjs
|
|
1247
|
+
import SignInButton from '../components/sign-in-button';
|
|
1248
|
+
<template>
|
|
1249
|
+
<div>
|
|
1250
|
+
<h1>Application template!</h1>
|
|
1251
|
+
{{mount 'admin' model=(hash
|
|
1252
|
+
title='Secret Admin'
|
|
1253
|
+
signInButton=SignInButton
|
|
1254
|
+
)}}
|
|
1255
|
+
</div>
|
|
1256
|
+
</template>
|
|
1284
1257
|
```
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
{{mount 'admin' model=(hash
|
|
1288
|
-
title='Secret Admin'
|
|
1289
|
-
signInButton=(component 'sign-in-button')
|
|
1290
|
-
)}}
|
|
1291
|
-
</div>
|
|
1292
|
-
```
|
|
1258
|
+
|
|
1259
|
+
`mount` is built-in and does not need to be imported.
|
|
1293
1260
|
|
|
1294
1261
|
@method mount
|
|
1295
1262
|
@param {String} name Name of the engine to mount.
|
|
@@ -1433,23 +1400,30 @@ function makeRouteTemplate(owner, name, template) {
|
|
|
1433
1400
|
/**
|
|
1434
1401
|
The `{{outlet}}` helper lets you specify where a child route will render in
|
|
1435
1402
|
your template. An important use of the `{{outlet}}` helper is in your
|
|
1436
|
-
application's `application.
|
|
1437
|
-
|
|
1438
|
-
```app/templates/application.
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1403
|
+
application's `application.gjs` file:
|
|
1404
|
+
|
|
1405
|
+
```app/templates/application.gjs
|
|
1406
|
+
import MyHeader from '../components/my-header';
|
|
1407
|
+
import MyFooter from '../components/my-footer';
|
|
1408
|
+
|
|
1409
|
+
<template>
|
|
1410
|
+
<MyHeader />
|
|
1411
|
+
|
|
1412
|
+
<div class="my-dynamic-content">
|
|
1413
|
+
<!-- this content will change based on the current route, which depends on the current URL -->
|
|
1414
|
+
{{outlet}}
|
|
1415
|
+
</div>
|
|
1416
|
+
|
|
1417
|
+
<MyFooter />
|
|
1418
|
+
</template>
|
|
1447
1419
|
```
|
|
1448
1420
|
|
|
1449
1421
|
See the [routing guide](https://guides.emberjs.com/release/routing/rendering-a-template/) for more
|
|
1450
1422
|
information on how your `route` interacts with the `{{outlet}}` helper.
|
|
1451
1423
|
Note: Your content __will not render__ if there isn't an `{{outlet}}` for it.
|
|
1452
1424
|
|
|
1425
|
+
`outlet` is built-in and does not need to be imported.
|
|
1426
|
+
|
|
1453
1427
|
@method outlet
|
|
1454
1428
|
@for Ember.Templates.helpers
|
|
1455
1429
|
@public
|
|
@@ -2001,7 +1975,12 @@ let renderSettledDeferred = null;
|
|
|
2001
1975
|
*/
|
|
2002
1976
|
function renderSettled() {
|
|
2003
1977
|
if (renderSettledDeferred === null) {
|
|
2004
|
-
|
|
1978
|
+
let resolve;
|
|
1979
|
+
let promise = new Promise(r => resolve = r);
|
|
1980
|
+
renderSettledDeferred = {
|
|
1981
|
+
promise,
|
|
1982
|
+
resolve
|
|
1983
|
+
};
|
|
2005
1984
|
// if there is no current runloop, the promise created above will not have
|
|
2006
1985
|
// a chance to resolve (because its resolved in backburner's "end" event)
|
|
2007
1986
|
if (!_getCurrentRunLoop()) {
|
|
@@ -2497,4 +2476,4 @@ class Renderer extends BaseRenderer {
|
|
|
2497
2476
|
}
|
|
2498
2477
|
}
|
|
2499
2478
|
|
|
2500
|
-
export { OutletView as O, Renderer as R, _resetRenderers as _,
|
|
2479
|
+
export { OutletView as O, Renderer as R, _resetRenderers as _, renderSettled as a, outletHelper as o, renderComponent as r };
|