{"id":40891,"library":"ember-compatibility-helpers","title":"ember-compatibility-helpers","description":"Provides build-time flags and version helpers for Ember addon authors to write backwards/forward compatible code. Current stable version: 1.2.7. Release cadence: infrequent, primarily maintenance. Key differentiators: zero-cost via Babel transform and dead code elimination; runtime has no overhead as flags are replaced with booleans at build time.","status":"maintenance","version":"1.2.7","language":"javascript","source_language":"en","source_url":"https://github.com/pzuraq/ember-compatibility-helpers","tags":["javascript","ember-addon"],"install":[{"cmd":"npm install ember-compatibility-helpers","lang":"bash","label":"npm"},{"cmd":"yarn add ember-compatibility-helpers","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-compatibility-helpers","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"gte is a named export, not default.","wrong":"import gte from 'ember-compatibility-helpers'","symbol":"gte","correct":"import { gte } from 'ember-compatibility-helpers'"},{"note":"CommonJS require works but ESM is recommended in Ember apps.","wrong":"const lte = require('ember-compatibility-helpers').lte","symbol":"lte","correct":"import { lte } from 'ember-compatibility-helpers'"},{"note":"Flag is a named export; do not use default import.","wrong":"import HAS_UNDERSCORE_ACTIONS from 'ember-compatibility-helpers'","symbol":"HAS_UNDERSCORE_ACTIONS","correct":"import { HAS_UNDERSCORE_ACTIONS } from 'ember-compatibility-helpers'"},{"note":"Named export. No common wrong pattern other than thinking it's a default export.","wrong":null,"symbol":"SUPPORTS_NEW_COMPUTED","correct":"import { SUPPORTS_NEW_COMPUTED } from 'ember-compatibility-helpers'"}],"quickstart":{"code":"// install: ember install ember-compatibility-helpers\n\nimport Component from '@ember/component';\nimport { computed } from '@ember/object';\nimport { SUPPORTS_NEW_COMPUTED } from 'ember-compatibility-helpers';\n\nfunction fooMacro() {\n  if (SUPPORTS_NEW_COMPUTED) {\n    return computed({\n      get() { return this.get('foo'); },\n      set(key, value) { this.set('foo', value); return value; }\n    });\n  } else {\n    return computed(function(key, value) {\n      if (arguments.length === 2) {\n        this.set('foo', value);\n        return value;\n      }\n      return this.get('foo');\n    });\n  }\n}\n\nexport default Component.extend({ bar: fooMacro() });","lang":"javascript","description":"Shows usage of SUPPORTS_NEW_COMPUTED flag to conditionally use new computed syntax vs old getter/setter pattern."},"warnings":[{"fix":"Use exact versions: gte('3.13.0') instead of gte('3.13').","message":"Version strings passed to gte/lte must be fully qualified (e.g., '3.13.0-beta.1'), not ranges or shorthands like '3.12' or '^3.12.0'.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure flags are used in statically analyzable conditional blocks.","message":"Flags are replaced at build time; they cannot be used in runtime dynamic checks (e.g., if (someCondition && SUPPORTS_NEW_COMPUTED) will work only if someCondition is also compile-time constant).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using @ember/optional-features or checking ember-source version in package.json.","message":"This addon is in maintenance mode; newer Ember versions may require alternative approaches like @ember/optional-features or polyfills.","severity":"deprecated","affected_versions":">=1.2.7"},{"fix":"Update Ember to a supported LTS version or use a fork.","message":"The addon only supports Ember versions that are still receiving security patches; very old Ember versions may not be targeted.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.2.7':25 'addon':15,59 'author':16 'babel':37 'backwards/forward':19 'boolean':52 'build':7,54 'build-tim':6 'cadenc':27 'code':21,41 'compat':3,20 'cost':35 'current':22 'dead':40 'differenti':32 'elimin':42 'ember':2,14,58 'ember-addon':57 'ember-compatibility-help':1 'flag':9,48 'helper':4,12 'infrequ':28 'javascript':56 'key':31 'mainten':30 'overhead':46 'primarili':29 'provid':5 'releas':26 'replac':50 'runtim':43 'stabl':23 'time':8,55 'transform':38 'version':11,24 'via':36 'write':18 'zero':34 'zero-cost':33","created_at":"2026-06-04T18:49:45.322581+00:00","updated_at":"2026-06-04T18:49:45.322581+00:00","problems":[{"fix":"Use // @ts-ignore or create a declaration file: declare module 'ember-compatibility-helpers';","cause":"TypeScript type definitions are not provided.","error":"Cannot find module 'ember-compatibility-helpers' or its corresponding type declarations."},{"fix":"Run 'ember install ember-compatibility-helpers' to add it to devDependencies.","cause":"Addon not installed or not included in the consuming app's package.json.","error":"Module not found: Error: Can't resolve 'ember-compatibility-helpers' in 'path/to/app'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/pzuraq/ember-compatibility-helpers#readme","github":"https://github.com/pzuraq/ember-compatibility-helpers","docs":null,"changelog":null,"pypi":null,"npm":"ember-compatibility-helpers","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}