1 | # Changelog
|
2 |
|
3 | ## v1.1.1 (2016-12-13)
|
4 |
|
5 | ### :bug: Bug Fix
|
6 |
|
7 | Regression with the previous release due to using `Object.values` (ES2017). This wasn't caught because we are using babel-register to run tests and includes polyfills so it didn't fail on CI even though we have Node 0.10 as an env. Looking into fixing this to prevent future issues.
|
8 |
|
9 | ## v1.1.0 (2016-12-13)
|
10 |
|
11 | ### :rocket: New Feature
|
12 |
|
13 | - Add `exclude` option, rename `whitelist` to `include` ([#89](https://github.com/babel/babel-preset-env/pull/89)) (@hzoo)
|
14 |
|
15 | Example:
|
16 |
|
17 | ```js
|
18 | {
|
19 | "presets": [
|
20 | ["env", {
|
21 | "targets": {
|
22 | "browsers": ["last 2 versions", "safari >= 7"]
|
23 | },
|
24 | "include": ["transform-es2015-arrow-functions"],
|
25 | "exclude": [
|
26 | "transform-regenerator",
|
27 | "transform-async-to-generator",
|
28 | "map"
|
29 | ],
|
30 | "useBuiltIns": true
|
31 | }]
|
32 | ]
|
33 | }
|
34 | ```
|
35 |
|
36 | `"exclude": ["transform-regenerator"]` doesn't transform generators and removes `regeneratorRuntime` from being imported.
|
37 |
|
38 | `"exclude": ["transform-async-to-generator"]` doesn't use the built-in async-to-gen transform so you can use something like [fast-async](https://github.com/MatAtBread/fast-async).
|
39 |
|
40 | `"exclude": ["map"]` doesn't include the `Map` polyfill if you know you aren't using it in your code (w/ `useBuiltIns`). (We will figure out a way to automatically do this [#84](https://github.com/babel/babel-preset-env/issues/84)).
|
41 |
|
42 | If you pass a wrong plugin it will error: valid options for `include/exclude` are in [/data/plugin-features.js](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js) and [/data/built-in-features.js](https://github.com/babel/babel-preset-env/blob/master/data/built-in-features.js) (without the `es6.`)
|
43 |
|
44 | ### :house: Internal
|
45 |
|
46 | - Optimize result filtration. ([#77](https://github.com/babel/babel-preset-env/pull/77)) (@yavorsky)
|
47 | - Update eslint config to align with other babel projects ([#79](https://github.com/babel/babel-preset-env/pull/79)) (@baer)
|
48 | - Update pathnames to avoid uppercase ([#80](https://github.com/babel/babel-preset-env/pull/80)) (@baer)
|
49 | - Refactor build data for clarity/consistency ([#81](https://github.com/babel/babel-preset-env/pull/81)) (@baer)
|
50 | - Update linting rules to cover all js ([#82](https://github.com/babel/babel-preset-env/pull/82)) (@baer)
|
51 | - Cleanup lib before rebuilding ([#87](https://github.com/babel/babel-preset-env/pull/87)) (@baer)
|
52 | - Move linting dependency to be dev only ([#88](https://github.com/babel/babel-preset-env/pull/88)) (@baer)
|
53 |
|
54 | ### :memo: Documentation
|
55 |
|
56 | - Fix typo ([#78](https://github.com/babel/babel-preset-env/pull/78)) (@rohmanhm)
|
57 | - Fix PR link in changelog. ([#75](https://github.com/babel/babel-preset-env/pull/75)) (@nhajidin)
|
58 |
|
59 | ## v1.0.2 (2016-12-10)
|
60 |
|
61 | ### :bug: Bug Fix
|
62 |
|
63 | * Fix issue with Object.getOwnPropertySymbols ([#71](https://github.com/babel/babel-preset-env/pull/71)) ([@existentialism](https://github.com/existentialism))
|
64 |
|
65 | Was requiring the wrong module kinda of like in v1.0.1:
|
66 |
|
67 | https://github.com/zloirock/core-js#ecmascript-6-symbol
|
68 |
|
69 | ```diff
|
70 | -import "core-js/modules/es6.object.get-own-property-symbols";
|
71 | ```
|
72 |
|
73 | The test is just a part of `Symbol`.
|
74 |
|
75 | ## v1.0.1 (2016-12-10)
|
76 |
|
77 | ### :bug: Bug Fix
|
78 |
|
79 | * Fix regenerator import ([#68](https://github.com/babel/babel-preset-env/pull/68)) ([@hzoo](https://github.com/hzoo))
|
80 |
|
81 | We were outputting an invalid path for `regenerator`!
|
82 |
|
83 | ```diff
|
84 | +import "regenerator-runtime/runtime";
|
85 | -import "core-js/modules/regenerator-runtime/runtime"-
|
86 | ```
|
87 |
|
88 | ## v1.0.0 (2016-12-09)
|
89 |
|
90 | ### :rocket: New Feature
|
91 |
|
92 | * Add `useBuiltIns` option ([#56](https://github.com/babel/babel-preset-env/pull/56)) ([@hzoo](https://github.com/hzoo)), ([@yavorsky](https://github.com/yavorsky)), ([@existentialism](https://github.com/existentialism))
|
93 |
|
94 | A way to apply `babel-preset-env` for polyfills (via `"babel-polyfill"``).
|
95 |
|
96 | > This option will apply a new Babel plugin that replaces `require("babel-polyfill")` with the individual requires for `babel-polyfill` based on the target environments.
|
97 |
|
98 | Install
|
99 |
|
100 | ```
|
101 | npm install babel-polyfill --save
|
102 | ```
|
103 |
|
104 | In
|
105 |
|
106 | ```js
|
107 | import "babel-polyfill"; // create an entry js file that contains this
|
108 | // or
|
109 | import "core-js";
|
110 | ```
|
111 |
|
112 | Out (different based on environment)
|
113 |
|
114 | ```js
|
115 | // chrome 55
|
116 | import "core-js/modules/es7.string.pad-start"; // haha left_pad
|
117 | import "core-js/modules/es7.string.pad-end";
|
118 | import "core-js/modules/web.timers";
|
119 | import "core-js/modules/web.immediate";
|
120 | import "core-js/modules/web.dom.iterable";
|
121 | ```
|
122 |
|
123 | `.babelrc` Usage
|
124 |
|
125 | ```js
|
126 | {
|
127 | "presets": [
|
128 | ["env", {
|
129 | "targets": {
|
130 | "electron": 1.4
|
131 | },
|
132 | "modules": false, // webpack 2
|
133 | "useBuiltIns": true // new option
|
134 | }]
|
135 | ]
|
136 | }
|
137 | ```
|
138 |
|
139 | > Also looking to make an easier integration point via Webpack with this method. Please reach out if you have ideas!
|
140 |
|
141 | ---
|
142 |
|
143 | * Support [Electron](http://electron.atom.io/) ([#55](https://github.com/babel/babel-preset-env/pull/55)) ([@paulcbetts](https://github.com/paulcbetts))
|
144 |
|
145 | Electron is also an environment, so [Paul went ahead](https://twitter.com/paulcbetts/status/804507070103851008) and added support for this!
|
146 |
|
147 | `.babelrc` Usage
|
148 |
|
149 | ```js
|
150 | {
|
151 | "presets": [ ["env", {"targets": { "electron": 1.4 }}]]
|
152 | }
|
153 | ```
|
154 |
|
155 | > Currently we are manually updating the data in [/data/electron-to-chromium.js](https://github.com/babel/babel-preset-env/blob/master/data/electron-to-chromium.js), but [@kevinsawicki](https://github.com/kevinsawicki) says we could generate the data from [atom-shell/dist/index.json](https://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/index.json) as well! (Someone should make a PR :smile:)
|
156 |
|
157 |
|
158 |
|
159 | ## v0.0.9 (2016-11-24)
|
160 |
|
161 | ### :rocket: New Feature
|
162 |
|
163 | * Support Opera ([#48](https://github.com/babel/babel-preset-env/pull/48)) (Henry Zhu)
|
164 |
|
165 | Was as simple as modifying the chrome version and subtracting 13! (so chrome 54 = opera 41)
|
166 |
|
167 | ```js
|
168 | {
|
169 | "presets": [
|
170 | ["env", {
|
171 | "targets": {
|
172 | "opera": 41
|
173 | }
|
174 | }]
|
175 | ]
|
176 | }
|
177 | ```
|
178 |
|
179 | ## v0.0.8 (2016-11-16)
|
180 |
|
181 | ### :nail_care: Polish
|
182 |
|
183 | * Only print the debug info once ([#46](https://github.com/babel/babel-preset-env/pull/46) (Henry Zhu)
|
184 |
|
185 | When using the `debug` option it was printing the data for each file processed rather than once.
|
186 |
|
187 | ```js
|
188 | {
|
189 | "presets": [
|
190 | ["env", {
|
191 | "debug": true
|
192 | }]
|
193 | ]
|
194 | }
|
195 | ```
|
196 |
|
197 | ## v0.0.7 (2016-11-02)
|
198 |
|
199 | ### :rocket: New Feature
|
200 |
|
201 | * hardcode a current node version option ([#35](https://github.com/babel/babel-preset-env/pull/35)) (Henry Zhu)
|
202 |
|
203 | ```js
|
204 | {
|
205 | "presets": [
|
206 | ["env", {
|
207 | "targets": {
|
208 | "node": "current" // parseFloat(process.versions.node)
|
209 | }
|
210 | }]
|
211 | ]
|
212 | }
|
213 | ```
|
214 |
|
215 | * add 'whitelist' option ([#31](https://github.com/babel/babel-preset-env/pull/31)) (Henry Zhu)
|
216 |
|
217 | ```js
|
218 | {
|
219 | "presets": [
|
220 | ["env", {
|
221 | "targets": {
|
222 | "chrome": 52
|
223 | },
|
224 | "whitelist": ["transform-es2015-arrow-functions"]
|
225 | }]
|
226 | ]
|
227 | }
|
228 | ```
|
229 |
|
230 | * Add more aliases (Henry Zhu)
|
231 | * Update plugin data: firefox 52 supports async/await! ([#29](https://github.com/babel/babel-preset-env/pull/29)) (Henry Zhu)
|
232 |
|
233 | ### :bug: Bug Fixes
|
234 |
|
235 | * Use compat-table equals option ([#36](https://github.com/babel/babel-preset-env/pull/36)) (Henry Zhu)
|
236 |
|
237 | Compute and use `compat-table` equivalents
|
238 |
|
239 | ```js
|
240 | {
|
241 | "safari6": "phantom",
|
242 | "chrome44": "iojs",
|
243 | "chrome50": "node64",
|
244 | "chrome51": "node65",
|
245 | "chrome54": "node7",
|
246 | "chrome30": "android44",
|
247 | "chrome37": "android50",
|
248 | "chrome39": "android51",
|
249 | "safari7": "ios7",
|
250 | "safari71_8": "ios8",
|
251 | "safari9": "ios9",
|
252 | "safari10": "ios10",
|
253 | "chrome50": "node6"
|
254 | }
|
255 | ```
|
256 |
|
257 | * Change default behavior to act the same as babel-preset-latest ([#33](https://github.com/babel/babel-preset-env/pull/33)) (Henry Zhu)
|
258 |
|
259 | ```js
|
260 | { "presets": ["env"] } // should act the same as babel-preset-latest
|
261 | ```
|
262 |
|
263 | ## Internal
|
264 |
|
265 | * Add fixture helper for tests ([#28](https://github.com/babel/babel-preset-env/pull/28)) (Henry Zhu)
|