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,50 +1,97 @@
|
|
|
1
1
|
declare module '@ember/-internals/glimmer/lib/helpers/each-in' {
|
|
2
2
|
/**
|
|
3
|
-
The `{{#each}}`
|
|
3
|
+
The `{{#each}}` keyword loops over elements in a collection. It is an extension
|
|
4
4
|
of the base Handlebars `{{#each}}` helper.
|
|
5
5
|
|
|
6
6
|
The default behavior of `{{#each}}` is to yield its inner block once for every
|
|
7
7
|
item in an array passing the item as the first block parameter.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```gjs {data-filename="app/components/developer-list.gjs"}
|
|
10
|
+
import Component from '@glimmer/component';
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
export default class DeveloperList extends Component {
|
|
13
|
+
developers = [
|
|
14
|
+
{ name: 'Yehuda' },
|
|
15
|
+
{ name: 'Tom' },
|
|
16
|
+
{ name: 'Paul' },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<ul>
|
|
21
|
+
{{#each this.developers as |person|}}
|
|
22
|
+
<li>Hello, {{person.name}}!</li>
|
|
23
|
+
{{/each}}
|
|
24
|
+
</ul>
|
|
25
|
+
</template>
|
|
26
|
+
}
|
|
13
27
|
```
|
|
14
28
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{{/each}}
|
|
20
|
-
</ul>
|
|
21
|
-
```
|
|
29
|
+
The same rules apply to arrays of primitives:
|
|
30
|
+
|
|
31
|
+
```app/components/developer-names.gjs
|
|
32
|
+
import Component from '@glimmer/component';
|
|
22
33
|
|
|
23
|
-
|
|
34
|
+
export default class DeveloperNames extends Component {
|
|
35
|
+
developerNames = ['Yehuda', 'Tom', 'Paul'];
|
|
24
36
|
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
<template>
|
|
38
|
+
<ul>
|
|
39
|
+
{{#each this.developerNames as |name|}}
|
|
40
|
+
<li>Hello, {{name}}!</li>
|
|
41
|
+
{{/each}}
|
|
42
|
+
</ul>
|
|
43
|
+
</template>
|
|
44
|
+
}
|
|
27
45
|
```
|
|
28
46
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
47
|
+
`{{#each}}` also supports native JavaScript [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set)
|
|
48
|
+
values and other iterables:
|
|
49
|
+
|
|
50
|
+
```gjs {data-filename="app/components/developer-set.gjs"}
|
|
51
|
+
import Component from '@glimmer/component';
|
|
52
|
+
|
|
53
|
+
export default class DeveloperSet extends Component {
|
|
54
|
+
developers = new Set([
|
|
55
|
+
{ name: 'Yehuda' },
|
|
56
|
+
{ name: 'Tom' },
|
|
57
|
+
{ name: 'Paul' },
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
<template>
|
|
61
|
+
<ul>
|
|
62
|
+
{{#each this.developers as |person|}}
|
|
63
|
+
<li>Hello, {{person.name}}!</li>
|
|
64
|
+
{{/each}}
|
|
65
|
+
</ul>
|
|
66
|
+
</template>
|
|
67
|
+
}
|
|
35
68
|
```
|
|
36
69
|
|
|
37
|
-
During iteration, the index of each item in the array is provided as a second
|
|
38
|
-
parameter
|
|
70
|
+
During iteration, the index of each item in the array is provided as a second
|
|
71
|
+
block parameter:
|
|
39
72
|
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
73
|
+
```app/components/developer-list-with-index.gjs
|
|
74
|
+
import Component from '@glimmer/component';
|
|
75
|
+
|
|
76
|
+
export default class DeveloperListWithIndex extends Component {
|
|
77
|
+
developers = [
|
|
78
|
+
{ name: 'Yehuda' },
|
|
79
|
+
{ name: 'Tom' },
|
|
80
|
+
{ name: 'Paul' },
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
<template>
|
|
84
|
+
<ul>
|
|
85
|
+
{{#each this.developers as |person index|}}
|
|
86
|
+
<li>Hello, {{person.name}}! You're number {{index}} in line</li>
|
|
87
|
+
{{/each}}
|
|
88
|
+
</ul>
|
|
89
|
+
</template>
|
|
90
|
+
}
|
|
46
91
|
```
|
|
47
92
|
|
|
93
|
+
`#each` is a keyword and does not need to be imported.
|
|
94
|
+
|
|
48
95
|
### Specifying Keys
|
|
49
96
|
|
|
50
97
|
In order to improve rendering speed, Ember will try to reuse the DOM elements
|
|
@@ -59,30 +106,38 @@ declare module '@ember/-internals/glimmer/lib/helpers/each-in' {
|
|
|
59
106
|
needed. However, in some rare cases, the objects' identities may change even
|
|
60
107
|
though they represent the same underlying data.
|
|
61
108
|
|
|
62
|
-
For example
|
|
63
|
-
|
|
64
|
-
```javascript
|
|
65
|
-
people.map(person => {
|
|
66
|
-
return { ...person, type: 'developer' };
|
|
67
|
-
});
|
|
68
|
-
```
|
|
109
|
+
For example, mapping over `people` produces a new array of new objects on each
|
|
110
|
+
render. Use `key` so Ember can match items across those renders:
|
|
69
111
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
you can help Ember determine how these objects related to each other with the
|
|
73
|
-
`key` option:
|
|
112
|
+
```gjs {data-filename="app/components/mapped-developers.gjs"}
|
|
113
|
+
import Component from '@glimmer/component';
|
|
74
114
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
115
|
+
export default class MappedDevelopers extends Component {
|
|
116
|
+
people = [
|
|
117
|
+
{ name: 'Yehuda' },
|
|
118
|
+
{ name: 'Tom' },
|
|
119
|
+
{ name: 'Paul' },
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
get developers() {
|
|
123
|
+
return this.people.map((person) => {
|
|
124
|
+
return { ...person, type: 'developer' };
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
<template>
|
|
129
|
+
<ul>
|
|
130
|
+
{{#each this.developers key="name" as |person|}}
|
|
131
|
+
<li>Hello, {{person.name}}!</li>
|
|
132
|
+
{{/each}}
|
|
133
|
+
</ul>
|
|
134
|
+
</template>
|
|
135
|
+
}
|
|
81
136
|
```
|
|
82
137
|
|
|
83
138
|
By doing so, Ember will use the value of the property specified (`person.name`
|
|
84
139
|
in the example) to find a "match" from the previous render. That is, if Ember
|
|
85
|
-
has previously seen an object from the
|
|
140
|
+
has previously seen an object from the `developers` array with a matching
|
|
86
141
|
name, its DOM elements will be re-used.
|
|
87
142
|
|
|
88
143
|
There are two special values for `key`:
|
|
@@ -95,49 +150,58 @@ declare module '@ember/-internals/glimmer/lib/helpers/each-in' {
|
|
|
95
150
|
`{{#each}}` can have a matching `{{else}}`. The contents of this block will render
|
|
96
151
|
if the collection is empty.
|
|
97
152
|
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
153
|
+
```gjs {data-filename="app/components/available-developers.gjs"}
|
|
154
|
+
import Component from '@glimmer/component';
|
|
155
|
+
|
|
156
|
+
export default class AvailableDevelopers extends Component {
|
|
157
|
+
developers = [];
|
|
158
|
+
|
|
159
|
+
<template>
|
|
160
|
+
<ul>
|
|
161
|
+
{{#each this.developers as |person|}}
|
|
162
|
+
<li>{{person.name}} is available!</li>
|
|
163
|
+
{{else}}
|
|
164
|
+
<li>Sorry, nobody is available for this task.</li>
|
|
165
|
+
{{/each}}
|
|
166
|
+
</ul>
|
|
167
|
+
</template>
|
|
168
|
+
}
|
|
106
169
|
```
|
|
107
170
|
|
|
108
171
|
@method each
|
|
109
|
-
@for
|
|
172
|
+
@for Keywords
|
|
173
|
+
@static
|
|
174
|
+
@noimport
|
|
110
175
|
@public
|
|
111
176
|
*/
|
|
112
177
|
/**
|
|
113
|
-
The `{{each-in}}`
|
|
178
|
+
The `{{#each-in}}` keyword loops over properties on an object, or entries in a
|
|
179
|
+
native JavaScript [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map).
|
|
114
180
|
|
|
115
181
|
For example, given this component definition:
|
|
116
182
|
|
|
117
|
-
```app/components/developer-details.
|
|
183
|
+
```gjs {data-filename="app/components/developer-details.gjs"}
|
|
118
184
|
import Component from '@glimmer/component';
|
|
119
185
|
import { tracked } from '@glimmer/tracking';
|
|
120
186
|
|
|
121
|
-
export default class extends Component {
|
|
187
|
+
export default class DeveloperDetails extends Component {
|
|
122
188
|
@tracked developer = {
|
|
123
|
-
|
|
124
|
-
|
|
189
|
+
name: 'Shelly Sails',
|
|
190
|
+
age: 42,
|
|
125
191
|
};
|
|
192
|
+
|
|
193
|
+
<template>
|
|
194
|
+
<ul>
|
|
195
|
+
{{#each-in this.developer as |key value|}}
|
|
196
|
+
<li>{{key}}: {{value}}</li>
|
|
197
|
+
{{/each-in}}
|
|
198
|
+
</ul>
|
|
199
|
+
</template>
|
|
126
200
|
}
|
|
127
201
|
```
|
|
128
202
|
|
|
129
203
|
This template would display all properties on the `developer`
|
|
130
|
-
object in a list:
|
|
131
|
-
|
|
132
|
-
```app/components/developer-details.hbs
|
|
133
|
-
<ul>
|
|
134
|
-
{{#each-in this.developer as |key value|}}
|
|
135
|
-
<li>{{key}}: {{value}}</li>
|
|
136
|
-
{{/each-in}}
|
|
137
|
-
</ul>
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Outputting their name and age:
|
|
204
|
+
object in a list, outputting their name and age:
|
|
141
205
|
|
|
142
206
|
```html
|
|
143
207
|
<ul>
|
|
@@ -146,8 +210,55 @@ declare module '@ember/-internals/glimmer/lib/helpers/each-in' {
|
|
|
146
210
|
</ul>
|
|
147
211
|
```
|
|
148
212
|
|
|
213
|
+
The same pattern works with a `Map`:
|
|
214
|
+
|
|
215
|
+
```gjs {data-filename="app/components/developer-map.gjs"}
|
|
216
|
+
import Component from '@glimmer/component';
|
|
217
|
+
|
|
218
|
+
export default class DeveloperMap extends Component {
|
|
219
|
+
map = new Map([
|
|
220
|
+
['name', 'Shelly Sails'],
|
|
221
|
+
['age', 42],
|
|
222
|
+
]);
|
|
223
|
+
|
|
224
|
+
<template>
|
|
225
|
+
<ul>
|
|
226
|
+
{{#each-in this.map as |key value|}}
|
|
227
|
+
<li>{{key}}: {{value}}</li>
|
|
228
|
+
{{/each-in}}
|
|
229
|
+
</ul>
|
|
230
|
+
</template>
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
When a `Map` uses object keys, you can pass `key="@identity"` to explicitly
|
|
235
|
+
track entries across re-renders using the JavaScript identity of each key:
|
|
236
|
+
|
|
237
|
+
```gjs {data-filename="app/components/object-keyed-map.gjs"}
|
|
238
|
+
import Component from '@glimmer/component';
|
|
239
|
+
|
|
240
|
+
export default class ObjectKeyedMap extends Component {
|
|
241
|
+
map = new Map([
|
|
242
|
+
[{ name: 'one' }, 'foo'],
|
|
243
|
+
[{ name: 'two' }, 'bar'],
|
|
244
|
+
]);
|
|
245
|
+
|
|
246
|
+
<template>
|
|
247
|
+
<ul>
|
|
248
|
+
{{#each-in this.map key="@identity" as |key value|}}
|
|
249
|
+
<li>{{key.name}}: {{value}}</li>
|
|
250
|
+
{{/each-in}}
|
|
251
|
+
</ul>
|
|
252
|
+
</template>
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
`#each-in` is a keyword and does not need to be imported.
|
|
257
|
+
|
|
149
258
|
@method each-in
|
|
150
|
-
@
|
|
259
|
+
@static
|
|
260
|
+
@noimport
|
|
261
|
+
@for Keywords
|
|
151
262
|
@public
|
|
152
263
|
@since 2.1.0
|
|
153
264
|
*/
|
|
@@ -2,28 +2,6 @@ declare module '@ember/-internals/glimmer/lib/helpers/element' {
|
|
|
2
2
|
/**
|
|
3
3
|
@module @ember/helper
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
6
|
-
The `element` helper lets you dynamically set the tag name of an element.
|
|
7
|
-
|
|
8
|
-
```handlebars
|
|
9
|
-
{{#let (element @tagName) as |Tag|}}
|
|
10
|
-
<Tag class="my-element">Hello</Tag>
|
|
11
|
-
{{/let}}
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
When `@tagName` is `"h1"`, this renders `<h1 class="my-element">Hello</h1>`.
|
|
15
|
-
|
|
16
|
-
When `@tagName` is an empty string `""`, the block content is rendered without
|
|
17
|
-
a wrapping element.
|
|
18
|
-
|
|
19
|
-
Passing `null`, `undefined`, or non-string values will throw an assertion error.
|
|
20
|
-
|
|
21
|
-
Changing the tag name will tear down and recreate the element and its contents.
|
|
22
|
-
|
|
23
|
-
@method element
|
|
24
|
-
@for Ember.Templates.helpers
|
|
25
|
-
@public
|
|
26
|
-
*/
|
|
27
5
|
const _default: object;
|
|
28
6
|
export default _default;
|
|
29
7
|
}
|
|
@@ -1,75 +1,45 @@
|
|
|
1
1
|
declare module '@ember/-internals/glimmer/lib/helpers/mut' {
|
|
2
2
|
/**
|
|
3
|
-
The `mut` helper
|
|
4
|
-
|
|
3
|
+
The `mut` helper is a shortcut for updating for args.
|
|
4
|
+
|
|
5
|
+
However, defining update functions on your backing class is preferable to using `mut`.
|
|
6
|
+
|
|
7
|
+
More directly: Don't use `mut`.
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<MyChild @childClickCount={{fn (mut totalClicks)}} />
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
or
|
|
13
|
-
|
|
14
|
-
```handlebars
|
|
15
|
-
{{my-child childClickCount=(mut totalClicks)}}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
The child `Component` can then modify the parent's value just by modifying its own
|
|
19
|
-
property:
|
|
20
|
-
|
|
21
|
-
```javascript
|
|
22
|
-
// my-child.js
|
|
23
|
-
export default class MyChild extends Component {
|
|
24
|
-
click() {
|
|
25
|
-
this.incrementProperty('childClickCount');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Note that for curly components (`{{my-component}}`) the bindings are already mutable,
|
|
31
|
-
making the `mut` unnecessary.
|
|
32
|
-
|
|
33
|
-
Additionally, the `mut` helper can be combined with the `fn` helper to
|
|
34
|
-
mutate a value. For example:
|
|
35
|
-
|
|
36
|
-
```handlebars
|
|
37
|
-
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
or
|
|
9
|
+
The `mut` helper, when used with `fn`, will return a function that
|
|
10
|
+
sets the value passed to `mut` to its first argument. As an example, we can create a
|
|
11
|
+
button that increments a value passing the value directly to the `fn`:
|
|
41
12
|
|
|
42
13
|
```handlebars
|
|
43
|
-
|
|
14
|
+
<MyChild @childClickCount={{this.totalClicks}} @clickCountChange={{fn (mut this.totalClicks)}} />
|
|
44
15
|
```
|
|
45
16
|
|
|
46
|
-
The child `Component` would invoke the function with the new click
|
|
17
|
+
The child `Component` would invoke the function with the new click count:
|
|
47
18
|
|
|
48
|
-
```
|
|
49
|
-
|
|
19
|
+
```gjs {data-filename="app/components/my-child.gjs"}
|
|
20
|
+
import Component from '@glimmer/component';
|
|
21
|
+
import { action } from '@ember/object';
|
|
22
|
+
|
|
50
23
|
export default class MyChild extends Component {
|
|
51
|
-
|
|
52
|
-
|
|
24
|
+
@action
|
|
25
|
+
update() {
|
|
26
|
+
this.args.clickCountChange(this.args.childClickCount + 1);
|
|
53
27
|
}
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<button {{on "click" this.update}}>
|
|
31
|
+
Click me!
|
|
32
|
+
</button>
|
|
33
|
+
</template>
|
|
54
34
|
}
|
|
55
35
|
```
|
|
56
36
|
|
|
57
37
|
The `mut` helper changes the `totalClicks` value to what was provided as the `fn` argument.
|
|
58
38
|
|
|
59
|
-
The `mut` helper, when used with `fn`, will return a function that
|
|
60
|
-
sets the value passed to `mut` to its first argument. As an example, we can create a
|
|
61
|
-
button that increments a value passing the value directly to the `fn`:
|
|
62
|
-
|
|
63
|
-
```handlebars
|
|
64
|
-
{{! inc helper is not provided by Ember }}
|
|
65
|
-
<button onclick={{fn (mut count) (inc count)}}>
|
|
66
|
-
Increment count
|
|
67
|
-
</button>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
39
|
@method mut
|
|
71
40
|
@param {Object} [attr] the "two-way" attribute that can be modified.
|
|
72
|
-
@
|
|
41
|
+
@static
|
|
42
|
+
@for Keywords
|
|
73
43
|
@public
|
|
74
44
|
*/
|
|
75
45
|
const _default: object;
|
|
@@ -2,6 +2,10 @@ declare module '@ember/-internals/glimmer/lib/helpers/readonly' {
|
|
|
2
2
|
/**
|
|
3
3
|
The `readonly` helper let's you specify that a binding is one-way only,
|
|
4
4
|
instead of two-way.
|
|
5
|
+
|
|
6
|
+
This is a vestigial helper from the days of `@ember/component` and does not apply to
|
|
7
|
+
components extending from `@glimmer/component`.
|
|
8
|
+
|
|
5
9
|
When you pass a `readonly` binding from an outer context (e.g. parent component),
|
|
6
10
|
to to an inner context (e.g. child component), you are saying that changing that
|
|
7
11
|
property in the inner context does not change the value in the outer context.
|
|
@@ -14,14 +18,6 @@ declare module '@ember/-internals/glimmer/lib/helpers/readonly' {
|
|
|
14
18
|
}
|
|
15
19
|
```
|
|
16
20
|
|
|
17
|
-
```app/templates/components/my-parent.hbs
|
|
18
|
-
{{log totalClicks}} // -> 3
|
|
19
|
-
<MyChild @childClickCount={{readonly totalClicks}} />
|
|
20
|
-
```
|
|
21
|
-
```
|
|
22
|
-
{{my-child childClickCount=(readonly totalClicks)}}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
21
|
Now, when you update `childClickCount`:
|
|
26
22
|
|
|
27
23
|
```app/components/my-child.js
|
|
@@ -111,7 +107,9 @@ declare module '@ember/-internals/glimmer/lib/helpers/readonly' {
|
|
|
111
107
|
|
|
112
108
|
@method readonly
|
|
113
109
|
@param {Object} [attr] the read-only attribute.
|
|
114
|
-
@for
|
|
110
|
+
@for Keywords
|
|
111
|
+
@noimport
|
|
112
|
+
@static
|
|
115
113
|
@private
|
|
116
114
|
*/
|
|
117
115
|
const _default: object;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare module '@ember/-internals/glimmer/lib/helpers/unbound' {
|
|
2
2
|
/**
|
|
3
|
-
@module ember
|
|
3
|
+
@module @ember/helper
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
The `{{unbound}}` helper disconnects the one-way binding of a property,
|
|
@@ -24,9 +24,13 @@ declare module '@ember/-internals/glimmer/lib/helpers/unbound' {
|
|
|
24
24
|
|
|
25
25
|
The `unbound` helper only accepts a single argument, and it return an
|
|
26
26
|
unbound value.
|
|
27
|
+
|
|
28
|
+
`unbound` is a template keyword and does not need to be imported.
|
|
27
29
|
|
|
28
30
|
@method unbound
|
|
29
|
-
@
|
|
31
|
+
@static
|
|
32
|
+
@noimport
|
|
33
|
+
@for Keywords
|
|
30
34
|
@public
|
|
31
35
|
*/
|
|
32
36
|
const _default: object;
|
|
@@ -6,7 +6,6 @@ declare module '@ember/-internals/glimmer/lib/renderer' {
|
|
|
6
6
|
import type { CurriedValue } from "@glimmer/runtime/lib/curried-value";
|
|
7
7
|
import { clientBuilder } from "@glimmer/runtime/lib/vm/element-builder";
|
|
8
8
|
import type { SimpleDocument, SimpleElement, SimpleNode } from "@simple-dom/interface";
|
|
9
|
-
import RSVP from "rsvp";
|
|
10
9
|
import type Component from "@ember/-internals/glimmer/lib/component";
|
|
11
10
|
import type ClassicComponent from "@ember/-internals/glimmer/lib/component";
|
|
12
11
|
import { BOUNDS } from "@ember/-internals/glimmer/lib/component-managers/curly";
|
|
@@ -58,7 +57,7 @@ declare module '@ember/-internals/glimmer/lib/renderer' {
|
|
|
58
57
|
destroy(): void;
|
|
59
58
|
}
|
|
60
59
|
export function _resetRenderers(): void;
|
|
61
|
-
export function renderSettled():
|
|
60
|
+
export function renderSettled(): Promise<void>;
|
|
62
61
|
interface ViewRegistry {
|
|
63
62
|
[viewId: string]: unknown;
|
|
64
63
|
}
|
|
@@ -6,15 +6,14 @@ declare module '@ember/-internals/glimmer/lib/syntax/mount' {
|
|
|
6
6
|
|
|
7
7
|
For example, the following template mounts the `ember-chat` engine:
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
{{! application.hbs }}
|
|
9
|
+
```gjs {data-filename="app/templates/application.gjs"}
|
|
11
10
|
{{mount "ember-chat"}}
|
|
12
11
|
```
|
|
13
12
|
|
|
14
13
|
Additionally, you can also pass in a `model` argument that will be
|
|
15
14
|
set as the engines model. This can be an existing object:
|
|
16
15
|
|
|
17
|
-
```
|
|
16
|
+
```hbs
|
|
18
17
|
<div>
|
|
19
18
|
{{mount 'admin' model=userSettings}}
|
|
20
19
|
</div>
|
|
@@ -22,21 +21,28 @@ declare module '@ember/-internals/glimmer/lib/syntax/mount' {
|
|
|
22
21
|
|
|
23
22
|
Or an inline `hash`, and you can even pass components:
|
|
24
23
|
|
|
24
|
+
```gjs
|
|
25
|
+
import SignInButton from '../components/sign-in-button';
|
|
26
|
+
<template>
|
|
27
|
+
<div>
|
|
28
|
+
<h1>Application template!</h1>
|
|
29
|
+
{{mount 'admin' model=(hash
|
|
30
|
+
title='Secret Admin'
|
|
31
|
+
signInButton=SignInButton
|
|
32
|
+
)}}
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
25
35
|
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{{mount 'admin' model=(hash
|
|
29
|
-
title='Secret Admin'
|
|
30
|
-
signInButton=(component 'sign-in-button')
|
|
31
|
-
)}}
|
|
32
|
-
</div>
|
|
33
|
-
```
|
|
36
|
+
|
|
37
|
+
`mount` is built-in and does not need to be imported.
|
|
34
38
|
|
|
35
39
|
@method mount
|
|
36
40
|
@param {String} name Name of the engine to mount.
|
|
37
41
|
@param {Object} [model] Object that will be set as
|
|
38
42
|
the model of the engine.
|
|
39
|
-
@for
|
|
43
|
+
@for Keywords
|
|
44
|
+
@static
|
|
45
|
+
@noimport
|
|
40
46
|
@public
|
|
41
47
|
*/
|
|
42
48
|
export const mountHelper: object;
|
|
@@ -1,26 +1,38 @@
|
|
|
1
1
|
declare module '@ember/-internals/glimmer/lib/syntax/outlet' {
|
|
2
|
+
/**
|
|
3
|
+
@module @ember/helper
|
|
4
|
+
*/
|
|
2
5
|
/**
|
|
3
6
|
The `{{outlet}}` helper lets you specify where a child route will render in
|
|
4
7
|
your template. An important use of the `{{outlet}}` helper is in your
|
|
5
|
-
application's `application.
|
|
6
|
-
|
|
7
|
-
```app/templates/application.hbs
|
|
8
|
-
<MyHeader />
|
|
9
|
-
|
|
10
|
-
<div class="my-dynamic-content">
|
|
11
|
-
<!-- this content will change based on the current route, which depends on the current URL -->
|
|
12
|
-
{{outlet}}
|
|
13
|
-
</div>
|
|
8
|
+
application's `application.gjs` file:
|
|
14
9
|
|
|
15
|
-
|
|
10
|
+
```gjs {data-filename="app/templates/application.gjs"}
|
|
11
|
+
import MyHeader from '../components/my-header';
|
|
12
|
+
import MyFooter from '../components/my-footer';
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<MyHeader />
|
|
16
|
+
|
|
17
|
+
<div class="my-dynamic-content">
|
|
18
|
+
<!-- this content will change based on the current route, which depends on the current URL -->
|
|
19
|
+
{{outlet}}
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<MyFooter />
|
|
23
|
+
</template>
|
|
16
24
|
```
|
|
17
25
|
|
|
18
26
|
See the [routing guide](https://guides.emberjs.com/release/routing/rendering-a-template/) for more
|
|
19
27
|
information on how your `route` interacts with the `{{outlet}}` helper.
|
|
20
28
|
Note: Your content __will not render__ if there isn't an `{{outlet}}` for it.
|
|
21
29
|
|
|
30
|
+
`outlet` is built-in and does not need to be imported.
|
|
31
|
+
|
|
22
32
|
@method outlet
|
|
23
|
-
@for
|
|
33
|
+
@for Keywords
|
|
34
|
+
@static
|
|
35
|
+
@noimport
|
|
24
36
|
@public
|
|
25
37
|
*/
|
|
26
38
|
export const outletHelper: object;
|
|
@@ -5,7 +5,7 @@ declare module '@ember/-internals/runtime/lib/mixins/target_action_support' {
|
|
|
5
5
|
import Mixin from "@ember/object/mixin";
|
|
6
6
|
/**
|
|
7
7
|
`TargetActionSupport` is a mixin that can be included in a class
|
|
8
|
-
to add a `triggerAction` method with semantics similar to the
|
|
8
|
+
to add a `triggerAction` method with semantics similar to the
|
|
9
9
|
`{{action}}` helper. In normal Ember usage, the `{{action}}` helper is
|
|
10
10
|
usually the best choice. This mixin is most often useful when you are
|
|
11
11
|
doing more complex event handling in Components.
|