{"id":18145,"library":"babel-plugin-ember-data-packages-polyfill","title":"babel-plugin-ember-data-packages-polyfill","description":"A Babel plugin (v0.1.2) that transforms EmberData Packages API import statements (e.g., `import { attr } from '@ember-data/model'`) back to the legacy `DS.*` syntax for backward compatibility with older EmberData versions. It uses the @ember-data/rfc395-data mapping and is intended for use within Ember CLI apps and addons during the transition to the new packages. The plugin supports both default and named imports and works with Node 6+.","status":"active","version":"0.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/ember-data/babel-plugin-ember-data-packages-polyfill","tags":["javascript","babel-plugin"],"install":[{"cmd":"npm install babel-plugin-ember-data-packages-polyfill","lang":"bash","label":"npm"},{"cmd":"yarn add babel-plugin-ember-data-packages-polyfill","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-plugin-ember-data-packages-polyfill","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides the official mapping of old import paths to new package names","package":"@ember-data/rfc395-data","optional":false}],"imports":[{"note":"Use as a Babel plugin, not a JavaScript import.","wrong":"import plugin from 'babel-plugin-ember-data-packages-polyfill'; // This is a Babel plugin, not an importable module","symbol":"babel-plugin-ember-data-packages-polyfill","correct":"// add to .babelrc plugins or ember-cli-build.js plugins"}],"quickstart":{"code":"// In your .babelrc or ember-cli-build.js\n{\n  \"plugins\": [\"babel-plugin-ember-data-packages-polyfill\"]\n}\n\n// Then in your source code, use new packages API:\nimport Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n// Will be transpiled to legacy syntax:\n// import DS from 'ember-data';\n// const Model = DS.Model;\n// const attr = DS.attr;\n// const belongsTo = DS.belongsTo;\n// const hasMany = DS.hasMany;","lang":"javascript","description":"Shows how to add the plugin to Babel config and an example of how imports are transformed."},"warnings":[{"fix":"Ensure @ember-data/rfc395-data is in your package.json dependencies.","message":"Plugin requires @ember-data/rfc395-data to be installed as a dependency, otherwise it will fail to find mappings.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use static import syntax for EmberData members.","message":"The plugin only works with import statements; it does not transform dynamic require() calls.","severity":"gotcha","affected_versions":"*"},{"fix":"Migrate away from legacy DS syntax entirely when possible.","message":"This plugin is a transitional polyfill; as EmberData packages become universally supported, the plugin may become unnecessary.","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install --save-dev @ember-data/rfc395-data","cause":"The dependency @ember-data/rfc395-data is not installed.","error":"Cannot find module '@ember-data/rfc395-data'"},{"fix":"Update @ember-data/rfc395-data to the latest version or add a custom mapping.","cause":"The plugin could not map a given import to a legacy path (possibly due to a new package not in the mapping data).","error":"Error: Babel plugin throw: Could not find mapping for '@ember-data/model'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}