Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@ember/optional-features

emberjs367.5kMIT2.2.0

The default blueprint for ember-cli addons.

ember-addon

readme

@ember/optional-features

This addon allows you to easily enable/disable optional features in ember-source. To clarify what we mean by optional, these are features that will be opt-in/opt-out and optional for the foreseeable future, not features that will be enabled by default. It is intended for use with apps only not addons.

Installation

ember install @ember/optional-features

Usage

From command-line

List available features

Features will only be available in versions of ember-source that included them. To list all available features run:

ember feature:list

Enable/disable features

To enable a feature, run:

ember feature:enable some-feature

Similarly, if you want to disable a feature, you can run:

ember feature:disable some-feature

At build-time (from an addon)

This addon exposes a build-time method called isFeatureEnabled, which can be called from an addon's index.js, e.g.:

included() {
  let optionalFeatues = this.addons.find(a => a.name === '@ember/optional-features');
  if (optionalFeatures.isFeatureEnabled('jquery-integration') {
    // ...
  }
}

It also exposes a method called isFeatureExplicitlySet, which can be used to check whether or not the user has explictly set the value of the option instead of using the default.

At run-time (from an app or addon)

WIP -- there does not yet exist a public API for accessing the state of optional features at runtime. This issue is tracking it.

changelog

Changelog

Release (2024-02-28)

@ember/optional-features 2.2.0 (minor)

:rocket: Enhancement

Committers: 2

Release (2024-02-21)

@ember/optional-features 2.1.0 (minor)

:rocket: Enhancement

  • @ember/optional-features
    • #334 Add feature for no-implicit-route-model - only effective from ember-source 5.7 (@achambers)

:house: Internal

Committers: 3

v2.0.0 (2020-08-27)

:boom: Breaking Change

:rocket: Enhancement

:house: Internal

Committers: 2

v1.3.0 (2019-12-19)

:rocket: Enhancement

:house: Internal

  • #161 Remove co.wrap usage in favor of using async/await directly. (@rwjblue)

Committers: 1

v1.2.0 (2019-12-16)

:bug: Bug Fix

Committers: 2

v1.1.0 (2019-10-23)

:rocket: Enhancement

  • #148 [FEATURE] Adds isFeatureExplicitlySet API (@pzuraq)

Committers: 2

v1.0.0 (2019-09-21)

:boom: Breaking Change

:rocket: Enhancement

  • #132 Add default-async-observers optional feature. (@rwjblue)
  • #97 template-only-glimmer-components: Add support for pods and mixed layouts (@Turbo87)

:memo: Documentation

:house: Internal

Committers: 4