Socket
Socket
Sign inDemoInstall

@ember/optional-features

Package Overview
Dependencies
64
Maintainers
12
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ember/optional-features

The default blueprint for ember-cli addons.


Version published
Maintainers
12
Install size
7.85 MB
Created

Changelog

Source

v2.0.0 (2020-08-27)

:boom: Breaking Change
  • #238 Drop Node 8 support. (@rwjblue)
:rocket: Enhancement
:house: Internal
Committers: 2

Readme

Source

@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.

Keywords

FAQs

Last updated on 27 Aug 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc