autobind-decorator
Advanced tools
Comparing version 2.2.1 to 2.3.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.3.0"></a> | ||
# [2.3.0](https://github.com/andreypopp/autobind-decorator/compare/v2.2.1...v2.3.0) (2018-11-17) | ||
### Features | ||
* **env:** define envs that we support ([3d9563f](https://github.com/andreypopp/autobind-decorator/commit/3d9563f)) | ||
<a name="2.2.1"></a> | ||
@@ -7,0 +17,0 @@ ## [2.2.1](https://github.com/andreypopp/autobind-decorator/compare/v2.2.0...v2.2.1) (2018-11-03) |
{ | ||
"name": "autobind-decorator", | ||
"version": "2.2.1", | ||
"version": "2.3.0", | ||
"description": "Decorator for binding method to an object", | ||
@@ -33,3 +33,7 @@ "main": "lib/index.js", | ||
"url": "git+https://github.com/andreypopp/autobind-decorator.git" | ||
}, | ||
"engines": { | ||
"node": ">=8.10", | ||
"npm": ">=6.4.1" | ||
} | ||
} |
@@ -17,16 +17,59 @@ # autobind decorator | ||
**Note Babel 6 users:** | ||
## Installation: | ||
The implementation of the decorator transform is currently on hold as the syntax is not final. If you would like to use this project with Babel 6.0, you may use [babel-plugin-transform-decorators-legacy](https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy) which implement Babel 5 decorator transform for Babel 6. | ||
``` | ||
npm install autobind-decorator | ||
``` | ||
**Note TypeScript users:** | ||
### Supported platforms: | ||
This package will work out of the box with TypeScript (no Babel needed) and includes the `.d.ts` typings along with it. | ||
#### Output | ||
## Installation: | ||
We target IE11+ browsers with the following caveats: | ||
`main` entry is in ES5 | ||
`module` entry is in ES6+ (notably ES modules to enable tree shaking) | ||
#### Dev | ||
node 8.10+ with latest npm | ||
### Note uglify users: | ||
Starting from v2.2, we added `module` entry in package.json and kept `main` entry as is. `module` entry is for those who wish to use modern JavaScript (notably ES modules to enable tree shaking). If your environment doesn't understand the modern syntax, you can configure your tool to read the ES5 script via the `main` entry. EG: with webpack, you could do | ||
```js | ||
resolve: { | ||
mainFields: ['main'] | ||
} | ||
``` | ||
npm install autobind-decorator | ||
You could also transpile the script to your target environment ([@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env) is recommended). For more details, please read https://babeljs.io/blog/2018/06/26/on-consuming-and-publishing-es2015+-packages. | ||
### Note Babel 6 users: | ||
The implementation of the decorator transform is currently on hold as the syntax is not final. If you would like to use this project with Babel 6, you may use [babel-plugin-transform-decorators-legacy](https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy) which implement Babel 5 decorator transform for Babel 6. | ||
### Note Babel 7 users: | ||
Babel 7's `@babel/plugin-proposal-decorators` officially supports the same logic that babel-plugin-transform-decorators-legacy has, but integrates better with Babel 7's other plugins. You can enable this with | ||
```json | ||
{ | ||
"plugins": [ | ||
["@babel/plugin-proposal-decorators", { "legacy": true }], | ||
] | ||
} | ||
``` | ||
in your Babel configuration. Note that `legacy: true` is specifically needed if you | ||
want to get the same behavior as `transform-decorators-legacy` because there | ||
are newer versions of the decorator specification coming out, and they do not | ||
behave the same way. We are trying to keep this module up-to-date with the latest spec. | ||
### Note TypeScript users: | ||
This package will work out of the box with TypeScript (no Babel needed) and includes the `.d.ts` typings along with it. | ||
## Examples: | ||
@@ -33,0 +76,0 @@ |
27208
172