ember-source 4.10.0-beta.2 → 4.11.0-alpha.2
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/CHANGELOG.md +5 -1
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +147 -172
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +129 -6
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +334 -314
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/glimmer/index.js +60 -59
- package/dist/packages/@ember/-internals/metal/index.js +6 -6
- package/dist/packages/@ember/-internals/{utils/types.js → utility-types/index.js} +0 -0
- package/dist/packages/@ember/-internals/utils/index.js +3 -137
- package/dist/packages/@ember/-internals/views/lib/mixins/action_support.js +1 -2
- package/dist/packages/@ember/-internals/views/lib/views/states/default.js +1 -2
- package/dist/packages/@ember/-internals/views/lib/views/states/destroying.js +2 -3
- package/dist/packages/@ember/-internals/views/lib/views/states/in_dom.js +1 -2
- package/dist/packages/@ember/array/-internals.js +8 -0
- package/dist/packages/@ember/array/index.js +2 -2
- package/dist/packages/@ember/array/lib/make-array.js +10 -0
- package/dist/packages/@ember/canary-features/index.js +0 -4
- package/dist/packages/@ember/debug/data-adapter.js +16 -16
- package/dist/packages/@ember/debug/index.js +2 -3
- package/dist/packages/@ember/debug/lib/inspect.js +117 -0
- package/dist/packages/@ember/engine/instance.js +1 -2
- package/dist/packages/@ember/instrumentation/index.js +2 -8
- package/dist/packages/@ember/object/core.js +2 -1
- package/dist/packages/@ember/object/mixin.js +11 -2
- package/dist/packages/@ember/object/promise-proxy-mixin.js +1 -2
- package/dist/packages/@ember/owner/index.js +2 -2
- package/dist/packages/@ember/routing/lib/utils.js +1 -2
- package/dist/packages/@ember/routing/router.js +36 -37
- package/dist/packages/ember/index.js +3 -3
- package/dist/packages/ember/version.js +1 -1
- package/dist/packages/ember-testing/lib/adapters/qunit.js +1 -1
- package/docs/data.json +252 -253
- package/package.json +19 -19
- package/types/preview/@ember/controller/index.d.ts +1 -1
- package/types/preview/@ember/engine/-private/container-proxy-mixin.d.ts +1 -1
- package/types/preview/@ember/engine/-private/registry-proxy-mixin.d.ts +1 -1
- package/types/preview/@ember/error/index.d.ts +2 -2
- package/types/preview/ember/index.d.ts +1 -1
- package/types/preview/index.d.ts +0 -2
- package/types/publish.mjs +314 -294
- package/types/stable/@ember/-internals/bootstrap/index.d.ts +3 -0
- package/types/stable/@ember/-internals/browser-environment/index.d.ts +9 -0
- package/types/stable/@ember/-internals/browser-environment/lib/has-dom.d.ts +4 -0
- package/types/stable/@ember/-internals/container/index.d.ts +4 -0
- package/types/stable/@ember/-internals/container/lib/container.d.ts +164 -0
- package/types/stable/@ember/-internals/container/lib/registry.d.ts +292 -0
- package/types/stable/@ember/-internals/environment/index.d.ts +5 -0
- package/types/stable/@ember/-internals/environment/lib/context.d.ts +10 -0
- package/types/stable/@ember/-internals/environment/lib/env.d.ts +153 -0
- package/types/stable/@ember/-internals/environment/lib/global.d.ts +4 -0
- package/types/stable/@ember/-internals/error-handling/index.d.ts +9 -0
- package/types/stable/@ember/-internals/glimmer/index.d.ts +456 -0
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/curly.d.ts +47 -0
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/mount.d.ts +41 -0
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/outlet.d.ts +51 -0
- package/types/stable/@ember/-internals/glimmer/lib/component-managers/root.d.ts +23 -0
- package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +840 -0
- package/types/stable/@ember/-internals/glimmer/lib/components/abstract-input.d.ts +37 -0
- package/types/stable/@ember/-internals/glimmer/lib/components/input.d.ts +4 -0
- package/types/stable/@ember/-internals/glimmer/lib/components/internal.d.ts +48 -0
- package/types/stable/@ember/-internals/glimmer/lib/components/link-to.d.ts +4 -0
- package/types/stable/@ember/-internals/glimmer/lib/components/textarea.d.ts +4 -0
- package/types/stable/@ember/-internals/glimmer/lib/dom.d.ts +4 -0
- package/types/stable/@ember/-internals/glimmer/lib/environment.d.ts +11 -0
- package/types/stable/@ember/-internals/glimmer/lib/glimmer-component-docs.d.ts +387 -0
- package/types/stable/@ember/-internals/glimmer/lib/glimmer-tracking-docs.d.ts +249 -0
- package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +160 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/-disallow-dynamic-resolution.d.ts +4 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/-in-element-null-check.d.ts +4 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/-normalize-class.d.ts +4 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/-resolve.d.ts +4 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/-track-array.d.ts +9 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/action.d.ts +268 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/array.d.ts +40 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/component.d.ts +148 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/concat.d.ts +27 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/each-in.d.ts +160 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/fn.d.ts +72 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/get.d.ts +99 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/hash.d.ts +43 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/helper.d.ts +42 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/if-unless.d.ts +181 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/internal-helper.d.ts +5 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/log.d.ts +18 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/modifier.d.ts +41 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/mut.d.ts +77 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/page-title.d.ts +19 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/readonly.d.ts +119 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/unbound.d.ts +34 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/unique-id.d.ts +7 -0
- package/types/stable/@ember/-internals/glimmer/lib/modifiers/action.d.ts +30 -0
- package/types/stable/@ember/-internals/glimmer/lib/modifiers/internal.d.ts +33 -0
- package/types/stable/@ember/-internals/glimmer/lib/modifiers/on.d.ts +94 -0
- package/types/stable/@ember/-internals/glimmer/lib/renderer.d.ts +96 -0
- package/types/stable/@ember/-internals/glimmer/lib/resolver.d.ts +16 -0
- package/types/stable/@ember/-internals/glimmer/lib/setup-registry.d.ts +5 -0
- package/types/stable/@ember/-internals/glimmer/lib/syntax/in-element.d.ts +46 -0
- package/types/stable/@ember/-internals/glimmer/lib/syntax/let.d.ts +54 -0
- package/types/stable/@ember/-internals/glimmer/lib/syntax/mount.d.ts +43 -0
- package/types/stable/@ember/-internals/glimmer/lib/syntax/outlet.d.ts +27 -0
- package/types/stable/@ember/-internals/glimmer/lib/syntax/utils.d.ts +4 -0
- package/types/stable/@ember/-internals/glimmer/lib/template.d.ts +6 -0
- package/types/stable/@ember/-internals/glimmer/lib/template_registry.d.ts +11 -0
- package/types/stable/@ember/-internals/glimmer/lib/utils/bindings.d.ts +10 -0
- package/types/stable/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.d.ts +31 -0
- package/types/stable/@ember/-internals/glimmer/lib/utils/debug-render-message.d.ts +4 -0
- package/types/stable/@ember/-internals/glimmer/lib/utils/iterator.d.ts +5 -0
- package/types/stable/@ember/-internals/glimmer/lib/utils/managers.d.ts +19 -0
- package/types/stable/@ember/-internals/glimmer/lib/utils/outlet.d.ts +51 -0
- package/types/stable/@ember/-internals/glimmer/lib/utils/process-args.d.ts +4 -0
- package/types/stable/@ember/-internals/glimmer/lib/utils/serialization-first-node-helpers.d.ts +3 -0
- package/types/stable/@ember/-internals/glimmer/lib/utils/string.d.ts +61 -0
- package/types/stable/@ember/-internals/glimmer/lib/utils/to-bool.d.ts +3 -0
- package/types/stable/@ember/-internals/glimmer/lib/views/outlet.d.ts +34 -0
- package/types/stable/@ember/-internals/meta/index.d.ts +3 -0
- package/types/stable/@ember/-internals/meta/lib/meta.d.ts +174 -0
- package/types/stable/@ember/-internals/metal/index.d.ts +26 -0
- package/types/stable/@ember/-internals/metal/lib/alias.d.ts +22 -0
- package/types/stable/@ember/-internals/metal/lib/array.d.ts +18 -0
- package/types/stable/@ember/-internals/metal/lib/array_events.d.ts +6 -0
- package/types/stable/@ember/-internals/metal/lib/cache.d.ts +121 -0
- package/types/stable/@ember/-internals/metal/lib/cached.d.ts +3 -0
- package/types/stable/@ember/-internals/metal/lib/chain-tags.d.ts +8 -0
- package/types/stable/@ember/-internals/metal/lib/change_event.d.ts +3 -0
- package/types/stable/@ember/-internals/metal/lib/computed.d.ts +484 -0
- package/types/stable/@ember/-internals/metal/lib/computed_cache.d.ts +3 -0
- package/types/stable/@ember/-internals/metal/lib/decorator.d.ts +64 -0
- package/types/stable/@ember/-internals/metal/lib/dependent_keys.d.ts +2 -0
- package/types/stable/@ember/-internals/metal/lib/deprecate_property.d.ts +18 -0
- package/types/stable/@ember/-internals/metal/lib/each_proxy_events.d.ts +5 -0
- package/types/stable/@ember/-internals/metal/lib/events.d.ts +91 -0
- package/types/stable/@ember/-internals/metal/lib/expand_properties.d.ts +33 -0
- package/types/stable/@ember/-internals/metal/lib/get_properties.d.ts +36 -0
- package/types/stable/@ember/-internals/metal/lib/injected_property.d.ts +25 -0
- package/types/stable/@ember/-internals/metal/lib/libraries.d.ts +31 -0
- package/types/stable/@ember/-internals/metal/lib/namespace_search.d.ts +19 -0
- package/types/stable/@ember/-internals/metal/lib/observer.d.ts +54 -0
- package/types/stable/@ember/-internals/metal/lib/path_cache.d.ts +3 -0
- package/types/stable/@ember/-internals/metal/lib/properties.d.ts +58 -0
- package/types/stable/@ember/-internals/metal/lib/property_events.d.ts +59 -0
- package/types/stable/@ember/-internals/metal/lib/property_get.d.ts +44 -0
- package/types/stable/@ember/-internals/metal/lib/property_set.d.ts +52 -0
- package/types/stable/@ember/-internals/metal/lib/set_properties.d.ts +32 -0
- package/types/stable/@ember/-internals/metal/lib/tags.d.ts +7 -0
- package/types/stable/@ember/-internals/metal/lib/tracked.d.ts +78 -0
- package/types/stable/@ember/-internals/overrides/index.d.ts +3 -0
- package/types/stable/@ember/-internals/owner/index.d.ts +646 -0
- package/types/stable/@ember/-internals/routing/index.d.ts +3 -0
- package/types/stable/@ember/-internals/runtime/index.d.ts +11 -0
- package/types/stable/@ember/-internals/runtime/lib/ext/rsvp.d.ts +5 -0
- package/types/stable/@ember/-internals/runtime/lib/mixins/-proxy.d.ts +34 -0
- package/types/stable/@ember/-internals/runtime/lib/mixins/action_handler.d.ts +23 -0
- package/types/stable/@ember/-internals/runtime/lib/mixins/comparable.d.ts +22 -0
- package/types/stable/@ember/-internals/runtime/lib/mixins/container_proxy.d.ts +22 -0
- package/types/stable/@ember/-internals/runtime/lib/mixins/registry_proxy.d.ts +22 -0
- package/types/stable/@ember/-internals/runtime/lib/mixins/target_action_support.d.ts +29 -0
- package/types/stable/@ember/-internals/utility-types/index.d.ts +10 -0
- package/types/stable/@ember/-internals/utils/index.d.ts +16 -0
- package/types/stable/@ember/-internals/utils/lib/cache.d.ts +14 -0
- package/types/stable/@ember/-internals/utils/lib/dictionary.d.ts +7 -0
- package/types/stable/@ember/-internals/utils/lib/get-debug-name.d.ts +4 -0
- package/types/stable/@ember/-internals/utils/lib/guid.d.ts +60 -0
- package/types/stable/@ember/-internals/utils/lib/intern.d.ts +42 -0
- package/types/stable/@ember/-internals/utils/lib/invoke.d.ts +24 -0
- package/types/stable/@ember/-internals/utils/lib/is_proxy.d.ts +5 -0
- package/types/stable/@ember/-internals/utils/lib/lookup-descriptor.d.ts +3 -0
- package/types/stable/@ember/-internals/utils/lib/mandatory-setter.d.ts +6 -0
- package/types/stable/@ember/-internals/utils/lib/name.d.ts +4 -0
- package/types/stable/@ember/-internals/utils/lib/spec.d.ts +14 -0
- package/types/stable/@ember/-internals/utils/lib/super.d.ts +31 -0
- package/types/stable/@ember/-internals/utils/lib/symbol.d.ts +5 -0
- package/types/stable/@ember/-internals/utils/lib/to-string.d.ts +3 -0
- package/types/stable/@ember/-internals/views/index.d.ts +13 -0
- package/types/stable/@ember/-internals/views/lib/compat/attrs.d.ts +3 -0
- package/types/stable/@ember/-internals/views/lib/compat/fallback-view-registry.d.ts +6 -0
- package/types/stable/@ember/-internals/views/lib/component_lookup.d.ts +5 -0
- package/types/stable/@ember/-internals/views/lib/mixins/action_support.d.ts +13 -0
- package/types/stable/@ember/-internals/views/lib/mixins/child_views_support.d.ts +13 -0
- package/types/stable/@ember/-internals/views/lib/mixins/class_names_support.d.ts +14 -0
- package/types/stable/@ember/-internals/views/lib/mixins/view_state_support.d.ts +13 -0
- package/types/stable/@ember/-internals/views/lib/mixins/view_support.d.ts +25 -0
- package/types/stable/@ember/-internals/views/lib/system/action_manager.d.ts +11 -0
- package/types/stable/@ember/-internals/views/lib/system/event_dispatcher.d.ts +117 -0
- package/types/stable/@ember/-internals/views/lib/system/utils.d.ts +94 -0
- package/types/stable/@ember/-internals/views/lib/views/core_view.d.ts +60 -0
- package/types/stable/@ember/-internals/views/lib/views/states/default.d.ts +5 -0
- package/types/stable/@ember/-internals/views/lib/views/states/destroying.d.ts +5 -0
- package/types/stable/@ember/-internals/views/lib/views/states/has_element.d.ts +5 -0
- package/types/stable/@ember/-internals/views/lib/views/states/in_dom.d.ts +5 -0
- package/types/stable/@ember/-internals/views/lib/views/states/pre_render.d.ts +11 -0
- package/types/stable/@ember/-internals/views/lib/views/states.d.ts +25 -0
- package/types/stable/@ember/application/index.d.ts +814 -0
- package/types/stable/@ember/application/instance.d.ts +288 -0
- package/types/stable/@ember/application/lib/lazy_load.d.ts +38 -0
- package/types/stable/@ember/application/namespace.d.ts +38 -0
- package/types/stable/@ember/array/-internals.d.ts +5 -0
- package/types/stable/@ember/array/index.d.ts +1457 -0
- package/types/stable/@ember/array/lib/make-array.d.ts +34 -0
- package/types/stable/@ember/array/mutable.d.ts +3 -0
- package/types/stable/@ember/array/proxy.d.ts +158 -0
- package/types/stable/@ember/canary-features/index.d.ts +49 -0
- package/types/stable/@ember/component/helper.d.ts +3 -0
- package/types/stable/@ember/component/index.d.ts +5 -0
- package/types/stable/@ember/component/template-only.d.ts +33 -0
- package/types/stable/@ember/controller/index.d.ts +277 -0
- package/types/stable/@ember/debug/container-debug-adapter.d.ts +73 -0
- package/types/stable/@ember/debug/data-adapter.d.ts +325 -0
- package/types/stable/@ember/debug/index.d.ts +52 -0
- package/types/stable/@ember/debug/lib/capture-render-tree.d.ts +21 -0
- package/types/stable/@ember/debug/lib/deprecate.d.ts +72 -0
- package/types/stable/@ember/debug/lib/handlers.d.ts +14 -0
- package/types/stable/@ember/debug/lib/inspect.d.ts +20 -0
- package/types/stable/@ember/debug/lib/testing.d.ts +4 -0
- package/types/stable/@ember/debug/lib/warn.d.ts +14 -0
- package/types/stable/@ember/deprecated-features/index.d.ts +3 -0
- package/types/stable/@ember/destroyable/index.d.ts +237 -0
- package/types/stable/@ember/engine/index.d.ts +347 -0
- package/types/stable/@ember/engine/instance.d.ts +127 -0
- package/types/stable/@ember/engine/lib/engine-parent.d.ts +27 -0
- package/types/stable/@ember/enumerable/index.d.ts +19 -0
- package/types/stable/@ember/enumerable/mutable.d.ts +21 -0
- package/types/stable/@ember/error/index.d.ts +15 -0
- package/types/stable/@ember/helper/index.d.ts +314 -0
- package/types/stable/@ember/instrumentation/index.d.ts +127 -0
- package/types/stable/@ember/modifier/index.d.ts +5 -0
- package/types/stable/@ember/object/-internals.d.ts +9 -0
- package/types/stable/@ember/object/compat.d.ts +90 -0
- package/types/stable/@ember/object/computed.d.ts +5 -0
- package/types/stable/@ember/object/core.d.ts +638 -0
- package/types/stable/@ember/object/evented.d.ts +134 -0
- package/types/stable/@ember/object/events.d.ts +3 -0
- package/types/stable/@ember/object/index.d.ts +60 -0
- package/types/stable/@ember/object/internals.d.ts +3 -0
- package/types/stable/@ember/object/lib/computed/computed_macros.d.ts +644 -0
- package/types/stable/@ember/object/lib/computed/reduce_computed_macros.d.ts +791 -0
- package/types/stable/@ember/object/mixin.d.ts +157 -0
- package/types/stable/@ember/object/observable.d.ts +383 -0
- package/types/stable/@ember/object/observers.d.ts +3 -0
- package/types/stable/@ember/object/promise-proxy-mixin.d.ts +167 -0
- package/types/stable/@ember/object/proxy.d.ts +88 -0
- package/types/stable/@ember/owner/index.d.ts +80 -0
- package/types/stable/@ember/polyfills/index.d.ts +4 -0
- package/types/stable/@ember/polyfills/lib/assign.d.ts +9 -0
- package/types/stable/@ember/renderer/index.d.ts +28 -0
- package/types/stable/@ember/routing/-internals.d.ts +11 -0
- package/types/stable/@ember/routing/auto-location.d.ts +149 -0
- package/types/stable/@ember/routing/hash-location.d.ts +113 -0
- package/types/stable/@ember/routing/history-location.d.ts +143 -0
- package/types/stable/@ember/routing/index.d.ts +3 -0
- package/types/stable/@ember/routing/lib/cache.d.ts +16 -0
- package/types/stable/@ember/routing/lib/controller_for.d.ts +15 -0
- package/types/stable/@ember/routing/lib/dsl.d.ts +52 -0
- package/types/stable/@ember/routing/lib/engines.d.ts +14 -0
- package/types/stable/@ember/routing/lib/generate_controller.d.ts +25 -0
- package/types/stable/@ember/routing/lib/location-utils.d.ts +31 -0
- package/types/stable/@ember/routing/lib/query_params.d.ts +7 -0
- package/types/stable/@ember/routing/lib/route-info.d.ts +3 -0
- package/types/stable/@ember/routing/lib/router_state.d.ts +13 -0
- package/types/stable/@ember/routing/lib/routing-service.d.ts +35 -0
- package/types/stable/@ember/routing/lib/utils.d.ts +36 -0
- package/types/stable/@ember/routing/location.d.ts +108 -0
- package/types/stable/@ember/routing/none-location.d.ts +83 -0
- package/types/stable/@ember/routing/route-info.d.ts +125 -0
- package/types/stable/@ember/routing/route.d.ts +1456 -0
- package/types/stable/@ember/routing/router-service.d.ts +588 -0
- package/types/stable/@ember/routing/router.d.ts +431 -0
- package/types/stable/@ember/routing/transition.d.ts +180 -0
- package/types/stable/@ember/runloop/index.d.ts +657 -0
- package/types/stable/@ember/service/index.d.ts +82 -0
- package/types/stable/@ember/string/index.d.ts +152 -0
- package/types/stable/@ember/string/lib/string_registry.d.ts +9 -0
- package/types/stable/@ember/template/index.d.ts +3 -0
- package/types/stable/@ember/template-compilation/index.d.ts +4 -0
- package/types/stable/@ember/template-factory/index.d.ts +3 -0
- package/types/stable/@ember/test/adapter.d.ts +4 -0
- package/types/stable/@ember/test/index.d.ts +8 -0
- package/types/stable/@ember/utils/index.d.ts +9 -0
- package/types/stable/@ember/utils/lib/compare.d.ts +54 -0
- package/types/stable/@ember/utils/lib/is-equal.d.ts +52 -0
- package/types/stable/@ember/utils/lib/is_blank.d.ts +32 -0
- package/types/stable/@ember/utils/lib/is_empty.d.ts +38 -0
- package/types/stable/@ember/utils/lib/is_none.d.ts +26 -0
- package/types/stable/@ember/utils/lib/is_present.d.ts +35 -0
- package/types/stable/@ember/utils/lib/type-of.d.ts +68 -0
- package/types/stable/@ember/version/index.d.ts +3 -0
- package/types/stable/@glimmer/tracking/index.d.ts +203 -0
- package/types/stable/@glimmer/tracking/primitives/cache.d.ts +3 -0
- package/types/stable/ember/index.d.ts +376 -0
- package/types/stable/ember-template-compiler/index.d.ts +21 -0
- package/types/stable/ember-template-compiler/lib/plugins/assert-against-attrs.d.ts +20 -0
- package/types/stable/ember-template-compiler/lib/plugins/assert-against-named-outlets.d.ts +14 -0
- package/types/stable/ember-template-compiler/lib/plugins/assert-input-helper-without-block.d.ts +5 -0
- package/types/stable/ember-template-compiler/lib/plugins/assert-reserved-named-arguments.d.ts +5 -0
- package/types/stable/ember-template-compiler/lib/plugins/assert-splattribute-expression.d.ts +5 -0
- package/types/stable/ember-template-compiler/lib/plugins/index.d.ts +5 -0
- package/types/stable/ember-template-compiler/lib/plugins/transform-action-syntax.d.ts +28 -0
- package/types/stable/ember-template-compiler/lib/plugins/transform-each-in-into-each.d.ts +24 -0
- package/types/stable/ember-template-compiler/lib/plugins/transform-each-track-array.d.ts +24 -0
- package/types/stable/ember-template-compiler/lib/plugins/transform-in-element.d.ts +22 -0
- package/types/stable/ember-template-compiler/lib/plugins/transform-quoted-bindings-into-just-bindings.d.ts +4 -0
- package/types/stable/ember-template-compiler/lib/plugins/transform-resolutions.d.ts +5 -0
- package/types/stable/ember-template-compiler/lib/plugins/transform-wrap-mount-and-outlet.d.ts +36 -0
- package/types/stable/ember-template-compiler/lib/plugins/utils.d.ts +13 -0
- package/types/stable/ember-template-compiler/lib/system/bootstrap.d.ts +26 -0
- package/types/stable/ember-template-compiler/lib/system/calculate-location-display.d.ts +4 -0
- package/types/stable/ember-template-compiler/lib/system/compile-options.d.ts +6 -0
- package/types/stable/ember-template-compiler/lib/system/compile.d.ts +13 -0
- package/types/stable/ember-template-compiler/lib/system/dasherize-component-name.d.ts +5 -0
- package/types/stable/ember-template-compiler/lib/system/initializer.d.ts +3 -0
- package/types/stable/ember-template-compiler/lib/system/precompile.d.ts +17 -0
- package/types/stable/ember-testing/index.d.ts +10 -0
- package/types/stable/ember-testing/lib/adapters/adapter.d.ts +20 -0
- package/types/stable/ember-testing/lib/adapters/qunit.d.ts +19 -0
- package/types/stable/ember-testing/lib/ext/application.d.ts +12 -0
- package/types/stable/ember-testing/lib/ext/rsvp.d.ts +4 -0
- package/types/stable/ember-testing/lib/helpers/and_then.d.ts +4 -0
- package/types/stable/ember-testing/lib/helpers/current_path.d.ts +22 -0
- package/types/stable/ember-testing/lib/helpers/current_route_name.d.ts +21 -0
- package/types/stable/ember-testing/lib/helpers/current_url.d.ts +22 -0
- package/types/stable/ember-testing/lib/helpers/pause_test.d.ts +53 -0
- package/types/stable/ember-testing/lib/helpers/visit.d.ts +22 -0
- package/types/stable/ember-testing/lib/helpers/wait.d.ts +34 -0
- package/types/stable/ember-testing/lib/helpers.d.ts +3 -0
- package/types/stable/ember-testing/lib/initializers.d.ts +3 -0
- package/types/stable/ember-testing/lib/setup_for_testing.d.ts +15 -0
- package/types/stable/ember-testing/lib/test/adapter.d.ts +7 -0
- package/types/stable/ember-testing/lib/test/helpers.d.ts +115 -0
- package/types/stable/ember-testing/lib/test/on_inject_helpers.d.ts +33 -0
- package/types/stable/ember-testing/lib/test/pending_requests.d.ts +6 -0
- package/types/stable/ember-testing/lib/test/promise.d.ts +38 -0
- package/types/stable/ember-testing/lib/test/run.d.ts +3 -0
- package/types/stable/ember-testing/lib/test/waiters.d.ts +67 -0
- package/types/stable/ember-testing/lib/test.d.ts +47 -0
- package/types/stable/index.d.ts +47 -0
- package/types/preview/@ember/application/tsconfig.json +0 -3
- package/types/preview/@ember/array/tsconfig.json +0 -3
- package/types/preview/@ember/component/tsconfig.json +0 -3
- package/types/preview/@ember/controller/tsconfig.json +0 -3
- package/types/preview/@ember/debug/tsconfig.json +0 -3
- package/types/preview/@ember/destroyable/tsconfig.json +0 -3
- package/types/preview/@ember/engine/tsconfig.json +0 -3
- package/types/preview/@ember/error/tsconfig.json +0 -3
- package/types/preview/@ember/helper/tsconfig.json +0 -3
- package/types/preview/@ember/modifier/tsconfig.json +0 -3
- package/types/preview/@ember/object/tsconfig.json +0 -3
- package/types/preview/@ember/owner/index.d.ts +0 -423
- package/types/preview/@ember/owner/tsconfig.json +0 -3
- package/types/preview/@ember/polyfills/tsconfig.json +0 -3
- package/types/preview/@ember/routing/tsconfig.json +0 -3
- package/types/preview/@ember/runloop/tsconfig.json +0 -3
- package/types/preview/@ember/service/tsconfig.json +0 -3
- package/types/preview/@ember/string/tsconfig.json +0 -3
- package/types/preview/@ember/template/tsconfig.json +0 -3
- package/types/preview/@ember/test/tsconfig.json +0 -3
- package/types/preview/@ember/utils/tsconfig.json +0 -3
- package/types/preview/ember/tsconfig.json +0 -3
- package/types/preview/tsconfig.json +0 -6
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
declare module '@ember/engine/instance.d.ts' {
|
|
2
|
+
/**
|
|
3
|
+
@module @ember/engine
|
|
4
|
+
*/
|
|
5
|
+
import EmberObject from '@ember/object';
|
|
6
|
+
import { RSVP } from '@ember/-internals/runtime';
|
|
7
|
+
import { Registry } from '@ember/-internals/container';
|
|
8
|
+
import { ENGINE_PARENT } from './lib/engine-parent';
|
|
9
|
+
import { ContainerProxyMixin, RegistryProxyMixin } from '@ember/-internals/runtime';
|
|
10
|
+
import type { InternalOwner } from '@ember/-internals/owner';
|
|
11
|
+
import type Owner from '@ember/-internals/owner';
|
|
12
|
+
import { type FullName } from '@ember/-internals/owner';
|
|
13
|
+
import Engine from '@ember/engine';
|
|
14
|
+
import type Application from '@ember/application';
|
|
15
|
+
import type { SimpleElement } from '@simple-dom/interface';
|
|
16
|
+
export interface BootOptions {
|
|
17
|
+
isBrowser?: boolean;
|
|
18
|
+
shouldRender?: boolean;
|
|
19
|
+
document?: Document | null;
|
|
20
|
+
rootElement?: string | SimpleElement | null;
|
|
21
|
+
location?: string | null;
|
|
22
|
+
isInteractive?: boolean;
|
|
23
|
+
_renderMode?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface EngineInstanceOptions {
|
|
26
|
+
mountPoint?: string;
|
|
27
|
+
routable?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
The `EngineInstance` encapsulates all of the stateful aspects of a
|
|
31
|
+
running `Engine`.
|
|
32
|
+
|
|
33
|
+
@public
|
|
34
|
+
@class EngineInstance
|
|
35
|
+
@extends EmberObject
|
|
36
|
+
@uses RegistryProxyMixin
|
|
37
|
+
@uses ContainerProxyMixin
|
|
38
|
+
*/
|
|
39
|
+
interface EngineInstance extends RegistryProxyMixin, ContainerProxyMixin, InternalOwner, Owner {
|
|
40
|
+
}
|
|
41
|
+
const EngineInstance_base: Readonly<typeof EmberObject> & (new (owner?: Owner | undefined) => EmberObject);
|
|
42
|
+
class EngineInstance extends EngineInstance_base {
|
|
43
|
+
/**
|
|
44
|
+
@private
|
|
45
|
+
@method setupRegistry
|
|
46
|
+
@param {Registry} registry
|
|
47
|
+
@param {BootOptions} options
|
|
48
|
+
*/
|
|
49
|
+
static setupRegistry(_registry: Registry, _options?: BootOptions): void;
|
|
50
|
+
/**
|
|
51
|
+
The base `Engine` for which this is an instance.
|
|
52
|
+
|
|
53
|
+
@property {Engine} engine
|
|
54
|
+
@private
|
|
55
|
+
*/
|
|
56
|
+
base: Engine;
|
|
57
|
+
application: Application;
|
|
58
|
+
mountPoint?: string;
|
|
59
|
+
routable?: boolean;
|
|
60
|
+
[ENGINE_PARENT]?: EngineInstance;
|
|
61
|
+
_booted: boolean;
|
|
62
|
+
init(properties: object | undefined): void;
|
|
63
|
+
_bootPromise: RSVP.Promise<this> | null;
|
|
64
|
+
/**
|
|
65
|
+
Initialize the `EngineInstance` and return a promise that resolves
|
|
66
|
+
with the instance itself when the boot process is complete.
|
|
67
|
+
|
|
68
|
+
The primary task here is to run any registered instance initializers.
|
|
69
|
+
|
|
70
|
+
See the documentation on `BootOptions` for the options it takes.
|
|
71
|
+
|
|
72
|
+
@public
|
|
73
|
+
@method boot
|
|
74
|
+
@param options {Object}
|
|
75
|
+
@return {Promise<EngineInstance,Error>}
|
|
76
|
+
*/
|
|
77
|
+
boot(options?: BootOptions): Promise<this>;
|
|
78
|
+
/**
|
|
79
|
+
Unfortunately, a lot of existing code assumes booting an instance is
|
|
80
|
+
synchronous – specifically, a lot of tests assume the last call to
|
|
81
|
+
`app.advanceReadiness()` or `app.reset()` will result in a new instance
|
|
82
|
+
being fully-booted when the current runloop completes.
|
|
83
|
+
|
|
84
|
+
We would like new code (like the `visit` API) to stop making this
|
|
85
|
+
assumption, so we created the asynchronous version above that returns a
|
|
86
|
+
promise. But until we have migrated all the code, we would have to expose
|
|
87
|
+
this method for use *internally* in places where we need to boot an instance
|
|
88
|
+
synchronously.
|
|
89
|
+
|
|
90
|
+
@private
|
|
91
|
+
*/
|
|
92
|
+
_bootSync(options?: BootOptions): this;
|
|
93
|
+
setupRegistry(options?: BootOptions): void;
|
|
94
|
+
/**
|
|
95
|
+
Unregister a factory.
|
|
96
|
+
|
|
97
|
+
Overrides `RegistryProxy#unregister` in order to clear any cached instances
|
|
98
|
+
of the unregistered factory.
|
|
99
|
+
|
|
100
|
+
@public
|
|
101
|
+
@method unregister
|
|
102
|
+
@param {String} fullName
|
|
103
|
+
*/
|
|
104
|
+
unregister(fullName: FullName): void;
|
|
105
|
+
/**
|
|
106
|
+
Build a new `EngineInstance` that's a child of this instance.
|
|
107
|
+
|
|
108
|
+
Engines must be registered by name with their parent engine
|
|
109
|
+
(or application).
|
|
110
|
+
|
|
111
|
+
@private
|
|
112
|
+
@method buildChildEngineInstance
|
|
113
|
+
@param name {String} the registered name of the engine.
|
|
114
|
+
@param options {Object} options provided to the engine instance.
|
|
115
|
+
@return {EngineInstance,Error}
|
|
116
|
+
*/
|
|
117
|
+
buildChildEngineInstance(name: string, options?: EngineInstanceOptions): EngineInstance;
|
|
118
|
+
/**
|
|
119
|
+
Clone dependencies shared between an engine instance and its parent.
|
|
120
|
+
|
|
121
|
+
@private
|
|
122
|
+
@method cloneParentDependencies
|
|
123
|
+
*/
|
|
124
|
+
cloneParentDependencies(): void;
|
|
125
|
+
}
|
|
126
|
+
export default EngineInstance;
|
|
127
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare module '@ember/engine/lib/engine-parent.d.ts' {
|
|
2
|
+
/**
|
|
3
|
+
@module @ember/engine
|
|
4
|
+
*/
|
|
5
|
+
import type EngineInstance from '../instance';
|
|
6
|
+
export const ENGINE_PARENT: unique symbol;
|
|
7
|
+
/**
|
|
8
|
+
`getEngineParent` retrieves an engine instance's parent instance.
|
|
9
|
+
|
|
10
|
+
@method getEngineParent
|
|
11
|
+
@param {EngineInstance} engine An engine instance.
|
|
12
|
+
@return {EngineInstance} The parent engine instance.
|
|
13
|
+
@for @ember/engine
|
|
14
|
+
@static
|
|
15
|
+
@private
|
|
16
|
+
*/
|
|
17
|
+
export function getEngineParent(engine: EngineInstance): EngineInstance | undefined;
|
|
18
|
+
/**
|
|
19
|
+
`setEngineParent` sets an engine instance's parent instance.
|
|
20
|
+
|
|
21
|
+
@method setEngineParent
|
|
22
|
+
@param {EngineInstance} engine An engine instance.
|
|
23
|
+
@param {EngineInstance} parent The parent engine instance.
|
|
24
|
+
@private
|
|
25
|
+
*/
|
|
26
|
+
export function setEngineParent(engine: EngineInstance, parent: EngineInstance): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare module '@ember/enumerable' {
|
|
2
|
+
import Mixin from '@ember/object/mixin';
|
|
3
|
+
/**
|
|
4
|
+
@module @ember/enumerable
|
|
5
|
+
@private
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
The methods in this mixin have been moved to [MutableArray](/ember/release/classes/MutableArray). This mixin has
|
|
9
|
+
been intentionally preserved to avoid breaking Enumerable.detect checks
|
|
10
|
+
until the community migrates away from them.
|
|
11
|
+
|
|
12
|
+
@class Enumerable
|
|
13
|
+
@private
|
|
14
|
+
*/
|
|
15
|
+
interface Enumerable {
|
|
16
|
+
}
|
|
17
|
+
const Enumerable: Mixin;
|
|
18
|
+
export default Enumerable;
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare module '@ember/enumerable/mutable.d.ts' {
|
|
2
|
+
import Enumerable from '@ember/enumerable';
|
|
3
|
+
import Mixin from '@ember/object/mixin';
|
|
4
|
+
/**
|
|
5
|
+
@module ember
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
The methods in this mixin have been moved to MutableArray. This mixin has
|
|
9
|
+
been intentionally preserved to avoid breaking MutableEnumerable.detect
|
|
10
|
+
checks until the community migrates away from them.
|
|
11
|
+
|
|
12
|
+
@class MutableEnumerable
|
|
13
|
+
@namespace Ember
|
|
14
|
+
@uses Enumerable
|
|
15
|
+
@private
|
|
16
|
+
*/
|
|
17
|
+
interface MutableEnumerable extends Enumerable {
|
|
18
|
+
}
|
|
19
|
+
const MutableEnumerable: Mixin;
|
|
20
|
+
export default MutableEnumerable;
|
|
21
|
+
}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
declare module '@ember/helper' {
|
|
2
|
+
/**
|
|
3
|
+
@module @ember/helper
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
`capabilities` returns a capabilities configuration which can be used to modify
|
|
7
|
+
the behavior of the manager. Manager capabilities _must_ be provided using the
|
|
8
|
+
`capabilities` function, as the underlying implementation can change over time.
|
|
9
|
+
|
|
10
|
+
The first argument to capabilities is a version string, which is the version of
|
|
11
|
+
Ember that the capabilities were defined in. Ember can add new versions at any
|
|
12
|
+
time, and these may have entirely different behaviors, but it will not remove
|
|
13
|
+
old versions until the next major version.
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
capabilities('3.23');
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The second argument is an object of capabilities and boolean values indicating
|
|
20
|
+
whether they are enabled or disabled.
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
capabilities('3.23', {
|
|
24
|
+
hasValue: true,
|
|
25
|
+
hasDestructor: true,
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
If no value is specified, then the default value will be used.
|
|
30
|
+
|
|
31
|
+
### `3.23` capabilities
|
|
32
|
+
|
|
33
|
+
#### `hasDestroyable`
|
|
34
|
+
|
|
35
|
+
- Default value: false
|
|
36
|
+
|
|
37
|
+
Determines if the helper has a destroyable to include in the destructor
|
|
38
|
+
hierarchy. If enabled, the `getDestroyable` hook will be called, and its result
|
|
39
|
+
will be associated with the destroyable parent block.
|
|
40
|
+
|
|
41
|
+
#### `hasValue`
|
|
42
|
+
|
|
43
|
+
- Default value: false
|
|
44
|
+
|
|
45
|
+
Determines if the helper has a value which can be used externally. The helper's
|
|
46
|
+
`getValue` hook will be run whenever the value of the helper is accessed if this
|
|
47
|
+
capability is enabled.
|
|
48
|
+
|
|
49
|
+
@method capabilities
|
|
50
|
+
@for @ember/helper
|
|
51
|
+
@static
|
|
52
|
+
@param {String} managerApiVersion The version of capabilities that are being used
|
|
53
|
+
@param options The capabilities values
|
|
54
|
+
@return {Capabilities} The capabilities object instance
|
|
55
|
+
@public
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
Sets the helper manager for an object or function.
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
setHelperManager((owner) => new ClassHelperManager(owner), Helper)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
When a value is used as a helper in a template, the helper manager is looked up
|
|
65
|
+
on the object by walking up its prototype chain and finding the first helper
|
|
66
|
+
manager. This manager then receives the value and can create and manage an
|
|
67
|
+
instance of a helper from it. This provides a layer of indirection that allows
|
|
68
|
+
users to design high-level helper APIs, without Ember needing to worry about the
|
|
69
|
+
details. High-level APIs can be experimented with and iterated on while the
|
|
70
|
+
core of Ember helpers remains stable, and new APIs can be introduced gradually
|
|
71
|
+
over time to existing code bases.
|
|
72
|
+
|
|
73
|
+
`setHelperManager` receives two arguments:
|
|
74
|
+
|
|
75
|
+
1. A factory function, which receives the `owner` and returns an instance of a
|
|
76
|
+
helper manager.
|
|
77
|
+
2. A helper definition, which is the object or function to associate the factory function with.
|
|
78
|
+
|
|
79
|
+
The first time the object is looked up, the factory function will be called to
|
|
80
|
+
create the helper manager. It will be cached, and in subsequent lookups the
|
|
81
|
+
cached helper manager will be used instead.
|
|
82
|
+
|
|
83
|
+
Only one helper manager is guaranteed to exist per `owner` and per usage of
|
|
84
|
+
`setHelperManager`, so many helpers will end up using the same instance of the
|
|
85
|
+
helper manager. As such, you should only store state that is related to the
|
|
86
|
+
manager itself. If you want to store state specific to a particular helper
|
|
87
|
+
definition, you should assign a unique helper manager to that helper. In
|
|
88
|
+
general, most managers should either be stateless, or only have the `owner` they
|
|
89
|
+
were created with as state.
|
|
90
|
+
|
|
91
|
+
Helper managers must fulfill the following interface (This example uses
|
|
92
|
+
[TypeScript interfaces](https://www.typescriptlang.org/docs/handbook/interfaces.html)
|
|
93
|
+
for precision, you do not need to write helper managers using TypeScript):
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
interface HelperManager<HelperStateBucket> {
|
|
97
|
+
capabilities: HelperCapabilities;
|
|
98
|
+
|
|
99
|
+
createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;
|
|
100
|
+
|
|
101
|
+
getValue?(bucket: HelperStateBucket): unknown;
|
|
102
|
+
|
|
103
|
+
runEffect?(bucket: HelperStateBucket): void;
|
|
104
|
+
|
|
105
|
+
getDestroyable?(bucket: HelperStateBucket): object;
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The capabilities property _must_ be provided using the `capabilities()` function
|
|
110
|
+
imported from the same module as `setHelperManager`:
|
|
111
|
+
|
|
112
|
+
```js
|
|
113
|
+
import { capabilities } from '@ember/helper';
|
|
114
|
+
|
|
115
|
+
class MyHelperManager {
|
|
116
|
+
capabilities = capabilities('3.21.0', { hasValue: true });
|
|
117
|
+
|
|
118
|
+
// ...snip...
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Below is a description of each of the methods on the interface and their
|
|
123
|
+
functions.
|
|
124
|
+
|
|
125
|
+
#### `createHelper`
|
|
126
|
+
|
|
127
|
+
`createHelper` is a required hook on the HelperManager interface. The hook is
|
|
128
|
+
passed the definition of the helper that is currently being created, and is
|
|
129
|
+
expected to return a _state bucket_. This state bucket is what represents the
|
|
130
|
+
current state of the helper, and will be passed to the other lifecycle hooks at
|
|
131
|
+
appropriate times. It is not necessarily related to the definition of the
|
|
132
|
+
helper itself - for instance, you could return an object _containing_ an
|
|
133
|
+
instance of the helper:
|
|
134
|
+
|
|
135
|
+
```js
|
|
136
|
+
class MyManager {
|
|
137
|
+
createHelper(Definition, args) {
|
|
138
|
+
return {
|
|
139
|
+
instance: new Definition(args);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
This allows the manager to store metadata that it doesn't want to expose to the
|
|
146
|
+
user.
|
|
147
|
+
|
|
148
|
+
This hook is _not_ autotracked - changes to tracked values used within this hook
|
|
149
|
+
will _not_ result in a call to any of the other lifecycle hooks. This is because
|
|
150
|
+
it is unclear what should happen if it invalidates, and rather than make a
|
|
151
|
+
decision at this point, the initial API is aiming to allow as much expressivity
|
|
152
|
+
as possible. This could change in the future with changes to capabilities and
|
|
153
|
+
their behaviors.
|
|
154
|
+
|
|
155
|
+
If users do want to autotrack some values used during construction, they can
|
|
156
|
+
either create the instance of the helper in `runEffect` or `getValue`, or they
|
|
157
|
+
can use the `cache` API to autotrack the `createHelper` hook themselves. This
|
|
158
|
+
provides maximum flexibility and expressiveness to manager authors.
|
|
159
|
+
|
|
160
|
+
This hook has the following timing semantics:
|
|
161
|
+
|
|
162
|
+
**Always**
|
|
163
|
+
- called as discovered during DOM construction
|
|
164
|
+
- called in definition order in the template
|
|
165
|
+
|
|
166
|
+
#### `getValue`
|
|
167
|
+
|
|
168
|
+
`getValue` is an optional hook that should return the value of the helper. This
|
|
169
|
+
is the value that is returned from the helper and passed into the template.
|
|
170
|
+
|
|
171
|
+
This hook is called when the value is requested from the helper (e.g. when the
|
|
172
|
+
template is rendering and the helper value is needed). The hook is autotracked,
|
|
173
|
+
and will rerun whenever any tracked values used inside of it are updated.
|
|
174
|
+
Otherwise it does not rerun.
|
|
175
|
+
|
|
176
|
+
> Note: This means that arguments which are not _consumed_ within the hook will
|
|
177
|
+
> not trigger updates.
|
|
178
|
+
|
|
179
|
+
This hook is only called for helpers with the `hasValue` capability enabled.
|
|
180
|
+
This hook has the following timing semantics:
|
|
181
|
+
|
|
182
|
+
**Always**
|
|
183
|
+
- called the first time the helper value is requested
|
|
184
|
+
- called after autotracked state has changed
|
|
185
|
+
|
|
186
|
+
**Never**
|
|
187
|
+
- called if the `hasValue` capability is disabled
|
|
188
|
+
|
|
189
|
+
#### `runEffect`
|
|
190
|
+
|
|
191
|
+
`runEffect` is an optional hook that should run the effect that the helper is
|
|
192
|
+
applying, setting it up or updating it.
|
|
193
|
+
|
|
194
|
+
This hook is scheduled to be called some time after render and prior to paint.
|
|
195
|
+
There is not a guaranteed, 1-to-1 relationship between a render pass and this
|
|
196
|
+
hook firing. For instance, multiple render passes could occur, and the hook may
|
|
197
|
+
only trigger once. It may also never trigger if it was dirtied in one render
|
|
198
|
+
pass and then destroyed in the next.
|
|
199
|
+
|
|
200
|
+
The hook is autotracked, and will rerun whenever any tracked values used inside
|
|
201
|
+
of it are updated. Otherwise it does not rerun.
|
|
202
|
+
|
|
203
|
+
The hook is also run during a time period where state mutations are _disabled_
|
|
204
|
+
in Ember. Any tracked state mutation will throw an error during this time,
|
|
205
|
+
including changes to tracked properties, changes made using `Ember.set`, updates
|
|
206
|
+
to computed properties, etc. This is meant to prevent infinite rerenders and
|
|
207
|
+
other antipatterns.
|
|
208
|
+
|
|
209
|
+
This hook is only called for helpers with the `hasScheduledEffect` capability
|
|
210
|
+
enabled. This hook is also not called in SSR currently, though this could be
|
|
211
|
+
added as a capability in the future. It has the following timing semantics:
|
|
212
|
+
|
|
213
|
+
**Always**
|
|
214
|
+
- called after the helper was first created, if the helper has not been
|
|
215
|
+
destroyed since creation
|
|
216
|
+
- called after autotracked state has changed, if the helper has not been
|
|
217
|
+
destroyed during render
|
|
218
|
+
|
|
219
|
+
**Never**
|
|
220
|
+
- called if the `hasScheduledEffect` capability is disabled
|
|
221
|
+
- called in SSR
|
|
222
|
+
|
|
223
|
+
#### `getDestroyable`
|
|
224
|
+
|
|
225
|
+
`getDestroyable` is an optional hook that users can use to register a
|
|
226
|
+
destroyable object for the helper. This destroyable will be registered to the
|
|
227
|
+
containing block or template parent, and will be destroyed when it is destroyed.
|
|
228
|
+
See the [Destroyables RFC](https://github.com/emberjs/rfcs/blob/master/text/0580-destroyables.md)
|
|
229
|
+
for more details.
|
|
230
|
+
|
|
231
|
+
`getDestroyable` is only called if the `hasDestroyable` capability is enabled.
|
|
232
|
+
|
|
233
|
+
This hook has the following timing semantics:
|
|
234
|
+
|
|
235
|
+
**Always**
|
|
236
|
+
- called immediately after the `createHelper` hook is called
|
|
237
|
+
|
|
238
|
+
**Never**
|
|
239
|
+
- called if the `hasDestroyable` capability is disabled
|
|
240
|
+
|
|
241
|
+
@method setHelperManager
|
|
242
|
+
@for @ember/helper
|
|
243
|
+
@static
|
|
244
|
+
@param {Function} factory A factory function which receives an optional owner, and returns a helper manager
|
|
245
|
+
@param {object} definition The definition to associate the manager factory with
|
|
246
|
+
@return {object} The definition passed into setHelperManager
|
|
247
|
+
@public
|
|
248
|
+
*/
|
|
249
|
+
/**
|
|
250
|
+
The `invokeHelper` function can be used to create a helper instance in
|
|
251
|
+
JavaScript.
|
|
252
|
+
|
|
253
|
+
To access a helper's value you have to use `getValue` from
|
|
254
|
+
`@glimmer/tracking/primitives/cache`.
|
|
255
|
+
|
|
256
|
+
```js
|
|
257
|
+
// app/components/data-loader.js
|
|
258
|
+
import Component from '@glimmer/component';
|
|
259
|
+
import { getValue } from '@glimmer/tracking/primitives/cache';
|
|
260
|
+
import Helper from '@ember/component/helper';
|
|
261
|
+
import { invokeHelper } from '@ember/helper';
|
|
262
|
+
|
|
263
|
+
class PlusOne extends Helper {
|
|
264
|
+
compute([number]) {
|
|
265
|
+
return number + 1;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export default class PlusOneComponent extends Component {
|
|
270
|
+
plusOne = invokeHelper(this, PlusOne, () => {
|
|
271
|
+
return {
|
|
272
|
+
positional: [this.args.number],
|
|
273
|
+
};
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
get value() {
|
|
277
|
+
return getValue(this.plusOne);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
```hbs
|
|
282
|
+
{{this.value}}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
It receives three arguments:
|
|
286
|
+
|
|
287
|
+
* `context`: The parent context of the helper. When the parent is torn down and
|
|
288
|
+
removed, the helper will be as well.
|
|
289
|
+
* `definition`: The definition of the helper.
|
|
290
|
+
* `computeArgs`: An optional function that produces the arguments to the helper.
|
|
291
|
+
The function receives the parent context as an argument, and must return an
|
|
292
|
+
object with a `positional` property that is an array and/or a `named`
|
|
293
|
+
property that is an object.
|
|
294
|
+
|
|
295
|
+
And it returns a Cache instance that contains the most recent value of the
|
|
296
|
+
helper. You can access the helper using `getValue()` like any other cache. The
|
|
297
|
+
cache is also destroyable, and using the `destroy()` function on it will cause
|
|
298
|
+
the helper to be torn down.
|
|
299
|
+
|
|
300
|
+
Note that using `getValue()` on helpers that have scheduled effects will not
|
|
301
|
+
trigger the effect early. Effects will continue to run at their scheduled time.
|
|
302
|
+
|
|
303
|
+
@method invokeHelper
|
|
304
|
+
@for @ember/helper
|
|
305
|
+
@static
|
|
306
|
+
@param {object} context The parent context of the helper
|
|
307
|
+
@param {object} definition The helper definition
|
|
308
|
+
@param {Function} computeArgs An optional function that produces args
|
|
309
|
+
@returns
|
|
310
|
+
@public
|
|
311
|
+
*/
|
|
312
|
+
export { setHelperManager, helperCapabilities as capabilities } from '@glimmer/manager';
|
|
313
|
+
export { invokeHelper, hash, array, concat, get, fn } from '@glimmer/runtime';
|
|
314
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
declare module '@ember/instrumentation' {
|
|
2
|
+
export interface Listener<T> {
|
|
3
|
+
before: (name: string, timestamp: number, payload: object) => T;
|
|
4
|
+
after: (name: string, timestamp: number, payload: object, beforeValue: T) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface Subscriber<T> {
|
|
7
|
+
pattern: string;
|
|
8
|
+
regex: RegExp;
|
|
9
|
+
object: Listener<T>;
|
|
10
|
+
}
|
|
11
|
+
export interface PayloadWithException {
|
|
12
|
+
exception?: any;
|
|
13
|
+
}
|
|
14
|
+
export interface StructuredProfilePayload {
|
|
15
|
+
object: string | object;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
@module @ember/instrumentation
|
|
19
|
+
@private
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
The purpose of the Ember Instrumentation module is
|
|
23
|
+
to provide efficient, general-purpose instrumentation
|
|
24
|
+
for Ember.
|
|
25
|
+
|
|
26
|
+
Subscribe to a listener by using `subscribe`:
|
|
27
|
+
|
|
28
|
+
```javascript
|
|
29
|
+
import { subscribe } from '@ember/instrumentation';
|
|
30
|
+
|
|
31
|
+
subscribe("render", {
|
|
32
|
+
before(name, timestamp, payload) {
|
|
33
|
+
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
after(name, timestamp, payload) {
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If you return a value from the `before` callback, that same
|
|
43
|
+
value will be passed as a fourth parameter to the `after`
|
|
44
|
+
callback.
|
|
45
|
+
|
|
46
|
+
Instrument a block of code by using `instrument`:
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
import { instrument } from '@ember/instrumentation';
|
|
50
|
+
|
|
51
|
+
instrument("render.handlebars", payload, function() {
|
|
52
|
+
// rendering logic
|
|
53
|
+
}, binding);
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Event names passed to `instrument` are namespaced
|
|
57
|
+
by periods, from more general to more specific. Subscribers
|
|
58
|
+
can listen for events by whatever level of granularity they
|
|
59
|
+
are interested in.
|
|
60
|
+
|
|
61
|
+
In the above example, the event is `render.handlebars`,
|
|
62
|
+
and the subscriber listened for all events beginning with
|
|
63
|
+
`render`. It would receive callbacks for events named
|
|
64
|
+
`render`, `render.handlebars`, `render.container`, or
|
|
65
|
+
even `render.handlebars.layout`.
|
|
66
|
+
|
|
67
|
+
@class Instrumentation
|
|
68
|
+
@static
|
|
69
|
+
@private
|
|
70
|
+
*/
|
|
71
|
+
export let subscribers: Subscriber<any>[];
|
|
72
|
+
type InstrumentCallback<Binding, Result> = (this: Binding) => Result;
|
|
73
|
+
/**
|
|
74
|
+
Notifies event's subscribers, calls `before` and `after` hooks.
|
|
75
|
+
|
|
76
|
+
@method instrument
|
|
77
|
+
@for @ember/instrumentation
|
|
78
|
+
@static
|
|
79
|
+
@param {String} [name] Namespaced event name.
|
|
80
|
+
@param {Object} payload
|
|
81
|
+
@param {Function} callback Function that you're instrumenting.
|
|
82
|
+
@param {Object} binding Context that instrument function is called with.
|
|
83
|
+
@private
|
|
84
|
+
*/
|
|
85
|
+
export function instrument<Result>(name: string, callback: InstrumentCallback<undefined, Result>): Result;
|
|
86
|
+
export function instrument<Binding, Result>(name: string, callback: InstrumentCallback<Binding, Result>, binding: Binding): Result;
|
|
87
|
+
export function instrument<Result>(name: string, payload: object, callback: InstrumentCallback<undefined, Result>): Result;
|
|
88
|
+
export function instrument<Binding, Result>(name: string, payload: object, callback: InstrumentCallback<Binding, Result>, binding: Binding): Result;
|
|
89
|
+
export function flaggedInstrument<Result>(_name: string, _payload: object, callback: () => Result): Result;
|
|
90
|
+
export function _instrumentStart(name: string, payloadFunc: () => object): () => void;
|
|
91
|
+
export function _instrumentStart<Arg>(name: string, payloadFunc: (arg: Arg) => object, payloadArg: Arg): () => void;
|
|
92
|
+
/**
|
|
93
|
+
Subscribes to a particular event or instrumented block of code.
|
|
94
|
+
|
|
95
|
+
@method subscribe
|
|
96
|
+
@for @ember/instrumentation
|
|
97
|
+
@static
|
|
98
|
+
|
|
99
|
+
@param {String} [pattern] Namespaced event name.
|
|
100
|
+
@param {Object} [object] Before and After hooks.
|
|
101
|
+
|
|
102
|
+
@return {Subscriber}
|
|
103
|
+
@private
|
|
104
|
+
*/
|
|
105
|
+
export function subscribe<T>(pattern: string, object: Listener<T>): Subscriber<T>;
|
|
106
|
+
/**
|
|
107
|
+
Unsubscribes from a particular event or instrumented block of code.
|
|
108
|
+
|
|
109
|
+
@method unsubscribe
|
|
110
|
+
@for @ember/instrumentation
|
|
111
|
+
@static
|
|
112
|
+
|
|
113
|
+
@param {Object} [subscriber]
|
|
114
|
+
@private
|
|
115
|
+
*/
|
|
116
|
+
export function unsubscribe(subscriber: Subscriber<any>): void;
|
|
117
|
+
/**
|
|
118
|
+
Resets `Instrumentation` by flushing list of subscribers.
|
|
119
|
+
|
|
120
|
+
@method reset
|
|
121
|
+
@for @ember/instrumentation
|
|
122
|
+
@static
|
|
123
|
+
@private
|
|
124
|
+
*/
|
|
125
|
+
export function reset(): void;
|
|
126
|
+
export {};
|
|
127
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare module '@ember/object/-internals.d.ts' {
|
|
2
|
+
export { getCachedValueFor as cacheFor } from '@ember/-internals/metal';
|
|
3
|
+
export { guidFor } from '@ember/-internals/utils';
|
|
4
|
+
import EmberObject from '.';
|
|
5
|
+
interface FrameworkObject extends EmberObject {
|
|
6
|
+
}
|
|
7
|
+
let FrameworkObject: typeof EmberObject;
|
|
8
|
+
export { FrameworkObject };
|
|
9
|
+
}
|