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,55 +1,50 @@
|
|
|
1
1
|
import { privatize } from '../@ember/-internals/container/index.js';
|
|
2
2
|
import { E as ENV } from './env-g-kaAFLN.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 { constructStyleDeprecationMessage, getViewId, getViewElement } from '../@ember/-internals/views/lib/system/utils.js';
|
|
6
6
|
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 {
|
|
13
|
-
import { E as EMPTY_ARGS,
|
|
14
|
-
import { g as runtimeOptions, i as inTransaction, r as renderComponent$1, d as renderMain } from './render-
|
|
15
|
-
import { d as dict } from './collections-
|
|
16
|
-
import { u as unwrapTemplate,
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { h as hasDOM } from './index-DX90CU4L.js';
|
|
20
|
-
import EngineInstance from '../@ember/engine/instance.js';
|
|
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
|
+
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-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';
|
|
18
|
+
import { h as hasDOM } from './index-BGP1rw3B.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-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,
|
|
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,
|
|
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-Bg4r3CU4.js';
|
|
40
|
+
import { g as get$1, c as concat } from './get-B4o_4OLA.js';
|
|
41
|
+
import { o as on } from './on-CQqC2-wL.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--ZiOCQkd.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-BQdkjTtZ.js';
|
|
50
|
-
import '../@ember/routing/lib/routing-service.js';
|
|
45
|
+
import { a as uniqueId } from './unique-id-Csxuh1I7.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
|
}
|
|
@@ -242,55 +238,102 @@ class RootComponentDefinition {
|
|
|
242
238
|
}
|
|
243
239
|
|
|
244
240
|
/**
|
|
245
|
-
@module ember
|
|
241
|
+
@module @ember/helper
|
|
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
|
|
253
249
|
item in an array passing the item as the first block parameter.
|
|
254
250
|
|
|
255
|
-
|
|
251
|
+
```gjs {data-filename="app/components/developer-list.gjs"}
|
|
252
|
+
import Component from '@glimmer/component';
|
|
256
253
|
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
export default class DeveloperList extends Component {
|
|
255
|
+
developers = [
|
|
256
|
+
{ name: 'Yehuda' },
|
|
257
|
+
{ name: 'Tom' },
|
|
258
|
+
{ name: 'Paul' },
|
|
259
|
+
];
|
|
260
|
+
|
|
261
|
+
<template>
|
|
262
|
+
<ul>
|
|
263
|
+
{{#each this.developers as |person|}}
|
|
264
|
+
<li>Hello, {{person.name}}!</li>
|
|
265
|
+
{{/each}}
|
|
266
|
+
</ul>
|
|
267
|
+
</template>
|
|
268
|
+
}
|
|
259
269
|
```
|
|
260
270
|
|
|
261
|
-
|
|
262
|
-
<ul>
|
|
263
|
-
{{#each @developers as |person|}}
|
|
264
|
-
<li>Hello, {{person.name}}!</li>
|
|
265
|
-
{{/each}}
|
|
266
|
-
</ul>
|
|
267
|
-
```
|
|
271
|
+
The same rules apply to arrays of primitives:
|
|
268
272
|
|
|
269
|
-
|
|
273
|
+
```app/components/developer-names.gjs
|
|
274
|
+
import Component from '@glimmer/component';
|
|
270
275
|
|
|
271
|
-
|
|
272
|
-
|
|
276
|
+
export default class DeveloperNames extends Component {
|
|
277
|
+
developerNames = ['Yehuda', 'Tom', 'Paul'];
|
|
278
|
+
|
|
279
|
+
<template>
|
|
280
|
+
<ul>
|
|
281
|
+
{{#each this.developerNames as |name|}}
|
|
282
|
+
<li>Hello, {{name}}!</li>
|
|
283
|
+
{{/each}}
|
|
284
|
+
</ul>
|
|
285
|
+
</template>
|
|
286
|
+
}
|
|
273
287
|
```
|
|
274
288
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
289
|
+
`{{#each}}` also supports native JavaScript [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set)
|
|
290
|
+
values and other iterables:
|
|
291
|
+
|
|
292
|
+
```gjs {data-filename="app/components/developer-set.gjs"}
|
|
293
|
+
import Component from '@glimmer/component';
|
|
294
|
+
|
|
295
|
+
export default class DeveloperSet extends Component {
|
|
296
|
+
developers = new Set([
|
|
297
|
+
{ name: 'Yehuda' },
|
|
298
|
+
{ name: 'Tom' },
|
|
299
|
+
{ name: 'Paul' },
|
|
300
|
+
]);
|
|
301
|
+
|
|
302
|
+
<template>
|
|
303
|
+
<ul>
|
|
304
|
+
{{#each this.developers as |person|}}
|
|
305
|
+
<li>Hello, {{person.name}}!</li>
|
|
306
|
+
{{/each}}
|
|
307
|
+
</ul>
|
|
308
|
+
</template>
|
|
309
|
+
}
|
|
281
310
|
```
|
|
282
311
|
|
|
283
|
-
During iteration, the index of each item in the array is provided as a second
|
|
284
|
-
parameter
|
|
312
|
+
During iteration, the index of each item in the array is provided as a second
|
|
313
|
+
block parameter:
|
|
285
314
|
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
315
|
+
```app/components/developer-list-with-index.gjs
|
|
316
|
+
import Component from '@glimmer/component';
|
|
317
|
+
|
|
318
|
+
export default class DeveloperListWithIndex extends Component {
|
|
319
|
+
developers = [
|
|
320
|
+
{ name: 'Yehuda' },
|
|
321
|
+
{ name: 'Tom' },
|
|
322
|
+
{ name: 'Paul' },
|
|
323
|
+
];
|
|
324
|
+
|
|
325
|
+
<template>
|
|
326
|
+
<ul>
|
|
327
|
+
{{#each this.developers as |person index|}}
|
|
328
|
+
<li>Hello, {{person.name}}! You're number {{index}} in line</li>
|
|
329
|
+
{{/each}}
|
|
330
|
+
</ul>
|
|
331
|
+
</template>
|
|
332
|
+
}
|
|
292
333
|
```
|
|
293
334
|
|
|
335
|
+
`#each` is a keyword and does not need to be imported.
|
|
336
|
+
|
|
294
337
|
### Specifying Keys
|
|
295
338
|
|
|
296
339
|
In order to improve rendering speed, Ember will try to reuse the DOM elements
|
|
@@ -305,30 +348,38 @@ class RootComponentDefinition {
|
|
|
305
348
|
needed. However, in some rare cases, the objects' identities may change even
|
|
306
349
|
though they represent the same underlying data.
|
|
307
350
|
|
|
308
|
-
For example
|
|
351
|
+
For example, mapping over `people` produces a new array of new objects on each
|
|
352
|
+
render. Use `key` so Ember can match items across those renders:
|
|
309
353
|
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
return { ...person, type: 'developer' };
|
|
313
|
-
});
|
|
314
|
-
```
|
|
354
|
+
```gjs {data-filename="app/components/mapped-developers.gjs"}
|
|
355
|
+
import Component from '@glimmer/component';
|
|
315
356
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
357
|
+
export default class MappedDevelopers extends Component {
|
|
358
|
+
people = [
|
|
359
|
+
{ name: 'Yehuda' },
|
|
360
|
+
{ name: 'Tom' },
|
|
361
|
+
{ name: 'Paul' },
|
|
362
|
+
];
|
|
320
363
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
364
|
+
get developers() {
|
|
365
|
+
return this.people.map((person) => {
|
|
366
|
+
return { ...person, type: 'developer' };
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
<template>
|
|
371
|
+
<ul>
|
|
372
|
+
{{#each this.developers key="name" as |person|}}
|
|
373
|
+
<li>Hello, {{person.name}}!</li>
|
|
374
|
+
{{/each}}
|
|
375
|
+
</ul>
|
|
376
|
+
</template>
|
|
377
|
+
}
|
|
327
378
|
```
|
|
328
379
|
|
|
329
380
|
By doing so, Ember will use the value of the property specified (`person.name`
|
|
330
381
|
in the example) to find a "match" from the previous render. That is, if Ember
|
|
331
|
-
has previously seen an object from the
|
|
382
|
+
has previously seen an object from the `developers` array with a matching
|
|
332
383
|
name, its DOM elements will be re-used.
|
|
333
384
|
|
|
334
385
|
There are two special values for `key`:
|
|
@@ -341,50 +392,59 @@ class RootComponentDefinition {
|
|
|
341
392
|
`{{#each}}` can have a matching `{{else}}`. The contents of this block will render
|
|
342
393
|
if the collection is empty.
|
|
343
394
|
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
395
|
+
```gjs {data-filename="app/components/available-developers.gjs"}
|
|
396
|
+
import Component from '@glimmer/component';
|
|
397
|
+
|
|
398
|
+
export default class AvailableDevelopers extends Component {
|
|
399
|
+
developers = [];
|
|
400
|
+
|
|
401
|
+
<template>
|
|
402
|
+
<ul>
|
|
403
|
+
{{#each this.developers as |person|}}
|
|
404
|
+
<li>{{person.name}} is available!</li>
|
|
405
|
+
{{else}}
|
|
406
|
+
<li>Sorry, nobody is available for this task.</li>
|
|
407
|
+
{{/each}}
|
|
408
|
+
</ul>
|
|
409
|
+
</template>
|
|
410
|
+
}
|
|
352
411
|
```
|
|
353
412
|
|
|
354
413
|
@method each
|
|
355
|
-
@for
|
|
414
|
+
@for Keywords
|
|
415
|
+
@static
|
|
416
|
+
@noimport
|
|
356
417
|
@public
|
|
357
418
|
*/
|
|
358
419
|
|
|
359
420
|
/**
|
|
360
|
-
The `{{each-in}}`
|
|
421
|
+
The `{{#each-in}}` keyword loops over properties on an object, or entries in a
|
|
422
|
+
native JavaScript [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map).
|
|
361
423
|
|
|
362
424
|
For example, given this component definition:
|
|
363
425
|
|
|
364
|
-
```app/components/developer-details.
|
|
426
|
+
```gjs {data-filename="app/components/developer-details.gjs"}
|
|
365
427
|
import Component from '@glimmer/component';
|
|
366
428
|
import { tracked } from '@glimmer/tracking';
|
|
367
429
|
|
|
368
|
-
export default class extends Component {
|
|
430
|
+
export default class DeveloperDetails extends Component {
|
|
369
431
|
@tracked developer = {
|
|
370
|
-
|
|
371
|
-
|
|
432
|
+
name: 'Shelly Sails',
|
|
433
|
+
age: 42,
|
|
372
434
|
};
|
|
435
|
+
|
|
436
|
+
<template>
|
|
437
|
+
<ul>
|
|
438
|
+
{{#each-in this.developer as |key value|}}
|
|
439
|
+
<li>{{key}}: {{value}}</li>
|
|
440
|
+
{{/each-in}}
|
|
441
|
+
</ul>
|
|
442
|
+
</template>
|
|
373
443
|
}
|
|
374
444
|
```
|
|
375
445
|
|
|
376
446
|
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:
|
|
447
|
+
object in a list, outputting their name and age:
|
|
388
448
|
|
|
389
449
|
```html
|
|
390
450
|
<ul>
|
|
@@ -393,8 +453,55 @@ class RootComponentDefinition {
|
|
|
393
453
|
</ul>
|
|
394
454
|
```
|
|
395
455
|
|
|
456
|
+
The same pattern works with a `Map`:
|
|
457
|
+
|
|
458
|
+
```gjs {data-filename="app/components/developer-map.gjs"}
|
|
459
|
+
import Component from '@glimmer/component';
|
|
460
|
+
|
|
461
|
+
export default class DeveloperMap extends Component {
|
|
462
|
+
map = new Map([
|
|
463
|
+
['name', 'Shelly Sails'],
|
|
464
|
+
['age', 42],
|
|
465
|
+
]);
|
|
466
|
+
|
|
467
|
+
<template>
|
|
468
|
+
<ul>
|
|
469
|
+
{{#each-in this.map as |key value|}}
|
|
470
|
+
<li>{{key}}: {{value}}</li>
|
|
471
|
+
{{/each-in}}
|
|
472
|
+
</ul>
|
|
473
|
+
</template>
|
|
474
|
+
}
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
When a `Map` uses object keys, you can pass `key="@identity"` to explicitly
|
|
478
|
+
track entries across re-renders using the JavaScript identity of each key:
|
|
479
|
+
|
|
480
|
+
```gjs {data-filename="app/components/object-keyed-map.gjs"}
|
|
481
|
+
import Component from '@glimmer/component';
|
|
482
|
+
|
|
483
|
+
export default class ObjectKeyedMap extends Component {
|
|
484
|
+
map = new Map([
|
|
485
|
+
[{ name: 'one' }, 'foo'],
|
|
486
|
+
[{ name: 'two' }, 'bar'],
|
|
487
|
+
]);
|
|
488
|
+
|
|
489
|
+
<template>
|
|
490
|
+
<ul>
|
|
491
|
+
{{#each-in this.map key="@identity" as |key value|}}
|
|
492
|
+
<li>{{key.name}}: {{value}}</li>
|
|
493
|
+
{{/each-in}}
|
|
494
|
+
</ul>
|
|
495
|
+
</template>
|
|
496
|
+
}
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
`#each-in` is a keyword and does not need to be imported.
|
|
500
|
+
|
|
396
501
|
@method each-in
|
|
397
|
-
@
|
|
502
|
+
@static
|
|
503
|
+
@noimport
|
|
504
|
+
@for Keywords
|
|
398
505
|
@public
|
|
399
506
|
@since 2.1.0
|
|
400
507
|
*/
|
|
@@ -857,80 +964,50 @@ const trackArray = internalHelper(({
|
|
|
857
964
|
});
|
|
858
965
|
|
|
859
966
|
/**
|
|
860
|
-
@module ember
|
|
967
|
+
@module @ember/helper
|
|
861
968
|
*/
|
|
862
969
|
|
|
863
970
|
/**
|
|
864
|
-
The `mut` helper
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
```handlebars
|
|
870
|
-
<MyChild @childClickCount={{fn (mut totalClicks)}} />
|
|
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
|
-
```
|
|
971
|
+
The `mut` helper is a shortcut for updating for args.
|
|
972
|
+
|
|
973
|
+
However, defining update functions on your backing class is preferable to using `mut`.
|
|
974
|
+
|
|
975
|
+
More directly: Don't use `mut`.
|
|
890
976
|
|
|
891
|
-
|
|
892
|
-
|
|
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
|
|
977
|
+
The `mut` helper, when used with `fn`, will return a function that
|
|
978
|
+
sets the value passed to `mut` to its first argument. As an example, we can create a
|
|
979
|
+
button that increments a value passing the value directly to the `fn`:
|
|
902
980
|
|
|
903
981
|
```handlebars
|
|
904
|
-
|
|
982
|
+
<MyChild @childClickCount={{this.totalClicks}} @clickCountChange={{fn (mut this.totalClicks)}} />
|
|
905
983
|
```
|
|
906
984
|
|
|
907
|
-
The child `Component` would invoke the function with the new click
|
|
985
|
+
The child `Component` would invoke the function with the new click count:
|
|
908
986
|
|
|
909
|
-
```
|
|
910
|
-
|
|
987
|
+
```gjs {data-filename="app/components/my-child.gjs"}
|
|
988
|
+
import Component from '@glimmer/component';
|
|
989
|
+
import { action } from '@ember/object';
|
|
990
|
+
|
|
911
991
|
export default class MyChild extends Component {
|
|
912
|
-
|
|
913
|
-
|
|
992
|
+
@action
|
|
993
|
+
update() {
|
|
994
|
+
this.args.clickCountChange(this.args.childClickCount + 1);
|
|
914
995
|
}
|
|
996
|
+
|
|
997
|
+
<template>
|
|
998
|
+
<button {{on "click" this.update}}>
|
|
999
|
+
Click me!
|
|
1000
|
+
</button>
|
|
1001
|
+
</template>
|
|
915
1002
|
}
|
|
916
1003
|
```
|
|
917
1004
|
|
|
918
1005
|
The `mut` helper changes the `totalClicks` value to what was provided as the `fn` argument.
|
|
919
1006
|
|
|
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
1007
|
@method mut
|
|
932
1008
|
@param {Object} [attr] the "two-way" attribute that can be modified.
|
|
933
|
-
@
|
|
1009
|
+
@static
|
|
1010
|
+
@for Keywords
|
|
934
1011
|
@public
|
|
935
1012
|
*/
|
|
936
1013
|
|
|
@@ -955,13 +1032,17 @@ const mut = internalHelper(({
|
|
|
955
1032
|
});
|
|
956
1033
|
|
|
957
1034
|
/**
|
|
958
|
-
@module ember
|
|
1035
|
+
@module @ember/helper
|
|
959
1036
|
*/
|
|
960
1037
|
|
|
961
1038
|
|
|
962
1039
|
/**
|
|
963
1040
|
The `readonly` helper let's you specify that a binding is one-way only,
|
|
964
1041
|
instead of two-way.
|
|
1042
|
+
|
|
1043
|
+
This is a vestigial helper from the days of `@ember/component` and does not apply to
|
|
1044
|
+
components extending from `@glimmer/component`.
|
|
1045
|
+
|
|
965
1046
|
When you pass a `readonly` binding from an outer context (e.g. parent component),
|
|
966
1047
|
to to an inner context (e.g. child component), you are saying that changing that
|
|
967
1048
|
property in the inner context does not change the value in the outer context.
|
|
@@ -974,14 +1055,6 @@ const mut = internalHelper(({
|
|
|
974
1055
|
}
|
|
975
1056
|
```
|
|
976
1057
|
|
|
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
1058
|
Now, when you update `childClickCount`:
|
|
986
1059
|
|
|
987
1060
|
```app/components/my-child.js
|
|
@@ -1071,7 +1144,9 @@ const mut = internalHelper(({
|
|
|
1071
1144
|
|
|
1072
1145
|
@method readonly
|
|
1073
1146
|
@param {Object} [attr] the read-only attribute.
|
|
1074
|
-
@for
|
|
1147
|
+
@for Keywords
|
|
1148
|
+
@noimport
|
|
1149
|
+
@static
|
|
1075
1150
|
@private
|
|
1076
1151
|
*/
|
|
1077
1152
|
const readonly = internalHelper(({
|
|
@@ -1083,7 +1158,7 @@ const readonly = internalHelper(({
|
|
|
1083
1158
|
});
|
|
1084
1159
|
|
|
1085
1160
|
/**
|
|
1086
|
-
@module ember
|
|
1161
|
+
@module @ember/helper
|
|
1087
1162
|
*/
|
|
1088
1163
|
|
|
1089
1164
|
|
|
@@ -1109,9 +1184,13 @@ const readonly = internalHelper(({
|
|
|
1109
1184
|
|
|
1110
1185
|
The `unbound` helper only accepts a single argument, and it return an
|
|
1111
1186
|
unbound value.
|
|
1187
|
+
|
|
1188
|
+
`unbound` is a template keyword and does not need to be imported.
|
|
1112
1189
|
|
|
1113
1190
|
@method unbound
|
|
1114
|
-
@
|
|
1191
|
+
@static
|
|
1192
|
+
@noimport
|
|
1193
|
+
@for Keywords
|
|
1115
1194
|
@public
|
|
1116
1195
|
*/
|
|
1117
1196
|
|
|
@@ -1156,7 +1235,7 @@ class MountManager {
|
|
|
1156
1235
|
// mount is a runtime helper, this shouldn't use dynamic layout
|
|
1157
1236
|
// we should resolve the engine app template in the helper
|
|
1158
1237
|
// it also should use the owner that looked up the mount helper.
|
|
1159
|
-
(!(
|
|
1238
|
+
(!('buildChildEngineInstance' in owner) && assert('Expected owner to be an EngineInstance', 'buildChildEngineInstance' in owner));
|
|
1160
1239
|
let engine = owner.buildChildEngineInstance(name);
|
|
1161
1240
|
engine.boot();
|
|
1162
1241
|
let applicationFactory = engine.factoryFor(`controller:application`);
|
|
@@ -1254,7 +1333,7 @@ class MountDefinition {
|
|
|
1254
1333
|
}
|
|
1255
1334
|
|
|
1256
1335
|
/**
|
|
1257
|
-
@module ember
|
|
1336
|
+
@module @ember/helper
|
|
1258
1337
|
*/
|
|
1259
1338
|
|
|
1260
1339
|
|
|
@@ -1265,15 +1344,14 @@ class MountDefinition {
|
|
|
1265
1344
|
|
|
1266
1345
|
For example, the following template mounts the `ember-chat` engine:
|
|
1267
1346
|
|
|
1268
|
-
```
|
|
1269
|
-
{{! application.hbs }}
|
|
1347
|
+
```gjs {data-filename="app/templates/application.gjs"}
|
|
1270
1348
|
{{mount "ember-chat"}}
|
|
1271
1349
|
```
|
|
1272
1350
|
|
|
1273
1351
|
Additionally, you can also pass in a `model` argument that will be
|
|
1274
1352
|
set as the engines model. This can be an existing object:
|
|
1275
1353
|
|
|
1276
|
-
```
|
|
1354
|
+
```hbs
|
|
1277
1355
|
<div>
|
|
1278
1356
|
{{mount 'admin' model=userSettings}}
|
|
1279
1357
|
</div>
|
|
@@ -1281,21 +1359,28 @@ class MountDefinition {
|
|
|
1281
1359
|
|
|
1282
1360
|
Or an inline `hash`, and you can even pass components:
|
|
1283
1361
|
|
|
1362
|
+
```gjs
|
|
1363
|
+
import SignInButton from '../components/sign-in-button';
|
|
1364
|
+
<template>
|
|
1365
|
+
<div>
|
|
1366
|
+
<h1>Application template!</h1>
|
|
1367
|
+
{{mount 'admin' model=(hash
|
|
1368
|
+
title='Secret Admin'
|
|
1369
|
+
signInButton=SignInButton
|
|
1370
|
+
)}}
|
|
1371
|
+
</div>
|
|
1372
|
+
</template>
|
|
1284
1373
|
```
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
{{mount 'admin' model=(hash
|
|
1288
|
-
title='Secret Admin'
|
|
1289
|
-
signInButton=(component 'sign-in-button')
|
|
1290
|
-
)}}
|
|
1291
|
-
</div>
|
|
1292
|
-
```
|
|
1374
|
+
|
|
1375
|
+
`mount` is built-in and does not need to be imported.
|
|
1293
1376
|
|
|
1294
1377
|
@method mount
|
|
1295
1378
|
@param {String} name Name of the engine to mount.
|
|
1296
1379
|
@param {Object} [model] Object that will be set as
|
|
1297
1380
|
the model of the engine.
|
|
1298
|
-
@for
|
|
1381
|
+
@for Keywords
|
|
1382
|
+
@static
|
|
1383
|
+
@noimport
|
|
1299
1384
|
@public
|
|
1300
1385
|
*/
|
|
1301
1386
|
const mountHelper = internalHelper((args, owner) => {
|
|
@@ -1430,28 +1515,41 @@ function makeRouteTemplate(owner, name, template) {
|
|
|
1430
1515
|
return curry(0, routeTemplate, owner, null, true);
|
|
1431
1516
|
}
|
|
1432
1517
|
|
|
1518
|
+
/**
|
|
1519
|
+
@module @ember/helper
|
|
1520
|
+
*/
|
|
1521
|
+
|
|
1433
1522
|
/**
|
|
1434
1523
|
The `{{outlet}}` helper lets you specify where a child route will render in
|
|
1435
1524
|
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
|
-
|
|
1525
|
+
application's `application.gjs` file:
|
|
1526
|
+
|
|
1527
|
+
```gjs {data-filename="app/templates/application.gjs"}
|
|
1528
|
+
import MyHeader from '../components/my-header';
|
|
1529
|
+
import MyFooter from '../components/my-footer';
|
|
1530
|
+
|
|
1531
|
+
<template>
|
|
1532
|
+
<MyHeader />
|
|
1533
|
+
|
|
1534
|
+
<div class="my-dynamic-content">
|
|
1535
|
+
<!-- this content will change based on the current route, which depends on the current URL -->
|
|
1536
|
+
{{outlet}}
|
|
1537
|
+
</div>
|
|
1538
|
+
|
|
1539
|
+
<MyFooter />
|
|
1540
|
+
</template>
|
|
1447
1541
|
```
|
|
1448
1542
|
|
|
1449
1543
|
See the [routing guide](https://guides.emberjs.com/release/routing/rendering-a-template/) for more
|
|
1450
1544
|
information on how your `route` interacts with the `{{outlet}}` helper.
|
|
1451
1545
|
Note: Your content __will not render__ if there isn't an `{{outlet}}` for it.
|
|
1452
1546
|
|
|
1547
|
+
`outlet` is built-in and does not need to be imported.
|
|
1548
|
+
|
|
1453
1549
|
@method outlet
|
|
1454
|
-
@for
|
|
1550
|
+
@for Keywords
|
|
1551
|
+
@static
|
|
1552
|
+
@noimport
|
|
1455
1553
|
@public
|
|
1456
1554
|
*/
|
|
1457
1555
|
const outletHelper = internalHelper((_args, owner, scope) => {
|
|
@@ -2001,7 +2099,12 @@ let renderSettledDeferred = null;
|
|
|
2001
2099
|
*/
|
|
2002
2100
|
function renderSettled() {
|
|
2003
2101
|
if (renderSettledDeferred === null) {
|
|
2004
|
-
|
|
2102
|
+
let resolve;
|
|
2103
|
+
let promise = new Promise(r => resolve = r);
|
|
2104
|
+
renderSettledDeferred = {
|
|
2105
|
+
promise,
|
|
2106
|
+
resolve
|
|
2107
|
+
};
|
|
2005
2108
|
// if there is no current runloop, the promise created above will not have
|
|
2006
2109
|
// a chance to resolve (because its resolved in backburner's "end" event)
|
|
2007
2110
|
if (!_getCurrentRunLoop()) {
|