UNPKG

12.7 kBMarkdownView Raw
1# Changelog
2
3## v1.1.9 (2017-02-24)
4
5### :bug: Bug Fix
6
7- Add tests for debug output ([#156](https://github.com/babel/babel-preset-env/pull/156)) (@existentialism)
8
9Since 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.
10
11- Fixes #143. Log correct targets. ([#155](https://github.com/babel/babel-preset-env/pull/155)) (@yavorsky)
12
13This fixes a bug in the `debug` output where incorrect target(s) were being displayed for why a particular plugin/preset was being included.
14
15Given targets:
16
17```txt
18{
19 "firefox": 52,
20 "node": 7.4
21}
22```
23
24Before:
25
26```txt
27Using plugins:
28 transform-es2015-destructuring {"node":6.5}
29 transform-es2015-for-of {"node":6.5}
30 transform-es2015-function-name {"node":6.5}
31 transform-es2015-literals {"node":4}
32 transform-exponentiation-operator {"firefox":52}
33 syntax-trailing-function-commas {"firefox":52}
34```
35
36After:
37
38```txt
39Using plugins:
40 transform-es2015-destructuring {"firefox":52}
41 transform-es2015-for-of {"firefox":52}
42 transform-es2015-function-name {"firefox":52}
43 transform-es2015-literals {"firefox":52}
44 transform-exponentiation-operator {"node":7.4}
45 syntax-trailing-function-commas {"node":7.4}
46```
47
48### :memo: Documentation
49
50- Fix compat-table link in contributing.md (@existentialism)
51- Update README examples to fix website ([#151](https://github.com/babel/babel-preset-env/pull/)) (@existentialism)
52- Fix few typos ([#146](https://github.com/babel/babel-preset-env/pull/146)) (@existentialism)
53- Add configuration example to clarify `debug: true` ([#138](https://github.com/babel/babel-preset-env/pull/138)) (@yavorsky)
54- Fix CHANGELOG’s v1.1.8 updates typo. ([#136](https://github.com/babel/babel-preset-env/pull/136)) (@yavorsky)
55- README: Update `debug: true` example. ([#138](https://github.com/babel/babel-preset-env/pull/138)) (@yavorsky)
56
57### :house: Internal
58
59- update compat ([#169](https://github.com/babel/babel-preset-env/pull/169)) (@hzoo)
60- Use external Electron to Chromium library ([#144](https://github.com/babel/babel-preset-env/pull/144)) (@Kilian)
61- Update yarn lockfile ([#152](https://github.com/babel/babel-preset-env/pull/152)) (@existentialism)
62- Extract option normalization into independant file ([#125](https://github.com/babel/babel-preset-env/pull/125)) (@baer)
63- Update yarnfile ([#145](https://github.com/babel/babel-preset-env/pull/145)) (@baer)
64- devDeps: eslint-config-babel v5.0.0 ([#139](https://github.com/babel/babel-preset-env/pull/139)) (@kaicataldo)
65- Update compat-table, build data ([#135](https://github.com/babel/babel-preset-env/pull/135)) (@hzoo)
66
67## v1.1.8 (2017-01-10)
68
69### :bug: Bug Fix
70
71- Debug: Transformations before logs. ([#128](https://github.com/babel/babel-preset-env/pull/128)) (@yavorsky)
72
73Makes 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)).
74
75### :house: Internal
76
77- Remove unnecessary extension. ([#131](https://github.com/babel/babel-preset-env/pull/131)) (@roman-yakobnyuk)
78- Include yarn.lock and update CI. ([#124](https://github.com/babel/babel-preset-env/pull/124)) (@existentialism)
79
80## v1.1.7 (2017-01-09)
81
82Had a publishing issue in the previous release.
83
84## v1.1.6 (2017-01-06)
85
86### :bug: Bug Fix
87
88- Explicitly resolve lowest browser version. ([#121](https://github.com/babel/babel-preset-env/pull/121)) (@brokenmass)
89
90```js
91{
92 "targets": {
93 "browsers": ["ios >= 6"] // was resolving to {ios: 10} rather than {ios: 6}
94 }
95}
96```
97
98## v1.1.5 (2017-01-04)
99
100### :bug: Bug Fix
101
102- Show error if target version is not a number. ([#107](https://github.com/babel/babel-preset-env/pull/107)) (@existentialism)
103
104```js
105{
106 "presets": [
107 ["env", {
108 "targets": {
109 "chrome": "52", // will error since it's not a number,
110 "chrome": 52 // correct!
111 }
112 }]
113 ]
114}
115```
116
117- Fix targets for the `debug` option. ([#109](https://github.com/babel/babel-preset-env/pull/109)) (@yavorsky)
118
119Now it prints the transformed targets/environments rather than the browsers query.
120
121```txt
122Using targets:
123{
124 "chrome": 53,
125 "ie": 10,
126 "node": 6
127}
128
129Modules transform: false
130
131Using plugins:
132 transform-es2015-arrow-functions {"chrome":47,"node":6}
133 transform-es2015-block-scoped-functions {"chrome":41,"ie":11,"node":4}
134
135Using polyfills:
136 es6.typed.uint8-clamped-array {"chrome":5,"node":0.12}
137 es6.map {"chrome":51,"node":6.5}
138```
139
140## v1.1.4 (2016-12-16)
141
142v1.1.2-v1.1.4
143
144### :bug: Bug Fix
145
146The new `exclude`/`include` options weren't working correctly for built-ins. ([#102](https://github.com/babel/babel-preset-env/pull/102)).
147
148Also fixes an issue with debug option.
149
150## v1.1.1 (2016-12-13)
151
152### :bug: Bug Fix
153
154Regression 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.
155
156## v1.1.0 (2016-12-13)
157
158### :rocket: New Feature
159
160- Add `exclude` option, rename `whitelist` to `include` ([#89](https://github.com/babel/babel-preset-env/pull/89)) (@hzoo)
161
162Example:
163
164```js
165{
166 "presets": [
167 ["env", {
168 "targets": {
169 "browsers": ["last 2 versions", "safari >= 7"]
170 },
171 "include": ["transform-es2015-arrow-functions"],
172 "exclude": [
173 "transform-regenerator",
174 "transform-async-to-generator",
175 "map"
176 ],
177 "useBuiltIns": true
178 }]
179 ]
180}
181```
182
183`"exclude": ["transform-regenerator"]` doesn't transform generators and removes `regeneratorRuntime` from being imported.
184
185`"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).
186
187`"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)).
188
189If 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.`)
190
191### :house: Internal
192
193- Optimize result filtration. ([#77](https://github.com/babel/babel-preset-env/pull/77)) (@yavorsky)
194- Update eslint config to align with other babel projects ([#79](https://github.com/babel/babel-preset-env/pull/79)) (@baer)
195- Update pathnames to avoid uppercase ([#80](https://github.com/babel/babel-preset-env/pull/80)) (@baer)
196- Refactor build data for clarity/consistency ([#81](https://github.com/babel/babel-preset-env/pull/81)) (@baer)
197- Update linting rules to cover all js ([#82](https://github.com/babel/babel-preset-env/pull/82)) (@baer)
198- Cleanup lib before rebuilding ([#87](https://github.com/babel/babel-preset-env/pull/87)) (@baer)
199- Move linting dependency to be dev only ([#88](https://github.com/babel/babel-preset-env/pull/88)) (@baer)
200
201### :memo: Documentation
202
203- Fix typo ([#78](https://github.com/babel/babel-preset-env/pull/78)) (@rohmanhm)
204- Fix PR link in changelog. ([#75](https://github.com/babel/babel-preset-env/pull/75)) (@nhajidin)
205
206## v1.0.2 (2016-12-10)
207
208### :bug: Bug Fix
209
210* Fix issue with Object.getOwnPropertySymbols ([#71](https://github.com/babel/babel-preset-env/pull/71)) ([@existentialism](https://github.com/existentialism))
211
212Was requiring the wrong module kinda of like in v1.0.1:
213
214https://github.com/zloirock/core-js#ecmascript-6-symbol
215
216```diff
217-import "core-js/modules/es6.object.get-own-property-symbols";
218```
219
220The test is just a part of `Symbol`.
221
222## v1.0.1 (2016-12-10)
223
224### :bug: Bug Fix
225
226* Fix regenerator import ([#68](https://github.com/babel/babel-preset-env/pull/68)) ([@hzoo](https://github.com/hzoo))
227
228We were outputting an invalid path for `regenerator`!
229
230```diff
231+import "regenerator-runtime/runtime";
232-import "core-js/modules/regenerator-runtime/runtime"-
233```
234
235## v1.0.0 (2016-12-09)
236
237### :rocket: New Feature
238
239* 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))
240
241A way to apply `babel-preset-env` for polyfills (via `"babel-polyfill"``).
242
243> 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.
244
245Install
246
247```
248npm install babel-polyfill --save
249```
250
251In
252
253```js
254import "babel-polyfill"; // create an entry js file that contains this
255// or
256import "core-js";
257```
258
259Out (different based on environment)
260
261```js
262// chrome 55
263import "core-js/modules/es7.string.pad-start"; // haha left_pad
264import "core-js/modules/es7.string.pad-end";
265import "core-js/modules/web.timers";
266import "core-js/modules/web.immediate";
267import "core-js/modules/web.dom.iterable";
268```
269
270`.babelrc` Usage
271
272```js
273{
274 "presets": [
275 ["env", {
276 "targets": {
277 "electron": 1.4
278 },
279 "modules": false, // webpack 2
280 "useBuiltIns": true // new option
281 }]
282 ]
283}
284```
285
286> Also looking to make an easier integration point via Webpack with this method. Please reach out if you have ideas!
287
288---
289
290* Support [Electron](http://electron.atom.io/) ([#55](https://github.com/babel/babel-preset-env/pull/55)) ([@paulcbetts](https://github.com/paulcbetts))
291
292Electron is also an environment, so [Paul went ahead](https://twitter.com/paulcbetts/status/804507070103851008) and added support for this!
293
294`.babelrc` Usage
295
296```js
297{
298 "presets": [ ["env", {"targets": { "electron": 1.4 }}]]
299}
300```
301
302> 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:)
303
304
305
306## v0.0.9 (2016-11-24)
307
308### :rocket: New Feature
309
310* Support Opera ([#48](https://github.com/babel/babel-preset-env/pull/48)) (Henry Zhu)
311
312Was as simple as modifying the chrome version and subtracting 13! (so chrome 54 = opera 41)
313
314```js
315{
316 "presets": [
317 ["env", {
318 "targets": {
319 "opera": 41
320 }
321 }]
322 ]
323}
324```
325
326## v0.0.8 (2016-11-16)
327
328### :nail_care: Polish
329
330* Only print the debug info once ([#46](https://github.com/babel/babel-preset-env/pull/46) (Henry Zhu)
331
332When using the `debug` option it was printing the data for each file processed rather than once.
333
334```js
335{
336 "presets": [
337 ["env", {
338 "debug": true
339 }]
340 ]
341}
342```
343
344## v0.0.7 (2016-11-02)
345
346### :rocket: New Feature
347
348* hardcode a current node version option ([#35](https://github.com/babel/babel-preset-env/pull/35)) (Henry Zhu)
349
350```js
351{
352 "presets": [
353 ["env", {
354 "targets": {
355 "node": "current" // parseFloat(process.versions.node)
356 }
357 }]
358 ]
359}
360```
361
362* add 'whitelist' option ([#31](https://github.com/babel/babel-preset-env/pull/31)) (Henry Zhu)
363
364```js
365 {
366 "presets": [
367 ["env", {
368 "targets": {
369 "chrome": 52
370 },
371 "whitelist": ["transform-es2015-arrow-functions"]
372 }]
373 ]
374}
375```
376
377* Add more aliases (Henry Zhu)
378* Update plugin data: firefox 52 supports async/await! ([#29](https://github.com/babel/babel-preset-env/pull/29)) (Henry Zhu)
379
380### :bug: Bug Fixes
381
382* Use compat-table equals option ([#36](https://github.com/babel/babel-preset-env/pull/36)) (Henry Zhu)
383
384Compute and use `compat-table` equivalents
385
386```js
387{
388 "safari6": "phantom",
389 "chrome44": "iojs",
390 "chrome50": "node64",
391 "chrome51": "node65",
392 "chrome54": "node7",
393 "chrome30": "android44",
394 "chrome37": "android50",
395 "chrome39": "android51",
396 "safari7": "ios7",
397 "safari71_8": "ios8",
398 "safari9": "ios9",
399 "safari10": "ios10",
400 "chrome50": "node6"
401}
402```
403
404* Change default behavior to act the same as babel-preset-latest ([#33](https://github.com/babel/babel-preset-env/pull/33)) (Henry Zhu)
405
406```js
407{ "presets": ["env"] } // should act the same as babel-preset-latest
408```
409
410## Internal
411
412* Add fixture helper for tests ([#28](https://github.com/babel/babel-preset-env/pull/28)) (Henry Zhu)