ember-source 7.2.0-alpha.4 → 7.3.0-alpha.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/deprecations/index.js +10 -0
- 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 +8 -8
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +1 -1
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/comparable.js +5 -0
- 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 +24 -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 +321 -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 -6
- 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 -19
- 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/compare.js +5 -2
- 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 +3 -3
- 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-DGUCLOud.js} +10 -11
- package/dist/dev/packages/shared-chunks/curly-brand-B_F79Dep.js +12 -0
- 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-brand-C9_8vvOf.js +12 -0
- package/dist/dev/packages/shared-chunks/{index-DX90CU4L.js → index-BGP1rw3B.js} +1 -1
- package/dist/dev/packages/shared-chunks/{index-dyv6rcBf.js → index-CCyXUNBa.js} +655 -1633
- 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/outlet-CHFL7tun.js +135 -0
- 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-BHdDJATP.js +951 -0
- 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-B8loxkay.js} +3 -3
- 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/deprecations/index.js +10 -0
- 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 +8 -8
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +1 -1
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/comparable.js +5 -0
- 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 +19 -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 +305 -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 -5
- 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 -18
- 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/compare.js +5 -2
- 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 +3 -3
- 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-a6DP7r87.js} +10 -11
- package/dist/prod/packages/shared-chunks/curly-brand-B_F79Dep.js +12 -0
- 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-brand-C9_8vvOf.js +12 -0
- 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-npr2B-vu.js} +541 -1465
- 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/prod/packages/shared-chunks/outlet--lIm3q7t.js +132 -0
- 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-Dfu8EyLU.js +886 -0
- 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-jjQ-FqKB.js} +3 -3
- package/dist/{dev/packages/shared-chunks/vm-ops-5QCUIRx4.js → prod/packages/shared-chunks/vm-ops-ImHv0Wtg.js} +1 -1
- package/docs/data.json +616 -569
- package/package.json +8 -6
- package/types/stable/@ember/-internals/deprecations/index.d.ts +6 -0
- package/types/stable/@ember/-internals/glimmer/index.d.ts +165 -121
- package/types/stable/@ember/-internals/glimmer/lib/base-renderer.d.ts +150 -0
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly-brand.d.ts +10 -0
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly.d.ts +3 -2
- 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-brand.d.ts +10 -0
- package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +20 -10
- 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 +7 -155
- package/types/stable/@ember/-internals/glimmer/lib/router-resolver.d.ts +17 -0
- 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/renderer/index.d.ts +2 -2
- 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 +590 -585
- package/dist/dev/packages/shared-chunks/helper-Bm6EhgSW.js +0 -314
- package/dist/dev/packages/shared-chunks/setup-registry-C_YovxNX.js +0 -77
- package/dist/prod/packages/shared-chunks/helper-CCK8Ef0x.js +0 -298
- package/dist/prod/packages/shared-chunks/setup-registry-D14I0iDX.js +0 -74
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import { setOwner } from '../@ember/-internals/owner/index.js';
|
|
2
|
-
import { FrameworkObject } from '../@ember/object/-internals.js';
|
|
3
|
-
import { g as getDebugName } from './get-debug-name-CSniHBsn.js';
|
|
4
|
-
import '../@ember/debug/index.js';
|
|
5
|
-
import { join } from '../@ember/runloop/index.js';
|
|
6
|
-
import { a as getInternalHelperManager, i as helperCapabilities } from './api-DG5kRT-o.js';
|
|
7
|
-
import { b as setHelperManager } from './api-BT9M3UaD.js';
|
|
8
|
-
import { m as createTag, D as DIRTY_TAG, k as consumeTag } from './cache-CeWOBNQg.js';
|
|
9
|
-
import { assert } from '../@ember/debug/lib/assert.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
@module @ember/component
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const RECOMPUTE_TAG = Symbol('RECOMPUTE_TAG');
|
|
16
|
-
|
|
17
|
-
// Signature type utilities
|
|
18
|
-
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
20
|
-
|
|
21
|
-
// Implements Ember's `Factory` interface and tags it for narrowing/checking.
|
|
22
|
-
|
|
23
|
-
const IS_CLASSIC_HELPER = Symbol('IS_CLASSIC_HELPER');
|
|
24
|
-
|
|
25
|
-
// A zero-runtime-overhead private symbol to use in branding the component to
|
|
26
|
-
// preserve its type parameter.
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
Ember Helpers are functions that can compute values, and are used in templates.
|
|
30
|
-
For example, this code calls a helper named `format-currency`:
|
|
31
|
-
|
|
32
|
-
```app/templates/application.hbs
|
|
33
|
-
<Cost @cents={{230}} />
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
```app/components/cost.hbs
|
|
37
|
-
<div>{{format-currency @cents currency="$"}}</div>
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Additionally a helper can be called as a nested helper.
|
|
41
|
-
In this example, we show the formatted currency value if the `showMoney`
|
|
42
|
-
named argument is truthy.
|
|
43
|
-
|
|
44
|
-
```handlebars
|
|
45
|
-
{{if @showMoney (format-currency @cents currency="$")}}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Helpers defined using a class must provide a `compute` function. For example:
|
|
49
|
-
|
|
50
|
-
```app/helpers/format-currency.js
|
|
51
|
-
import Helper from '@ember/component/helper';
|
|
52
|
-
|
|
53
|
-
export default class extends Helper {
|
|
54
|
-
compute([cents], { currency }) {
|
|
55
|
-
return `${currency}${cents * 0.01}`;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Each time the input to a helper changes, the `compute` function will be
|
|
61
|
-
called again.
|
|
62
|
-
|
|
63
|
-
As instances, these helpers also have access to the container and will accept
|
|
64
|
-
injected dependencies.
|
|
65
|
-
|
|
66
|
-
Additionally, class helpers can call `recompute` to force a new computation.
|
|
67
|
-
|
|
68
|
-
@class Helper
|
|
69
|
-
@extends CoreObject
|
|
70
|
-
@public
|
|
71
|
-
@since 1.13.0
|
|
72
|
-
*/
|
|
73
|
-
// ESLint doesn't understand declaration merging.
|
|
74
|
-
/* eslint-disable import/export */
|
|
75
|
-
|
|
76
|
-
class Helper extends FrameworkObject {
|
|
77
|
-
static isHelperFactory = true;
|
|
78
|
-
static [IS_CLASSIC_HELPER] = true;
|
|
79
|
-
|
|
80
|
-
// `packages/ember/index.js` was setting `Helper.helper`. This seems like
|
|
81
|
-
// a bad idea and probably not something we want. We've moved that definition
|
|
82
|
-
// here, but it should definitely be reviewed and probably removed.
|
|
83
|
-
/** @deprecated */
|
|
84
|
-
static helper = helper;
|
|
85
|
-
|
|
86
|
-
// SAFETY: this is initialized in `init`, rather than `constructor`. It is
|
|
87
|
-
// safe to `declare` like this *if and only if* nothing uses the constructor
|
|
88
|
-
// directly in this class, since nothing else can run before `init`.
|
|
89
|
-
|
|
90
|
-
// SAFETY: this has no runtime existence whatsoever; it is a "phantom type"
|
|
91
|
-
// here to preserve the type param.
|
|
92
|
-
|
|
93
|
-
init(properties) {
|
|
94
|
-
super.init(properties);
|
|
95
|
-
this[RECOMPUTE_TAG] = createTag();
|
|
96
|
-
(!(this.compute) && assert('expected compute to be defined', this.compute));
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
On a class-based helper, it may be useful to force a recomputation of that
|
|
101
|
-
helpers value. This is akin to `rerender` on a component.
|
|
102
|
-
In most cases, `recompute` is not needed because accessing tracked
|
|
103
|
-
properties in `compute` will automatically re-run the helper when
|
|
104
|
-
those properties change. Use `recompute` only when you need to
|
|
105
|
-
trigger a recomputation imperatively, for example in response to an
|
|
106
|
-
external event:
|
|
107
|
-
```app/helpers/current-time.js
|
|
108
|
-
import Helper from '@ember/component/helper';
|
|
109
|
-
export default class CurrentTimeHelper extends Helper {
|
|
110
|
-
interval = null;
|
|
111
|
-
compute() {
|
|
112
|
-
return new Date().toLocaleTimeString();
|
|
113
|
-
}
|
|
114
|
-
constructor() {
|
|
115
|
-
super(...arguments);
|
|
116
|
-
this.interval = setInterval(() => this.recompute(), 1000);
|
|
117
|
-
}
|
|
118
|
-
willDestroy() {
|
|
119
|
-
super.willDestroy();
|
|
120
|
-
clearInterval(this.interval);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
@method recompute
|
|
125
|
-
@public
|
|
126
|
-
@since 1.13.0
|
|
127
|
-
*/
|
|
128
|
-
recompute() {
|
|
129
|
-
join(() => DIRTY_TAG(this[RECOMPUTE_TAG]));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
/* eslint-enable import/export */
|
|
133
|
-
|
|
134
|
-
function isClassicHelper(obj) {
|
|
135
|
-
return obj[IS_CLASSIC_HELPER] === true;
|
|
136
|
-
}
|
|
137
|
-
class ClassicHelperManager {
|
|
138
|
-
capabilities = helperCapabilities('3.23', {
|
|
139
|
-
hasValue: true,
|
|
140
|
-
hasDestroyable: true
|
|
141
|
-
});
|
|
142
|
-
ownerInjection;
|
|
143
|
-
constructor(owner) {
|
|
144
|
-
let ownerInjection = {};
|
|
145
|
-
setOwner(ownerInjection, owner);
|
|
146
|
-
this.ownerInjection = ownerInjection;
|
|
147
|
-
}
|
|
148
|
-
createHelper(definition, args) {
|
|
149
|
-
let instance = isFactoryManager(definition) ? definition.create() : definition.create(this.ownerInjection);
|
|
150
|
-
(!(function (instance) {
|
|
151
|
-
if (instance !== null && typeof instance === 'object') {
|
|
152
|
-
let cast = instance;
|
|
153
|
-
return typeof cast.compute === 'function' && typeof cast.destroy === 'function';
|
|
154
|
-
}
|
|
155
|
-
return false;
|
|
156
|
-
}(instance)) && assert('expected HelperInstance', function (instance) {
|
|
157
|
-
if (instance !== null && typeof instance === 'object') {
|
|
158
|
-
let cast = instance;
|
|
159
|
-
return typeof cast.compute === 'function' && typeof cast.destroy === 'function';
|
|
160
|
-
}
|
|
161
|
-
return false;
|
|
162
|
-
}(instance)));
|
|
163
|
-
return {
|
|
164
|
-
instance,
|
|
165
|
-
args
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
getDestroyable({
|
|
169
|
-
instance
|
|
170
|
-
}) {
|
|
171
|
-
return instance;
|
|
172
|
-
}
|
|
173
|
-
getValue({
|
|
174
|
-
instance,
|
|
175
|
-
args
|
|
176
|
-
}) {
|
|
177
|
-
let {
|
|
178
|
-
positional,
|
|
179
|
-
named
|
|
180
|
-
} = args;
|
|
181
|
-
let ret = instance.compute(positional, named);
|
|
182
|
-
consumeTag(instance[RECOMPUTE_TAG]);
|
|
183
|
-
return ret;
|
|
184
|
-
}
|
|
185
|
-
getDebugName(definition) {
|
|
186
|
-
return getDebugName((definition.class || definition)['prototype']);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function isFactoryManager(obj) {
|
|
190
|
-
return obj != null && 'class' in obj;
|
|
191
|
-
}
|
|
192
|
-
setHelperManager(owner => {
|
|
193
|
-
return new ClassicHelperManager(owner);
|
|
194
|
-
}, Helper);
|
|
195
|
-
const CLASSIC_HELPER_MANAGER = getInternalHelperManager(Helper);
|
|
196
|
-
|
|
197
|
-
///////////
|
|
198
|
-
|
|
199
|
-
class Wrapper {
|
|
200
|
-
isHelperFactory = true;
|
|
201
|
-
constructor(compute) {
|
|
202
|
-
this.compute = compute;
|
|
203
|
-
}
|
|
204
|
-
create() {
|
|
205
|
-
// needs new instance or will leak containers
|
|
206
|
-
return {
|
|
207
|
-
compute: this.compute
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
class SimpleClassicHelperManager {
|
|
212
|
-
capabilities = helperCapabilities('3.23', {
|
|
213
|
-
hasValue: true
|
|
214
|
-
});
|
|
215
|
-
createHelper(definition, args) {
|
|
216
|
-
return () => definition.compute.call(null, args.positional, args.named);
|
|
217
|
-
}
|
|
218
|
-
getValue(fn) {
|
|
219
|
-
return fn();
|
|
220
|
-
}
|
|
221
|
-
getDebugName(definition) {
|
|
222
|
-
return getDebugName(definition.compute);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
const SIMPLE_CLASSIC_HELPER_MANAGER = new SimpleClassicHelperManager();
|
|
226
|
-
setHelperManager(() => SIMPLE_CLASSIC_HELPER_MANAGER, Wrapper.prototype);
|
|
227
|
-
|
|
228
|
-
/*
|
|
229
|
-
Function-based helpers need to present with a constructor signature so that
|
|
230
|
-
type parameters can be preserved when `helper()` is passed a generic function
|
|
231
|
-
(this is particularly key for checking helper invocations with Glint).
|
|
232
|
-
Accordingly, we define an abstract class and declaration merge it with the
|
|
233
|
-
interface; this inherently provides an `abstract` constructor. Since it is
|
|
234
|
-
`abstract`, it is not callable, which is important since end users should not
|
|
235
|
-
be able to do `let myHelper = helper(someFn); new myHelper()`.
|
|
236
|
-
*/
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* The type of a function-based helper.
|
|
240
|
-
*
|
|
241
|
-
* @note This is *not* user-constructible: it is exported only so that the type
|
|
242
|
-
* returned by the `helper` function can be named (and indeed can be exported
|
|
243
|
-
* like `export default helper(...)` safely).
|
|
244
|
-
*/
|
|
245
|
-
// Making `FunctionBasedHelper` an alias this way allows callers to name it in
|
|
246
|
-
// terms meaningful to *them*, while preserving the type behavior described on
|
|
247
|
-
// the `abstract class FunctionBasedHelperInstance` below.
|
|
248
|
-
|
|
249
|
-
// This abstract class -- specifically, its `protected abstract __concrete__`
|
|
250
|
-
// member -- prevents subclasses from doing `class X extends helper(..)`, since
|
|
251
|
-
// that is an error at runtime. While it is rare that people would type that, it
|
|
252
|
-
// is not impossible and we use this to give them early signal via the types for
|
|
253
|
-
// a behavior which will break (and in a somewhat inscrutable way!) at runtime.
|
|
254
|
-
//
|
|
255
|
-
// This is needful because we lie about what this actually is for Glint's sake:
|
|
256
|
-
// a function-based helper returns a `Factory<SimpleHelper>`, which is designed
|
|
257
|
-
// to be "opaque" from a consumer's POV, i.e. not user-callable or constructible
|
|
258
|
-
// but only useable in a template (or via `invokeHelper()` which also treats it
|
|
259
|
-
// as a fully opaque `object` from a type POV). But Glint needs a `Helper<S>` to
|
|
260
|
-
// make it work the same way as class-based helpers. (Note that this does not
|
|
261
|
-
// hold for plain functions as helpers, which it can handle distinctly.) This
|
|
262
|
-
// signature thus makes it so that the item is usable *as* a `Helper` in Glint,
|
|
263
|
-
// but without letting end users treat it as a helper class instance.
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
In many cases it is not necessary to use the full `Helper` class.
|
|
267
|
-
The `helper` method create pure-function helpers without instances.
|
|
268
|
-
For example:
|
|
269
|
-
|
|
270
|
-
```app/helpers/format-currency.js
|
|
271
|
-
import { helper } from '@ember/component/helper';
|
|
272
|
-
|
|
273
|
-
export default helper(function([cents], {currency}) {
|
|
274
|
-
return `${currency}${cents * 0.01}`;
|
|
275
|
-
});
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
@static
|
|
279
|
-
@param {Function} helper The helper function
|
|
280
|
-
@method helper
|
|
281
|
-
@for @ember/component/helper
|
|
282
|
-
@public
|
|
283
|
-
@since 1.13.0
|
|
284
|
-
*/
|
|
285
|
-
// This overload allows users to write types directly on the callback passed to
|
|
286
|
-
// the `helper` function and infer the resulting type correctly.
|
|
287
|
-
|
|
288
|
-
// This overload allows users to provide a `Signature` type explicitly at the
|
|
289
|
-
// helper definition site, e.g. `helper<Sig>((pos, named) => {...})`. **Note:**
|
|
290
|
-
// this overload must appear second, since TS' inference engine will not
|
|
291
|
-
// correctly infer the type of `S` here from the types on the supplied callback.
|
|
292
|
-
|
|
293
|
-
function helper(helperFn) {
|
|
294
|
-
// SAFETY: this is completely lies, in two ways:
|
|
295
|
-
//
|
|
296
|
-
// 1. `Wrapper` is a `Factory<SimpleHelper<S>>`, but from the perspective of
|
|
297
|
-
// any external callers (i.e. Ember *users*), it is quite important that
|
|
298
|
-
// the `Factory` relationship be hidden, because it is not public API for
|
|
299
|
-
// an end user to call `.create()` on a helper created this way. Instead,
|
|
300
|
-
// we provide them an `abstract new` signature (which means it cannot be
|
|
301
|
-
// directly constructed by calling `new` on it) and which does not have the
|
|
302
|
-
// `.create()` signature on it anymore.
|
|
303
|
-
//
|
|
304
|
-
// 2. The produced type here ends up being a subtype of `Helper`, which is not
|
|
305
|
-
// strictly true. This is necessary for the sake of Glint, which provides
|
|
306
|
-
// its information by way of a "declaration merge" with `Helper<S>` in the
|
|
307
|
-
// case of items produced by `helper()`.
|
|
308
|
-
//
|
|
309
|
-
// Long-term, this entire construct can go away in favor of deprecating the
|
|
310
|
-
// `helper()` invocation in favor of using plain functions.
|
|
311
|
-
return new Wrapper(helperFn);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
export { CLASSIC_HELPER_MANAGER as C, Helper as H, helper as h, isClassicHelper as i };
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { privatize } from '../@ember/-internals/container/index.js';
|
|
2
|
-
import { getOwner } from '../@ember/-internals/owner/index.js';
|
|
3
|
-
import '../@ember/debug/index.js';
|
|
4
|
-
import { I as Input, T as Textarea } from './textarea-DHjEFpZu.js';
|
|
5
|
-
import { LinkTo } from '../@ember/routing/index.js';
|
|
6
|
-
import './render-Dz3OWqXy.js';
|
|
7
|
-
import { e as clientBuilder } from './element-builder-Cl1kHFJE.js';
|
|
8
|
-
import { r as rehydrationBuilder } from './rehydrate-builder-IH4d_JQy.js';
|
|
9
|
-
import { s as serializeBuilder } from './serialize-builder-DKliZPPG.js';
|
|
10
|
-
import { o as outletHelper, O as OutletView, R as Renderer } from './index-dyv6rcBf.js';
|
|
11
|
-
import { h as templateFactory } from './index-DkwVSPP5.js';
|
|
12
|
-
import { assert } from '../@ember/debug/lib/assert.js';
|
|
13
|
-
|
|
14
|
-
const OutletTemplate = templateFactory(
|
|
15
|
-
/*
|
|
16
|
-
{{component (outletHelper)}}
|
|
17
|
-
*/
|
|
18
|
-
{
|
|
19
|
-
"id": null,
|
|
20
|
-
"block": "[[[46,[28,[32,0],null,null],null,null,null]],[],[\"component\"]]",
|
|
21
|
-
"moduleName": "packages/@ember/-internals/glimmer/lib/templates/outlet.hbs",
|
|
22
|
-
"scope": () => ({
|
|
23
|
-
outletHelper
|
|
24
|
-
}),
|
|
25
|
-
"isStrictMode": true
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const RootTemplate = templateFactory(
|
|
29
|
-
/*
|
|
30
|
-
{{component this}}
|
|
31
|
-
*/
|
|
32
|
-
{
|
|
33
|
-
"id": null,
|
|
34
|
-
"block": "[[[46,[30,0],null,null,null]],[],[\"component\"]]",
|
|
35
|
-
"moduleName": "packages/@ember/-internals/glimmer/lib/templates/root.hbs",
|
|
36
|
-
"isStrictMode": true
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
function setupApplicationRegistry(registry) {
|
|
40
|
-
// because we are using injections we can't use instantiate false
|
|
41
|
-
// we need to use bind() to copy the function so factory for
|
|
42
|
-
// association won't leak
|
|
43
|
-
registry.register('service:-dom-builder', {
|
|
44
|
-
// Additionally, we *must* constrain this to require `props` on create, else
|
|
45
|
-
// we *know* it cannot have an owner.
|
|
46
|
-
create(props) {
|
|
47
|
-
let owner = getOwner(props);
|
|
48
|
-
(!(owner) && assert('DomBuilderService is unexpectedly missing an owner', owner));
|
|
49
|
-
let env = owner.lookup('-environment:main');
|
|
50
|
-
switch (env._renderMode) {
|
|
51
|
-
case 'serialize':
|
|
52
|
-
return serializeBuilder.bind(null);
|
|
53
|
-
case 'rehydrate':
|
|
54
|
-
return rehydrationBuilder.bind(null);
|
|
55
|
-
default:
|
|
56
|
-
return clientBuilder.bind(null);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
registry.register(privatize`template:-root`, RootTemplate);
|
|
61
|
-
registry.register('renderer:-dom', Renderer);
|
|
62
|
-
}
|
|
63
|
-
function setupEngineRegistry(registry) {
|
|
64
|
-
registry.optionsForType('template', {
|
|
65
|
-
instantiate: false
|
|
66
|
-
});
|
|
67
|
-
registry.register('view:-outlet', OutletView);
|
|
68
|
-
registry.register('template:-outlet', OutletTemplate);
|
|
69
|
-
registry.optionsForType('helper', {
|
|
70
|
-
instantiate: false
|
|
71
|
-
});
|
|
72
|
-
registry.register('component:input', Input);
|
|
73
|
-
registry.register('component:link-to', LinkTo);
|
|
74
|
-
registry.register('component:textarea', Textarea);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export { RootTemplate as R, setupEngineRegistry as a, setupApplicationRegistry as s };
|
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import { setOwner } from '../@ember/-internals/owner/index.js';
|
|
2
|
-
import { FrameworkObject } from '../@ember/object/-internals.js';
|
|
3
|
-
import { g as getDebugName } from './get-debug-name-BDxIL2Y1.js';
|
|
4
|
-
import { join } from '../@ember/runloop/index.js';
|
|
5
|
-
import { a as getInternalHelperManager, i as helperCapabilities } from './api-DOLN_cR2.js';
|
|
6
|
-
import { b as setHelperManager } from './api-CGZbGcvX.js';
|
|
7
|
-
import { m as createTag, D as DIRTY_TAG, k as consumeTag } from './cache-CG6_L9db.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
@module @ember/component
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const RECOMPUTE_TAG = Symbol('RECOMPUTE_TAG');
|
|
14
|
-
|
|
15
|
-
// Signature type utilities
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
18
|
-
|
|
19
|
-
// Implements Ember's `Factory` interface and tags it for narrowing/checking.
|
|
20
|
-
|
|
21
|
-
const IS_CLASSIC_HELPER = Symbol('IS_CLASSIC_HELPER');
|
|
22
|
-
|
|
23
|
-
// A zero-runtime-overhead private symbol to use in branding the component to
|
|
24
|
-
// preserve its type parameter.
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
Ember Helpers are functions that can compute values, and are used in templates.
|
|
28
|
-
For example, this code calls a helper named `format-currency`:
|
|
29
|
-
|
|
30
|
-
```app/templates/application.hbs
|
|
31
|
-
<Cost @cents={{230}} />
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
```app/components/cost.hbs
|
|
35
|
-
<div>{{format-currency @cents currency="$"}}</div>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Additionally a helper can be called as a nested helper.
|
|
39
|
-
In this example, we show the formatted currency value if the `showMoney`
|
|
40
|
-
named argument is truthy.
|
|
41
|
-
|
|
42
|
-
```handlebars
|
|
43
|
-
{{if @showMoney (format-currency @cents currency="$")}}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Helpers defined using a class must provide a `compute` function. For example:
|
|
47
|
-
|
|
48
|
-
```app/helpers/format-currency.js
|
|
49
|
-
import Helper from '@ember/component/helper';
|
|
50
|
-
|
|
51
|
-
export default class extends Helper {
|
|
52
|
-
compute([cents], { currency }) {
|
|
53
|
-
return `${currency}${cents * 0.01}`;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Each time the input to a helper changes, the `compute` function will be
|
|
59
|
-
called again.
|
|
60
|
-
|
|
61
|
-
As instances, these helpers also have access to the container and will accept
|
|
62
|
-
injected dependencies.
|
|
63
|
-
|
|
64
|
-
Additionally, class helpers can call `recompute` to force a new computation.
|
|
65
|
-
|
|
66
|
-
@class Helper
|
|
67
|
-
@extends CoreObject
|
|
68
|
-
@public
|
|
69
|
-
@since 1.13.0
|
|
70
|
-
*/
|
|
71
|
-
// ESLint doesn't understand declaration merging.
|
|
72
|
-
/* eslint-disable import/export */
|
|
73
|
-
|
|
74
|
-
class Helper extends FrameworkObject {
|
|
75
|
-
static isHelperFactory = true;
|
|
76
|
-
static [IS_CLASSIC_HELPER] = true;
|
|
77
|
-
|
|
78
|
-
// `packages/ember/index.js` was setting `Helper.helper`. This seems like
|
|
79
|
-
// a bad idea and probably not something we want. We've moved that definition
|
|
80
|
-
// here, but it should definitely be reviewed and probably removed.
|
|
81
|
-
/** @deprecated */
|
|
82
|
-
static helper = helper;
|
|
83
|
-
|
|
84
|
-
// SAFETY: this is initialized in `init`, rather than `constructor`. It is
|
|
85
|
-
// safe to `declare` like this *if and only if* nothing uses the constructor
|
|
86
|
-
// directly in this class, since nothing else can run before `init`.
|
|
87
|
-
|
|
88
|
-
// SAFETY: this has no runtime existence whatsoever; it is a "phantom type"
|
|
89
|
-
// here to preserve the type param.
|
|
90
|
-
|
|
91
|
-
init(properties) {
|
|
92
|
-
super.init(properties);
|
|
93
|
-
this[RECOMPUTE_TAG] = createTag();
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
On a class-based helper, it may be useful to force a recomputation of that
|
|
98
|
-
helpers value. This is akin to `rerender` on a component.
|
|
99
|
-
In most cases, `recompute` is not needed because accessing tracked
|
|
100
|
-
properties in `compute` will automatically re-run the helper when
|
|
101
|
-
those properties change. Use `recompute` only when you need to
|
|
102
|
-
trigger a recomputation imperatively, for example in response to an
|
|
103
|
-
external event:
|
|
104
|
-
```app/helpers/current-time.js
|
|
105
|
-
import Helper from '@ember/component/helper';
|
|
106
|
-
export default class CurrentTimeHelper extends Helper {
|
|
107
|
-
interval = null;
|
|
108
|
-
compute() {
|
|
109
|
-
return new Date().toLocaleTimeString();
|
|
110
|
-
}
|
|
111
|
-
constructor() {
|
|
112
|
-
super(...arguments);
|
|
113
|
-
this.interval = setInterval(() => this.recompute(), 1000);
|
|
114
|
-
}
|
|
115
|
-
willDestroy() {
|
|
116
|
-
super.willDestroy();
|
|
117
|
-
clearInterval(this.interval);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
@method recompute
|
|
122
|
-
@public
|
|
123
|
-
@since 1.13.0
|
|
124
|
-
*/
|
|
125
|
-
recompute() {
|
|
126
|
-
join(() => DIRTY_TAG(this[RECOMPUTE_TAG]));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
/* eslint-enable import/export */
|
|
130
|
-
|
|
131
|
-
function isClassicHelper(obj) {
|
|
132
|
-
return obj[IS_CLASSIC_HELPER] === true;
|
|
133
|
-
}
|
|
134
|
-
class ClassicHelperManager {
|
|
135
|
-
capabilities = helperCapabilities('3.23', {
|
|
136
|
-
hasValue: true,
|
|
137
|
-
hasDestroyable: true
|
|
138
|
-
});
|
|
139
|
-
ownerInjection;
|
|
140
|
-
constructor(owner) {
|
|
141
|
-
let ownerInjection = {};
|
|
142
|
-
setOwner(ownerInjection, owner);
|
|
143
|
-
this.ownerInjection = ownerInjection;
|
|
144
|
-
}
|
|
145
|
-
createHelper(definition, args) {
|
|
146
|
-
let instance = isFactoryManager(definition) ? definition.create() : definition.create(this.ownerInjection);
|
|
147
|
-
return {
|
|
148
|
-
instance,
|
|
149
|
-
args
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
getDestroyable({
|
|
153
|
-
instance
|
|
154
|
-
}) {
|
|
155
|
-
return instance;
|
|
156
|
-
}
|
|
157
|
-
getValue({
|
|
158
|
-
instance,
|
|
159
|
-
args
|
|
160
|
-
}) {
|
|
161
|
-
let {
|
|
162
|
-
positional,
|
|
163
|
-
named
|
|
164
|
-
} = args;
|
|
165
|
-
let ret = instance.compute(positional, named);
|
|
166
|
-
consumeTag(instance[RECOMPUTE_TAG]);
|
|
167
|
-
return ret;
|
|
168
|
-
}
|
|
169
|
-
getDebugName(definition) {
|
|
170
|
-
return getDebugName((definition.class || definition)['prototype']);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
function isFactoryManager(obj) {
|
|
174
|
-
return obj != null && 'class' in obj;
|
|
175
|
-
}
|
|
176
|
-
setHelperManager(owner => {
|
|
177
|
-
return new ClassicHelperManager(owner);
|
|
178
|
-
}, Helper);
|
|
179
|
-
const CLASSIC_HELPER_MANAGER = getInternalHelperManager(Helper);
|
|
180
|
-
|
|
181
|
-
///////////
|
|
182
|
-
|
|
183
|
-
class Wrapper {
|
|
184
|
-
isHelperFactory = true;
|
|
185
|
-
constructor(compute) {
|
|
186
|
-
this.compute = compute;
|
|
187
|
-
}
|
|
188
|
-
create() {
|
|
189
|
-
// needs new instance or will leak containers
|
|
190
|
-
return {
|
|
191
|
-
compute: this.compute
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
class SimpleClassicHelperManager {
|
|
196
|
-
capabilities = helperCapabilities('3.23', {
|
|
197
|
-
hasValue: true
|
|
198
|
-
});
|
|
199
|
-
createHelper(definition, args) {
|
|
200
|
-
return () => definition.compute.call(null, args.positional, args.named);
|
|
201
|
-
}
|
|
202
|
-
getValue(fn) {
|
|
203
|
-
return fn();
|
|
204
|
-
}
|
|
205
|
-
getDebugName(definition) {
|
|
206
|
-
return getDebugName(definition.compute);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
const SIMPLE_CLASSIC_HELPER_MANAGER = new SimpleClassicHelperManager();
|
|
210
|
-
setHelperManager(() => SIMPLE_CLASSIC_HELPER_MANAGER, Wrapper.prototype);
|
|
211
|
-
|
|
212
|
-
/*
|
|
213
|
-
Function-based helpers need to present with a constructor signature so that
|
|
214
|
-
type parameters can be preserved when `helper()` is passed a generic function
|
|
215
|
-
(this is particularly key for checking helper invocations with Glint).
|
|
216
|
-
Accordingly, we define an abstract class and declaration merge it with the
|
|
217
|
-
interface; this inherently provides an `abstract` constructor. Since it is
|
|
218
|
-
`abstract`, it is not callable, which is important since end users should not
|
|
219
|
-
be able to do `let myHelper = helper(someFn); new myHelper()`.
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* The type of a function-based helper.
|
|
224
|
-
*
|
|
225
|
-
* @note This is *not* user-constructible: it is exported only so that the type
|
|
226
|
-
* returned by the `helper` function can be named (and indeed can be exported
|
|
227
|
-
* like `export default helper(...)` safely).
|
|
228
|
-
*/
|
|
229
|
-
// Making `FunctionBasedHelper` an alias this way allows callers to name it in
|
|
230
|
-
// terms meaningful to *them*, while preserving the type behavior described on
|
|
231
|
-
// the `abstract class FunctionBasedHelperInstance` below.
|
|
232
|
-
|
|
233
|
-
// This abstract class -- specifically, its `protected abstract __concrete__`
|
|
234
|
-
// member -- prevents subclasses from doing `class X extends helper(..)`, since
|
|
235
|
-
// that is an error at runtime. While it is rare that people would type that, it
|
|
236
|
-
// is not impossible and we use this to give them early signal via the types for
|
|
237
|
-
// a behavior which will break (and in a somewhat inscrutable way!) at runtime.
|
|
238
|
-
//
|
|
239
|
-
// This is needful because we lie about what this actually is for Glint's sake:
|
|
240
|
-
// a function-based helper returns a `Factory<SimpleHelper>`, which is designed
|
|
241
|
-
// to be "opaque" from a consumer's POV, i.e. not user-callable or constructible
|
|
242
|
-
// but only useable in a template (or via `invokeHelper()` which also treats it
|
|
243
|
-
// as a fully opaque `object` from a type POV). But Glint needs a `Helper<S>` to
|
|
244
|
-
// make it work the same way as class-based helpers. (Note that this does not
|
|
245
|
-
// hold for plain functions as helpers, which it can handle distinctly.) This
|
|
246
|
-
// signature thus makes it so that the item is usable *as* a `Helper` in Glint,
|
|
247
|
-
// but without letting end users treat it as a helper class instance.
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
In many cases it is not necessary to use the full `Helper` class.
|
|
251
|
-
The `helper` method create pure-function helpers without instances.
|
|
252
|
-
For example:
|
|
253
|
-
|
|
254
|
-
```app/helpers/format-currency.js
|
|
255
|
-
import { helper } from '@ember/component/helper';
|
|
256
|
-
|
|
257
|
-
export default helper(function([cents], {currency}) {
|
|
258
|
-
return `${currency}${cents * 0.01}`;
|
|
259
|
-
});
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
@static
|
|
263
|
-
@param {Function} helper The helper function
|
|
264
|
-
@method helper
|
|
265
|
-
@for @ember/component/helper
|
|
266
|
-
@public
|
|
267
|
-
@since 1.13.0
|
|
268
|
-
*/
|
|
269
|
-
// This overload allows users to write types directly on the callback passed to
|
|
270
|
-
// the `helper` function and infer the resulting type correctly.
|
|
271
|
-
|
|
272
|
-
// This overload allows users to provide a `Signature` type explicitly at the
|
|
273
|
-
// helper definition site, e.g. `helper<Sig>((pos, named) => {...})`. **Note:**
|
|
274
|
-
// this overload must appear second, since TS' inference engine will not
|
|
275
|
-
// correctly infer the type of `S` here from the types on the supplied callback.
|
|
276
|
-
|
|
277
|
-
function helper(helperFn) {
|
|
278
|
-
// SAFETY: this is completely lies, in two ways:
|
|
279
|
-
//
|
|
280
|
-
// 1. `Wrapper` is a `Factory<SimpleHelper<S>>`, but from the perspective of
|
|
281
|
-
// any external callers (i.e. Ember *users*), it is quite important that
|
|
282
|
-
// the `Factory` relationship be hidden, because it is not public API for
|
|
283
|
-
// an end user to call `.create()` on a helper created this way. Instead,
|
|
284
|
-
// we provide them an `abstract new` signature (which means it cannot be
|
|
285
|
-
// directly constructed by calling `new` on it) and which does not have the
|
|
286
|
-
// `.create()` signature on it anymore.
|
|
287
|
-
//
|
|
288
|
-
// 2. The produced type here ends up being a subtype of `Helper`, which is not
|
|
289
|
-
// strictly true. This is necessary for the sake of Glint, which provides
|
|
290
|
-
// its information by way of a "declaration merge" with `Helper<S>` in the
|
|
291
|
-
// case of items produced by `helper()`.
|
|
292
|
-
//
|
|
293
|
-
// Long-term, this entire construct can go away in favor of deprecating the
|
|
294
|
-
// `helper()` invocation in favor of using plain functions.
|
|
295
|
-
return new Wrapper(helperFn);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
export { CLASSIC_HELPER_MANAGER as C, Helper as H, helper as h, isClassicHelper as i };
|