UNPKG

17.3 kBMarkdownView Raw
1# Changelog
2
3## v1.3.0 (2017-03-30)
4
5### :bug: Bug Fix
6
7- Add check for ArrayBuffer[Symbol.species] ([#233](https://github.com/babel/babel-preset-env/pull/233)) (@existentialism)
8
9We now properly check for `Symbol.species` support in ArrayBuffer and include the
10polyfill if necessary. This should, as a side effect, fix ArrayBuffer-related
11errors on IE9.
12
13### :nail_care: Polish
14
15- Fill data with electron as a target. ([#229](https://github.com/babel/babel-preset-env/pull/229)) (@yavorsky)
16
17We've simplified things by adding `electron` as a target instead of doing a bunch of
18things at runtime. Electron targets should now also be displayed in the debug output.
19
20- separate default builtins for platforms ([#226](https://github.com/babel/babel-preset-env/pull/226)) (@restrry)
21
22If you are targeting the `node` environment exclusively, the always-included web polyfills
23(like `dom.iterable`, and a few others) will now no longer be included.
24
25### :memo: Documentation
26
27 * remove deprecated projects ([#223](https://github.com/babel/babel-preset-env/pull/223)) [skip ci] (@stevemao)
28
29### :house: Internal
30
31 * npmignore: Add related to build data and codecov. ([#216](https://github.com/babel/babel-preset-env/pull/216)) (@yavorsky)
32
33## v1.2.2 (2017-03-14)
34
35### :bug: Bug Fix
36
37- Refactor browser data parsing to handle families ([#208](https://github.com/babel/babel-preset-env/pull/208)) (@existentialism)
38
39When parsing plugin data, we weren't properly handling browser families. This caused
40`transform-es2015-block-scoping` and other plugins to be incorrectly added for Edge >= 12.
41(s/o to @mgol for the the report and review!)
42
43- Add typed array methods to built-ins features. ([#198](https://github.com/babel/babel-preset-env/pull/198)) (@yavorsky)
44
45Fixes an issue where some TypedArray features were not being polyfilled properly. (s/o to @alippai for the report!)
46
47### :memo: Documentation
48
49- Fixed minor typo in readme ([#199](https://github.com/babel/babel-preset-env/pull/199)) (@bl4ckdu5t)
50- Add built-ins, better links, compat-table url, etc ([#195](https://github.com/babel/babel-preset-env/pull/195)) (@yavorsky)
51- Change CONTRIBUTING.md to use absolute paths ([#194](https://github.com/babel/babel-preset-env/pull/194)) (@aaronang)
52
53### :house: Internal
54
55- Bump plugins ([#201](https://github.com/babel/babel-preset-env/pull/201)) (@yavorsky)
56- Enable code coverage ([#200](https://github.com/babel/babel-preset-env/pull/200)) (@alxpy)
57- Increase mocha timeout to 10s ([#202](https://github.com/babel/babel-preset-env/pull/202)) (@yavorsky)
58
59## v1.2.1 (2017-03-06)
60
61### :bug: Bug Fix
62
63- Add transform-duplicate-keys mapping ([#192](https://github.com/babel/babel-preset-env/pull/192)) (@existentialism)
64
65Our plugin data was missing a mapping for the `transform-duplicate-keys` plugin which caused it to never be included. (s/o to @Timer for the report!)
66
67### :memo: Documentation
68
69- Clarify reasons for the uglify option in README.md ([#188](https://github.com/babel/babel-preset-env/pull/188)) (@mikegreiling)
70
71## v1.2.0 (2017-03-03)
72
73### :rocket: New Feature
74
75- Add uglify as a target ([#178](https://github.com/babel/babel-preset-env/pull/178)) (@yavorsky)
76
77Support for `uglify` as a target is now available! This will enable all plugins and, as a result, fully compiles your code to ES5. Note, that useBuiltIns will work as before, and only the polyfills that your other target(s) need will be included.
78
79```json
80{
81 "presets": [
82 ["env", {
83 "targets": {
84 "chrome": 55,
85 "uglify": true
86 },
87 "useBuiltIns": true,
88 "modules": false
89 }]
90 ]
91}
92```
93
94### :bug: Bug Fix
95
96- Respect older versions in invert equals map ([#180](https://github.com/babel/babel-preset-env/pull/180)) (@danez)
97
98Fixes a number of bugs that caused some incorrect and/or missing environment data when parsing `compat-table`.
99
100## v1.1.11 (2017-03-01)
101
102This release primarily upgrades `compat-table`, which adds support for async on Node 7.6!
103
104### :bug: Bug Fix
105
106- Fix hasBeenWarned condition. ([#175](https://github.com/babel/babel-preset-env/pull/175)) (@yavorsky)
107
108### :memo: Documentation
109
110- Add yarn example. ([#174](https://github.com/babel/babel-preset-env/pull/174)) (@yavorsky)
111
112### :house: Internal
113
114- Bump compat-table ([#177](https://github.com/babel/babel-preset-env/pull/177)) (@existentialism)
115- Add electron version exception test ([#176](https://github.com/babel/babel-preset-env/pull/176)) (@existentialism)
116
117## v1.1.10 (2017-02-24)
118
119### :bug: Bug Fix
120
121- Drop use of lodash/intersection from checkDuplicateIncludeExcludes ([#173](https://github.com/babel/babel-preset-env/pull/173)) (@existentialism)
122
123## v1.1.9 (2017-02-24)
124
125### :bug: Bug Fix
126
127- Add tests for debug output ([#156](https://github.com/babel/babel-preset-env/pull/156)) (@existentialism)
128
129Since we've (mostly @yavorsky) have fixed a number of bugs recently with the `debug` option output, we added the ability to assert stdout matches what we expect. Read the updated [CONTRIBUTING.md](https://github.com/babel/babel-preset-env/blob/master/CONTRIBUTING.md#testing-the-debug-option) for more info.
130
131- Fixes #143. Log correct targets. ([#155](https://github.com/babel/babel-preset-env/pull/155)) (@yavorsky)
132
133This fixes a bug in the `debug` output where incorrect target(s) were being displayed for why a particular plugin/preset was being included.
134
135Given targets:
136
137```txt
138{
139 "firefox": 52,
140 "node": 7.4
141}
142```
143
144Before:
145
146```txt
147Using plugins:
148 transform-es2015-destructuring {"node":6.5}
149 transform-es2015-for-of {"node":6.5}
150 transform-es2015-function-name {"node":6.5}
151 transform-es2015-literals {"node":4}
152 transform-exponentiation-operator {"firefox":52}
153 syntax-trailing-function-commas {"firefox":52}
154```
155
156After:
157
158```txt
159Using plugins:
160 transform-es2015-destructuring {"firefox":52}
161 transform-es2015-for-of {"firefox":52}
162 transform-es2015-function-name {"firefox":52}
163 transform-es2015-literals {"firefox":52}
164 transform-exponentiation-operator {"node":7.4}
165 syntax-trailing-function-commas {"node":7.4}
166```
167
168### :memo: Documentation
169
170- Fix compat-table link in contributing.md (@existentialism)
171- Update README examples to fix website ([#151](https://github.com/babel/babel-preset-env/pull/)) (@existentialism)
172- Fix few typos ([#146](https://github.com/babel/babel-preset-env/pull/146)) (@existentialism)
173- Add configuration example to clarify `debug: true` ([#138](https://github.com/babel/babel-preset-env/pull/138)) (@yavorsky)
174- Fix CHANGELOG’s v1.1.8 updates typo. ([#136](https://github.com/babel/babel-preset-env/pull/136)) (@yavorsky)
175- README: Update `debug: true` example. ([#138](https://github.com/babel/babel-preset-env/pull/138)) (@yavorsky)
176
177### :house: Internal
178
179- update compat ([#169](https://github.com/babel/babel-preset-env/pull/169)) (@hzoo)
180- Use external Electron to Chromium library ([#144](https://github.com/babel/babel-preset-env/pull/144)) (@Kilian)
181- Update yarn lockfile ([#152](https://github.com/babel/babel-preset-env/pull/152)) (@existentialism)
182- Extract option normalization into independant file ([#125](https://github.com/babel/babel-preset-env/pull/125)) (@baer)
183- Update yarnfile ([#145](https://github.com/babel/babel-preset-env/pull/145)) (@baer)
184- devDeps: eslint-config-babel v5.0.0 ([#139](https://github.com/babel/babel-preset-env/pull/139)) (@kaicataldo)
185- Update compat-table, build data ([#135](https://github.com/babel/babel-preset-env/pull/135)) (@hzoo)
186
187## v1.1.8 (2017-01-10)
188
189### :bug: Bug Fix
190
191- Debug: Transformations before logs. ([#128](https://github.com/babel/babel-preset-env/pull/128)) (@yavorsky)
192
193Makes sure that all transformations on `targets` (such as `exclude`/`include`) are run before logging out with the `debug` option. Fixes ([#127](https://github.com/babel/babel-preset-env/issues/127)).
194
195### :house: Internal
196
197- Remove unnecessary extension. ([#131](https://github.com/babel/babel-preset-env/pull/131)) (@roman-yakobnyuk)
198- Include yarn.lock and update CI. ([#124](https://github.com/babel/babel-preset-env/pull/124)) (@existentialism)
199
200## v1.1.7 (2017-01-09)
201
202Had a publishing issue in the previous release.
203
204## v1.1.6 (2017-01-06)
205
206### :bug: Bug Fix
207
208- Explicitly resolve lowest browser version. ([#121](https://github.com/babel/babel-preset-env/pull/121)) (@brokenmass)
209
210```js
211{
212 "targets": {
213 "browsers": ["ios >= 6"] // was resolving to {ios: 10} rather than {ios: 6}
214 }
215}
216```
217
218## v1.1.5 (2017-01-04)
219
220### :bug: Bug Fix
221
222- Show error if target version is not a number. ([#107](https://github.com/babel/babel-preset-env/pull/107)) (@existentialism)
223
224```js
225{
226 "presets": [
227 ["env", {
228 "targets": {
229 "chrome": "52", // will error since it's not a number,
230 "chrome": 52 // correct!
231 }
232 }]
233 ]
234}
235```
236
237- Fix targets for the `debug` option. ([#109](https://github.com/babel/babel-preset-env/pull/109)) (@yavorsky)
238
239Now it prints the transformed targets/environments rather than the browsers query.
240
241```txt
242Using targets:
243{
244 "chrome": 53,
245 "ie": 10,
246 "node": 6
247}
248
249Modules transform: false
250
251Using plugins:
252 transform-es2015-arrow-functions {"chrome":47,"node":6}
253 transform-es2015-block-scoped-functions {"chrome":41,"ie":11,"node":4}
254
255Using polyfills:
256 es6.typed.uint8-clamped-array {"chrome":5,"node":0.12}
257 es6.map {"chrome":51,"node":6.5}
258```
259
260## v1.1.4 (2016-12-16)
261
262v1.1.2-v1.1.4
263
264### :bug: Bug Fix
265
266The new `exclude`/`include` options weren't working correctly for built-ins. ([#102](https://github.com/babel/babel-preset-env/pull/102)).
267
268Also fixes an issue with debug option.
269
270## v1.1.1 (2016-12-13)
271
272### :bug: Bug Fix
273
274Regression 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.
275
276## v1.1.0 (2016-12-13)
277
278### :rocket: New Feature
279
280- Add `exclude` option, rename `whitelist` to `include` ([#89](https://github.com/babel/babel-preset-env/pull/89)) (@hzoo)
281
282Example:
283
284```js
285{
286 "presets": [
287 ["env", {
288 "targets": {
289 "browsers": ["last 2 versions", "safari >= 7"]
290 },
291 "include": ["transform-es2015-arrow-functions"],
292 "exclude": [
293 "transform-regenerator",
294 "transform-async-to-generator",
295 "map"
296 ],
297 "useBuiltIns": true
298 }]
299 ]
300}
301```
302
303`"exclude": ["transform-regenerator"]` doesn't transform generators and removes `regeneratorRuntime` from being imported.
304
305`"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).
306
307`"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)).
308
309If 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.`)
310
311### :house: Internal
312
313- Optimize result filtration. ([#77](https://github.com/babel/babel-preset-env/pull/77)) (@yavorsky)
314- Update eslint config to align with other babel projects ([#79](https://github.com/babel/babel-preset-env/pull/79)) (@baer)
315- Update pathnames to avoid uppercase ([#80](https://github.com/babel/babel-preset-env/pull/80)) (@baer)
316- Refactor build data for clarity/consistency ([#81](https://github.com/babel/babel-preset-env/pull/81)) (@baer)
317- Update linting rules to cover all js ([#82](https://github.com/babel/babel-preset-env/pull/82)) (@baer)
318- Cleanup lib before rebuilding ([#87](https://github.com/babel/babel-preset-env/pull/87)) (@baer)
319- Move linting dependency to be dev only ([#88](https://github.com/babel/babel-preset-env/pull/88)) (@baer)
320
321### :memo: Documentation
322
323- Fix typo ([#78](https://github.com/babel/babel-preset-env/pull/78)) (@rohmanhm)
324- Fix PR link in changelog. ([#75](https://github.com/babel/babel-preset-env/pull/75)) (@nhajidin)
325
326## v1.0.2 (2016-12-10)
327
328### :bug: Bug Fix
329
330* Fix issue with Object.getOwnPropertySymbols ([#71](https://github.com/babel/babel-preset-env/pull/71)) ([@existentialism](https://github.com/existentialism))
331
332Was requiring the wrong module kinda of like in v1.0.1:
333
334https://github.com/zloirock/core-js#ecmascript-6-symbol
335
336```diff
337-import "core-js/modules/es6.object.get-own-property-symbols";
338```
339
340The test is just a part of `Symbol`.
341
342## v1.0.1 (2016-12-10)
343
344### :bug: Bug Fix
345
346* Fix regenerator import ([#68](https://github.com/babel/babel-preset-env/pull/68)) ([@hzoo](https://github.com/hzoo))
347
348We were outputting an invalid path for `regenerator`!
349
350```diff
351+import "regenerator-runtime/runtime";
352-import "core-js/modules/regenerator-runtime/runtime"-
353```
354
355## v1.0.0 (2016-12-09)
356
357### :rocket: New Feature
358
359* 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))
360
361A way to apply `babel-preset-env` for polyfills (via `"babel-polyfill"``).
362
363> 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.
364
365Install
366
367```
368npm install babel-polyfill --save
369```
370
371In
372
373```js
374import "babel-polyfill"; // create an entry js file that contains this
375// or
376import "core-js";
377```
378
379Out (different based on environment)
380
381```js
382// chrome 55
383import "core-js/modules/es7.string.pad-start"; // haha left_pad
384import "core-js/modules/es7.string.pad-end";
385import "core-js/modules/web.timers";
386import "core-js/modules/web.immediate";
387import "core-js/modules/web.dom.iterable";
388```
389
390`.babelrc` Usage
391
392```js
393{
394 "presets": [
395 ["env", {
396 "targets": {
397 "electron": 1.4
398 },
399 "modules": false, // webpack 2
400 "useBuiltIns": true // new option
401 }]
402 ]
403}
404```
405
406> Also looking to make an easier integration point via Webpack with this method. Please reach out if you have ideas!
407
408---
409
410* Support [Electron](http://electron.atom.io/) ([#55](https://github.com/babel/babel-preset-env/pull/55)) ([@paulcbetts](https://github.com/paulcbetts))
411
412Electron is also an environment, so [Paul went ahead](https://twitter.com/paulcbetts/status/804507070103851008) and added support for this!
413
414`.babelrc` Usage
415
416```js
417{
418 "presets": [ ["env", {"targets": { "electron": 1.4 }}]]
419}
420```
421
422> 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:)
423
424
425
426## v0.0.9 (2016-11-24)
427
428### :rocket: New Feature
429
430* Support Opera ([#48](https://github.com/babel/babel-preset-env/pull/48)) (Henry Zhu)
431
432Was as simple as modifying the chrome version and subtracting 13! (so chrome 54 = opera 41)
433
434```js
435{
436 "presets": [
437 ["env", {
438 "targets": {
439 "opera": 41
440 }
441 }]
442 ]
443}
444```
445
446## v0.0.8 (2016-11-16)
447
448### :nail_care: Polish
449
450* Only print the debug info once ([#46](https://github.com/babel/babel-preset-env/pull/46) (Henry Zhu)
451
452When using the `debug` option it was printing the data for each file processed rather than once.
453
454```js
455{
456 "presets": [
457 ["env", {
458 "debug": true
459 }]
460 ]
461}
462```
463
464## v0.0.7 (2016-11-02)
465
466### :rocket: New Feature
467
468* hardcode a current node version option ([#35](https://github.com/babel/babel-preset-env/pull/35)) (Henry Zhu)
469
470```js
471{
472 "presets": [
473 ["env", {
474 "targets": {
475 "node": "current" // parseFloat(process.versions.node)
476 }
477 }]
478 ]
479}
480```
481
482* add 'whitelist' option ([#31](https://github.com/babel/babel-preset-env/pull/31)) (Henry Zhu)
483
484```js
485 {
486 "presets": [
487 ["env", {
488 "targets": {
489 "chrome": 52
490 },
491 "whitelist": ["transform-es2015-arrow-functions"]
492 }]
493 ]
494}
495```
496
497* Add more aliases (Henry Zhu)
498* Update plugin data: firefox 52 supports async/await! ([#29](https://github.com/babel/babel-preset-env/pull/29)) (Henry Zhu)
499
500### :bug: Bug Fixes
501
502* Use compat-table equals option ([#36](https://github.com/babel/babel-preset-env/pull/36)) (Henry Zhu)
503
504Compute and use `compat-table` equivalents
505
506```js
507{
508 "safari6": "phantom",
509 "chrome44": "iojs",
510 "chrome50": "node64",
511 "chrome51": "node65",
512 "chrome54": "node7",
513 "chrome30": "android44",
514 "chrome37": "android50",
515 "chrome39": "android51",
516 "safari7": "ios7",
517 "safari71_8": "ios8",
518 "safari9": "ios9",
519 "safari10": "ios10",
520 "chrome50": "node6"
521}
522```
523
524* Change default behavior to act the same as babel-preset-latest ([#33](https://github.com/babel/babel-preset-env/pull/33)) (Henry Zhu)
525
526```js
527{ "presets": ["env"] } // should act the same as babel-preset-latest
528```
529
530## Internal
531
532* Add fixture helper for tests ([#28](https://github.com/babel/babel-preset-env/pull/28)) (Henry Zhu)