babel-plugin-ember-property-computed

1.0.1 • Public • Published

babel-plugin-ember-property-computed

Migrate from function prototype fn.property(args) into Ember.computed(args, fn).

Convert computed properties into Ember.computed() to not use prototype anymore. This plugin can be used along with Webpack and other babel plugins just to test in dev server. If you want to overwrite existing files, you can execute this plugin in Node env as well.

Example

In

fullname: function () {
  return `${this.firstName} ${this.lastName}`;
}.property("firstName", "lastName")

Out

fullname: Ember.computed("firstName", "lastName", function () {
  return `${this.firstName} ${this.lastName}`;
})

Installation

$ npm install babel-plugin-ember-property-computed

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["ember-property-computed"]
}

Via CLI

$ babel --plugins ember-property-computed script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["ember-property-computed"]
});

Package Sidebar

Install

npm i babel-plugin-ember-property-computed

Weekly Downloads

0

Version

1.0.1

License

none

Unpacked Size

6.18 kB

Total Files

9

Last publish

Collaborators

  • asmyk