-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from pzuraq/initial-implementation
Initial implementation
- Loading branch information
Showing
15 changed files
with
2,249 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = { | ||
root: true, | ||
parser: 'babel-eslint', | ||
parserOptions: { | ||
ecmaVersion: 2017, | ||
sourceType: 'module' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,70 @@ | ||
ember-decorators-polyfill | ||
============================================================================== | ||
# ember-decorators-polyfill | ||
|
||
[Short description of the addon.] | ||
Polyfills Ember's built-in decorators | ||
|
||
## Compatibility | ||
|
||
Compatibility | ||
------------------------------------------------------------------------------ | ||
- Ember.js v2.18 or above | ||
- Ember CLI v2.13 or above | ||
|
||
* Ember.js v2.18 or above | ||
* Ember CLI v2.13 or above | ||
This addon is not needed in Ember 3.10+ | ||
|
||
|
||
Installation | ||
------------------------------------------------------------------------------ | ||
## Installation | ||
|
||
``` | ||
ember install ember-decorators-polyfill | ||
``` | ||
|
||
## Usage | ||
|
||
Polyfills Ember's built-in decorators API: | ||
|
||
```js | ||
import { action, computed } from '@ember/object'; | ||
|
||
import { inject as service } from '@ember/service'; | ||
import { inject as controller } from '@ember/controller'; | ||
|
||
import { | ||
alias, | ||
and, | ||
bool, | ||
collect, | ||
deprecatingAlias, | ||
empty, | ||
equal, | ||
filter, | ||
filterBy, | ||
gt, | ||
gte, | ||
intersect, | ||
lt, | ||
lte, | ||
map, | ||
mapBy, | ||
match, | ||
max, | ||
min, | ||
none, | ||
not, | ||
notEmpty, | ||
oneWay, | ||
or, | ||
reads, | ||
readOnly, | ||
setDiff, | ||
sort, | ||
sum, | ||
union, | ||
uniq, | ||
uniqBy, | ||
} from '@ember/object/computed'; | ||
``` | ||
|
||
Usage | ||
------------------------------------------------------------------------------ | ||
|
||
[Longer description of how to use the addon in apps.] | ||
|
||
|
||
Contributing | ||
------------------------------------------------------------------------------ | ||
## Contributing | ||
|
||
See the [Contributing](CONTRIBUTING.md) guide for details. | ||
|
||
|
||
License | ||
------------------------------------------------------------------------------ | ||
## License | ||
|
||
This project is licensed under the [MIT License](LICENSE.md). |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,45 @@ | ||
'use strict'; | ||
const VersionChecker = require('ember-cli-version-checker'); | ||
|
||
module.exports = { | ||
name: require('./package').name | ||
name: require('./package').name, | ||
|
||
init() { | ||
this._super.init && this._super.init.apply(this, arguments); | ||
|
||
let checker = new VersionChecker(this.project); | ||
let emberVersion = checker.forEmber(); | ||
|
||
this.shouldPolyfill = emberVersion.lt('3.10.0-alpha.1'); | ||
}, | ||
|
||
included() { | ||
this._super.included.apply(this, arguments); | ||
|
||
if (!this.shouldPolyfill) { | ||
return; | ||
} | ||
|
||
this.import('vendor/ember-decorators-polyfill/index.js'); | ||
}, | ||
|
||
treeForVendor(rawVendorTree) { | ||
if (!this.shouldPolyfill) { | ||
return; | ||
} | ||
|
||
let babelAddon = this.addons.find( | ||
addon => addon.name === 'ember-cli-babel' | ||
); | ||
|
||
let transpiledVendorTree = babelAddon.transpileTree(rawVendorTree, { | ||
babel: this.options.babel, | ||
|
||
'ember-cli-babel': { | ||
compileModules: false, | ||
}, | ||
}); | ||
|
||
return transpiledVendorTree; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.