ember-source 7.2.0-alpha.4 → 7.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +21 -15
- 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 +8 -27
- package/dist/dev/packages/@ember/modifier/index.js +2 -2
- package/dist/dev/packages/@ember/modifier/on.js +1 -1
- package/dist/dev/packages/@ember/object/-internals.js +2 -2
- package/dist/dev/packages/@ember/object/compat.js +3 -3
- 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 +12 -8
- 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 +2281 -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-BYLB-q7a.js} +5 -3
- 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-CO3EIWsm.js → get-6I3sjd-I.js} +33 -36
- 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-2-93qikL.js → hash-6NDs_5_f.js} +18 -12
- package/dist/dev/packages/shared-chunks/{helper-Bm6EhgSW.js → helper-DIj85_-f.js} +21 -9
- package/dist/dev/packages/shared-chunks/{index-dyv6rcBf.js → index-B3pPx1fL.js} +113 -134
- package/dist/dev/packages/shared-chunks/{index-DX90CU4L.js → index-BGP1rw3B.js} +1 -1
- 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-DYh6AY9Z.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-DlF0Wy7P.js} +10 -10
- 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.es-DR7yS7qg.js} +150 -154
- 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-9DCmHTFF.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-C4lYkaHj.js} +12 -8
- 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-DQOhouG1.js} +2 -2
- package/dist/dev/packages/shared-chunks/{unrecognized-url-error-BQdkjTtZ.js → unrecognized-url-error-BJHjL30Q.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 +20 -14
- 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 +8 -27
- package/dist/prod/packages/@ember/modifier/index.js +2 -2
- package/dist/prod/packages/@ember/modifier/on.js +1 -1
- package/dist/prod/packages/@ember/object/-internals.js +2 -2
- package/dist/prod/packages/@ember/object/compat.js +3 -3
- 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 +12 -8
- package/dist/prod/packages/@ember/routing/lib/generate_controller.js +1 -2
- package/dist/prod/packages/@ember/routing/lib/routing-service.js +4 -4
- package/dist/prod/packages/@ember/routing/lib/utils.js +3 -3
- package/dist/prod/packages/@ember/routing/route.js +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 +2281 -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-DgHdPZ8u.js} +5 -3
- 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-tlL23wmp.js → get-Dago5uGl.js} +33 -36
- 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-C6IoC4eR.js → hash-gEXIsSO4.js} +24 -18
- package/dist/prod/packages/shared-chunks/{helper-CCK8Ef0x.js → helper-DkXiTBjc.js} +21 -9
- package/dist/prod/packages/shared-chunks/{index-D-rcNBLp.js → index-Bf53M8eS.js} +9 -8
- package/dist/prod/packages/shared-chunks/{index-DabsnYit.js → index-CslMfEpb.js} +110 -131
- 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-BOIVROuv.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-BZHAxzdq.js} +10 -10
- 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.es-DR7yS7qg.js} +150 -154
- 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-U-6VaNQG.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-DOmZ1x0E.js} +11 -7
- 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-o2pS74go.js} +2 -2
- package/dist/prod/packages/shared-chunks/{unrecognized-url-error-ClNyMFJt.js → unrecognized-url-error-EgNrnFu_.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 +316 -334
- package/package.json +6 -4
- package/types/stable/@ember/-internals/glimmer/index.d.ts +165 -121
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/mount.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/outlet.d.ts +1 -1
- package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +8 -2
- package/types/stable/@ember/-internals/glimmer/lib/glimmer-tracking-docs.d.ts +12 -12
- package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +18 -6
- package/types/stable/@ember/-internals/glimmer/lib/helpers/array.d.ts +3 -1
- package/types/stable/@ember/-internals/glimmer/lib/helpers/component.d.ts +65 -121
- package/types/stable/@ember/-internals/glimmer/lib/helpers/concat.d.ts +8 -4
- package/types/stable/@ember/-internals/glimmer/lib/helpers/each-in.d.ts +16 -14
- package/types/stable/@ember/-internals/glimmer/lib/helpers/element.d.ts +2 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/fn.d.ts +11 -7
- package/types/stable/@ember/-internals/glimmer/lib/helpers/get.d.ts +23 -29
- package/types/stable/@ember/-internals/glimmer/lib/helpers/hash.d.ts +3 -1
- package/types/stable/@ember/-internals/glimmer/lib/helpers/if-unless.d.ts +95 -49
- package/types/stable/@ember/-internals/glimmer/lib/helpers/mut.d.ts +23 -54
- package/types/stable/@ember/-internals/glimmer/lib/helpers/page-title.d.ts +6 -2
- package/types/stable/@ember/-internals/glimmer/lib/helpers/readonly.d.ts +4 -8
- package/types/stable/@ember/-internals/glimmer/lib/modifiers/on.d.ts +10 -10
- package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +1 -2
- package/types/stable/@ember/-internals/glimmer/lib/syntax/in-element.d.ts +2 -0
- package/types/stable/@ember/-internals/glimmer/lib/syntax/let.d.ts +2 -14
- package/types/stable/@ember/-internals/glimmer/lib/syntax/mount.d.ts +15 -11
- package/types/stable/@ember/-internals/glimmer/lib/syntax/outlet.d.ts +17 -10
- package/types/stable/@ember/-internals/runtime/lib/mixins/target_action_support.d.ts +1 -1
- package/types/stable/@ember/array/index.d.ts +6 -29
- package/types/stable/@ember/array/lib/is-array.d.ts +35 -0
- package/types/stable/@ember/component/template-only.d.ts +1 -3
- package/types/stable/@ember/controller/index.d.ts +1 -1
- package/types/stable/@ember/helper/index.d.ts +0 -19
- package/types/stable/@ember/object/index.d.ts +4 -3
- package/types/stable/@ember/object/observable.d.ts +4 -0
- package/types/stable/@ember/reactive/collections.d.ts +0 -6
- package/types/stable/@ember/routing/lib/generate_controller.d.ts +1 -1
- package/types/stable/@ember/routing/route.d.ts +2 -2
- package/types/stable/@ember/routing/router-service.d.ts +20 -12
- package/types/stable/@glimmer/runtime/lib/component/template-only.d.ts +0 -2
- package/types/stable/@glimmer/runtime/lib/dom/sanitized-values.d.ts +2 -2
- package/types/stable/@glimmer/runtime/lib/helpers/array.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/helpers/concat.d.ts +8 -3
- package/types/stable/@glimmer/runtime/lib/helpers/fn.d.ts +13 -7
- package/types/stable/@glimmer/runtime/lib/helpers/get.d.ts +21 -29
- package/types/stable/@glimmer/runtime/lib/helpers/hash.d.ts +1 -1
- package/types/stable/@glimmer/syntax/lib/get-template-locals.d.ts +1 -1
- package/types/stable/@glimmer/tracking/index.d.ts +12 -12
- package/types/stable/index.d.ts +1 -0
|
@@ -17,26 +17,34 @@ declare module '@ember/-internals/glimmer/lib/helpers/if-unless' {
|
|
|
17
17
|
using the block form to wrap the section of template you want to conditionally render.
|
|
18
18
|
Like so:
|
|
19
19
|
|
|
20
|
-
```app/templates/application.
|
|
21
|
-
|
|
20
|
+
```app/templates/application.gjs
|
|
21
|
+
import Weather from '../components/weather';
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<Weather />
|
|
25
|
+
</template>
|
|
22
26
|
```
|
|
23
27
|
|
|
24
|
-
```app/components/weather.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
```app/components/weather.gjs
|
|
29
|
+
<template>
|
|
30
|
+
{{! will not render because greeting is undefined}}
|
|
31
|
+
{{#if @isRaining}}
|
|
32
|
+
Yes, grab an umbrella!
|
|
33
|
+
{{/if}}
|
|
34
|
+
</template>
|
|
29
35
|
```
|
|
30
36
|
|
|
31
37
|
You can also define what to show if the property is falsey by using
|
|
32
38
|
the `else` helper.
|
|
33
39
|
|
|
34
|
-
```app/components/weather.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
```app/components/weather.gjs
|
|
41
|
+
<template>
|
|
42
|
+
{{#if @isRaining}}
|
|
43
|
+
Yes, grab an umbrella!
|
|
44
|
+
{{else}}
|
|
45
|
+
No, it's lovely outside!
|
|
46
|
+
{{/if}}
|
|
47
|
+
</template>
|
|
40
48
|
```
|
|
41
49
|
|
|
42
50
|
You are also able to combine `else` and `if` helpers to create more complex
|
|
@@ -44,20 +52,26 @@ declare module '@ember/-internals/glimmer/lib/helpers/if-unless' {
|
|
|
44
52
|
|
|
45
53
|
For the following template:
|
|
46
54
|
|
|
47
|
-
```app/components/weather.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
```app/components/weather.gjs
|
|
56
|
+
<template>
|
|
57
|
+
{{#if @isRaining}}
|
|
58
|
+
Yes, grab an umbrella!
|
|
59
|
+
{{else if @isCold}}
|
|
60
|
+
Grab a coat, it's chilly!
|
|
61
|
+
{{else}}
|
|
62
|
+
No, it's lovely outside!
|
|
63
|
+
{{/if}}
|
|
64
|
+
</template>
|
|
55
65
|
```
|
|
56
66
|
|
|
57
67
|
If you call it by saying `isCold` is true:
|
|
58
68
|
|
|
59
|
-
```app/templates/application.
|
|
60
|
-
|
|
69
|
+
```app/templates/application.gjs
|
|
70
|
+
import Weather from '../components/weather';
|
|
71
|
+
|
|
72
|
+
<template>
|
|
73
|
+
<Weather @isCold={{true}} />
|
|
74
|
+
</template>
|
|
61
75
|
```
|
|
62
76
|
|
|
63
77
|
Then `Grab a coat, it's chilly!` will be rendered.
|
|
@@ -71,12 +85,18 @@ declare module '@ember/-internals/glimmer/lib/helpers/if-unless' {
|
|
|
71
85
|
|
|
72
86
|
For example, if `useLongGreeting` is truthy, the following:
|
|
73
87
|
|
|
74
|
-
```app/templates/application.
|
|
75
|
-
|
|
88
|
+
```app/templates/application.gjs
|
|
89
|
+
import Greeting from '../components/greeting';
|
|
90
|
+
|
|
91
|
+
<template>
|
|
92
|
+
<Greeting @useLongGreeting={{true}} />
|
|
93
|
+
<template>
|
|
76
94
|
```
|
|
77
95
|
|
|
78
|
-
```app/components/greeting.
|
|
79
|
-
|
|
96
|
+
```app/components/greeting.gjs
|
|
97
|
+
<template>
|
|
98
|
+
{{if @useLongGreeting "Hello" "Hi"}} Alex
|
|
99
|
+
<template>
|
|
80
100
|
```
|
|
81
101
|
|
|
82
102
|
Will render:
|
|
@@ -88,7 +108,9 @@ declare module '@ember/-internals/glimmer/lib/helpers/if-unless' {
|
|
|
88
108
|
One detail to keep in mind is that both branches of the `if` helper will be evaluated,
|
|
89
109
|
so if you have `{{if condition "foo" (expensive-operation "bar")`,
|
|
90
110
|
`expensive-operation` will always calculate.
|
|
91
|
-
|
|
111
|
+
|
|
112
|
+
`if` is built-in and does not need to be imported.
|
|
113
|
+
|
|
92
114
|
@method if
|
|
93
115
|
@for Ember.Templates.helpers
|
|
94
116
|
@public
|
|
@@ -107,12 +129,18 @@ declare module '@ember/-internals/glimmer/lib/helpers/if-unless' {
|
|
|
107
129
|
|
|
108
130
|
For example, if you pass a falsey `useLongGreeting` to the `Greeting` component:
|
|
109
131
|
|
|
110
|
-
```app/templates/application.
|
|
111
|
-
|
|
132
|
+
```app/templates/application.gjs
|
|
133
|
+
import Greeting from '../components/greeting';
|
|
134
|
+
|
|
135
|
+
<template>
|
|
136
|
+
<Greeting @useLongGreeting={{false}} />
|
|
137
|
+
</template>
|
|
112
138
|
```
|
|
113
139
|
|
|
114
|
-
```app/components/greeting.
|
|
115
|
-
|
|
140
|
+
```app/components/greeting.gjs
|
|
141
|
+
<template>
|
|
142
|
+
{{unless @useLongGreeting "Hi" "Hello"}} Ben
|
|
143
|
+
</template>
|
|
116
144
|
```
|
|
117
145
|
|
|
118
146
|
Then it will display:
|
|
@@ -127,14 +155,20 @@ declare module '@ember/-internals/glimmer/lib/helpers/if-unless' {
|
|
|
127
155
|
|
|
128
156
|
The following will not render anything:
|
|
129
157
|
|
|
130
|
-
```app/templates/application.
|
|
131
|
-
|
|
158
|
+
```app/templates/application.gjs
|
|
159
|
+
import Greeting from '../components/greeting';
|
|
160
|
+
|
|
161
|
+
<template>
|
|
162
|
+
<Greeting />
|
|
163
|
+
</template>
|
|
132
164
|
```
|
|
133
165
|
|
|
134
|
-
```app/components/greeting.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
166
|
+
```app/components/greeting.gjs
|
|
167
|
+
<template>
|
|
168
|
+
{{#unless @greeting}}
|
|
169
|
+
No greeting was found. Why not set one?
|
|
170
|
+
{{/unless}}
|
|
171
|
+
</template>
|
|
138
172
|
```
|
|
139
173
|
|
|
140
174
|
You can also use an `else` helper with the `unless` block. The
|
|
@@ -142,18 +176,24 @@ declare module '@ember/-internals/glimmer/lib/helpers/if-unless' {
|
|
|
142
176
|
|
|
143
177
|
If you have the following component:
|
|
144
178
|
|
|
145
|
-
```app/components/logged-in.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
179
|
+
```app/components/logged-in.gjs
|
|
180
|
+
<template>
|
|
181
|
+
{{#unless @userData}}
|
|
182
|
+
Please login.
|
|
183
|
+
{{else}}
|
|
184
|
+
Welcome back!
|
|
185
|
+
{{/unless}}
|
|
186
|
+
</template>
|
|
151
187
|
```
|
|
152
188
|
|
|
153
189
|
Calling it with a truthy `userData`:
|
|
154
190
|
|
|
155
|
-
```app/templates/application.
|
|
156
|
-
|
|
191
|
+
```app/templates/application.gjs
|
|
192
|
+
import LoggedIn from '../components/logged-in';
|
|
193
|
+
|
|
194
|
+
<template>
|
|
195
|
+
<LoggedIn @userData={{hash username="Zoey"}} />
|
|
196
|
+
</template>
|
|
157
197
|
```
|
|
158
198
|
|
|
159
199
|
Will render:
|
|
@@ -164,8 +204,12 @@ declare module '@ember/-internals/glimmer/lib/helpers/if-unless' {
|
|
|
164
204
|
|
|
165
205
|
and calling it with a falsey `userData`:
|
|
166
206
|
|
|
167
|
-
```app/templates/application.
|
|
168
|
-
|
|
207
|
+
```app/templates/application.gjs
|
|
208
|
+
import LoggedIn from '../components/logged-in';
|
|
209
|
+
|
|
210
|
+
<template>
|
|
211
|
+
<LoggedIn @userData={{false}} />
|
|
212
|
+
</template>
|
|
169
213
|
```
|
|
170
214
|
|
|
171
215
|
Will render:
|
|
@@ -173,7 +217,9 @@ declare module '@ember/-internals/glimmer/lib/helpers/if-unless' {
|
|
|
173
217
|
```html
|
|
174
218
|
Please login.
|
|
175
219
|
```
|
|
176
|
-
|
|
220
|
+
|
|
221
|
+
`unless` is built-in and does not need to be imported.
|
|
222
|
+
|
|
177
223
|
@method unless
|
|
178
224
|
@for Ember.Templates.helpers
|
|
179
225
|
@public
|
|
@@ -1,72 +1,41 @@
|
|
|
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
|
+
```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
|
@for Ember.Templates.helpers
|
|
@@ -7,8 +7,12 @@ declare module '@ember/-internals/glimmer/lib/helpers/page-title' {
|
|
|
7
7
|
append additional titles for each route. For complete documentation, see
|
|
8
8
|
https://github.com/ember-cli/ember-page-title.
|
|
9
9
|
|
|
10
|
-
```
|
|
11
|
-
|
|
10
|
+
```gjs
|
|
11
|
+
import pageTitle from 'ember-page-title/helpers/page-title';
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
{{pageTitle "My Page Title" }}
|
|
15
|
+
</template>
|
|
12
16
|
```
|
|
13
17
|
|
|
14
18
|
@method page-title
|
|
@@ -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
|
|
@@ -10,20 +10,20 @@ declare module '@ember/-internals/glimmer/lib/modifiers/on' {
|
|
|
10
10
|
For example, if you'd like to run a function on your component when a `<button>`
|
|
11
11
|
in the components template is clicked you might do something like:
|
|
12
12
|
|
|
13
|
-
```app/components/like-post.
|
|
14
|
-
<button {{on 'click' this.saveLike}}>Like this post!</button>
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
```app/components/like-post.js
|
|
13
|
+
```app/components/like-post.gjs
|
|
18
14
|
import Component from '@glimmer/component';
|
|
19
15
|
import { action } from '@ember/object';
|
|
20
16
|
|
|
21
|
-
export default class
|
|
17
|
+
export default class LikePost extends Component {
|
|
22
18
|
@action
|
|
23
19
|
saveLike() {
|
|
24
20
|
// someone likes your post!
|
|
25
21
|
// better send a request off to your server...
|
|
26
22
|
}
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<button {{on 'click' this.saveLike}}>Like this post!</button>
|
|
26
|
+
</template>
|
|
27
27
|
}
|
|
28
28
|
```
|
|
29
29
|
|
|
@@ -58,7 +58,7 @@ declare module '@ember/-internals/glimmer/lib/modifiers/on' {
|
|
|
58
58
|
For example, in our example case above if you'd like to pass in the post that
|
|
59
59
|
was being liked when the button is clicked you could do something like:
|
|
60
60
|
|
|
61
|
-
```
|
|
61
|
+
```hbs
|
|
62
62
|
<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
|
|
63
63
|
```
|
|
64
64
|
|
|
@@ -68,13 +68,13 @@ declare module '@ember/-internals/glimmer/lib/modifiers/on' {
|
|
|
68
68
|
### Function Context
|
|
69
69
|
|
|
70
70
|
In the example above, we used `@action` to ensure that `likePost` is
|
|
71
|
-
properly bound to the `
|
|
71
|
+
properly bound to the `LikePost` Component, but let's explore what happens if we
|
|
72
72
|
left out `@action`:
|
|
73
73
|
|
|
74
|
-
```app/components/like-post.
|
|
74
|
+
```app/components/like-post.gjs
|
|
75
75
|
import Component from '@glimmer/component';
|
|
76
76
|
|
|
77
|
-
export default class
|
|
77
|
+
export default class LikePost extends Component {
|
|
78
78
|
saveLike() {
|
|
79
79
|
// ...snip...
|
|
80
80
|
}
|
|
@@ -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
|
}
|
|
@@ -32,21 +32,9 @@ declare module '@ember/-internals/glimmer/lib/syntax/let' {
|
|
|
32
32
|
<MyPost @title={{title}} @content={{content}} @options={{options}} />
|
|
33
33
|
{{/let}}
|
|
34
34
|
```
|
|
35
|
-
or
|
|
36
|
-
```handlebars
|
|
37
|
-
{{#let
|
|
38
|
-
(concat post.title ' | The Ember.js Blog')
|
|
39
|
-
post.content
|
|
40
|
-
(hash
|
|
41
|
-
theme="high-contrast"
|
|
42
|
-
enableComments=true
|
|
43
|
-
)
|
|
44
|
-
as |title content options|
|
|
45
|
-
}}
|
|
46
|
-
{{my-post title=title content=content options=options}}
|
|
47
|
-
{{/let}}
|
|
48
|
-
```
|
|
49
35
|
|
|
36
|
+
`let` is built-in and does not need to be imported.
|
|
37
|
+
|
|
50
38
|
@method let
|
|
51
39
|
@for Ember.Templates.helpers
|
|
52
40
|
@public
|
|
@@ -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
|
+
```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,15 +21,20 @@ 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.
|
|
@@ -2,23 +2,30 @@ declare module '@ember/-internals/glimmer/lib/syntax/outlet' {
|
|
|
2
2
|
/**
|
|
3
3
|
The `{{outlet}}` helper lets you specify where a child route will render in
|
|
4
4
|
your template. An important use of the `{{outlet}}` helper is in your
|
|
5
|
-
application's `application.
|
|
5
|
+
application's `application.gjs` file:
|
|
6
6
|
|
|
7
|
-
```app/templates/application.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
```app/templates/application.gjs
|
|
8
|
+
import MyHeader from '../components/my-header';
|
|
9
|
+
import MyFooter from '../components/my-footer';
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<MyHeader />
|
|
13
|
+
|
|
14
|
+
<div class="my-dynamic-content">
|
|
15
|
+
<!-- this content will change based on the current route, which depends on the current URL -->
|
|
16
|
+
{{outlet}}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<MyFooter />
|
|
20
|
+
</template>
|
|
16
21
|
```
|
|
17
22
|
|
|
18
23
|
See the [routing guide](https://guides.emberjs.com/release/routing/rendering-a-template/) for more
|
|
19
24
|
information on how your `route` interacts with the `{{outlet}}` helper.
|
|
20
25
|
Note: Your content __will not render__ if there isn't an `{{outlet}}` for it.
|
|
21
26
|
|
|
27
|
+
`outlet` is built-in and does not need to be imported.
|
|
28
|
+
|
|
22
29
|
@method outlet
|
|
23
30
|
@for Ember.Templates.helpers
|
|
24
31
|
@public
|
|
@@ -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.
|
|
@@ -4,39 +4,12 @@ declare module '@ember/array' {
|
|
|
4
4
|
import MutableEnumerable from "@ember/enumerable/mutable";
|
|
5
5
|
import Observable from "@ember/object/observable";
|
|
6
6
|
import type { MethodNamesOf, MethodParams, MethodReturns } from "@ember/-internals/utility-types";
|
|
7
|
+
import isArray from "@ember/array/lib/is-array";
|
|
7
8
|
export { default as makeArray } from "@ember/array/make";
|
|
8
9
|
export type EmberArrayLike<T> = EmberArray<T> | NativeArray<T>;
|
|
9
10
|
export function uniqBy<T>(array: T[] | EmberArray<T>, keyOrFunc?: string | ((item: T) => unknown)): T[] | EmberArray<T>;
|
|
10
11
|
export function removeAt<T, A extends T[] | MutableArray<T>>(array: A, index: number, len?: number): A;
|
|
11
|
-
|
|
12
|
-
Returns true if the passed object is an array or Array-like.
|
|
13
|
-
|
|
14
|
-
Objects are considered Array-like if any of the following are true:
|
|
15
|
-
|
|
16
|
-
- the object is a native Array
|
|
17
|
-
- the object has an objectAt property
|
|
18
|
-
- the object is an Object, and has a length property
|
|
19
|
-
|
|
20
|
-
Unlike `typeOf` this method returns true even if the passed object is
|
|
21
|
-
not formally an array but appears to be array-like (i.e. implements `Array`)
|
|
22
|
-
|
|
23
|
-
```javascript
|
|
24
|
-
import { isArray } from '@ember/array';
|
|
25
|
-
import ArrayProxy from '@ember/array/proxy';
|
|
26
|
-
|
|
27
|
-
isArray(); // false
|
|
28
|
-
isArray([]); // true
|
|
29
|
-
isArray(ArrayProxy.create({ content: [] })); // true
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
@method isArray
|
|
33
|
-
@static
|
|
34
|
-
@for @ember/array
|
|
35
|
-
@param {Object} obj The object to test
|
|
36
|
-
@return {Boolean} true if the passed object is an array or Array-like
|
|
37
|
-
@public
|
|
38
|
-
*/
|
|
39
|
-
export function isArray(obj: unknown): obj is ArrayLike<unknown> | EmberArray<unknown>;
|
|
12
|
+
export { isArray };
|
|
40
13
|
/**
|
|
41
14
|
This mixin implements Observer-friendly Array-like behavior. It is not a
|
|
42
15
|
concrete implementation, but it can be used up by other classes that want
|
|
@@ -1274,6 +1247,10 @@ declare module '@ember/array' {
|
|
|
1274
1247
|
/**
|
|
1275
1248
|
Creates an `NativeArray` from an Array-like object.
|
|
1276
1249
|
Does not modify the original object's contents.
|
|
1250
|
+
|
|
1251
|
+
This exists primarily for historic reasons and should not be used
|
|
1252
|
+
in new code. Prefer native [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
|
|
1253
|
+
or [trackedArray](/ember/release/functions/@ember%2Freactive%2Fcollections/trackedArray).
|
|
1277
1254
|
|
|
1278
1255
|
Example
|
|
1279
1256
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare module '@ember/array/lib/is-array' {
|
|
2
|
+
import type EmberArray from "@ember/array";
|
|
3
|
+
/**
|
|
4
|
+
@module @ember/array
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
Returns true if the passed object is an array or Array-like.
|
|
8
|
+
|
|
9
|
+
Objects are considered Array-like if any of the following are true:
|
|
10
|
+
|
|
11
|
+
- the object is a native Array
|
|
12
|
+
- the object has an objectAt property
|
|
13
|
+
- the object is an Object, and has a length property
|
|
14
|
+
|
|
15
|
+
Unlike `typeOf` this method returns true even if the passed object is
|
|
16
|
+
not formally an array but appears to be array-like (i.e. implements `Array`)
|
|
17
|
+
|
|
18
|
+
```javascript
|
|
19
|
+
import { isArray } from '@ember/array';
|
|
20
|
+
import ArrayProxy from '@ember/array/proxy';
|
|
21
|
+
|
|
22
|
+
isArray(); // false
|
|
23
|
+
isArray([]); // true
|
|
24
|
+
isArray(ArrayProxy.create({ content: [] })); // true
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
@method isArray
|
|
28
|
+
@static
|
|
29
|
+
@for @ember/array
|
|
30
|
+
@param {Object} obj The object to test
|
|
31
|
+
@return {Boolean} true if the passed object is an array or Array-like
|
|
32
|
+
@public
|
|
33
|
+
*/
|
|
34
|
+
export default function isArray(obj: unknown): obj is ArrayLike<unknown> | EmberArray<unknown>;
|
|
35
|
+
}
|
|
@@ -14,9 +14,7 @@ declare module '@ember/component/template-only' {
|
|
|
14
14
|
|
|
15
15
|
Addons may want to use this method directly to ensure that a template-only component is treated consistently in all Ember versions (Ember versions
|
|
16
16
|
before 4.0 have a "template-only-glimmer-components" optional feature that causes a standalone `.hbs` file to be interpreted differently).
|
|
17
|
-
|
|
18
|
-
@example
|
|
19
|
-
|
|
17
|
+
|
|
20
18
|
```js
|
|
21
19
|
import templateOnly from '@ember/component/template-only';
|
|
22
20
|
|