ember-source 7.2.0-alpha.4 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/browser-environment/index.js +1 -1
- package/dist/dev/packages/@ember/-internals/glimmer/index.js +11 -11
- package/dist/dev/packages/@ember/-internals/metal/index.js +18 -18
- 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/utils/index.js +2 -2
- 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/system/utils.js +1 -1
- package/dist/dev/packages/@ember/-internals/views/lib/views/core_view.js +1 -1
- package/dist/dev/packages/@ember/application/index.js +6 -7
- package/dist/dev/packages/@ember/application/instance.js +4 -4
- package/dist/dev/packages/@ember/application/namespace.js +3 -3
- 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 +22 -16
- 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/debug/index.js +1 -1
- package/dist/dev/packages/@ember/engine/index.js +5 -5
- package/dist/dev/packages/@ember/engine/instance.js +2 -2
- package/dist/dev/packages/@ember/helper/index.js +1132 -98
- 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/-internals.js +2 -2
- package/dist/dev/packages/@ember/object/compat.js +3 -35
- package/dist/dev/packages/@ember/object/computed.js +2 -2
- package/dist/dev/packages/@ember/object/core.js +7 -7
- package/dist/dev/packages/@ember/object/evented.js +2 -2
- package/dist/dev/packages/@ember/object/events.js +1 -1
- package/dist/dev/packages/@ember/object/index.js +30 -25
- package/dist/dev/packages/@ember/object/internals.js +1 -1
- package/dist/dev/packages/@ember/object/lib/computed/computed_macros.js +5 -5
- package/dist/dev/packages/@ember/object/lib/computed/reduce_computed_macros.js +3 -3
- package/dist/dev/packages/@ember/object/mixin.js +6 -6
- package/dist/dev/packages/@ember/object/observable.js +7 -7
- 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 +18 -34
- package/dist/dev/packages/@ember/routing/lib/generate_controller.js +2 -3
- package/dist/dev/packages/@ember/routing/lib/routing-service.js +5 -5
- package/dist/dev/packages/@ember/routing/lib/utils.js +3 -3
- package/dist/dev/packages/@ember/routing/route.js +12 -12
- package/dist/dev/packages/@ember/routing/router-service.js +25 -18
- 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 +2 -2
- 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 +3 -3
- package/dist/dev/packages/@glimmer/opcode-compiler/index.js +2 -2
- package/dist/dev/packages/@glimmer/program/index.js +10 -10
- package/dist/dev/packages/@glimmer/reference/index.js +5 -5
- package/dist/dev/packages/@glimmer/runtime/index.js +13 -13
- 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/util/index.js +4 -4
- package/dist/dev/packages/@glimmer/validator/index.js +3 -3
- package/dist/dev/packages/@glimmer/vm/index.js +2 -2
- package/dist/dev/packages/ember/version.js +1 -1
- package/dist/dev/packages/ember-template-compiler/index.js +4 -4
- package/dist/dev/packages/router_js/index.js +2 -2
- package/dist/dev/packages/rsvp/index.js +1 -1
- package/dist/dev/packages/shared-chunks/{alias-RGbDZoAB.js → alias-DpqL1qx6.js} +7 -7
- package/dist/dev/packages/shared-chunks/{api-BT9M3UaD.js → api-BlZDPg1n.js} +6 -6
- package/dist/dev/packages/shared-chunks/{element-builder-Cl1kHFJE.js → api-C0PAtEgQ.js} +139 -120
- package/dist/dev/packages/shared-chunks/{api-DG5kRT-o.js → api-DuLOZMO_.js} +3 -3
- package/dist/dev/packages/shared-chunks/{args-proxy-CB0SM6jC.js → args-proxy-CS5Brs3_.js} +2 -2
- package/dist/dev/packages/shared-chunks/{untouchable-this-BHdAERUu.js → arguments-CDkbOqTS.js} +236 -236
- package/dist/dev/packages/shared-chunks/{array-BMaSKezP.js → array-CVEnNWng.js} +3 -3
- package/dist/dev/packages/shared-chunks/{array-utils-BEaSKdEb.js → array-utils-CZQxrdD3.js} +1 -1
- package/dist/dev/packages/shared-chunks/{cache-CeWOBNQg.js → cache-DGDPVCpC.js} +2 -3
- package/dist/dev/packages/shared-chunks/{capabilities-CZkuOqqC.js → capabilities-CajW4QjE.js} +1 -1
- package/dist/dev/packages/shared-chunks/{chain-tags-DfmU63mS.js → chain-tags-uWSImHzB.js} +4 -4
- package/dist/dev/packages/shared-chunks/{collections-DEt-i-8B.js → collections-DPkjqeA3.js} +2 -2
- package/dist/dev/packages/shared-chunks/{compiler-DhH2WLpA.js → compiler-QUSl_urU.js} +3 -3
- package/dist/dev/packages/shared-chunks/{computed-Daavz6vC.js → computed-BPCtuOxQ.js} +6 -6
- package/dist/dev/packages/shared-chunks/{curly-YoYS2vXw.js → curly-Ei5G8jhk.js} +7 -7
- package/dist/dev/packages/shared-chunks/{curried-Cnjy9_ug.js → curried-BZnYakIg.js} +1 -1
- package/dist/dev/packages/shared-chunks/{decorator-DYQwMItS.js → decorator-B5Uh5NFI.js} +1 -1
- package/dist/dev/packages/shared-chunks/{element-bBwMD8cw.js → element-Cgoi4ldD.js} +3 -25
- package/dist/dev/packages/shared-chunks/{events-B1lx9T1I.js → events-6aFVjD4k.js} +1 -1
- package/dist/{prod/packages/shared-chunks/flags-B9qxc-pB.js → dev/packages/shared-chunks/flags-BZxHQ0yn.js} +1 -1
- package/dist/dev/packages/shared-chunks/get-B4o_4OLA.js +40 -0
- package/dist/{prod/packages/shared-chunks/get_properties-wj_Qmotj.js → dev/packages/shared-chunks/get_properties-Cm2sWt5f.js} +1 -1
- package/dist/dev/packages/shared-chunks/{guid-PO2v9BaN.js → guid-Cbq2sNV_.js} +1 -1
- package/dist/dev/packages/shared-chunks/hash-Bg4r3CU4.js +57 -0
- package/dist/dev/packages/shared-chunks/{helper-Bm6EhgSW.js → helper--ZiOCQkd.js} +21 -9
- package/dist/dev/packages/shared-chunks/{index-DX90CU4L.js → index-BGP1rw3B.js} +1 -1
- package/dist/dev/packages/shared-chunks/{index-dyv6rcBf.js → index-C5Q8WHUG.js} +304 -201
- package/dist/dev/packages/shared-chunks/{index-DkwVSPP5.js → index-DaFzpTIE.js} +10 -9
- package/dist/dev/packages/shared-chunks/{injected_property-B075jH6c.js → injected_property-CbBLr5jt.js} +2 -2
- package/dist/dev/packages/shared-chunks/{internal-Bpr6ihB_.js → internal-DTOXyEGM.js} +4 -4
- package/dist/dev/packages/shared-chunks/{internal-helper-IC87S6iZ.js → internal-helper-CKrni0b_.js} +1 -1
- package/dist/dev/packages/shared-chunks/{invoke-Ds0KEfP_.js → invoke-d9sqa50M.js} +3 -3
- package/dist/dev/packages/shared-chunks/{libraries-P8Ins5CB.js → libraries-DwffpMGE.js} +1 -1
- package/dist/dev/packages/shared-chunks/{meta-Cjo3zQJq.js → meta-BqC7f9Ia.js} +1 -1
- package/dist/{prod/packages/shared-chunks/namespace_search-TFdmjK_a.js → dev/packages/shared-chunks/namespace_search-BfvzEQzN.js} +1 -1
- package/dist/dev/packages/shared-chunks/{normalize-CxG_iVLJ.js → normalize-CKySQVU7.js} +2 -2
- package/dist/dev/packages/shared-chunks/{or-Bg6rCMF8.js → not-JB6ln6bJ.js} +36 -36
- package/dist/dev/packages/shared-chunks/{observers-CejcZw5s.js → observers-DMlX2nCi.js} +5 -5
- package/dist/dev/packages/shared-chunks/{on-Ch_lyozr.js → on-CQqC2-wL.js} +29 -18
- package/dist/dev/packages/shared-chunks/{present-D0EfKzC6.js → present-B1rrjAVM.js} +1 -1
- package/dist/{prod/packages/shared-chunks/program-CF651Zuj.js → dev/packages/shared-chunks/program-DlgjqLa6.js} +3 -3
- package/dist/dev/packages/shared-chunks/{program-context-BaYVr5GA.js → program-context-Dq8xN2HI.js} +5 -4
- package/dist/dev/packages/shared-chunks/{property_get-BjbsrgpU.js → property_get-CRP7MFz_.js} +3 -3
- package/dist/dev/packages/shared-chunks/{property_set-LJskl202.js → property_set-qCUylPEK.js} +3 -3
- package/dist/dev/packages/shared-chunks/{reference-C-OXd_kp.js → reference-BqOLhKFy.js} +3 -3
- package/dist/dev/packages/shared-chunks/{registers-Buvdhhxx.js → registers-C_W2qYHJ.js} +1 -1
- package/dist/dev/packages/shared-chunks/{rehydrate-builder-IH4d_JQy.js → rehydrate-builder-C6k1XhET.js} +4 -4
- package/dist/dev/packages/shared-chunks/{render-Dz3OWqXy.js → render-87_sKZ_k.js} +94 -94
- package/dist/dev/packages/shared-chunks/{rsvp-C6j8G1D1.js → rsvp-aLN_pQtn.js} +4 -4
- package/dist/dev/packages/shared-chunks/{serialize-builder-DKliZPPG.js → serialize-builder-BlxBjwO-.js} +2 -2
- package/dist/dev/packages/shared-chunks/{set_properties-CNds2HCH.js → set_properties-C4TSebH6.js} +2 -2
- package/dist/dev/packages/shared-chunks/{setup-registry-C_YovxNX.js → setup-registry-Dovj1LIQ.js} +18 -18
- package/dist/{prod/packages/shared-chunks/simple-cast-BXTrayoV.js → dev/packages/shared-chunks/simple-cast-DCvJLSin.js} +1 -1
- package/dist/{prod/packages/shared-chunks/super-D4qkU4uq.js → dev/packages/shared-chunks/super-BBBjgF69.js} +1 -1
- package/dist/{prod/packages/shared-chunks/syscall-ops-nrBHMOTp.js → dev/packages/shared-chunks/syscall-ops-CN7STuUn.js} +1 -1
- package/dist/dev/packages/shared-chunks/{template-B0Apv9g2.js → template-BRrQR6KS.js} +1 -1
- package/dist/dev/packages/shared-chunks/{template-only-BxYzSEnC.js → template-only-Cu639ICT.js} +2 -4
- package/dist/dev/packages/shared-chunks/{textarea-DHjEFpZu.js → textarea-B5TmhnQU.js} +14 -30
- package/dist/dev/packages/shared-chunks/{tracked-B76E1nGz.js → tracked-DEyf0T_X.js} +5 -5
- package/dist/dev/packages/shared-chunks/{tracked-data-CH1USZZy.js → tracked-data-DgqqRdYO.js} +2 -2
- package/dist/dev/packages/shared-chunks/{unique-id-Hd96VZlE.js → unique-id-Csxuh1I7.js} +2 -6
- package/dist/dev/packages/shared-chunks/{unrecognized-url-error-BQdkjTtZ.js → unrecognized-url-error-DyurFqvv.js} +2 -2
- package/dist/{prod/packages/shared-chunks/vm-ops-5QCUIRx4.js → dev/packages/shared-chunks/vm-ops-ImHv0Wtg.js} +1 -1
- package/dist/prod/packages/@ember/-internals/glimmer/index.js +11 -11
- package/dist/prod/packages/@ember/-internals/metal/index.js +18 -18
- 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/utils/index.js +2 -2
- 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/system/utils.js +1 -1
- 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 +4 -4
- package/dist/prod/packages/@ember/application/namespace.js +3 -3
- 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 +21 -15
- 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 +2 -2
- package/dist/prod/packages/@ember/helper/index.js +1132 -98
- 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/-internals.js +2 -2
- package/dist/prod/packages/@ember/object/compat.js +3 -35
- package/dist/prod/packages/@ember/object/computed.js +2 -2
- package/dist/prod/packages/@ember/object/core.js +7 -7
- package/dist/prod/packages/@ember/object/evented.js +2 -2
- package/dist/prod/packages/@ember/object/events.js +1 -1
- package/dist/prod/packages/@ember/object/index.js +30 -25
- package/dist/prod/packages/@ember/object/internals.js +2 -2
- 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 +6 -6
- package/dist/prod/packages/@ember/object/observable.js +7 -7
- 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 +18 -34
- 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 +12 -12
- 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 +10 -10
- package/dist/prod/packages/@glimmer/reference/index.js +5 -5
- 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 +4 -4
- package/dist/prod/packages/@glimmer/validator/index.js +3 -3
- package/dist/prod/packages/@glimmer/vm/index.js +2 -2
- package/dist/prod/packages/ember/version.js +1 -1
- package/dist/prod/packages/ember-template-compiler/index.js +4 -4
- package/dist/prod/packages/router_js/index.js +2 -2
- package/dist/prod/packages/rsvp/index.js +1 -1
- package/dist/prod/packages/shared-chunks/{alias-DsIh-16z.js → alias-Bod6qdNp.js} +7 -7
- package/dist/prod/packages/shared-chunks/{api-CGZbGcvX.js → api-B_poQGXS.js} +6 -6
- package/dist/prod/packages/shared-chunks/{element-builder-CZePCkbA.js → api-CQexacBn.js} +139 -120
- package/dist/prod/packages/shared-chunks/{api-DOLN_cR2.js → api-DlJKfm_f.js} +3 -3
- package/dist/prod/packages/shared-chunks/{args-proxy-CaXVcI8G.js → args-proxy-CCoFtYLS.js} +2 -2
- package/dist/prod/packages/shared-chunks/{debug-render-tree-CYENUjgX.js → arguments-BzAkZVBa.js} +198 -198
- package/dist/prod/packages/shared-chunks/{array-DYFI95FA.js → array-BzReKMeW.js} +3 -3
- package/dist/prod/packages/shared-chunks/{array-utils-BEaSKdEb.js → array-utils-CZQxrdD3.js} +1 -1
- package/dist/prod/packages/shared-chunks/{cache-CG6_L9db.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-BP0V2LnZ.js → chain-tags-B2J7DsxO.js} +4 -4
- package/dist/prod/packages/shared-chunks/{collections-By4M3cTy.js → collections-GpG8lT2g.js} +10 -10
- package/dist/prod/packages/shared-chunks/{compiler-DQmEjFyx.js → compiler-lBSssiWp.js} +2 -2
- package/dist/prod/packages/shared-chunks/{computed-D6MVTTDd.js → computed-DtIStxvq.js} +6 -6
- package/dist/prod/packages/shared-chunks/{curly-DCYSwLtz.js → curly-IY06zACp.js} +7 -7
- package/dist/prod/packages/shared-chunks/{curried-Cnjy9_ug.js → curried-BZnYakIg.js} +1 -1
- package/dist/prod/packages/shared-chunks/{decorator-B8Lpq40g.js → decorator-9ikVwsjY.js} +1 -1
- package/dist/prod/packages/shared-chunks/{element-CT5H5uxF.js → element-BmBjPjkQ.js} +3 -25
- package/dist/prod/packages/shared-chunks/{events-C7aYCy0N.js → events-DYrYz3V8.js} +1 -1
- package/dist/{dev/packages/shared-chunks/flags-B9qxc-pB.js → prod/packages/shared-chunks/flags-BZxHQ0yn.js} +1 -1
- package/dist/prod/packages/shared-chunks/get-DpBAICuC.js +40 -0
- package/dist/{dev/packages/shared-chunks/get_properties-B203vZpz.js → prod/packages/shared-chunks/get_properties-Dg3xFpiS.js} +1 -1
- package/dist/prod/packages/shared-chunks/{guid-PO2v9BaN.js → guid-Cbq2sNV_.js} +1 -1
- package/dist/prod/packages/shared-chunks/hash-D31JO-BD.js +57 -0
- package/dist/prod/packages/shared-chunks/{helper-CCK8Ef0x.js → helper-Df5MpdcT.js} +21 -9
- package/dist/prod/packages/shared-chunks/{index-DabsnYit.js → index-BQaaoknf.js} +301 -198
- package/dist/prod/packages/shared-chunks/{index-D-rcNBLp.js → index-Bf53M8eS.js} +9 -8
- package/dist/prod/packages/shared-chunks/{injected_property-COGiYHKc.js → injected_property-Y-FadDej.js} +2 -2
- package/dist/prod/packages/shared-chunks/{internal-BEJC2IJ-.js → internal-BQ7zHrqS.js} +4 -4
- package/dist/prod/packages/shared-chunks/{internal-helper-CoxiRnnb.js → internal-helper-Bz1lpDXr.js} +1 -1
- package/dist/prod/packages/shared-chunks/{invoke-D_jsLbsj.js → invoke-DhQ5QRp2.js} +3 -3
- package/dist/prod/packages/shared-chunks/{libraries-Bs3H8iwC.js → libraries-DBql0hdn.js} +2 -2
- package/dist/prod/packages/shared-chunks/{meta-Ce6-qROq.js → meta-BJtIZDir.js} +1 -1
- package/dist/{dev/packages/shared-chunks/namespace_search-TFdmjK_a.js → prod/packages/shared-chunks/namespace_search-BfvzEQzN.js} +1 -1
- package/dist/prod/packages/shared-chunks/{normalize-Bx4H3NjB.js → normalize-C_IStty9.js} +2 -2
- package/dist/prod/packages/shared-chunks/{or-sYlRiUn_.js → not-Bm2-x-jD.js} +28 -28
- package/dist/prod/packages/shared-chunks/{observers-Ci31SE36.js → observers-BmobpXAF.js} +5 -5
- package/dist/prod/packages/shared-chunks/{on-Dgmychhk.js → on-8aS8t_5D.js} +29 -18
- package/dist/{dev/packages/shared-chunks/program-CPXeXWVB.js → prod/packages/shared-chunks/program-BAh__OXZ.js} +3 -3
- package/dist/prod/packages/shared-chunks/{program-context-DmI53TzJ.js → program-context-COSioH46.js} +5 -4
- package/dist/prod/packages/shared-chunks/{property_get-Sw0SicEZ.js → property_get-DAKgbeJX.js} +2 -2
- package/dist/prod/packages/shared-chunks/{property_set-SHEIPMUG.js → property_set-BaQJdVfS.js} +3 -3
- package/dist/prod/packages/shared-chunks/{reference-D2agTt1V.js → reference-CG0yPgLy.js} +3 -3
- package/dist/prod/packages/shared-chunks/{registers-Buvdhhxx.js → registers-C_W2qYHJ.js} +1 -1
- package/dist/prod/packages/shared-chunks/{rehydrate-builder-B7MtrWip.js → rehydrate-builder-Blt1x9MP.js} +4 -4
- package/dist/prod/packages/shared-chunks/{render-B790-vbk.js → render-Dx7lr1hR.js} +94 -94
- package/dist/prod/packages/shared-chunks/{rsvp-C6j8G1D1.js → rsvp-aLN_pQtn.js} +4 -4
- package/dist/prod/packages/shared-chunks/{serialize-builder-kEyOKbzp.js → serialize-builder-BvAXYHTr.js} +2 -2
- package/dist/prod/packages/shared-chunks/{set_properties-CcLLHg1w.js → set_properties-Qxhw4qzw.js} +2 -2
- package/dist/prod/packages/shared-chunks/{setup-registry-D14I0iDX.js → setup-registry-DMAzVcVn.js} +18 -18
- package/dist/{dev/packages/shared-chunks/simple-cast-BXTrayoV.js → prod/packages/shared-chunks/simple-cast-DCvJLSin.js} +1 -1
- package/dist/{dev/packages/shared-chunks/super-D4qkU4uq.js → prod/packages/shared-chunks/super-BBBjgF69.js} +1 -1
- package/dist/{dev/packages/shared-chunks/syscall-ops-nrBHMOTp.js → prod/packages/shared-chunks/syscall-ops-CN7STuUn.js} +1 -1
- package/dist/prod/packages/shared-chunks/{template-B0Apv9g2.js → template-BRrQR6KS.js} +1 -1
- package/dist/prod/packages/shared-chunks/{template-only-CP0NT7ce.js → template-only-DKNcKM5b.js} +2 -4
- package/dist/prod/packages/shared-chunks/{textarea-B_JYBuE8.js → textarea-CQmTzSKe.js} +13 -29
- package/dist/prod/packages/shared-chunks/{tracked-CXcapuAm.js → tracked-B9380JtC.js} +5 -5
- package/dist/prod/packages/shared-chunks/{tracked-data-DNDzhYXf.js → tracked-data-CHq42QHb.js} +2 -2
- package/dist/prod/packages/shared-chunks/{unique-id-Hn8Qp4dS.js → unique-id-BJb1p8EG.js} +2 -6
- package/dist/prod/packages/shared-chunks/{unrecognized-url-error-ClNyMFJt.js → unrecognized-url-error-DgXBAzKl.js} +2 -2
- package/dist/{dev/packages/shared-chunks/vm-ops-5QCUIRx4.js → prod/packages/shared-chunks/vm-ops-ImHv0Wtg.js} +1 -1
- package/docs/data.json +1435 -1617
- package/package.json +6 -7
- package/types/stable/@ember/-internals/glimmer/index.d.ts +24 -353
- 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 +9 -3
- 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/each-in.d.ts +183 -72
- package/types/stable/@ember/-internals/glimmer/lib/helpers/element.d.ts +0 -22
- package/types/stable/@ember/-internals/glimmer/lib/helpers/mut.d.ts +25 -55
- package/types/stable/@ember/-internals/glimmer/lib/helpers/readonly.d.ts +7 -9
- package/types/stable/@ember/-internals/glimmer/lib/helpers/unbound.d.ts +6 -2
- package/types/stable/@ember/-internals/glimmer/lib/helpers/unique-id.d.ts +0 -3
- package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +1 -2
- package/types/stable/@ember/-internals/glimmer/lib/syntax/mount.d.ts +18 -12
- package/types/stable/@ember/-internals/glimmer/lib/syntax/outlet.d.ts +23 -11
- 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 +1111 -90
- package/types/stable/@ember/object/compat.d.ts +0 -32
- 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 +0 -33
- package/types/stable/@glimmer/runtime/lib/helpers/concat.d.ts +0 -20
- package/types/stable/@glimmer/runtime/lib/helpers/fn.d.ts +0 -64
- package/types/stable/@glimmer/runtime/lib/helpers/get.d.ts +0 -77
- package/types/stable/@glimmer/runtime/lib/helpers/hash.d.ts +0 -36
- 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 -14
- package/dist/dev/packages/shared-chunks/get-CO3EIWsm.js +0 -138
- package/dist/dev/packages/shared-chunks/hash-2-93qikL.js +0 -192
- package/dist/prod/packages/shared-chunks/get-tlL23wmp.js +0 -138
- package/dist/prod/packages/shared-chunks/hash-C6IoC4eR.js +0 -192
- package/types/stable/@ember/-internals/glimmer/lib/helpers/array.d.ts +0 -41
- package/types/stable/@ember/-internals/glimmer/lib/helpers/component.d.ts +0 -149
- package/types/stable/@ember/-internals/glimmer/lib/helpers/concat.d.ts +0 -28
- package/types/stable/@ember/-internals/glimmer/lib/helpers/fn.d.ts +0 -73
- package/types/stable/@ember/-internals/glimmer/lib/helpers/get.d.ts +0 -100
- package/types/stable/@ember/-internals/glimmer/lib/helpers/hash.d.ts +0 -44
- package/types/stable/@ember/-internals/glimmer/lib/helpers/helper.d.ts +0 -43
- package/types/stable/@ember/-internals/glimmer/lib/helpers/if-unless.d.ts +0 -182
- package/types/stable/@ember/-internals/glimmer/lib/helpers/log.d.ts +0 -19
- package/types/stable/@ember/-internals/glimmer/lib/helpers/modifier.d.ts +0 -42
- package/types/stable/@ember/-internals/glimmer/lib/helpers/page-title.d.ts +0 -20
- package/types/stable/@ember/-internals/glimmer/lib/modifiers/on.d.ts +0 -95
- package/types/stable/@ember/-internals/glimmer/lib/syntax/in-element.d.ts +0 -47
- package/types/stable/@ember/-internals/glimmer/lib/syntax/let.d.ts +0 -55
|
@@ -1,53 +1,48 @@
|
|
|
1
1
|
import { privatize } from '../@ember/-internals/container/index.js';
|
|
2
2
|
import { E as ENV } from './env-DXxsTFkM.js';
|
|
3
3
|
import { isFactory, getOwner } from '../@ember/-internals/owner/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { g as guidFor } from './guid-Cbq2sNV_.js';
|
|
5
5
|
import { getViewId, getViewElement } from '../@ember/-internals/views/lib/system/utils.js';
|
|
6
6
|
import { h as hasDOM } from './has-dom-DdQORPzI.js';
|
|
7
7
|
import { assert } from '../@ember/debug/lib/assert.js';
|
|
8
8
|
import { schedule, _backburner, _getCurrentRunLoop } from '../@ember/runloop/index.js';
|
|
9
9
|
import { associateDestroyableChild, isDestroyed, destroy, registerDestructor, isDestroying } from '../@glimmer/destroyable/index.js';
|
|
10
10
|
import { artifacts } from '../@glimmer/program/index.js';
|
|
11
|
-
import { R as RuntimeOpImpl } from './program-
|
|
12
|
-
import { v as valueForRef, U as UNDEFINED_REFERENCE,
|
|
13
|
-
import {
|
|
14
|
-
import { E as EMPTY_ARGS,
|
|
15
|
-
import { g as runtimeOptions, i as inTransaction, r as renderComponent$1, d as renderMain } from './render-
|
|
16
|
-
import { d as dict } from './collections-
|
|
17
|
-
import { u as unwrapTemplate,
|
|
18
|
-
import {
|
|
19
|
-
import { a as RSVP } from './rsvp-C6j8G1D1.js';
|
|
20
|
-
import '../@ember/engine/instance.js';
|
|
11
|
+
import { R as RuntimeOpImpl } from './program-BAh__OXZ.js';
|
|
12
|
+
import { v as valueForRef, U as UNDEFINED_REFERENCE, c as createComputeRef, a as createConstRef, h as createInvokableRef, j as createReadOnlyRef, k as createUnboundRef, g as childRefFromParts, u as updateRef } from './reference-CG0yPgLy.js';
|
|
13
|
+
import { c as clientBuilder } from './api-CQexacBn.js';
|
|
14
|
+
import { E as EMPTY_ARGS, c as createCapturedArgs, b as EMPTY_POSITIONAL, d as curry } from './arguments-BzAkZVBa.js';
|
|
15
|
+
import { g as runtimeOptions, i as inTransaction, r as renderComponent$1, d as renderMain } from './render-Dx7lr1hR.js';
|
|
16
|
+
import { d as dict } from './collections-GpG8lT2g.js';
|
|
17
|
+
import { u as unwrapTemplate, a as CurlyComponentManager, i as initialRenderInstrumentDetails, b as ComponentStateBucket, D as DIRTY_TAG, c as isCurlyManager, B as BOUNDS } from './curly-IY06zACp.js';
|
|
18
|
+
import { C as CONSTANT_TAG, c as consumeTag, f as isTracking, D as DIRTY_TAG$1, r as createTag, a as valueForTag, k as CURRENT_TAG, v as validateTag } from './cache-CofLhaS4.js';
|
|
21
19
|
import { _instrumentStart } from '../@ember/instrumentation/index.js';
|
|
22
|
-
import { c as capabilityFlagsFrom } from './capabilities-
|
|
23
|
-
import {
|
|
20
|
+
import { c as capabilityFlagsFrom } from './capabilities-BuVYh-vx.js';
|
|
21
|
+
import { t as templateFactory } from './index-Bf53M8eS.js';
|
|
24
22
|
import { g as getFactoryFor } from './container-BYOnjnwz.js';
|
|
25
|
-
import { g as get, a as _getProp } from './property_get-
|
|
26
|
-
import { _ as _setProp, s as set } from './property_set-
|
|
23
|
+
import { g as get, a as _getProp } from './property_get-DAKgbeJX.js';
|
|
24
|
+
import { _ as _setProp, s as set } from './property_set-BaQJdVfS.js';
|
|
27
25
|
import setGlobalContext from '../@glimmer/global-context/index.js';
|
|
28
|
-
import { t as tagForObject, o as objectAt,
|
|
26
|
+
import { t as tagForObject, o as objectAt, a as tagForProperty } from './chain-tags-B2J7DsxO.js';
|
|
29
27
|
import { isEmberArray } from '../@ember/array/-internals.js';
|
|
30
28
|
import { i as isObject } from './spec-BXl1reqK.js';
|
|
31
|
-
import { t as tagFor } from './meta-
|
|
29
|
+
import { t as tagFor } from './meta-BJtIZDir.js';
|
|
32
30
|
import { contentFor } from '../@ember/-internals/runtime/lib/mixins/-proxy.js';
|
|
33
31
|
import { i as isProxy } from './is_proxy-Bzg0d4m4.js';
|
|
34
|
-
import { i as internalHelper } from './internal-helper-
|
|
32
|
+
import { i as internalHelper } from './internal-helper-Bz1lpDXr.js';
|
|
35
33
|
import { i as isHTMLSafe } from './index-D-xTBV4B.js';
|
|
36
|
-
import
|
|
34
|
+
import isArray from '../@ember/array/lib/is-array.js';
|
|
37
35
|
import { g as getComponentTemplate } from './template-Dc_cBOoX.js';
|
|
38
|
-
import { c as hasInternalComponentManager, j as setInternalHelperManager, g as getInternalComponentManager } from './api-
|
|
39
|
-
import { h as hash, f as fn, a as array } from './hash-
|
|
40
|
-
import { g as get$1, c as concat } from './get-
|
|
41
|
-
import { o as on } from './on-
|
|
42
|
-
import { T as TEMPLATE_ONLY_COMPONENT_MANAGER, t as templateOnlyComponent } from './template-only-
|
|
43
|
-
import { i as isClassicHelper, C as CLASSIC_HELPER_MANAGER } from './helper-
|
|
36
|
+
import { c as hasInternalComponentManager, j as setInternalHelperManager, g as getInternalComponentManager } from './api-DlJKfm_f.js';
|
|
37
|
+
import { h as hash, f as fn, a as array } from './hash-D31JO-BD.js';
|
|
38
|
+
import { g as get$1, c as concat } from './get-DpBAICuC.js';
|
|
39
|
+
import { o as on } from './on-8aS8t_5D.js';
|
|
40
|
+
import { T as TEMPLATE_ONLY_COMPONENT_MANAGER, t as templateOnlyComponent } from './template-only-DKNcKM5b.js';
|
|
41
|
+
import { i as isClassicHelper, C as CLASSIC_HELPER_MANAGER } from './helper-Df5MpdcT.js';
|
|
44
42
|
import { dasherize } from '../@ember/-internals/string/index.js';
|
|
45
|
-
import { a as uniqueId } from './unique-id-
|
|
46
|
-
import '../route-recognizer/index.js';
|
|
47
|
-
import './unrecognized-url-error-ClNyMFJt.js';
|
|
48
|
-
import '../@ember/routing/lib/routing-service.js';
|
|
43
|
+
import { a as uniqueId } from './unique-id-BJb1p8EG.js';
|
|
49
44
|
import { generateControllerFactory } from '../@ember/routing/lib/generate_controller.js';
|
|
50
|
-
import { E as EvaluationContextImpl } from './program-context-
|
|
45
|
+
import { E as EvaluationContextImpl } from './program-context-COSioH46.js';
|
|
51
46
|
|
|
52
47
|
function instrumentationPayload$1(def) {
|
|
53
48
|
// "main" used to be the outlet name, keeping it around for compatibility
|
|
@@ -90,13 +85,14 @@ class OutletComponentManager {
|
|
|
90
85
|
let currentState = valueForRef(currentStateRef);
|
|
91
86
|
let currentOwner = currentState?.render?.owner;
|
|
92
87
|
if (parentOwner && parentOwner !== currentOwner) {
|
|
88
|
+
let engineInstance = currentOwner;
|
|
93
89
|
let {
|
|
94
90
|
mountPoint
|
|
95
|
-
} =
|
|
91
|
+
} = engineInstance;
|
|
96
92
|
if (mountPoint) {
|
|
97
93
|
state.engine = {
|
|
98
94
|
mountPoint,
|
|
99
|
-
instance:
|
|
95
|
+
instance: engineInstance
|
|
100
96
|
};
|
|
101
97
|
}
|
|
102
98
|
}
|
|
@@ -235,55 +231,102 @@ class RootComponentDefinition {
|
|
|
235
231
|
}
|
|
236
232
|
|
|
237
233
|
/**
|
|
238
|
-
@module ember
|
|
234
|
+
@module @ember/helper
|
|
239
235
|
*/
|
|
240
236
|
|
|
241
237
|
/**
|
|
242
|
-
The `{{#each}}`
|
|
238
|
+
The `{{#each}}` keyword loops over elements in a collection. It is an extension
|
|
243
239
|
of the base Handlebars `{{#each}}` helper.
|
|
244
240
|
|
|
245
241
|
The default behavior of `{{#each}}` is to yield its inner block once for every
|
|
246
242
|
item in an array passing the item as the first block parameter.
|
|
247
243
|
|
|
248
|
-
|
|
244
|
+
```gjs {data-filename="app/components/developer-list.gjs"}
|
|
245
|
+
import Component from '@glimmer/component';
|
|
249
246
|
|
|
250
|
-
|
|
251
|
-
|
|
247
|
+
export default class DeveloperList extends Component {
|
|
248
|
+
developers = [
|
|
249
|
+
{ name: 'Yehuda' },
|
|
250
|
+
{ name: 'Tom' },
|
|
251
|
+
{ name: 'Paul' },
|
|
252
|
+
];
|
|
253
|
+
|
|
254
|
+
<template>
|
|
255
|
+
<ul>
|
|
256
|
+
{{#each this.developers as |person|}}
|
|
257
|
+
<li>Hello, {{person.name}}!</li>
|
|
258
|
+
{{/each}}
|
|
259
|
+
</ul>
|
|
260
|
+
</template>
|
|
261
|
+
}
|
|
252
262
|
```
|
|
253
263
|
|
|
254
|
-
|
|
255
|
-
<ul>
|
|
256
|
-
{{#each @developers as |person|}}
|
|
257
|
-
<li>Hello, {{person.name}}!</li>
|
|
258
|
-
{{/each}}
|
|
259
|
-
</ul>
|
|
260
|
-
```
|
|
264
|
+
The same rules apply to arrays of primitives:
|
|
261
265
|
|
|
262
|
-
|
|
266
|
+
```app/components/developer-names.gjs
|
|
267
|
+
import Component from '@glimmer/component';
|
|
263
268
|
|
|
264
|
-
|
|
265
|
-
|
|
269
|
+
export default class DeveloperNames extends Component {
|
|
270
|
+
developerNames = ['Yehuda', 'Tom', 'Paul'];
|
|
271
|
+
|
|
272
|
+
<template>
|
|
273
|
+
<ul>
|
|
274
|
+
{{#each this.developerNames as |name|}}
|
|
275
|
+
<li>Hello, {{name}}!</li>
|
|
276
|
+
{{/each}}
|
|
277
|
+
</ul>
|
|
278
|
+
</template>
|
|
279
|
+
}
|
|
266
280
|
```
|
|
267
281
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
282
|
+
`{{#each}}` also supports native JavaScript [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set)
|
|
283
|
+
values and other iterables:
|
|
284
|
+
|
|
285
|
+
```gjs {data-filename="app/components/developer-set.gjs"}
|
|
286
|
+
import Component from '@glimmer/component';
|
|
287
|
+
|
|
288
|
+
export default class DeveloperSet extends Component {
|
|
289
|
+
developers = new Set([
|
|
290
|
+
{ name: 'Yehuda' },
|
|
291
|
+
{ name: 'Tom' },
|
|
292
|
+
{ name: 'Paul' },
|
|
293
|
+
]);
|
|
294
|
+
|
|
295
|
+
<template>
|
|
296
|
+
<ul>
|
|
297
|
+
{{#each this.developers as |person|}}
|
|
298
|
+
<li>Hello, {{person.name}}!</li>
|
|
299
|
+
{{/each}}
|
|
300
|
+
</ul>
|
|
301
|
+
</template>
|
|
302
|
+
}
|
|
274
303
|
```
|
|
275
304
|
|
|
276
|
-
During iteration, the index of each item in the array is provided as a second
|
|
277
|
-
parameter
|
|
305
|
+
During iteration, the index of each item in the array is provided as a second
|
|
306
|
+
block parameter:
|
|
278
307
|
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
308
|
+
```app/components/developer-list-with-index.gjs
|
|
309
|
+
import Component from '@glimmer/component';
|
|
310
|
+
|
|
311
|
+
export default class DeveloperListWithIndex extends Component {
|
|
312
|
+
developers = [
|
|
313
|
+
{ name: 'Yehuda' },
|
|
314
|
+
{ name: 'Tom' },
|
|
315
|
+
{ name: 'Paul' },
|
|
316
|
+
];
|
|
317
|
+
|
|
318
|
+
<template>
|
|
319
|
+
<ul>
|
|
320
|
+
{{#each this.developers as |person index|}}
|
|
321
|
+
<li>Hello, {{person.name}}! You're number {{index}} in line</li>
|
|
322
|
+
{{/each}}
|
|
323
|
+
</ul>
|
|
324
|
+
</template>
|
|
325
|
+
}
|
|
285
326
|
```
|
|
286
327
|
|
|
328
|
+
`#each` is a keyword and does not need to be imported.
|
|
329
|
+
|
|
287
330
|
### Specifying Keys
|
|
288
331
|
|
|
289
332
|
In order to improve rendering speed, Ember will try to reuse the DOM elements
|
|
@@ -298,30 +341,38 @@ class RootComponentDefinition {
|
|
|
298
341
|
needed. However, in some rare cases, the objects' identities may change even
|
|
299
342
|
though they represent the same underlying data.
|
|
300
343
|
|
|
301
|
-
For example
|
|
344
|
+
For example, mapping over `people` produces a new array of new objects on each
|
|
345
|
+
render. Use `key` so Ember can match items across those renders:
|
|
302
346
|
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
return { ...person, type: 'developer' };
|
|
306
|
-
});
|
|
307
|
-
```
|
|
347
|
+
```gjs {data-filename="app/components/mapped-developers.gjs"}
|
|
348
|
+
import Component from '@glimmer/component';
|
|
308
349
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
350
|
+
export default class MappedDevelopers extends Component {
|
|
351
|
+
people = [
|
|
352
|
+
{ name: 'Yehuda' },
|
|
353
|
+
{ name: 'Tom' },
|
|
354
|
+
{ name: 'Paul' },
|
|
355
|
+
];
|
|
313
356
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
357
|
+
get developers() {
|
|
358
|
+
return this.people.map((person) => {
|
|
359
|
+
return { ...person, type: 'developer' };
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
<template>
|
|
364
|
+
<ul>
|
|
365
|
+
{{#each this.developers key="name" as |person|}}
|
|
366
|
+
<li>Hello, {{person.name}}!</li>
|
|
367
|
+
{{/each}}
|
|
368
|
+
</ul>
|
|
369
|
+
</template>
|
|
370
|
+
}
|
|
320
371
|
```
|
|
321
372
|
|
|
322
373
|
By doing so, Ember will use the value of the property specified (`person.name`
|
|
323
374
|
in the example) to find a "match" from the previous render. That is, if Ember
|
|
324
|
-
has previously seen an object from the
|
|
375
|
+
has previously seen an object from the `developers` array with a matching
|
|
325
376
|
name, its DOM elements will be re-used.
|
|
326
377
|
|
|
327
378
|
There are two special values for `key`:
|
|
@@ -334,50 +385,59 @@ class RootComponentDefinition {
|
|
|
334
385
|
`{{#each}}` can have a matching `{{else}}`. The contents of this block will render
|
|
335
386
|
if the collection is empty.
|
|
336
387
|
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
388
|
+
```gjs {data-filename="app/components/available-developers.gjs"}
|
|
389
|
+
import Component from '@glimmer/component';
|
|
390
|
+
|
|
391
|
+
export default class AvailableDevelopers extends Component {
|
|
392
|
+
developers = [];
|
|
393
|
+
|
|
394
|
+
<template>
|
|
395
|
+
<ul>
|
|
396
|
+
{{#each this.developers as |person|}}
|
|
397
|
+
<li>{{person.name}} is available!</li>
|
|
398
|
+
{{else}}
|
|
399
|
+
<li>Sorry, nobody is available for this task.</li>
|
|
400
|
+
{{/each}}
|
|
401
|
+
</ul>
|
|
402
|
+
</template>
|
|
403
|
+
}
|
|
345
404
|
```
|
|
346
405
|
|
|
347
406
|
@method each
|
|
348
|
-
@for
|
|
407
|
+
@for Keywords
|
|
408
|
+
@static
|
|
409
|
+
@noimport
|
|
349
410
|
@public
|
|
350
411
|
*/
|
|
351
412
|
|
|
352
413
|
/**
|
|
353
|
-
The `{{each-in}}`
|
|
414
|
+
The `{{#each-in}}` keyword loops over properties on an object, or entries in a
|
|
415
|
+
native JavaScript [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map).
|
|
354
416
|
|
|
355
417
|
For example, given this component definition:
|
|
356
418
|
|
|
357
|
-
```app/components/developer-details.
|
|
419
|
+
```gjs {data-filename="app/components/developer-details.gjs"}
|
|
358
420
|
import Component from '@glimmer/component';
|
|
359
421
|
import { tracked } from '@glimmer/tracking';
|
|
360
422
|
|
|
361
|
-
export default class extends Component {
|
|
423
|
+
export default class DeveloperDetails extends Component {
|
|
362
424
|
@tracked developer = {
|
|
363
|
-
|
|
364
|
-
|
|
425
|
+
name: 'Shelly Sails',
|
|
426
|
+
age: 42,
|
|
365
427
|
};
|
|
428
|
+
|
|
429
|
+
<template>
|
|
430
|
+
<ul>
|
|
431
|
+
{{#each-in this.developer as |key value|}}
|
|
432
|
+
<li>{{key}}: {{value}}</li>
|
|
433
|
+
{{/each-in}}
|
|
434
|
+
</ul>
|
|
435
|
+
</template>
|
|
366
436
|
}
|
|
367
437
|
```
|
|
368
438
|
|
|
369
439
|
This template would display all properties on the `developer`
|
|
370
|
-
object in a list:
|
|
371
|
-
|
|
372
|
-
```app/components/developer-details.hbs
|
|
373
|
-
<ul>
|
|
374
|
-
{{#each-in this.developer as |key value|}}
|
|
375
|
-
<li>{{key}}: {{value}}</li>
|
|
376
|
-
{{/each-in}}
|
|
377
|
-
</ul>
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
Outputting their name and age:
|
|
440
|
+
object in a list, outputting their name and age:
|
|
381
441
|
|
|
382
442
|
```html
|
|
383
443
|
<ul>
|
|
@@ -386,8 +446,55 @@ class RootComponentDefinition {
|
|
|
386
446
|
</ul>
|
|
387
447
|
```
|
|
388
448
|
|
|
449
|
+
The same pattern works with a `Map`:
|
|
450
|
+
|
|
451
|
+
```gjs {data-filename="app/components/developer-map.gjs"}
|
|
452
|
+
import Component from '@glimmer/component';
|
|
453
|
+
|
|
454
|
+
export default class DeveloperMap extends Component {
|
|
455
|
+
map = new Map([
|
|
456
|
+
['name', 'Shelly Sails'],
|
|
457
|
+
['age', 42],
|
|
458
|
+
]);
|
|
459
|
+
|
|
460
|
+
<template>
|
|
461
|
+
<ul>
|
|
462
|
+
{{#each-in this.map as |key value|}}
|
|
463
|
+
<li>{{key}}: {{value}}</li>
|
|
464
|
+
{{/each-in}}
|
|
465
|
+
</ul>
|
|
466
|
+
</template>
|
|
467
|
+
}
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
When a `Map` uses object keys, you can pass `key="@identity"` to explicitly
|
|
471
|
+
track entries across re-renders using the JavaScript identity of each key:
|
|
472
|
+
|
|
473
|
+
```gjs {data-filename="app/components/object-keyed-map.gjs"}
|
|
474
|
+
import Component from '@glimmer/component';
|
|
475
|
+
|
|
476
|
+
export default class ObjectKeyedMap extends Component {
|
|
477
|
+
map = new Map([
|
|
478
|
+
[{ name: 'one' }, 'foo'],
|
|
479
|
+
[{ name: 'two' }, 'bar'],
|
|
480
|
+
]);
|
|
481
|
+
|
|
482
|
+
<template>
|
|
483
|
+
<ul>
|
|
484
|
+
{{#each-in this.map key="@identity" as |key value|}}
|
|
485
|
+
<li>{{key.name}}: {{value}}</li>
|
|
486
|
+
{{/each-in}}
|
|
487
|
+
</ul>
|
|
488
|
+
</template>
|
|
489
|
+
}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
`#each-in` is a keyword and does not need to be imported.
|
|
493
|
+
|
|
389
494
|
@method each-in
|
|
390
|
-
@
|
|
495
|
+
@static
|
|
496
|
+
@noimport
|
|
497
|
+
@for Keywords
|
|
391
498
|
@public
|
|
392
499
|
@since 2.1.0
|
|
393
500
|
*/
|
|
@@ -772,80 +879,50 @@ const trackArray = internalHelper(({
|
|
|
772
879
|
});
|
|
773
880
|
|
|
774
881
|
/**
|
|
775
|
-
@module ember
|
|
882
|
+
@module @ember/helper
|
|
776
883
|
*/
|
|
777
884
|
|
|
778
885
|
/**
|
|
779
|
-
The `mut` helper
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
```handlebars
|
|
785
|
-
<MyChild @childClickCount={{fn (mut totalClicks)}} />
|
|
786
|
-
```
|
|
787
|
-
|
|
788
|
-
or
|
|
789
|
-
|
|
790
|
-
```handlebars
|
|
791
|
-
{{my-child childClickCount=(mut totalClicks)}}
|
|
792
|
-
```
|
|
793
|
-
|
|
794
|
-
The child `Component` can then modify the parent's value just by modifying its own
|
|
795
|
-
property:
|
|
796
|
-
|
|
797
|
-
```javascript
|
|
798
|
-
// my-child.js
|
|
799
|
-
export default class MyChild extends Component {
|
|
800
|
-
click() {
|
|
801
|
-
this.incrementProperty('childClickCount');
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
```
|
|
886
|
+
The `mut` helper is a shortcut for updating for args.
|
|
887
|
+
|
|
888
|
+
However, defining update functions on your backing class is preferable to using `mut`.
|
|
889
|
+
|
|
890
|
+
More directly: Don't use `mut`.
|
|
805
891
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
Additionally, the `mut` helper can be combined with the `fn` helper to
|
|
810
|
-
mutate a value. For example:
|
|
811
|
-
|
|
812
|
-
```handlebars
|
|
813
|
-
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
|
|
814
|
-
```
|
|
815
|
-
|
|
816
|
-
or
|
|
892
|
+
The `mut` helper, when used with `fn`, will return a function that
|
|
893
|
+
sets the value passed to `mut` to its first argument. As an example, we can create a
|
|
894
|
+
button that increments a value passing the value directly to the `fn`:
|
|
817
895
|
|
|
818
896
|
```handlebars
|
|
819
|
-
|
|
897
|
+
<MyChild @childClickCount={{this.totalClicks}} @clickCountChange={{fn (mut this.totalClicks)}} />
|
|
820
898
|
```
|
|
821
899
|
|
|
822
|
-
The child `Component` would invoke the function with the new click
|
|
900
|
+
The child `Component` would invoke the function with the new click count:
|
|
823
901
|
|
|
824
|
-
```
|
|
825
|
-
|
|
902
|
+
```gjs {data-filename="app/components/my-child.gjs"}
|
|
903
|
+
import Component from '@glimmer/component';
|
|
904
|
+
import { action } from '@ember/object';
|
|
905
|
+
|
|
826
906
|
export default class MyChild extends Component {
|
|
827
|
-
|
|
828
|
-
|
|
907
|
+
@action
|
|
908
|
+
update() {
|
|
909
|
+
this.args.clickCountChange(this.args.childClickCount + 1);
|
|
829
910
|
}
|
|
911
|
+
|
|
912
|
+
<template>
|
|
913
|
+
<button {{on "click" this.update}}>
|
|
914
|
+
Click me!
|
|
915
|
+
</button>
|
|
916
|
+
</template>
|
|
830
917
|
}
|
|
831
918
|
```
|
|
832
919
|
|
|
833
920
|
The `mut` helper changes the `totalClicks` value to what was provided as the `fn` argument.
|
|
834
921
|
|
|
835
|
-
The `mut` helper, when used with `fn`, will return a function that
|
|
836
|
-
sets the value passed to `mut` to its first argument. As an example, we can create a
|
|
837
|
-
button that increments a value passing the value directly to the `fn`:
|
|
838
|
-
|
|
839
|
-
```handlebars
|
|
840
|
-
{{! inc helper is not provided by Ember }}
|
|
841
|
-
<button onclick={{fn (mut count) (inc count)}}>
|
|
842
|
-
Increment count
|
|
843
|
-
</button>
|
|
844
|
-
```
|
|
845
|
-
|
|
846
922
|
@method mut
|
|
847
923
|
@param {Object} [attr] the "two-way" attribute that can be modified.
|
|
848
|
-
@
|
|
924
|
+
@static
|
|
925
|
+
@for Keywords
|
|
849
926
|
@public
|
|
850
927
|
*/
|
|
851
928
|
|
|
@@ -857,13 +934,17 @@ const mut = internalHelper(({
|
|
|
857
934
|
});
|
|
858
935
|
|
|
859
936
|
/**
|
|
860
|
-
@module ember
|
|
937
|
+
@module @ember/helper
|
|
861
938
|
*/
|
|
862
939
|
|
|
863
940
|
|
|
864
941
|
/**
|
|
865
942
|
The `readonly` helper let's you specify that a binding is one-way only,
|
|
866
943
|
instead of two-way.
|
|
944
|
+
|
|
945
|
+
This is a vestigial helper from the days of `@ember/component` and does not apply to
|
|
946
|
+
components extending from `@glimmer/component`.
|
|
947
|
+
|
|
867
948
|
When you pass a `readonly` binding from an outer context (e.g. parent component),
|
|
868
949
|
to to an inner context (e.g. child component), you are saying that changing that
|
|
869
950
|
property in the inner context does not change the value in the outer context.
|
|
@@ -876,14 +957,6 @@ const mut = internalHelper(({
|
|
|
876
957
|
}
|
|
877
958
|
```
|
|
878
959
|
|
|
879
|
-
```app/templates/components/my-parent.hbs
|
|
880
|
-
{{log totalClicks}} // -> 3
|
|
881
|
-
<MyChild @childClickCount={{readonly totalClicks}} />
|
|
882
|
-
```
|
|
883
|
-
```
|
|
884
|
-
{{my-child childClickCount=(readonly totalClicks)}}
|
|
885
|
-
```
|
|
886
|
-
|
|
887
960
|
Now, when you update `childClickCount`:
|
|
888
961
|
|
|
889
962
|
```app/components/my-child.js
|
|
@@ -973,7 +1046,9 @@ const mut = internalHelper(({
|
|
|
973
1046
|
|
|
974
1047
|
@method readonly
|
|
975
1048
|
@param {Object} [attr] the read-only attribute.
|
|
976
|
-
@for
|
|
1049
|
+
@for Keywords
|
|
1050
|
+
@noimport
|
|
1051
|
+
@static
|
|
977
1052
|
@private
|
|
978
1053
|
*/
|
|
979
1054
|
const readonly = internalHelper(({
|
|
@@ -984,7 +1059,7 @@ const readonly = internalHelper(({
|
|
|
984
1059
|
});
|
|
985
1060
|
|
|
986
1061
|
/**
|
|
987
|
-
@module ember
|
|
1062
|
+
@module @ember/helper
|
|
988
1063
|
*/
|
|
989
1064
|
|
|
990
1065
|
|
|
@@ -1010,9 +1085,13 @@ const readonly = internalHelper(({
|
|
|
1010
1085
|
|
|
1011
1086
|
The `unbound` helper only accepts a single argument, and it return an
|
|
1012
1087
|
unbound value.
|
|
1088
|
+
|
|
1089
|
+
`unbound` is a template keyword and does not need to be imported.
|
|
1013
1090
|
|
|
1014
1091
|
@method unbound
|
|
1015
|
-
@
|
|
1092
|
+
@static
|
|
1093
|
+
@noimport
|
|
1094
|
+
@for Keywords
|
|
1016
1095
|
@public
|
|
1017
1096
|
*/
|
|
1018
1097
|
|
|
@@ -1149,7 +1228,7 @@ class MountDefinition {
|
|
|
1149
1228
|
}
|
|
1150
1229
|
|
|
1151
1230
|
/**
|
|
1152
|
-
@module ember
|
|
1231
|
+
@module @ember/helper
|
|
1153
1232
|
*/
|
|
1154
1233
|
|
|
1155
1234
|
|
|
@@ -1160,15 +1239,14 @@ class MountDefinition {
|
|
|
1160
1239
|
|
|
1161
1240
|
For example, the following template mounts the `ember-chat` engine:
|
|
1162
1241
|
|
|
1163
|
-
```
|
|
1164
|
-
{{! application.hbs }}
|
|
1242
|
+
```gjs {data-filename="app/templates/application.gjs"}
|
|
1165
1243
|
{{mount "ember-chat"}}
|
|
1166
1244
|
```
|
|
1167
1245
|
|
|
1168
1246
|
Additionally, you can also pass in a `model` argument that will be
|
|
1169
1247
|
set as the engines model. This can be an existing object:
|
|
1170
1248
|
|
|
1171
|
-
```
|
|
1249
|
+
```hbs
|
|
1172
1250
|
<div>
|
|
1173
1251
|
{{mount 'admin' model=userSettings}}
|
|
1174
1252
|
</div>
|
|
@@ -1176,21 +1254,28 @@ class MountDefinition {
|
|
|
1176
1254
|
|
|
1177
1255
|
Or an inline `hash`, and you can even pass components:
|
|
1178
1256
|
|
|
1257
|
+
```gjs
|
|
1258
|
+
import SignInButton from '../components/sign-in-button';
|
|
1259
|
+
<template>
|
|
1260
|
+
<div>
|
|
1261
|
+
<h1>Application template!</h1>
|
|
1262
|
+
{{mount 'admin' model=(hash
|
|
1263
|
+
title='Secret Admin'
|
|
1264
|
+
signInButton=SignInButton
|
|
1265
|
+
)}}
|
|
1266
|
+
</div>
|
|
1267
|
+
</template>
|
|
1179
1268
|
```
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
{{mount 'admin' model=(hash
|
|
1183
|
-
title='Secret Admin'
|
|
1184
|
-
signInButton=(component 'sign-in-button')
|
|
1185
|
-
)}}
|
|
1186
|
-
</div>
|
|
1187
|
-
```
|
|
1269
|
+
|
|
1270
|
+
`mount` is built-in and does not need to be imported.
|
|
1188
1271
|
|
|
1189
1272
|
@method mount
|
|
1190
1273
|
@param {String} name Name of the engine to mount.
|
|
1191
1274
|
@param {Object} [model] Object that will be set as
|
|
1192
1275
|
the model of the engine.
|
|
1193
|
-
@for
|
|
1276
|
+
@for Keywords
|
|
1277
|
+
@static
|
|
1278
|
+
@noimport
|
|
1194
1279
|
@public
|
|
1195
1280
|
*/
|
|
1196
1281
|
const mountHelper = internalHelper((args, owner) => {
|
|
@@ -1313,28 +1398,41 @@ function makeRouteTemplate(owner, name, template) {
|
|
|
1313
1398
|
return curry(0, routeTemplate, owner, null, true);
|
|
1314
1399
|
}
|
|
1315
1400
|
|
|
1401
|
+
/**
|
|
1402
|
+
@module @ember/helper
|
|
1403
|
+
*/
|
|
1404
|
+
|
|
1316
1405
|
/**
|
|
1317
1406
|
The `{{outlet}}` helper lets you specify where a child route will render in
|
|
1318
1407
|
your template. An important use of the `{{outlet}}` helper is in your
|
|
1319
|
-
application's `application.
|
|
1320
|
-
|
|
1321
|
-
```app/templates/application.
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1408
|
+
application's `application.gjs` file:
|
|
1409
|
+
|
|
1410
|
+
```gjs {data-filename="app/templates/application.gjs"}
|
|
1411
|
+
import MyHeader from '../components/my-header';
|
|
1412
|
+
import MyFooter from '../components/my-footer';
|
|
1413
|
+
|
|
1414
|
+
<template>
|
|
1415
|
+
<MyHeader />
|
|
1416
|
+
|
|
1417
|
+
<div class="my-dynamic-content">
|
|
1418
|
+
<!-- this content will change based on the current route, which depends on the current URL -->
|
|
1419
|
+
{{outlet}}
|
|
1420
|
+
</div>
|
|
1421
|
+
|
|
1422
|
+
<MyFooter />
|
|
1423
|
+
</template>
|
|
1330
1424
|
```
|
|
1331
1425
|
|
|
1332
1426
|
See the [routing guide](https://guides.emberjs.com/release/routing/rendering-a-template/) for more
|
|
1333
1427
|
information on how your `route` interacts with the `{{outlet}}` helper.
|
|
1334
1428
|
Note: Your content __will not render__ if there isn't an `{{outlet}}` for it.
|
|
1335
1429
|
|
|
1430
|
+
`outlet` is built-in and does not need to be imported.
|
|
1431
|
+
|
|
1336
1432
|
@method outlet
|
|
1337
|
-
@for
|
|
1433
|
+
@for Keywords
|
|
1434
|
+
@static
|
|
1435
|
+
@noimport
|
|
1338
1436
|
@public
|
|
1339
1437
|
*/
|
|
1340
1438
|
const outletHelper = internalHelper((_args, owner, scope) => {
|
|
@@ -1828,7 +1926,12 @@ let renderSettledDeferred = null;
|
|
|
1828
1926
|
*/
|
|
1829
1927
|
function renderSettled() {
|
|
1830
1928
|
if (renderSettledDeferred === null) {
|
|
1831
|
-
|
|
1929
|
+
let resolve;
|
|
1930
|
+
let promise = new Promise(r => resolve = r);
|
|
1931
|
+
renderSettledDeferred = {
|
|
1932
|
+
promise,
|
|
1933
|
+
resolve
|
|
1934
|
+
};
|
|
1832
1935
|
// if there is no current runloop, the promise created above will not have
|
|
1833
1936
|
// a chance to resolve (because its resolved in backburner's "end" event)
|
|
1834
1937
|
if (!_getCurrentRunLoop()) {
|