Compare commits
906 Commits
v7.0.0-bet
...
v7.0.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1d774b34f | ||
|
|
8874c5c481 | ||
|
|
b439013cd4 | ||
|
|
f8b0a5579f | ||
|
|
2a4f162366 | ||
|
|
55295cc545 | ||
|
|
59e9c6322b | ||
|
|
0fd3da110d | ||
|
|
d60c5e1736 | ||
|
|
90bebe7186 | ||
|
|
8d6ed7e0aa | ||
|
|
8f4bae8ea4 | ||
|
|
2c3c12fdf7 | ||
|
|
25d2f59018 | ||
|
|
3a399d1eb9 | ||
|
|
c2a2e24965 | ||
|
|
ef68114d67 | ||
|
|
ca639b4262 | ||
|
|
7a51d72345 | ||
|
|
ab8555a867 | ||
|
|
0136a26af7 | ||
|
|
c75a00bd56 | ||
|
|
ffa8e6cbae | ||
|
|
5043ec78bc | ||
|
|
3989213e37 | ||
|
|
d79b5eeeff | ||
|
|
1e0b649485 | ||
|
|
8c65230258 | ||
|
|
427aff559f | ||
|
|
de16ac08be | ||
|
|
0a958861c9 | ||
|
|
904bcaffe3 | ||
|
|
e855987c51 | ||
|
|
8b1406127a | ||
|
|
c8bb450032 | ||
|
|
b6db036ff7 | ||
|
|
6476a0d089 | ||
|
|
6695f5e2f7 | ||
|
|
86ce2e4e0d | ||
|
|
8cffbbae75 | ||
|
|
cb51704745 | ||
|
|
a8224d40e2 | ||
|
|
3210a7a873 | ||
|
|
9c598a8e28 | ||
|
|
a149466001 | ||
|
|
ec8330870e | ||
|
|
363c5923f0 | ||
|
|
8173b6e694 | ||
|
|
e2d64f146c | ||
|
|
9392783738 | ||
|
|
810b7916c2 | ||
|
|
eb0e999987 | ||
|
|
5c728ea609 | ||
|
|
b8f9ebf638 | ||
|
|
55ca90b3fc | ||
|
|
1a0fe993f5 | ||
|
|
02760d0f70 | ||
|
|
adca165ee9 | ||
|
|
fa86b2ddf0 | ||
|
|
5eb193c61f | ||
|
|
ec69b4bb12 | ||
|
|
5fdcd29ef9 | ||
|
|
8ee24fdfc0 | ||
|
|
db2a9fc96e | ||
|
|
75767e9273 | ||
|
|
4346a95b88 | ||
|
|
26cbbb569f | ||
|
|
a811cf78e1 | ||
|
|
c70a32ab9d | ||
|
|
6f3a800677 | ||
|
|
d781e207c8 | ||
|
|
8b10a44fe1 | ||
|
|
adae1501ac | ||
|
|
c8038f69fe | ||
|
|
30ea328e97 | ||
|
|
16b1f8c427 | ||
|
|
a582cc5bd8 | ||
|
|
84282f199b | ||
|
|
52a569056c | ||
|
|
7446d06911 | ||
|
|
8817fcf03e | ||
|
|
6d177ba4c5 | ||
|
|
935533cff3 | ||
|
|
c4f67bfa57 | ||
|
|
2854a187be | ||
|
|
62ee1adc85 | ||
|
|
fd9ebf9e1d | ||
|
|
dca6125128 | ||
|
|
093483c399 | ||
|
|
b89234b1a2 | ||
|
|
f2fd9e982e | ||
|
|
301db1b921 | ||
|
|
19a1705293 | ||
|
|
10910a10f5 | ||
|
|
dd6da3b3af | ||
|
|
d2d2118a44 | ||
|
|
21de1581aa | ||
|
|
b5e64cb66e | ||
|
|
44f738bcbf | ||
|
|
13153ede92 | ||
|
|
c0c13ae30f | ||
|
|
cea562c009 | ||
|
|
f93fa28c90 | ||
|
|
430a105ae7 | ||
|
|
3e71108f82 | ||
|
|
e9184ed05e | ||
|
|
663c96db04 | ||
|
|
85b7154f91 | ||
|
|
f70d7c8dfe | ||
|
|
e229ebbb8a | ||
|
|
db1385fb82 | ||
|
|
b6eba87daa | ||
|
|
2cf2fd544b | ||
|
|
9bd4b46fd6 | ||
|
|
4d125c391a | ||
|
|
afa1207224 | ||
|
|
c6a4108e57 | ||
|
|
236bd9309c | ||
|
|
eac4c5bc17 | ||
|
|
e1662759ed | ||
|
|
12c75cc08c | ||
|
|
9283efaeb7 | ||
|
|
532c25c8db | ||
|
|
3c90baaf6c | ||
|
|
add5f8d0fe | ||
|
|
cb79473499 | ||
|
|
d383659ca6 | ||
|
|
e86d1e0d6a | ||
|
|
a2cd264211 | ||
|
|
8f8b4e8e82 | ||
|
|
07c88e6f0b | ||
|
|
ba98cf782a | ||
|
|
bc64e02bf8 | ||
|
|
814fce946d | ||
|
|
6894465df8 | ||
|
|
60c4f30c71 | ||
|
|
c313b267f7 | ||
|
|
eb54adb755 | ||
|
|
e0ef50c00f | ||
|
|
3af623678f | ||
|
|
96528d36df | ||
|
|
5de12c26f6 | ||
|
|
4b5a55d937 | ||
|
|
036c429ce1 | ||
|
|
3c46e75b8f | ||
|
|
106907e605 | ||
|
|
387cda8fbb | ||
|
|
86c10ff4f3 | ||
|
|
6d5392554f | ||
|
|
0b25e3327c | ||
|
|
b6455c611b | ||
|
|
313960e601 | ||
|
|
9e4c56f990 | ||
|
|
119db23ee3 | ||
|
|
3432792568 | ||
|
|
cc4ee350e4 | ||
|
|
5bd79c70a5 | ||
|
|
01f6f4c66d | ||
|
|
000fa83b9e | ||
|
|
efb34aa7dc | ||
|
|
ab928713af | ||
|
|
3de053cc6c | ||
|
|
110779e9f3 | ||
|
|
8070a2204d | ||
|
|
9f4e2f81d8 | ||
|
|
415d79bdfe | ||
|
|
62eb32677c | ||
|
|
7da7e760a6 | ||
|
|
bd44902024 | ||
|
|
6480ae4a9f | ||
|
|
80b3362fcc | ||
|
|
8bc0182489 | ||
|
|
e9d861537f | ||
|
|
153ad4c6f3 | ||
|
|
218d69007e | ||
|
|
f838a7e9f1 | ||
|
|
6349118bed | ||
|
|
8bbb10c021 | ||
|
|
f614809002 | ||
|
|
b445b79734 | ||
|
|
b6eaaa2496 | ||
|
|
e2471337f4 | ||
|
|
826edd0bd5 | ||
|
|
f434a50829 | ||
|
|
5895277b32 | ||
|
|
62114b807b | ||
|
|
2abd7839e1 | ||
|
|
b8dcd6f593 | ||
|
|
fe556c502d | ||
|
|
ab62a94399 | ||
|
|
d83d141e00 | ||
|
|
cb17f07ac9 | ||
|
|
21b9b2e42d | ||
|
|
2a8ebbe7ae | ||
|
|
9add6d88f5 | ||
|
|
2d2f37fa6c | ||
|
|
7846eaebaa | ||
|
|
d45ee5e025 | ||
|
|
f699f1bbbf | ||
|
|
f0283572a5 | ||
|
|
90566103a6 | ||
|
|
cf8058e5b6 | ||
|
|
90a174e7c4 | ||
|
|
9c707f9670 | ||
|
|
53e4d74ebe | ||
|
|
98ff2ce877 | ||
|
|
0ffc8ed209 | ||
|
|
e6d198eef5 | ||
|
|
86aacad2bc | ||
|
|
6eab6f5863 | ||
|
|
555ee80f43 | ||
|
|
a94cbf760a | ||
|
|
0bc3027554 | ||
|
|
6f3093b557 | ||
|
|
7489f8da7b | ||
|
|
dccaec7691 | ||
|
|
c992f5b61e | ||
|
|
5cd1276a27 | ||
|
|
2af7a33c4e | ||
|
|
ffe04d9195 | ||
|
|
b33823e7f8 | ||
|
|
007bfb6565 | ||
|
|
c8faa34848 | ||
|
|
5bcca0123a | ||
|
|
1d987fb655 | ||
|
|
06e5c46c8d | ||
|
|
52b800decb | ||
|
|
01d969a182 | ||
|
|
7d99a96f9f | ||
|
|
ad1de09b5f | ||
|
|
6b91d6434d | ||
|
|
18796173ab | ||
|
|
eb3334a14e | ||
|
|
5e00c96368 | ||
|
|
b4d18f4764 | ||
|
|
981bff08e4 | ||
|
|
7d641d2e74 | ||
|
|
f2882d570a | ||
|
|
cc5aeb3b50 | ||
|
|
d164f820e6 | ||
|
|
43aa61d6be | ||
|
|
ca1c98b255 | ||
|
|
0963dbddea | ||
|
|
2058e0686e | ||
|
|
c0013264b7 | ||
|
|
442ead701c | ||
|
|
5fb3696955 | ||
|
|
69cca412eb | ||
|
|
3bee37b14d | ||
|
|
bc757c8b75 | ||
|
|
c558dedd7b | ||
|
|
0879a6d608 | ||
|
|
51eef099b3 | ||
|
|
daf0ca8680 | ||
|
|
0200a3e510 | ||
|
|
27c39c512d | ||
|
|
70eb206c03 | ||
|
|
229179b8aa | ||
|
|
6baa36cdc5 | ||
|
|
a40f54f847 | ||
|
|
6226c52f43 | ||
|
|
25153359f7 | ||
|
|
2351a638b5 | ||
|
|
bc6f0f989d | ||
|
|
af7ab71486 | ||
|
|
ac13c302f7 | ||
|
|
b396cdcbe5 | ||
|
|
8dcfabd0d7 | ||
|
|
e45d5c3b65 | ||
|
|
8ff675ad69 | ||
|
|
a955efa3e3 | ||
|
|
51db3e9a5d | ||
|
|
41ca312545 | ||
|
|
a192f8beb4 | ||
|
|
f03adbadf4 | ||
|
|
97145ad01e | ||
|
|
25810d2609 | ||
|
|
5f58117790 | ||
|
|
dca2631ef0 | ||
|
|
ba11d9fa7c | ||
|
|
e06cf20d2e | ||
|
|
df1afa3160 | ||
|
|
cec93c01ce | ||
|
|
0a8367c979 | ||
|
|
ac5d2ba984 | ||
|
|
040ba2bf53 | ||
|
|
98f0808a22 | ||
|
|
bdcfb697a6 | ||
|
|
0341d299c8 | ||
|
|
1a7765712e | ||
|
|
b87c43d894 | ||
|
|
02c4a28608 | ||
|
|
4260ffd7ec | ||
|
|
25c3f0d689 | ||
|
|
21b03c35d3 | ||
|
|
ee1ee0e7ae | ||
|
|
73f8059ea0 | ||
|
|
70e3454d7a | ||
|
|
9dab691302 | ||
|
|
95fc38cecf | ||
|
|
84e76e2d49 | ||
|
|
0d9eef4750 | ||
|
|
d2ed7bbc8d | ||
|
|
5b5ac1f366 | ||
|
|
fa1547d8f8 | ||
|
|
b42b21f25c | ||
|
|
6dca0ff9bf | ||
|
|
3e9b59c0f1 | ||
|
|
3f6c475aae | ||
|
|
5c31e501d7 | ||
|
|
ed6b4e0e40 | ||
|
|
8615b6fe57 | ||
|
|
95fa5a66b1 | ||
|
|
c94355c1c9 | ||
|
|
839bf68d1f | ||
|
|
8198b1b334 | ||
|
|
d608535719 | ||
|
|
0353ce9ed5 | ||
|
|
65ca968f8b | ||
|
|
77445cb044 | ||
|
|
7c4509e280 | ||
|
|
87ae286bc3 | ||
|
|
9c1b3e8dc1 | ||
|
|
39d07638cf | ||
|
|
e887eecda4 | ||
|
|
a3e622ad15 | ||
|
|
494a56df5f | ||
|
|
8060ae5dae | ||
|
|
bd4ebc11c1 | ||
|
|
80cefaff2f | ||
|
|
e9d5073af1 | ||
|
|
c8fb48ffd6 | ||
|
|
55ef39eb87 | ||
|
|
91e1e1728c | ||
|
|
acf509bab5 | ||
|
|
4f312f5739 | ||
|
|
696f84468e | ||
|
|
71fd37067e | ||
|
|
7142a79eb9 | ||
|
|
1a6855eff2 | ||
|
|
1de36948ac | ||
|
|
b28ffedead | ||
|
|
a5edab7393 | ||
|
|
725e6a01c0 | ||
|
|
224ce38882 | ||
|
|
8c46fd159f | ||
|
|
47201db61e | ||
|
|
138d60922c | ||
|
|
cfb386ff03 | ||
|
|
9e7fe0ab49 | ||
|
|
e31e907d5f | ||
|
|
4da4728bf5 | ||
|
|
0112479ba9 | ||
|
|
408124438a | ||
|
|
eab4c0e93e | ||
|
|
d06bf993db | ||
|
|
1076018c4c | ||
|
|
07ff8f30f5 | ||
|
|
e6ba0ab82c | ||
|
|
2afe9404fe | ||
|
|
037fee8ffb | ||
|
|
3a2aa9b862 | ||
|
|
c8b57f777a | ||
|
|
b414387bb1 | ||
|
|
0bb71caad3 | ||
|
|
d6dcbdad48 | ||
|
|
8606b76438 | ||
|
|
34d73ebef0 | ||
|
|
890a45216f | ||
|
|
0a257e8972 | ||
|
|
3616137864 | ||
|
|
f8ab9466d3 | ||
|
|
8f24f91166 | ||
|
|
dbdce0e4e4 | ||
|
|
4595c7fdfd | ||
|
|
1f97b91655 | ||
|
|
b0e1e84471 | ||
|
|
f7c26bf2bf | ||
|
|
a67eb25547 | ||
|
|
485e37fcb0 | ||
|
|
f013dab5fb | ||
|
|
e45b58dcb1 | ||
|
|
339dfddca5 | ||
|
|
0cd868a5f2 | ||
|
|
29db23ed87 | ||
|
|
2679d6775c | ||
|
|
96316dcf88 | ||
|
|
42244123e1 | ||
|
|
4b97e837ea | ||
|
|
3299086955 | ||
|
|
2bded404f3 | ||
|
|
21c7ff3f37 | ||
|
|
341bdab90c | ||
|
|
81149a5cc9 | ||
|
|
5166eef103 | ||
|
|
0ee9a4e612 | ||
|
|
858a2c74e7 | ||
|
|
668358c4d0 | ||
|
|
39b05598a0 | ||
|
|
29eafbbf44 | ||
|
|
7a106025ea | ||
|
|
4f1473da3d | ||
|
|
c62b202e6a | ||
|
|
a084339a15 | ||
|
|
d7987fbbd2 | ||
|
|
8a31eabf5e | ||
|
|
80428dec47 | ||
|
|
61ec5ce957 | ||
|
|
1e41f613bb | ||
|
|
a86d14de61 | ||
|
|
a62cfe9045 | ||
|
|
f797454a18 | ||
|
|
ec882be44d | ||
|
|
ecbf0dd53c | ||
|
|
af3d6526e7 | ||
|
|
95894397eb | ||
|
|
b1c9af3f05 | ||
|
|
ec3722b3f9 | ||
|
|
7ae724f553 | ||
|
|
6597a472b3 | ||
|
|
fdd0789936 | ||
|
|
5b1332457c | ||
|
|
3177f05904 | ||
|
|
9dc178df9a | ||
|
|
75bc9422b8 | ||
|
|
bd98041321 | ||
|
|
6a8c4ab433 | ||
|
|
637bfe76b1 | ||
|
|
3f72f1d637 | ||
|
|
20de23f895 | ||
|
|
d17adf40df | ||
|
|
450a1678f2 | ||
|
|
e9ed0f5f21 | ||
|
|
29d249e3b7 | ||
|
|
6f9b0546ef | ||
|
|
fa2c6c5164 | ||
|
|
43040a4181 | ||
|
|
01f4c2368e | ||
|
|
56cb4baf46 | ||
|
|
b051243a63 | ||
|
|
e808b63c15 | ||
|
|
a6df92f245 | ||
|
|
f4b81ab101 | ||
|
|
360b632881 | ||
|
|
bdfeeb38c6 | ||
|
|
47ada5ab3a | ||
|
|
59ba3959dc | ||
|
|
0200e6256a | ||
|
|
9a26c2b07a | ||
|
|
901571d72f | ||
|
|
b09c729675 | ||
|
|
a36525be45 | ||
|
|
a10c91790f | ||
|
|
ab7d1231ad | ||
|
|
a5df709bc3 | ||
|
|
1dbed5f458 | ||
|
|
40e38646e4 | ||
|
|
9e4dd861ee | ||
|
|
a7bddc02ba | ||
|
|
023f8bd1cb | ||
|
|
c9b99af5a6 | ||
|
|
c8d82d6483 | ||
|
|
db42a5d70f | ||
|
|
0856f89882 | ||
|
|
921702ef8c | ||
|
|
8b57a3e3b9 | ||
|
|
21309cc8d4 | ||
|
|
19708e0154 | ||
|
|
f98dff9189 | ||
|
|
840ba187a7 | ||
|
|
de00d939f0 | ||
|
|
e80488f1d5 | ||
|
|
81c1b49f6a | ||
|
|
55bf55398a | ||
|
|
f0d681a238 | ||
|
|
6d6fe844fd | ||
|
|
edb0a70e14 | ||
|
|
669f6b97b2 | ||
|
|
e2c5f25e97 | ||
|
|
8eee435cd6 | ||
|
|
d260bfaec4 | ||
|
|
c662c2ada2 | ||
|
|
b6e54800b4 | ||
|
|
ae210a46d1 | ||
|
|
017d0e7078 | ||
|
|
b8d1d221f8 | ||
|
|
fed530f6bf | ||
|
|
29d44193cd | ||
|
|
82994ce087 | ||
|
|
586d3b5929 | ||
|
|
d682e32529 | ||
|
|
07ab02f6b2 | ||
|
|
91a114f74a | ||
|
|
6d9887fc0f | ||
|
|
d2a3a8151e | ||
|
|
270ea17fed | ||
|
|
da2aea31f5 | ||
|
|
1d69cd41ca | ||
|
|
a7ec312cfe | ||
|
|
6ff91cfdae | ||
|
|
dfb3795a97 | ||
|
|
353d3199c2 | ||
|
|
bdd70c37e0 | ||
|
|
9d2d499760 | ||
|
|
29807837bb | ||
|
|
c14a6a7735 | ||
|
|
3a7881379a | ||
|
|
f3f0197890 | ||
|
|
8e030e28b3 | ||
|
|
3c8e9acd4a | ||
|
|
958551fd89 | ||
|
|
b5e6536f26 | ||
|
|
0389035e15 | ||
|
|
4f4dd3d4a6 | ||
|
|
4da3f3bc64 | ||
|
|
7901e7d1b9 | ||
|
|
4b6c7ac0f6 | ||
|
|
24a07fc790 | ||
|
|
1c9b0ff49e | ||
|
|
828e9a8538 | ||
|
|
f97d4313c9 | ||
|
|
2a0071028d | ||
|
|
2c0d492674 | ||
|
|
e42cbb40a4 | ||
|
|
74ab2798e2 | ||
|
|
fef5c7e523 | ||
|
|
53825f8152 | ||
|
|
40819f112c | ||
|
|
2d36549541 | ||
|
|
7e423de911 | ||
|
|
8317f8ab14 | ||
|
|
65dcc4eabe | ||
|
|
c8992e4155 | ||
|
|
50b9fbb570 | ||
|
|
5d615dd198 | ||
|
|
eb2a0b0fcd | ||
|
|
eaa31b6ec3 | ||
|
|
4d76d5dddc | ||
|
|
a86d311986 | ||
|
|
a340a2614f | ||
|
|
f9857ca6ba | ||
|
|
f43bf7fcd5 | ||
|
|
653318b7e4 | ||
|
|
d187c26748 | ||
|
|
fc64ab5725 | ||
|
|
5cd8b5b7f0 | ||
|
|
a328b6ad1a | ||
|
|
15a80f0df8 | ||
|
|
a4795408b4 | ||
|
|
5f6e3122a0 | ||
|
|
7f8f4e86dc | ||
|
|
5c3092d86f | ||
|
|
7cc00cce0d | ||
|
|
beb99dfda1 | ||
|
|
5f9539e9cc | ||
|
|
aa669ef902 | ||
|
|
c92e8be612 | ||
|
|
ab1e295c74 | ||
|
|
ae0df86340 | ||
|
|
41bf66bca2 | ||
|
|
212058148c | ||
|
|
785131d8e6 | ||
|
|
81532103da | ||
|
|
cc6e739f15 | ||
|
|
3e95830646 | ||
|
|
53208d6998 | ||
|
|
fdfbd9a6f7 | ||
|
|
007f8d19b3 | ||
|
|
586ba35950 | ||
|
|
1a454f666c | ||
|
|
a07f96ce3f | ||
|
|
2c3eb3096f | ||
|
|
148e6dfc26 | ||
|
|
ddd40bf5c7 | ||
|
|
bf8b25289b | ||
|
|
b19b7fd2cf | ||
|
|
f004972625 | ||
|
|
5459c75d64 | ||
|
|
8e3e6e0a88 | ||
|
|
d4a8c7672c | ||
|
|
600106b9cb | ||
|
|
dffcef785a | ||
|
|
cb4f4f4d5f | ||
|
|
7ff4a73916 | ||
|
|
8823e4247e | ||
|
|
6f3be3a543 | ||
|
|
6f6c8dabba | ||
|
|
960fa66c9e | ||
|
|
df50cddd63 | ||
|
|
455c04e60a | ||
|
|
182fe7b04e | ||
|
|
959865b48d | ||
|
|
62c1046249 | ||
|
|
70627ac92c | ||
|
|
a99e9614a6 | ||
|
|
cfb830b5bd | ||
|
|
84de90e572 | ||
|
|
d283324f8a | ||
|
|
d75a6b8468 | ||
|
|
dad05ed503 | ||
|
|
7e90d56024 | ||
|
|
3d49766f6b | ||
|
|
4d17a96d50 | ||
|
|
6cbc585cf4 | ||
|
|
ee6dfd1580 | ||
|
|
e732ee0c5b | ||
|
|
128fc6864e | ||
|
|
6aed8e944f | ||
|
|
4d164bd8e6 | ||
|
|
ea3f2d9299 | ||
|
|
88a0f52230 | ||
|
|
4a2e1dbbc3 | ||
|
|
2979dd99ac | ||
|
|
534ee4734c | ||
|
|
a01007a3d3 | ||
|
|
493996e02a | ||
|
|
c03a34e509 | ||
|
|
92580e750d | ||
|
|
213805f21e | ||
|
|
28d13cb09b | ||
|
|
9a8ba76e1f | ||
|
|
d88173b9f8 | ||
|
|
85174b6ce1 | ||
|
|
ec2e0b664a | ||
|
|
a3ad518ce1 | ||
|
|
dd0337cc85 | ||
|
|
4887d81929 | ||
|
|
22555cd15d | ||
|
|
593c1a0861 | ||
|
|
7234442fde | ||
|
|
5ea1bfe780 | ||
|
|
2254ed45d2 | ||
|
|
278cd5e572 | ||
|
|
96c0415c86 | ||
|
|
ed98d2491e | ||
|
|
eb38ea2b10 | ||
|
|
f19d559ff3 | ||
|
|
73e64c6cb0 | ||
|
|
3deb246c7d | ||
|
|
1ebc229fa5 | ||
|
|
cc4913699b | ||
|
|
82b6ee734b | ||
|
|
22c8f6376c | ||
|
|
023550c87b | ||
|
|
8e0d247e8c | ||
|
|
65ae4ff15b | ||
|
|
2185256589 | ||
|
|
3316a554bf | ||
|
|
252ea5a966 | ||
|
|
912bcc186d | ||
|
|
63ae923987 | ||
|
|
dde9274986 | ||
|
|
ba111c13b5 | ||
|
|
967414d926 | ||
|
|
92fc26d399 | ||
|
|
fa5eb4f605 | ||
|
|
d6a782b09c | ||
|
|
567d25cfa5 | ||
|
|
1da831baa4 | ||
|
|
b0d8c62d1c | ||
|
|
0e570eceb2 | ||
|
|
ca18ea5e79 | ||
|
|
63d9998aa4 | ||
|
|
88e550c733 | ||
|
|
b96fdf8780 | ||
|
|
180eda3211 | ||
|
|
b3969d35fa | ||
|
|
dccfed3601 | ||
|
|
5759c33b4c | ||
|
|
193bccc93c | ||
|
|
5ce54799ff | ||
|
|
064c17e03f | ||
|
|
f9804e6beb | ||
|
|
47ce7e71c9 | ||
|
|
5ac8ba19a4 | ||
|
|
b5d20ab171 | ||
|
|
539009a980 | ||
|
|
c3654d83c8 | ||
|
|
667f5815c1 | ||
|
|
4f39e6ea4a | ||
|
|
64dfb7574e | ||
|
|
d36b142e30 | ||
|
|
3c8d831fe4 | ||
|
|
0a517b51cd | ||
|
|
79c84f2f9b | ||
|
|
ca86648726 | ||
|
|
2d05487293 | ||
|
|
c3352ad2e0 | ||
|
|
26e4911eb2 | ||
|
|
aa888e666a | ||
|
|
8659e1a88c | ||
|
|
9e384f3915 | ||
|
|
f694b5d034 | ||
|
|
d765573c0b | ||
|
|
64161fa0b5 | ||
|
|
52f22e9e1e | ||
|
|
3e5fce07e4 | ||
|
|
0f42accb87 | ||
|
|
07e69c009b | ||
|
|
ce420ba51c | ||
|
|
9fe30b98a1 | ||
|
|
0a9f136d5f | ||
|
|
e9ed687666 | ||
|
|
63157159ab | ||
|
|
74682f33bc | ||
|
|
b1bf7798ab | ||
|
|
7c99f4653f | ||
|
|
a19349a22a | ||
|
|
b93184e430 | ||
|
|
bb17b72f4f | ||
|
|
a76709cabc | ||
|
|
c292140254 | ||
|
|
f4a24a38ca | ||
|
|
193e841d89 | ||
|
|
1ded1d7ff6 | ||
|
|
aec6e5c370 | ||
|
|
152e95fb52 | ||
|
|
8250ff963e | ||
|
|
82c6ca2f96 | ||
|
|
820edd1e23 | ||
|
|
e872f0d975 | ||
|
|
c3f6f7fe28 | ||
|
|
49775e2f12 | ||
|
|
f3410e761c | ||
|
|
ebbd5c7321 | ||
|
|
4208099f5b | ||
|
|
068c65a1dd | ||
|
|
3956b3ee0e | ||
|
|
2297e2d764 | ||
|
|
d761d765bd | ||
|
|
ad2019aa30 | ||
|
|
f9e0805337 | ||
|
|
0f60d42fdf | ||
|
|
7d798952d2 | ||
|
|
ed2b88830e | ||
|
|
d25918aa5d | ||
|
|
035286a810 | ||
|
|
c9a00fbae8 | ||
|
|
758fd0369c | ||
|
|
7b861796cf | ||
|
|
f9825394a7 | ||
|
|
43e7d1d2cc | ||
|
|
de63443762 | ||
|
|
6a73f39199 | ||
|
|
2190e10e9a | ||
|
|
ae3f5b9149 | ||
|
|
0c885b3200 | ||
|
|
148fe7d3ff | ||
|
|
cabdf3769d | ||
|
|
1178799f07 | ||
|
|
b2f1d01965 | ||
|
|
4f53496546 | ||
|
|
1312a30d54 | ||
|
|
4afbc02476 | ||
|
|
080c7f1e2d | ||
|
|
3cea9f412a | ||
|
|
cd10ea03b4 | ||
|
|
5f8a1a2613 | ||
|
|
44da8201a5 | ||
|
|
2b065350b5 | ||
|
|
68476b6ddd | ||
|
|
17b37b5013 | ||
|
|
56638e1370 | ||
|
|
f0e46772a6 | ||
|
|
398bc43656 | ||
|
|
44ea9433c0 | ||
|
|
53826aaaa0 | ||
|
|
b900a3e5c2 | ||
|
|
ed4d90b33d | ||
|
|
209a598d51 | ||
|
|
9a146d01b0 | ||
|
|
f2437583ba | ||
|
|
a24c9f8ed6 | ||
|
|
6a7223af29 | ||
|
|
a66845169f | ||
|
|
8a4124b2ff | ||
|
|
05b22d2597 | ||
|
|
9cc0a26694 | ||
|
|
f5ef928586 | ||
|
|
42f66782be | ||
|
|
12ac1bccd7 | ||
|
|
82357d79a7 | ||
|
|
2958548c2c | ||
|
|
468aecca21 | ||
|
|
c7980b2b90 | ||
|
|
d6db5fb1e1 | ||
|
|
ac745ded0d | ||
|
|
a2aabbd33d | ||
|
|
fcfa987926 | ||
|
|
509dbb7302 | ||
|
|
e270fbe7f0 | ||
|
|
aa38c47160 | ||
|
|
62bbee97d7 | ||
|
|
ac72bfbd33 | ||
|
|
a7c9264c79 | ||
|
|
c41eb0d052 | ||
|
|
de5ab72c49 | ||
|
|
607916880d | ||
|
|
8270903ba2 | ||
|
|
95fe785354 | ||
|
|
413aa79711 | ||
|
|
1a3a502f97 | ||
|
|
5761eb0bb4 | ||
|
|
a992d06c41 | ||
|
|
d8bbaaae0a | ||
|
|
9d9710c765 | ||
|
|
18b91a8388 | ||
|
|
0a2a37c31f | ||
|
|
d731acc351 | ||
|
|
fba19295b4 | ||
|
|
8fc8a1f2ee | ||
|
|
18c8d97c3d | ||
|
|
58962c35b5 | ||
|
|
881fc14329 | ||
|
|
7d8932b6be | ||
|
|
6330a152ce | ||
|
|
189c56628a | ||
|
|
8be488652f | ||
|
|
cdf420d4d8 | ||
|
|
cf62908bbd | ||
|
|
66ee192a7f | ||
|
|
c635ff9c32 | ||
|
|
6cb9d20a0a | ||
|
|
b5cb78d33a | ||
|
|
1d0a3d6772 | ||
|
|
18ea5aca51 | ||
|
|
db28c18458 | ||
|
|
a89171910f | ||
|
|
0056fb1cfb | ||
|
|
041dd4a536 | ||
|
|
428e294ded | ||
|
|
0a3c2a0c4c | ||
|
|
917e3ede31 | ||
|
|
6d820a2757 | ||
|
|
1ef7e0f48e | ||
|
|
9206df964d | ||
|
|
c583a04a55 | ||
|
|
edbf5d33dc | ||
|
|
8393a6d089 | ||
|
|
464df13c69 | ||
|
|
80b4b7120b | ||
|
|
ccd7c25174 | ||
|
|
4384d38b90 | ||
|
|
3fae022320 | ||
|
|
70361f1200 | ||
|
|
d72d567d43 | ||
|
|
4a455639e7 | ||
|
|
ba441c5ce4 | ||
|
|
7064b298d7 | ||
|
|
f3004d0d4d | ||
|
|
037b2025a6 | ||
|
|
7d534dc32c | ||
|
|
2b710d0387 | ||
|
|
e67cfc5b31 | ||
|
|
4552ee9962 | ||
|
|
3c64554716 | ||
|
|
cee9ae48e0 | ||
|
|
39dae28d5c | ||
|
|
16e898c692 | ||
|
|
bb89364813 | ||
|
|
57e2c45cbe | ||
|
|
63397d0aad | ||
|
|
48906604f2 | ||
|
|
0f2ab2fe20 | ||
|
|
de3597983a | ||
|
|
aa2d415507 | ||
|
|
4c584ae341 | ||
|
|
74439889d8 | ||
|
|
74ea70718e | ||
|
|
bbff566024 | ||
|
|
3942862a2a | ||
|
|
f3fd2ee3b2 | ||
|
|
6a19c2299a | ||
|
|
6371200215 | ||
|
|
47d5f0c20c | ||
|
|
262d7518bd | ||
|
|
287b485d0e | ||
|
|
9ae23639ad | ||
|
|
3c359698a7 | ||
|
|
056a995dd8 | ||
|
|
84fe8e4181 | ||
|
|
e44cef3473 | ||
|
|
44c2791849 | ||
|
|
0e88156d0c | ||
|
|
394ad93d22 | ||
|
|
82a4919c11 | ||
|
|
186f04a3e9 | ||
|
|
42c740ca0a | ||
|
|
7ae6e1e5a0 | ||
|
|
097ff40001 | ||
|
|
b79e3c0e99 | ||
|
|
88c1b4ef1c | ||
|
|
6b417a8ecb | ||
|
|
cd8a869a18 | ||
|
|
f3f005c67e | ||
|
|
7dfa79f4c8 | ||
|
|
3e34162092 | ||
|
|
b93800d3cb | ||
|
|
233e60c765 | ||
|
|
72a90cb63d | ||
|
|
b51ac5e60a | ||
|
|
8b206b2c3b | ||
|
|
a2ed843636 | ||
|
|
b95810f4b4 | ||
|
|
abb4850709 | ||
|
|
459e289d63 |
@@ -1,4 +0,0 @@
|
||||
# Ensure babel-register won't compile fixtures, or try to recompile compiled code.
|
||||
packages/*/test/fixtures
|
||||
packages/*/lib
|
||||
packages/babel-standalone/babel.js
|
||||
64
.babelrc.js
64
.babelrc.js
@@ -1,64 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
// Blame Logan for this.
|
||||
// This works around https://github.com/istanbuljs/istanbuljs/issues/92 until
|
||||
// we have a version of Istanbul that actually works with 7.x.
|
||||
function istanbulHacks() {
|
||||
return {
|
||||
inherits: require("babel-plugin-istanbul").default,
|
||||
visitor: {
|
||||
Program: {
|
||||
exit: function(path) {
|
||||
if (!this.__dv__) return
|
||||
|
||||
const node = path.node.body[0];
|
||||
if (
|
||||
node.type !== "VariableDeclaration" ||
|
||||
node.declarations[0].id.type !== "Identifier" ||
|
||||
!node.declarations[0].id.name.match(/cov_/) ||
|
||||
node._blockHoist !== 3
|
||||
) {
|
||||
throw new Error("Something has gone wrong in Logan's hacks.");
|
||||
}
|
||||
|
||||
// Gross hacks to put the code coverage block above all compiled
|
||||
// import statement output.
|
||||
node._blockHoist = 5;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
let envOpts = {
|
||||
loose: true,
|
||||
exclude: ["transform-typeof-symbol"],
|
||||
};
|
||||
|
||||
const config = {
|
||||
comments: false,
|
||||
presets: [
|
||||
["@babel/env", envOpts],
|
||||
"@babel/flow"
|
||||
],
|
||||
plugins: [
|
||||
["@babel/proposal-class-properties", { loose: true }],
|
||||
"@babel/proposal-export-namespace",
|
||||
"@babel/proposal-numeric-separator",
|
||||
["@babel/proposal-object-rest-spread", { useBuiltIns: true}],
|
||||
]
|
||||
};
|
||||
|
||||
if (process.env.BABEL_ENV === "cov") {
|
||||
config.auxiliaryCommentBefore = "istanbul ignore next";
|
||||
config.plugins.push(istanbulHacks);
|
||||
}
|
||||
|
||||
if (process.env.BABEL_ENV === "development") {
|
||||
envOpts.targets = {
|
||||
node: "current"
|
||||
};
|
||||
envOpts.debug = true;
|
||||
}
|
||||
|
||||
module.exports = config;
|
||||
56
.circleci/config.yml
Normal file
56
.circleci/config.yml
Normal file
@@ -0,0 +1,56 @@
|
||||
version: 2
|
||||
aliases:
|
||||
- &restore-node-modules-cache
|
||||
keys:
|
||||
- v1-yarn-deps-{{ checksum "yarn.lock" }}
|
||||
|
||||
- &restore-yarn-cache
|
||||
keys:
|
||||
- v1-yarn-cache
|
||||
|
||||
- &save-node-modules-cache
|
||||
paths:
|
||||
- node_modules
|
||||
key: v1-yarn-deps-{{ checksum "yarn.lock" }}
|
||||
|
||||
- &save-yarn-cache
|
||||
paths:
|
||||
- ~/.yarn-cache
|
||||
key: v1-yarn-cache
|
||||
|
||||
- &artifact_babel
|
||||
path: ~/babel/packages/babel-standalone/babel.js
|
||||
|
||||
- &artifact_babel_min
|
||||
path: ~/babel/packages/babel-standalone/babel.min.js
|
||||
|
||||
- &artifact_env
|
||||
path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.js
|
||||
|
||||
- &artifact_env_min
|
||||
path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.min.js
|
||||
|
||||
jobs:
|
||||
build:
|
||||
working_directory: ~/babel
|
||||
docker:
|
||||
- image: circleci/node:10
|
||||
steps:
|
||||
- checkout
|
||||
- restore-cache: *restore-yarn-cache
|
||||
- restore-cache: *restore-node-modules-cache
|
||||
- run: yarn --version
|
||||
- run: make test-ci-coverage
|
||||
# Builds babel-standalone with the regular Babel config
|
||||
- run: make build
|
||||
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
|
||||
# data for a JS file that's several megabytes large is bound to fail. Here,
|
||||
# we just run the babel-standalone test separately.
|
||||
- run: ./node_modules/.bin/jest packages/babel-standalone/test/
|
||||
- run: ./node_modules/.bin/jest packages/babel-preset-env-standalone/test/
|
||||
- store_artifacts: *artifact_babel
|
||||
- store_artifacts: *artifact_babel_min
|
||||
- store_artifacts: *artifact_env
|
||||
- store_artifacts: *artifact_env_min
|
||||
- save_cache: *save-node-modules-cache
|
||||
- save_cache: *save-yarn-cache
|
||||
@@ -9,3 +9,6 @@ end_of_line = lf
|
||||
[*.{js,json}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{md,markdown}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
/lib
|
||||
/build
|
||||
/.git
|
||||
package.json
|
||||
lerna.json
|
||||
packages/babel-runtime
|
||||
!packages/babel-runtime/scripts
|
||||
!packages/babel-runtime/core-js.js
|
||||
!packages/babel-plugin-transform-runtime/scripts
|
||||
!packages/babel-runtime-corejs2/core-js.js
|
||||
packages/babel-runtime-corejs2
|
||||
packages/*/node_modules
|
||||
packages/*/lib
|
||||
packages/*/dist
|
||||
@@ -12,13 +17,10 @@ codemods/*/lib
|
||||
codemods/*/dist
|
||||
codemods/*/test/fixtures
|
||||
codemods/*/test/tmp
|
||||
experimental/*/lib
|
||||
experimental/*/node_modules
|
||||
experimental/*/test/fixtures
|
||||
experimental/*/test/tmp
|
||||
experimental/babel-preset-env/data
|
||||
experimental/babel-preset-env/test/debug-fixtures
|
||||
packages/babel-preset-env/data
|
||||
packages/babel-preset-env/test/debug-fixtures
|
||||
packages/babel-preset-env-standalone/babel-preset-env.js
|
||||
packages/babel-preset-env-standalone/babel-preset-env.min.js
|
||||
packages/babel-standalone/babel.js
|
||||
packages/babel-standalone/babel.min.js
|
||||
packages/babylon/build
|
||||
packages/babylon/test/expressions
|
||||
packages/babel-parser/test/expressions
|
||||
|
||||
32
.eslintrc
32
.eslintrc
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"extends": "babel",
|
||||
"plugins": [
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
"curly": ["error", "multi-line"],
|
||||
"prettier/prettier": "error",
|
||||
"no-case-declarations": "error"
|
||||
},
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"packages/*/src/**/*.js",
|
||||
"experimental/*/src/**/*.js",
|
||||
"codemods/*/src/**/*.js"
|
||||
],
|
||||
"rules": {
|
||||
"no-undefined-identifier": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [ "packages/*/test/**/*.js", "test/**/*.js" ],
|
||||
"env": {
|
||||
"mocha": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
33
.eslintrc.json
Normal file
33
.eslintrc.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"root": true,
|
||||
"extends": "babel",
|
||||
"plugins": ["prettier"],
|
||||
"rules": {
|
||||
"curly": ["error", "multi-line"],
|
||||
"prettier/prettier": "error",
|
||||
"no-case-declarations": "error"
|
||||
},
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"],
|
||||
"rules": {
|
||||
"no-undefined-identifier": "error",
|
||||
"no-deprecated-clone": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"packages/*/test/**/*.js",
|
||||
"codemods/*/test/**/*.js",
|
||||
"packages/babel-helper-transform-fixture-test-runner/src/helpers.js",
|
||||
"test/**/*.js"
|
||||
],
|
||||
"env": {
|
||||
"jest": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -4,22 +4,21 @@
|
||||
.*/packages/.*/test
|
||||
.*/codemods/.*/lib
|
||||
.*/codemods/.*/test
|
||||
.*/experimental/.*/lib
|
||||
.*/experimental/.*/test
|
||||
.*/node_modules/conventional-changelog-core/
|
||||
.*/node_modules/module-deps/
|
||||
|
||||
[include]
|
||||
packages/*/src
|
||||
codemods/*/src
|
||||
experimental/*/src
|
||||
|
||||
[libs]
|
||||
lib/file.js
|
||||
lib/parser.js
|
||||
lib/types.js
|
||||
lib/third-party-libs.js.flow
|
||||
packages/babel-types/lib/index.js.flow
|
||||
|
||||
[options]
|
||||
include_warnings=true
|
||||
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
|
||||
suppress_comment= \\(.\\|\n\\)*\\$FlowIssue
|
||||
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore
|
||||
|
||||
287
.github/CHANGELOG-v4.md
vendored
Normal file
287
.github/CHANGELOG-v4.md
vendored
Normal file
@@ -0,0 +1,287 @@
|
||||
# Babel v4 Changelog
|
||||
|
||||
## 4.7.16
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix constructor spreading of typed arrays.
|
||||
* Fix break/continue/return aliasing of non-loops in block scoping transformer.
|
||||
|
||||
## 4.7.15
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix constructor spreading of collections.
|
||||
|
||||
## 4.7.14
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix constructor spreading of `Promise`.
|
||||
* **Internal**
|
||||
* Deprecate remaining playground transformers and abstract references.
|
||||
|
||||
## 4.7.13
|
||||
|
||||
* **Bug Fix**
|
||||
* Handle comments on use strict directives.
|
||||
* Fix assignment patterns with a left side pattern.
|
||||
* **Polish**
|
||||
* Special case `this` when doing expression memoisation.
|
||||
|
||||
## 4.7.12
|
||||
|
||||
* **Bug Fix**
|
||||
* Deprecate `playground.methodBinding`.
|
||||
|
||||
## 4.7.11
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix unicode regexes stripping their unicode flag before being passed on two `regexpu`.
|
||||
|
||||
## 4.7.10
|
||||
|
||||
* **Internal**
|
||||
* Deprecate `playground.methodBinding` and `playground.objectGetterMemoization`.
|
||||
* **Bug Fix**
|
||||
* Fix `inputSourceMap` option. Thanks [@Rich-Harris](https://github.com/Rich-Harris)!
|
||||
|
||||
## 4.7.9
|
||||
|
||||
* **Polish**
|
||||
* Allow `inputSourceMap` to be set to `false` to skip the source map inference.
|
||||
* Infer computed literal property names.
|
||||
* **Bug Fix**
|
||||
* Fix nested labeled for-ofs.
|
||||
* Fix block scoping `break` colliding with the parent switch case.
|
||||
* **Internal**
|
||||
* Upgrade `acorn-babel`.
|
||||
|
||||
## 4.7.8
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix computed classes not properly setting symbols.
|
||||
|
||||
## 4.7.7
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `types` API exposure.
|
||||
|
||||
## 4.7.6
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix non-Identifier/Literal computed class methods.
|
||||
* **Polish**
|
||||
* Add a fallback if `stack` on an error is unconfigurable.
|
||||
* Hoist `esModule` module declarations to the top of the file to handle circular dependencies better.
|
||||
|
||||
## 4.7.5
|
||||
|
||||
* **Bug Fix**
|
||||
* Don't remap` break`s to call the iterator return.
|
||||
* **Polish**
|
||||
* Use a different helper for computed classes for much nicer output. Also fixes a bug in symbols being non-enumerable so they wouldn't be set on the class.
|
||||
|
||||
## 4.7.4
|
||||
|
||||
* **Bug Fix**
|
||||
* Rewrite named function expressions in optional async function transformers.
|
||||
* Hoist directives.
|
||||
* Remove `Number` from the list of valid `runtime` constructors.
|
||||
* **Internal**
|
||||
* `spec.typeofSymbol` transformer has been renamed to `es6.symbols`.
|
||||
|
||||
## 4.7.2
|
||||
|
||||
* **New Feature**
|
||||
* `"both"` option for `sourceMap`.
|
||||
* Add output types to external helpers. Thanks [@neVERberleRfellerER](https://github.com/neVERberleRfellerER)!
|
||||
* **Bug Fix**
|
||||
* Fix node duplication sometimes resulting in a recursion error.
|
||||
* Ignore `break`s within cases inside `for...of`.
|
||||
* **Polish**
|
||||
* Split up variable declarations and export declarations to allow easier transformation.
|
||||
|
||||
## 4.7.0
|
||||
|
||||
* **Bug Fix**
|
||||
* Add `alternate` to list of `STATEMENT_OR_BLOCK` keys.
|
||||
* Add support for module specifiers to `t.isReferenced`.
|
||||
* **New Feature**
|
||||
* Add `inputSourceMap` option.
|
||||
* **Polish**
|
||||
* Throw an error on different `babel` and `babel-runtime` versions.
|
||||
* Replicate module environment for `babel-node` eval.
|
||||
* Clean up classes output.
|
||||
* **Spec Compliancy**
|
||||
* Make it illegal to use a rest parameter on a setter.
|
||||
|
||||
## 4.6.6
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix incorrect method call in `utility.deadCodeElimination` transformer.
|
||||
* Fix `es6.blockScopingTDZ` transformer duplicating binding nodes.
|
||||
|
||||
## 4.6.5
|
||||
|
||||
* **Internal**
|
||||
* `useStrict` transformer has been renamed to `strict`.
|
||||
|
||||
## 4.6.4
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `ForOfStatement` not proplery inheriting labels.
|
||||
* When in closure mode in block scoping transformer, properly check for variable shadowing.
|
||||
* **New Feature**
|
||||
* New `utility.inlineEnvironmentVariables` and `utility.inlineExpression` transformers.
|
||||
|
||||
## 4.6.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `arguments` being incorrectly aliased in arrow function rest parameter optimisation.
|
||||
* Make deoptimisation trigger safer.
|
||||
* **New Feature**
|
||||
* Flow types are now retained when blacklisting the `flow` transformer.
|
||||
|
||||
## 4.6.1
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix generators in template directory being transformed.
|
||||
* Fix exposure of `util` for plugins.
|
||||
|
||||
## 4.6.0
|
||||
|
||||
* **New Feature**
|
||||
* Desugar sticky regexes to a new constructor expression so it can be handled by a polyfill.
|
||||
* **Spec Compliancy**
|
||||
* `for...of` now outputs in a lengthy `try...catch` this is to ensure spec compliancy in regards to iterator returns and abrupt completions. See [google/traceur-compiler#1773](https://github.com/google/traceur-compiler/issues/1773) and [babel/babel/#838](https://github.com/babel/babel/issues/838) for more information.
|
||||
* **Polish**
|
||||
* Rest parameters that are only refered to via number properties on member expressions are desugared into a direct `arguments` reference. Thanks [@neVERberleRfellerER](https://github.com/neVERberleRfellerER)!
|
||||
* `$ babel` no longer exits on syntax errors.
|
||||
* **Internal**
|
||||
* Upgrade `browserify`.
|
||||
* Upgrade `source-map`.
|
||||
* Publicly expose more internals.
|
||||
|
||||
## 4.5.5
|
||||
|
||||
* **Polish**
|
||||
* Delete old extensions when overriding them in `babel/register`.
|
||||
|
||||
## 4.5.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix whitelisting logic for helper build script.
|
||||
|
||||
## 4.5.2
|
||||
|
||||
* **New Feature**
|
||||
* `returnUsedHelpers` option and add whitelist to `buildHelpers`.
|
||||
* **Bug Fix**
|
||||
* Fix function arity on self referencing inferred named functions.
|
||||
* **Internal**
|
||||
* Bump `acorn-babel`.
|
||||
* Start converting source to ES6...
|
||||
|
||||
## 4.5.1
|
||||
|
||||
**Babel now compiles itself!**
|
||||
|
||||

|
||||
|
||||
## 4.5.0
|
||||
|
||||
* **New Feature**
|
||||
* Add `.babelrc` support.
|
||||
* **Bug Fix**
|
||||
* Move use strict directives to the module formatter bodies.
|
||||
* **Internal**
|
||||
* Make default `bin/babel` behaviour to ignore non-compilable files and add a `--copy-files` flag to revert to the old behaviour.
|
||||
|
||||
## 4.4.6
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix extending a class expression with no methods/only constructor. Thanks [@neVERberleRfellerER](https://github.com/neVERberleRfellerER)!
|
||||
* Allow `MemberExpression` as a valid `left` of `ForOfStatement`.
|
||||
* **Polish**
|
||||
* Throw an error when people try and transpile code with the `@jsx React.DOM` pragma as it conflicts with the custom jsx constructo method detection.
|
||||
* Crawl all comments for `@jsx` pragma.
|
||||
* **Internal**
|
||||
* Upgrade `chalk`.
|
||||
* Upgrade `core-js`.
|
||||
|
||||
## 4.4.5
|
||||
|
||||
* **Internal**
|
||||
* Remove function self reference optimisation.
|
||||
|
||||
## 4.4.4
|
||||
|
||||
* **Bug Fix**
|
||||
* Handle inferred function ids to be reassigned and deopt to a slower but working equivalent.
|
||||
* Don't unpack array patterns that have more elements than their right hand array expression.
|
||||
* **Polish**
|
||||
* Improve syntax highlighting in the code frame. Thanks [@lydell](https://github.com/lydell)!
|
||||
* **Internal**
|
||||
* Upgrade `acorn-babel`.
|
||||
|
||||
## 4.4.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `for...of` iterator break returns being duplicated.
|
||||
* Only call `return` on the iterator if it exists.
|
||||
* **Internal**
|
||||
* Rename `selfContained` transformer to `runtime`.
|
||||
|
||||
## 4.4.2
|
||||
|
||||
* **New Feature**
|
||||
* Add `moduleId` option for specifying a custom module id.
|
||||
|
||||
## 4.4.0
|
||||
|
||||
* **New Feature**
|
||||
* `/*** @jsx NAMESPACE **/` comments are now honored by the `react` transformer.
|
||||
* `getModuleName` option.
|
||||
* Infer function expression names. Thanks [@RReverser](https://github.com/RReverser)!
|
||||
* **Bug Fix**
|
||||
* Add proper control flow for tail recursion optimisation.
|
||||
* **Internal**
|
||||
* Remove useless `format` options and move the `format.compact` option to `format`.
|
||||
* **Polish**
|
||||
* Newline handling of the code generator has been heavily improved.
|
||||
* Code generator now deopts whitespace if the input size is >100KB.
|
||||
|
||||
## 4.3.0
|
||||
|
||||
* **Breaking Change**
|
||||
* Remove `commonStandard` module formatter and make it the default behaviour of all the strict module formatters.
|
||||
|
||||
## 4.2.1
|
||||
|
||||
* **Polish**
|
||||
* Add auxiliary comment to let scoping closure flow control.
|
||||
|
||||
## 4.2.0
|
||||
|
||||
* **Polish**
|
||||
* Use an assignment instead of a define for `__esModule` in loose mode.
|
||||
* **Internal**
|
||||
* Add error for `eval();` usage and enable strict mode for parsing.
|
||||
|
||||
## 4.1.0
|
||||
|
||||
* **New Feature**
|
||||
* Add `BABEL_CACHE_PATH` and `BABEL_DISABLE_CACHE` environment variables.
|
||||
* **Internal**
|
||||
* Replace many internal util functions with modules. Thanks [@sindresorhus](https://github.com/sindresorhus)!
|
||||
|
||||
## 4.0.2
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix generators not properly propagating their internal declarations.
|
||||
* **Polish**
|
||||
* Update setter param length error message.
|
||||
* Use ranges on dependencies.
|
||||
|
||||
## 4.0.0
|
||||
|
||||
* 6to5 is now known as Babel.
|
||||
* Global helpers/runtime has now been given the more descriptive name of "external helpers".
|
||||
839
.github/CHANGELOG-v5.md
vendored
Normal file
839
.github/CHANGELOG-v5.md
vendored
Normal file
@@ -0,0 +1,839 @@
|
||||
# Babel v5 Changelog
|
||||
|
||||
## 5.8.26
|
||||
|
||||
* **Internal**
|
||||
* Republish to get fix for runtime `typeof-react-element` helper.
|
||||
|
||||
## 5.8.25
|
||||
|
||||
* **Internal**
|
||||
* Rename `define` method to avoid webpack assuming those files are AMD.
|
||||
|
||||
## 5.8.24
|
||||
|
||||
* **Spec Compliancy**
|
||||
* Updated `optimisation.react.inlineElements` transformer to React 0.14 output. Thanks [@spicyj](https://github.com/spicyj)!
|
||||
* **Polish**
|
||||
* Add support for evaluating more static nodes. Thanks [@hzoo](https://github.com/hzoo)!
|
||||
|
||||
## 5.8.23
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix a bug where pushed scope bindings weren't properly being registered.
|
||||
|
||||
## 5.8.22
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix bug causing regexes to cause a syntax error after a block.
|
||||
* **Internal**
|
||||
* Expose `File`.
|
||||
|
||||
## 5.8.21
|
||||
|
||||
* **New Feature**
|
||||
* Add support for Flow export types.
|
||||
* **Bug Fix**
|
||||
* Fix flow type annotations on object properties being lost.
|
||||
* Fix bug effecting nested arrow functions.
|
||||
* Check valid `export default` `function`/`class` token when parsing export default before converting to a declaration to avoid turning expressions into declarations.
|
||||
* **Polish**
|
||||
* Add an exception to non-existent bindings when checking if we need to wrap block scoping blocks in a closure.
|
||||
* Make comment retainment for multiple replacement nodes more predictable.
|
||||
* **Internal**
|
||||
* Remove `operator` property from `AssignmentPattern` nodes.
|
||||
* Update `es7.asyncFunctions` and `es7.objectRestSpread` to stage 2.
|
||||
|
||||
## 5.8.13-5.8.20
|
||||
|
||||
**The CHANGELOG was broken for these releases. Git tags were not pushed in the correct order and are therefore incorrect. It's recommended you NOT use any versions within this range.**
|
||||
|
||||
* **New Feature**
|
||||
* Add `es6.spec.modules` transformer.
|
||||
* **Bug Fix**
|
||||
* Don't register export declarations as a module binding.
|
||||
* Register import bindings to the specifier instead of the declaration.
|
||||
* `export *` should not export `default`.
|
||||
* Clear `rawValue from JSX attribute values to avoid outputting the raw source verbatim.
|
||||
* Add support for boolean flow literals.
|
||||
* Fix bug where files that babel can compile weren't being written when ignored with the `--copy-files` flag.
|
||||
* Create new raw identifiers instead of cloning the original user one when exploding export specifiers to fix source map issues resulting in incorrect locations.
|
||||
* Break on hitting a terminator paren triggering character to avoid pushing multiple starting parens.
|
||||
* Consider comment starting character to be a terminatorless separator to avoid starting comments breaking terminatorless nodes.
|
||||
* **Internal**
|
||||
* Use `json5` for parsing `.babelrc` files and `JSON` for `package.json`.
|
||||
* Update Regenerator dependency to `0.8.35`.
|
||||
* Remove flow types from being scope tracked.
|
||||
* **Polish**
|
||||
* Only register export declarations in scope tracking if they're of a valid type.
|
||||
* Only output code frame and message on syntax errors in CLI.
|
||||
* Set decorated initialisers that have no `initialiser` to `undefined`.
|
||||
* Optimise common `typeof` cases in `es6.spec.symbols` transformer.
|
||||
|
||||
## 5.8.12
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix bug in lookahead causing decorators to be cleared.
|
||||
|
||||
## 5.8.11
|
||||
|
||||
* **Bug Fix**
|
||||
* Check if module options are nully instead of falsy to allow empty strings as `moduleRoot` etc.
|
||||
* Fix bug where reassigning the rest parameter wouldn't result in a deoptimisation.
|
||||
|
||||
## 5.8.9
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix issue in parser where the flow plugin wasn't using state to refer to whether it as in a type or not causing lookaheads to cause breakages.
|
||||
|
||||
## 5.8.8
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix comments not being attached if they're touching the start of their node.
|
||||
|
||||
## 5.8.7
|
||||
|
||||
* Never published, environment issues, again.
|
||||
|
||||
## 5.8.6
|
||||
|
||||
* **Bug Fix**
|
||||
* Remove `rawValue` for JSX inner text.
|
||||
|
||||
## 5.8.5
|
||||
|
||||
* **Polish**
|
||||
* Rewrite parentheses insertion for terminatorless nodes such as `BreakStatement` to be much more stable and cleaner.
|
||||
* Use `Object.setPrototypeOf` and fallback to `__proto__` in `inherits` helper.
|
||||
|
||||
## 5.8.2-5.8.4
|
||||
|
||||
Issues with publish process.
|
||||
|
||||
## 5.8.1
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix regression where async arrow functions couldn't have type annotation parameters.
|
||||
* Output type annotations of type instantiation parameters.
|
||||
* **Polish**
|
||||
* Prepend to highest loop when performing rest parameter allocation optimisation.
|
||||
* Add comment attachment to parser.
|
||||
* Add support for retaining inner comments of empty blocks.
|
||||
|
||||
## 5.8.0
|
||||
|
||||
* Never released due to publish environment issues.
|
||||
|
||||
## 5.7.4
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix comments containg `@flow` being completely removed from output rather than just the specific directive.
|
||||
|
||||
## 5.7.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Add shim file for broken file path that old versions of the CLI would attempt to use.
|
||||
|
||||
## 5.7.2
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix performance issue in code generator when comment columns would attempt to match up in `compact` mode causing large amounts of whitespace.
|
||||
* Fix single line comments not outputting a newline in `compact` mode.
|
||||
* **Polish**
|
||||
* Add support for flow return types for arrow functions.
|
||||
|
||||
## 5.7.1
|
||||
|
||||
* **Bug Fix**
|
||||
* Add back mistakenly removed `replaceWithSourceString` method.
|
||||
|
||||
## 5.7.0
|
||||
|
||||
* **Bug Fix**
|
||||
* Deopt on spread elements when performing array destructuring unpack optimisation.
|
||||
* **New Feature**
|
||||
* Add `shouldPrintComment` option to control comment output.
|
||||
* Add `.babelignore` file to be consistent with other tools.
|
||||
* Allow `.babelrc` configs to be specified via `package.json`.
|
||||
* **Polish**
|
||||
* Don't ignore comments when using `compact: true` option.
|
||||
* Add support for Flow `import typeof`.
|
||||
* Fix incorrect inheritance method position when using loose mode classes and constructor isn't the first item.
|
||||
* **Internal**
|
||||
* Completely fork Acorn with `babylon`.
|
||||
* Rewrite build system to accommodate for multiple packages.
|
||||
|
||||
## 5.6.17
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `CodeGenerator.findCommonStringDelimiter` causing a stack overflow.
|
||||
|
||||
## 5.6.16
|
||||
|
||||
* **Internal**
|
||||
* Fix `recast` version to avoid pulling in a newer version.
|
||||
* **New Feature**
|
||||
* Add support for functions in `util.shouldIgnore`.
|
||||
* **Polish**
|
||||
* Strip flow directives in flow transformer.
|
||||
* Add a check for out of bounds default parameters, drastically improving performance and removes engine deoptimisations.
|
||||
* Various performance optimisations by [@samccone](https://github.com/samccone) 💅✨
|
||||
* Delay `this` assignment when referencing this inside an arrow function pre-bare super in derived class constructors.
|
||||
* Split up class body pushing if the constructor is in the wrong order.
|
||||
* **Bug Fix**
|
||||
* Fix hoisting of `ForInStatement` `init` variables in `system` module formatter.
|
||||
* `PathHoister`: Don't hoist to the same function as their original paths function parent.
|
||||
* `PathHoister`: Push each violation paths ancestry to the breakOnScopePaths collection to avoid constant hoisting to nested paths.fix tail call recursion on functions with less arguments than parameters.
|
||||
* Disallow `super.*` before `super()` in derived class constructors.
|
||||
* Properly regenerate scope for replaced nodes. Thanks [@loganfsmyth](https://github.com/loganfsmyth)!
|
||||
* Move up template literal simplification logic to avoid breaking on single elements.
|
||||
|
||||
## 5.6.13-5.6.15
|
||||
|
||||
* Setting up automatic Travis releases.
|
||||
|
||||
## 5.6.12
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix finding parent for top-level shadowed functions.
|
||||
|
||||
## 5.6.11
|
||||
|
||||
** **Internal**
|
||||
* Merge `es6.parameters.rest` and `es6.parameters.default` transformers. See commit [c0fd4c1f9e0b18231f585c4fa793e4cb0e01aed1](https://github.com/babel/babel/commit/c0fd4c1f9e0b18231f585c4fa793e4cb0e01aed1) for more info.
|
||||
|
||||
## 5.6.10
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix faulty internal require check.
|
||||
* **Polish**
|
||||
* Add support for trailing commas in arrow function parameter lists.
|
||||
|
||||
## 5.6.8
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix binary expressions colliding with unary expression operators in compact mode.
|
||||
* Fix node properties being set to `null` when using computed properties.
|
||||
|
||||
## 5.6.7
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix hoisting of `ForXStatement` `left` `var`s when inserting a block scoping IIFE.
|
||||
* **Polish**
|
||||
* Combine all leading computed property initialisers into the root object in loose mode.
|
||||
* **Internal**
|
||||
* Deprecate returning of replacement strings from visitor methods.
|
||||
|
||||
## 5.6.6
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix weird parser bug where `void` type annotations were being parsed as keywords causing the tokeniser to lose track of context.
|
||||
|
||||
## 5.6.5
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix nested functions causing rest parameter optimisation to not properly detect when it should deopt on a reference.
|
||||
* **Internal**
|
||||
* Update Regenerator `0.8.31`.
|
||||
|
||||
## 5.6.4
|
||||
|
||||
* **Internal**
|
||||
* Add `ParenthesizedExpression` node type.
|
||||
|
||||
## 5.6.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix rest parameter array allocation loop being incorrectly aliased.
|
||||
|
||||
## 5.6.2
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix method key literals not turning into computed member expression in loose mode.
|
||||
* Elect rest parameters in spread element position as candidates instead of replacing them in place.
|
||||
|
||||
## 5.6.0
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix istanbul interop for register hook when registering for non-existence extension.
|
||||
* Fix super class constructor call differing for no constructor in derived classes.
|
||||
* Disable module import receiver when in loose mode.
|
||||
* Fix duplicate filenames when using `babel` CLI when passing multiple matching patterns.
|
||||
* Register labels as bindings to fix undeclared variable checks.
|
||||
* **Polish**
|
||||
* Remove unnecessary string binary expressions when transforming template literals.
|
||||
* Support module live bindings in arbitary positions not in Program statement position.
|
||||
* Throw error when attemping to replace a `Program` root node with another node not of type `Program`.
|
||||
* Optimise rest parameters in spread element position and allocate rest array at the earliest common ancestor of all references.
|
||||
* Generate original number representation when value was not changed.
|
||||
* Check for invalid binding identifiers when generating inferred method names.
|
||||
* Don't terminate CLI when watching files fail compilation on init.
|
||||
* **New Feature**
|
||||
* Add new plugin API.
|
||||
* **Internal**
|
||||
* Split react displayName addition into a plugin.
|
||||
* Add check for `JSXMemberExpression` to `t.isReferenced`.
|
||||
* Move `validation.undeclaredVariableCheck` transformer up.
|
||||
* Start great core-to-plugin exodus.
|
||||
* Add `BindingIdentifier` virtual type.
|
||||
* Hidden class optimisations.
|
||||
* Array allocation optimisations.
|
||||
* Update `regenerator`.
|
||||
* Update `js-tokens`.
|
||||
* Sync with upstream Acorn.
|
||||
|
||||
## 5.5.8
|
||||
|
||||
* **Internal**
|
||||
* Remove extremely unprofessional and harsh error message for those hotlinking to `resolve-rc`.
|
||||
|
||||
## 5.5.7
|
||||
|
||||
* **Bug Fix**
|
||||
* Push newline after decorators when doing code gen.
|
||||
* Rewriting error handling to normalise options before merging them.
|
||||
* Remove duplicate keys in `alias-keys.json` causing errors in strict mode.
|
||||
* Fix `$ babel --help` not showing optional transformers as such.
|
||||
* **New Feature**
|
||||
* Add `auxiliaryCommentBefore` and `auxiliaryCommentAfter` options.
|
||||
|
||||
## 5.5.6
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `let` binding collision in loop head not properly replacing `AssignmentExpression`s.
|
||||
|
||||
## 5.5.5
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `file.opts` not being set before `file.log.deprecate` was called causing a `ReferenceError` as it was checking for a property on it.
|
||||
|
||||
## 5.5.4
|
||||
|
||||
* **Bug Fix**
|
||||
* Add back missing `shouldIgnore` check.
|
||||
* Log message on deprecated options rather than throw an error.
|
||||
* Fix name of `auxiliaryComment` option when attempting Istanbul interop in `babel/register`.
|
||||
|
||||
## 5.5.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix weird state bug when traversing overa `node` `ClassProperty` instead of `path` in the `es6.classes` transformer.
|
||||
|
||||
## 5.5.2
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `NodePath#isPure` on `Property` nodes.
|
||||
* Use cwd instead of entry file directory when working out relative directory for `babel/register`.
|
||||
* **Internal**
|
||||
* Add scary warning for those few who choose to use the WIP experimental transformers.
|
||||
|
||||
## 5.5.1
|
||||
|
||||
* **Bug Fix**
|
||||
* Remove `ClassProperty` nodes always in the `Flow` transformer. This is fine now since class properties aren't supported in any engine that supports classes but the `es7.classProperties` transformer will need to be updated in the future to desugar to ES6 classes instead of relying on the `es6.classes` transformer from being ran.
|
||||
|
||||
## 5.5.0
|
||||
|
||||
* **Bug Fix**
|
||||
* Allow pushing declarations to `SwitchStatement`s.
|
||||
* Fix `minification.removeDebugger` to remove `DebuggerStatement`s rather than `ExpressionStatement`s with an identifier of `debugger`.
|
||||
* Check LHS in `ForInStatement` and `ForOfStatement` for constant violations.
|
||||
* Register function `id` as a reference when naming methods to avoid collisions.
|
||||
* Support key literals when checking for the existence of `displayName` property when attempting to add it for `React.createClass`.
|
||||
* Remove `ExportDefaultSpecifier` check from `t.isDefaultSpecifier`.
|
||||
* Don't consider `JSXIdentifier` HTML tag identifiers to be references.
|
||||
* **Polish**
|
||||
* Update `minification.deadCodeElimination` transformer to remove all statements after completion statements.
|
||||
* Update `minification.deadCodeElimination` transformer to not inline single used bindings that exist in different scopes.
|
||||
* When performing Istanbul interop in `babel/register`, add the auxiliary comment `"istanbul ignore text"` to get more accurate coverage.
|
||||
* Add `--nolazy` argument to `babel-node`.
|
||||
* Add support for `cluster` forking.
|
||||
* Perform scope tracking in a single pass instead of multiple.
|
||||
* Smarten up type inferrence and resolution to support the whole array of language constructs.
|
||||
* Optimise module metadata retrieval into a single pass.
|
||||
* Ignore trailing commas when inferring newlines.
|
||||
* Rename `minification.inlineExpressions` transformer to `minification.constantFolding`.
|
||||
* Check path relative to entry file when checking to see if we're inside `node_modules` when using `babel/register`.
|
||||
* Upgrade `regenerator`.
|
||||
|
||||
## 5.4.7
|
||||
|
||||
* **Bug Fix**
|
||||
* Don't consider `JSXAttribute` `names` to be valid `ReferencedIdentifier`s.
|
||||
|
||||
## 5.4.6
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `spec.functionName` transformer incorrectly attempting to rename a binding that doesn't exist as it's a global.
|
||||
* **Internal**
|
||||
* Deprecate custom module formatters.
|
||||
|
||||
## 5.4.5
|
||||
|
||||
* **Bug Fix**
|
||||
* Add `JSXIdentifier` as a valid `ReferencedIdentifier` visitor virtual type.
|
||||
* Ignore `CallExpression` `_prettyCall` when the `retainLines` option is enabled.
|
||||
* Inherit comments to new declaration node when exploding module declarations.
|
||||
* Fix `es6.tailCall` transformer failing on calls that exceed the max parameters of the function.
|
||||
|
||||
## 5.4.4
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix bug where replacing variable declarations in the head of a `for` loop would turn them into `ExpressionStatement`s.
|
||||
* Fix renaming of assignment expressions that were non-identifiers ie. patterns.
|
||||
* Force space before `class` `id` to avoid breaking named classes when using `compact` mode.
|
||||
* Add assignment pattern explosion to avoid initial duplicate nodes.
|
||||
* Ignore this and arguments when performing TCO on shadowed functions.
|
||||
* **Polish**
|
||||
* Rename `sourceMapName` option to `sourceMapTarget`. Thanks [@getify](https://github.com/getify)!
|
||||
* Better detection of completion records, ignore those in `Function`s.
|
||||
* Clarified descriptions of the options that are enabled by default.
|
||||
* Resolve `\`babel-plugin-${name}\`` plugin names **before** just checking the `name`. Thanks [@jquense](https://github.com/jquense)!
|
||||
* Update AMD module formatter to add import default remapping.
|
||||
|
||||
## 5.4.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `module` being incorrectly rewritten when used as in an export declaration.
|
||||
* When performing single-reference inlining, ensure that the single reference isn't a child of the binding itself.
|
||||
* Fix a bug in `minification.deadCodeElimination` where a new binding instance was being created for local class bindings instead of just inheriting the parent one.
|
||||
* Fix bug with paren printing in `compact` and `retainLines` mode where a left paren was already printed before catching up.
|
||||
* **Internal**
|
||||
* Handle contexts for paths much better. This will ensure that the path node location info is in sync.
|
||||
|
||||
## 5.4.2
|
||||
|
||||
* **Polish**
|
||||
* `ignore` and `only` patterns are now **very** liberal. The pattern can now exist anywhere in the path.
|
||||
|
||||
## 5.4.1
|
||||
|
||||
* **Bug Fix**
|
||||
* Add missing `slash` dependency. Thanks [@browncolyn](https://github.com/browncolyn)!
|
||||
* **Polish**
|
||||
* Clean up `shouldIgnore` algorithm to work how you'd expect rather than being a hacky piece of shit. It now crawls the entire path, checking each section of it against the input ignore/only patterns. This means that the pattern `foo` will ignore the paths `foo/bar.js`, `bar/foo` etc.
|
||||
|
||||
## 5.4.0
|
||||
|
||||
* **New Feature**
|
||||
* Added [function bind syntax](https://github.com/zenparsing/es-function-bind) behind stage 0. Thanks [@RReverser](https://github.com/rreverser)!
|
||||
* Added `env` option. Especially handy when using the `.babelrc`.
|
||||
* **Bug Fix**
|
||||
* Fix files not properly being ignored when `babel.transform` ignores them when using `$ babel`.
|
||||
* Fix scope tracking registering loop head bindings to their `VariableDeclaration` instead of `VariableDeclarator`.
|
||||
* **Polish**
|
||||
* Normalise path separators for souce map paths when using `$ babel`.
|
||||
* Rework `PathHoister` to ignore global references and to not deopt on reassignments to referenced bindings, instead it tries to hoist to the highest scope.
|
||||
* Added missing exponential operator inlining. Thanks [@nkt](https://github.com/nkt)!
|
||||
* Optimise `regenerator` transformer. Thanks [@benjamn](https://github.com/benjamn)!
|
||||
|
||||
## 5.3.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `minification.deadCodeElimination` transformer incorrectly trying to inline import declarations.
|
||||
* Fix `minification.inlineExpression` transformer getting into an infinite loop.
|
||||
|
||||
## 5.3.2
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix patterns not being considered when hoisting variables in the `es6.blockScoping` transformer.
|
||||
|
||||
## 5.3.1
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix unique export specifiers not being cloned when exploding class and function exports,
|
||||
* **Polish**
|
||||
* Turn import remaps to sequence expressions to remove their context and improve performance.
|
||||
|
||||
## 5.3.0
|
||||
|
||||
**Speeeeeeed**
|
||||
|
||||

|
||||
|
||||
* **Spec Compliancy**
|
||||
* Allow trailing param commas for methods when using the `es7.trailingCommas` transformer.
|
||||
* **Bug Fix**
|
||||
* Fix `es6.blockScoping` transformer not properly ignoring `break` in `SwitchCase`.
|
||||
* Fix lookahead context saving to avoid weird tokenizer state.
|
||||
* Explode duplicate identifiers in export/import specifiers and property shorthand to create unique objects.
|
||||
* Skip loose mode for class methods when they have decorators.
|
||||
* When removing nodes, share their comments with their siblings.
|
||||
* Properly hoist temp param declarations when doing TCO.
|
||||
* **Internal**
|
||||
* Add `--harmony_generators` flag to `$ babel-node`.
|
||||
* Internal AST traversals have been minimised **drastically**. Transformers have been grouped together which means entire tree traversals are much fewer. Visiting nodes is now also skipped if the traversal context can detect that the handler is a noop. This sames precious cycles as it avoids constructing traversal paths and creating a new traversal context. See issues [#1472](https://github.com/babel/babel/issues/1472) and [#1486](https://github.com/babel/babel/issues/1486) for related discussion.
|
||||
* **Polish**
|
||||
* Move many `utility` transformers to `minification`.
|
||||
|
||||
## 5.2.17
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix auxiliary comments not properly being attached to function declaration helpers.
|
||||
* Add `Super` node type to `ast-types` patch.
|
||||
* Ignore parameter bindings when attempting to inline them in the `minification.deadCodeElimination` transformer.
|
||||
* Correct `extensions` arguments when using the Babel CLI.
|
||||
|
||||
## 5.2.16
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix plugins being disabled when using the whitelist.
|
||||
* Fix correct function scope being passed to `nameMethod.property` when inferring the function name for class methods.
|
||||
* Fix incorrect extensions reference causing weird issues when using the Babel CLI.
|
||||
* Fix destructuring param reference replacements not inheriting from their original param.
|
||||
* **Spec Compliancy**
|
||||
* Fix order that method decorators are ran in.
|
||||
|
||||
## 5.2.15
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix initializer descriptor add attempt if it doesn't exist.
|
||||
|
||||
## 5.2.14
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix bug with initializer decorators where the descriptors weren't being defined if there was no `initializer` property.
|
||||
* **Internal**
|
||||
* Expose `retainLines` option to CLI.
|
||||
* Fix `retainLines` option not being taken into consideration when doing multiple variable declaration declarators generation.
|
||||
* Expose minified and unminified copies of dist scripts.
|
||||
|
||||
## 5.2.13
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `ExportDeclaration`s being incorrectly removed when using the `utility.deadCodeElimination` transformer.
|
||||
* Fix position of `utility` transformers.
|
||||
* **New Feature**
|
||||
* Add built-in `esquery` support.
|
||||
* **Internal**
|
||||
* Consolidate notion of "virtual types".
|
||||
|
||||
## 5.2.12
|
||||
|
||||
* **Polish**
|
||||
* Make UID generation based on module declarations **much** nicer.
|
||||
* **Internal**
|
||||
* Remove internal check for traversal path replacement of self. This is a pattern that **could** come up in the wild and it could lead to pretty nasty code and may lead to internal regressions as the test coverage isn't 100% :( Instead, just put it in the fast path.
|
||||
|
||||
## 5.2.11
|
||||
|
||||
* **Internal**
|
||||
* Rename `getModuleName` option to `getModuleId`, doh.
|
||||
|
||||
## 5.2.10
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix numerous issues in `replaceWithSourceString`. Thanks [@pangratz](https://github.com/pangratz)!
|
||||
* **New Feature**
|
||||
* Add `getModuleName` option. Thanks [@jayphelps](https://github.com/jayphelps)!
|
||||
|
||||
## 5.2.9
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `_blockHoist` transformer incorrectly sorting nodes on shitty environments that aren't spec compliant in their key order.
|
||||
* Fix broken `parse` API method reference to an undeclared import.
|
||||
|
||||
## 5.2.7
|
||||
|
||||
* **Bug Fix**
|
||||
* Move `utility.deadCodeElimination` transformer up to avoid race conditions.
|
||||
* Fix shorthand property scope binding renaming.
|
||||
* **Polish**
|
||||
* Turn helper variable declarations into function declarations if possible.
|
||||
* **Internal**
|
||||
* Removed native inheritance support from classes.
|
||||
* Added `replaceWithSourceString` path API.
|
||||
* Split up `es3.propertyLiterals` and `es3.memberExpressionLiterals` transformers to `minfication.propertyLiterals` and `es3.memberExpressionLiterals`.
|
||||
|
||||
## 5.2.6
|
||||
|
||||
* **Internal**
|
||||
* Fix transformer aliases being accidently set as deprecated ones.
|
||||
* Expose `Pipeline` as `TransformerPipeline` instead.
|
||||
|
||||
## 5.2.5
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `parse` API not adding all the correct pipeline transformers.
|
||||
|
||||
## 5.2.4
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix race condition with the Node API being loaded awkwardly and not being able to initialise itself when used in the browser.
|
||||
* **Internal**
|
||||
* Expose `transform.pipeline`.
|
||||
|
||||
## 5.2.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix plugin containers being called with an undefined import. Thanks [@timbur](https://github.com/timbur)!
|
||||
* Allow Flow object separators to be commas. Thanks [@monsanto](https://github.com/monsanto)!
|
||||
* Add missing `Statement` and `Declaration` node aliases to flow types.
|
||||
|
||||
## 5.2.2
|
||||
|
||||
* **Internal**
|
||||
* Allow `util.arrayify` to take arbitrary types and coerce it into an array.
|
||||
|
||||
## 5.2.1
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix regression in `node/register` that caused `node_modules` to not be ignored.
|
||||
|
||||
## 5.2.0
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix plugin strings splitting arbitrarily on `:` which caused full paths on Windows to fail as they include `:` after the drive letter.
|
||||
* Call class property `initializer`s with their target instead of their descriptor.
|
||||
* Fix `ignore` and `only` not properly working on Windows path separators. Thanks [@stagas](https://github.com/stagas)!
|
||||
* Fix `resolveRc` running on files twice causing issues. Thanks [@lukescott](https://github.com/lukescott)!
|
||||
* Fix shorthand properties not correctly being target for `isReferenced` checks. Thanks [@monsanto](https://github.com/monsanto)!
|
||||
* **Polish**
|
||||
* Allow passing an array of globs to `babel/register` `only` and `ignore` options. Thanks [@Mark-Simulacrum](https://github.com/Mark-Simulacrum)!
|
||||
* When inferring function names that collide with upper bindings, instead of doing the wrapper, instead rename them.
|
||||
* Consider constant-like variable declaration functions to always refer to themselves so TOC can be performed.
|
||||
* Process globs manually when using `$ babel` as some shells such as Windows don't explode them. Thanks [@jden](https://github.com/jden)!
|
||||
* Add alternative way to execute plugins via a closure that's called with the current Babel instance.
|
||||
* **Internal**
|
||||
* Remove multiple internal transformers in favor of directly doing things when we need to. Previously, declarations such as `_ref` that we needed to create in specific scopes were done at the very end via the `_declarations` transformer. Now, they're done and added to the scope **right** when they're needed. This gets rid of the crappy `_declarations` property on scope nodes and fixes the crappy regenerator bug where it was creating a new `BlockStatement` so the declarations were being lost.
|
||||
* Rework transformer traversal optimisation. Turns out that calling a `check` function for **every single node** in the AST is ridiculously expensive. 300,000 nodes timesed by ~30 transformers meant that it took tens of seconds to perform while it's quicker to just do the unnecessary traversal. Seems obvious in hindsight.
|
||||
* **New Feature**
|
||||
* Add `jscript` transformer that turns named function expressions into function declarations to get around [JScript's horribly broken function expression semantics](https://kangax.github.io/nfe/#jscript-bugs). Thanks [@kondi](https://github.com/kondi)!
|
||||
* Add `@@hasInstance` support to objects when using the `es6.spec.symbols` transformer.
|
||||
* Add `retainLines` option that retains the line (but not the columns!) of the input code.
|
||||
|
||||
## 5.1.13
|
||||
|
||||
* **Polish**
|
||||
* Remove symbol check from `defineProperty` helper.
|
||||
|
||||
## 5.1.12
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `resolveModuleSource` not being ran on `ExportAllDeclaration`s.
|
||||
* Fix `.babelrc` being resolved multiple times when using the require hook.
|
||||
* Fix parse error on spread properties in assignment position.
|
||||
* Fix `externalHelpers` option being incorrectly listed as type `string`.
|
||||
* **Internal**
|
||||
* Upgrade `core-js` to `0.9.0`.
|
||||
* **Spec Compliancy**
|
||||
* Fix object decorators not using the `initializer` pattern.
|
||||
* Remove property initializer descriptor reflection.
|
||||
|
||||
## 5.1.11
|
||||
|
||||
* **Bug Fix**
|
||||
* Memoise and bind member expression decorators.
|
||||
* Move JSX children cleaning to opening element visitor. Fixes elements not being cleaned in certain scenarios.
|
||||
* Consider `SwitchStatement`s to be `Scopable`.
|
||||
* Fix `bluebirdCoroutines` calling `interopRequireWildcard` before it's defined.
|
||||
* Add space to `do...while` code generation.
|
||||
* Validate `super` use before `this` on `super` exit rather than entrance.
|
||||
* **Polish**
|
||||
* Add Babel name to logger.
|
||||
|
||||
## 5.1.10
|
||||
|
||||
* **Bug Fix**
|
||||
* Remove `makePredicate` from acorn in favor of an `indexOf`.
|
||||
* Remove statements to expression explosion when inserting a block statement.
|
||||
* **Internal**
|
||||
* Remove runtime compatibility check.
|
||||
|
||||
## 5.1.9
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix class property initializers with `undefined` values not being correctly writable.
|
||||
* Fix self inferring generators incorrectly causing a stack error.
|
||||
* Fix default export specifiers not triggering AMD `module` argument inclusion.
|
||||
* Fix assignments not having their module references properly remapped.
|
||||
* **Internal**
|
||||
* Upgrade to latest `acorn`.
|
||||
* **Polish**
|
||||
* Make invalid LHS pattern error messages nicer.
|
||||
|
||||
## 5.1.8
|
||||
|
||||
* **Bug Fix**
|
||||
* Only make parenthesized object pattern LHS illegal.
|
||||
|
||||
## 5.1.7
|
||||
|
||||
* **Internal**
|
||||
* Add `parse` node API.
|
||||
|
||||
## 5.1.6
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix `runtime` built-in catchall not properly checking for local variables.
|
||||
|
||||
## 5.1.5
|
||||
|
||||
* **Internal**
|
||||
* Bump `core-js` version.
|
||||
|
||||
## 5.1.4
|
||||
|
||||
* **Polish**
|
||||
* Add missing `Reflect` methods to runtime transformer.
|
||||
|
||||
## 5.1.3
|
||||
|
||||
* **Internal**
|
||||
* Switch entirely to vanilla regenerator.
|
||||
* Clean up and make the parsing of decorators stateless.
|
||||
* **Bug Fix**
|
||||
* Don't do TCO on generators and async functions.
|
||||
* Add missing `core-js` runtime definitions.
|
||||
|
||||
## 5.1.2
|
||||
|
||||
* **Bug Fix**
|
||||
* Add `getIterator` and `isIterable` to `babel-runtime` build script.
|
||||
|
||||
## 5.1.1
|
||||
|
||||
* **Bug Fix**
|
||||
* Add missing runtime symbol definitions.
|
||||
|
||||
## 5.1.0
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix super reference when using decorators.
|
||||
* Don't do array unpack optimisation when member expressions are present.
|
||||
* Add missing descriptors for undecorated class properties.
|
||||
* Don't consider `arguments` and `eval` valid function names when doing function name inferrence.
|
||||
* Fix scope tracking of constants in loop heads.
|
||||
* Parse `AwaitExpression` as a unary instead of an assignment.
|
||||
* Fix regex evaluation when attempting static evaluation.
|
||||
* Don't emit tokens when doing a lookahead.
|
||||
* Add missing `test` declaration to `utility.deadCodeElimination` transformer.
|
||||
* **Internal**
|
||||
* Upgrade `regenerator` to the latest and use my branch with the hope of eventually switching to vanilla regenerator.
|
||||
* Add support for the replacement of for loop `init`s with statements.
|
||||
* Upgrade dependencies.
|
||||
* **Polish**
|
||||
* When adding the scope IIFE when using default parameters, don't shadow the function expression, just `apply` `this` and `arguments` if necessary.
|
||||
* Use path basename as non-default import fallback.
|
||||
* **New Feature**
|
||||
* Add [trailing function comma proposal](https://github.com/jeffmo/es-trailing-function-commas). Thanks [@AluisioASG](https://github.com/AluisioASG)!
|
||||
* Add support for object literal decorators.
|
||||
* Make core-js modular when using the `runtime` transformer.
|
||||
|
||||
## 5.0.12
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix incorrect remapping of module references inside of a function id redirection container.
|
||||
|
||||
## 5.0.11
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix new `for...of` loops not properly inheriting their original loop.
|
||||
* **Internal**
|
||||
* Disable scope instance cache.
|
||||
* **Polish**
|
||||
* Allow comments in `.babelrc` JSON.
|
||||
|
||||
## 5.0.9
|
||||
|
||||
* **Polish**
|
||||
* Use `moduleId` for UMD global name if available.
|
||||
* **Bug Fix**
|
||||
* Fix UMD global `module` variable shadowing the `amd`/`common` `module` variable.
|
||||
* Fix Flow param type annotation regression.
|
||||
* Fix function name collision `toString` wrapper. Thanks [@alawatthe](https://github.com/alawatthe)!
|
||||
|
||||
## 5.0.8
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix falsy static class properties not being writable.
|
||||
* Fix block scoping collisions not properly detecting modules and function clashes.
|
||||
* Skip `this` before `super` for derived constructors on functions.
|
||||
|
||||
## 5.0.7
|
||||
|
||||
* **New Feature**
|
||||
* Add `--ignore` and `--only` support to the CLI.
|
||||
* **Bug Fix**
|
||||
* Remove `HOMEPATH` environment variable from home resolution in `babel/register` cache.
|
||||
* **Internal**
|
||||
* Disable WIP path resolution introducing infinite recursion in some code examples.
|
||||
* **Polish**
|
||||
* Add live binding to CommonJS default imports.
|
||||
|
||||
## 5.0.6
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix mangling of import references that collide with properties on `Object.prototype`.
|
||||
* Fix duplicate declarations incorrectly being reported for `var`.
|
||||
|
||||
## 5.0.5
|
||||
|
||||
* **Internal**
|
||||
* Upgrade `core-js`.
|
||||
* **Bug Fix**
|
||||
* Fix arrays not being supported in `util.list`.
|
||||
|
||||
## 5.0.4
|
||||
|
||||
* **Polish**
|
||||
* Check for top level `breakConfig` in `resolveRc`.
|
||||
|
||||
## 5.0.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Make relative location absolute before calling `resolveRc`.
|
||||
* **Internal**
|
||||
* Switch to global UID registry.
|
||||
* Add `breakConfig` option to prevent Babel from erroring when hitting that option.
|
||||
|
||||
## 5.0.1
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix duplicate declaration regression.
|
||||
* Fix not being able to call non-writable methods.
|
||||
|
||||
## 5.0.0
|
||||
|
||||
* **New Feature**
|
||||
* Decorators based on [@wycat's](https://github.com/wycats) [stage 1 proposal](https://github.com/wycats/javascript-decorators).
|
||||
* Class property initializers based on [@jeffmo's](https://github.com/jeffmo) [stage 0 proposal](https://gist.github.com/jeffmo/054df782c05639da2adb).
|
||||
* Export extensions based on [@leebyron's](https://github.com/leebyron) [stage 1 proposal](https://github.com/leebyron/ecmascript-more-export-from).
|
||||
* UMD module formatter now supports globals.
|
||||
* Add `es3.runtime`, `optimisation.react.inlineElements` and `optimisation.react.constantElements` transformers.
|
||||
* Add stage option that replaces the experimental one.
|
||||
* Allow ES7 transformer to be enabled via `optional` instead of only via `stage`.
|
||||
* Infer string quotes to use in the code generator.
|
||||
* Consider `export { foo as default };` to be the same as `export default foo;`.
|
||||
* Add `nonStandard` option that can be set to `false` to remove parser support for JSX and Flow.
|
||||
* Add `jsxPragma` option.
|
||||
* Automatically generate CLI options based on internal API options.
|
||||
* Add support for `.babelrc` on absolute paths.
|
||||
* Plugin API!
|
||||
* **Internal**
|
||||
* Export `options` in browser API.
|
||||
* Rewritten parser.
|
||||
* Don't block hoist when runtime transformer is enabled in system module formatter.
|
||||
* Rewritten the internal traversal and node replacement API to use "paths" that abstracts out node relationships.
|
||||
* **Polish**
|
||||
* JSX output is now more inline with the official JSX transformer.
|
||||
* Hoist block scoping IIFE - this improves memory usage and performance.
|
||||
* Better IIFE detection - references are now checked to see if they're referencing the binding we're searching for.
|
||||
* Check for import reassignments in constants transformer.
|
||||
* Make method definitions with expression bodies illegal.
|
||||
* Save register cache on tick instead of `SIGINT`.
|
||||
* Enable strict mode on babel-node eval flag.
|
||||
* **Bug Fixes**
|
||||
* Add support for live bindings. This change also increases the reliablity of export specifier renaming.
|
||||
* Add support for super update and non equals assignment expressions.
|
||||
* Rename shadow constructor binding in classes.
|
||||
* Seed next iteration bindings with previous fresh bindings when reassinging loop block scoped variables.
|
||||
* Fix new expression spread referencing the wrong constructor.
|
||||
* Call `resolveModuleSource` on dynamic imports.
|
||||
* Added `param` to list of duplicate declaration kinds.
|
||||
* **Breaking Changes**
|
||||
* The Babel playground has been removed.
|
||||
* ES7 Abstract References have been removed.
|
||||
* Experimental option has been removed in favor of a stage option.
|
||||
* Rename `returnUsedHelpers` to `metadataUsedHelpers`.
|
||||
|
||||
4016
.github/CHANGELOG-v6.md
vendored
Normal file
4016
.github/CHANGELOG-v6.md
vendored
Normal file
File diff suppressed because it is too large
Load Diff
59
.github/ISSUE_TEMPLATE.md
vendored
59
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,63 +1,6 @@
|
||||
<!---
|
||||
Thanks for filing an issue 😄 ! Before you submit, please read the following:
|
||||
|
||||
Check the other issue templates if you are trying to submit a bug report, feature request, or question
|
||||
Search open/closed issues before submitting since someone might have asked the same thing before!
|
||||
|
||||
If you have a support request or question please submit them to one of this resources:
|
||||
|
||||
* Slack Community: https://slack.babeljs.io/
|
||||
* StackOverflow: http://stackoverflow.com/questions/tagged/babeljs using the tag `babeljs`
|
||||
* Also have a look at the readme for more information on how to get support:
|
||||
https://github.com/babel/babel/blob/master/README.md
|
||||
|
||||
Issues on GitHub are only related to problems of Babel itself and we cannot answer
|
||||
support questions here.
|
||||
-->
|
||||
|
||||
Choose one: is this a bug report or feature request?
|
||||
|
||||
<!--- Provide a general summary of the issue in the title above -->
|
||||
|
||||
### Input Code
|
||||
<!--- If you're describing a bug, please let us know which sample code reproduces your problem -->
|
||||
<!--- If you have link to our REPL or a standalone repo please link that! -->
|
||||
|
||||
```js
|
||||
var your => (code) => here;
|
||||
```
|
||||
|
||||
### Babel/Babylon Configuration (.babelrc, package.json, cli command)
|
||||
<!--- If describing a bug, tell us what your babel configuration looks like -->
|
||||
|
||||
```js
|
||||
{
|
||||
"your": { "config": "here" }
|
||||
}
|
||||
```
|
||||
|
||||
### Expected Behavior
|
||||
<!--- If you're describing a bug, tell us what should happen -->
|
||||
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
||||
|
||||
### Current Behavior
|
||||
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
||||
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
||||
|
||||
### Possible Solution
|
||||
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||
<!--- or ideas how to implement the addition or change -->
|
||||
|
||||
### Context
|
||||
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||
|
||||
### Your Environment
|
||||
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||
|
||||
| software | version(s)
|
||||
| ---------------- | -------
|
||||
| Babel |
|
||||
| Babylon | <!-- This is only needed if you are using Babylon directly -->
|
||||
| node |
|
||||
| npm |
|
||||
| Operating System |
|
||||
|
||||
41
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
Normal file
41
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: 🐛 Bug Report
|
||||
about: If something isn't working as expected 🤔.
|
||||
|
||||
---
|
||||
|
||||
## Bug Report
|
||||
|
||||
**Current Behavior**
|
||||
A clear and concise description of the behavior.
|
||||
|
||||
**Input Code**
|
||||
- REPL or Repo link if applicable:
|
||||
|
||||
```js
|
||||
var your => (code) => here;
|
||||
```
|
||||
|
||||
**Expected behavior/code**
|
||||
A clear and concise description of what you expected to happen (or code).
|
||||
|
||||
**Babel Configuration (.babelrc, package.json, cli command)**
|
||||
|
||||
```js
|
||||
{
|
||||
"your": { "config": "here" }
|
||||
}
|
||||
```
|
||||
|
||||
**Environment**
|
||||
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
|
||||
- Node/npm version: [e.g. Node 8/npm 5]
|
||||
- OS: [e.g. OSX 10.13.4, Windows 10]
|
||||
- Monorepo [e.g. yes/no/Lerna]
|
||||
- How you are using Babel: [e.g. `cli`, `register`, `loader`]
|
||||
|
||||
**Possible Solution**
|
||||
<!--- Only if you have suggestions on a fix for the bug -->
|
||||
|
||||
**Additional context/Screenshots**
|
||||
Add any other context about the problem here. If applicable, add screenshots to help explain.
|
||||
20
.github/ISSUE_TEMPLATE/Feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/Feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: 🚀 Feature Request
|
||||
about: I have a suggestion (and may want to implement it 🙂)!
|
||||
|
||||
---
|
||||
|
||||
## Feature Request
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I have an issue when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen. Add any considered drawbacks.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Teachability, Documentation, Adoption, Migration Strategy**
|
||||
If you can, explain how users will be able to use this and possibly write out a version the docs.
|
||||
Maybe a screenshot or design?
|
||||
41
.github/ISSUE_TEMPLATE/Regression-v7.md
vendored
Normal file
41
.github/ISSUE_TEMPLATE/Regression-v7.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: 💥 v7 Regression
|
||||
about: Report an unexpected behavior in v7 from v6 (Check the upgrade guide first ✌️)
|
||||
|
||||
---
|
||||
|
||||
# v7 Regression
|
||||
|
||||
> First check out: https://new.babeljs.io/docs/en/next/v7-migration.html
|
||||
> Also a partial upgrade tool: https://github.com/babel/babel-upgrade
|
||||
|
||||
**Potential Commit/PR that introduced the regression**
|
||||
If you have time to investigate, what PR/date introduced this issue.
|
||||
|
||||
**Describe the regression**
|
||||
A clear and concise description of what the regression is.
|
||||
|
||||
**Input Code**
|
||||
<!--- If you have link to our REPL or a standalone repo please link that! -->
|
||||
|
||||
```js
|
||||
var your => (code) => here;
|
||||
```
|
||||
|
||||
**Babel Configuration (.babelrc, package.json, cli command)**
|
||||
|
||||
```js
|
||||
{
|
||||
"your": { "config": "here" }
|
||||
}
|
||||
```
|
||||
|
||||
**Expected behavior/code**
|
||||
A clear and concise description of what you expected to happen (or code).
|
||||
|
||||
**Environment**
|
||||
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
|
||||
- Node/npm version: [e.g. Node 8/npm 5]
|
||||
- OS: [e.g. OSX 10.13.4, Windows 10]
|
||||
- Monorepo [e.g. yes/no/Lerna]
|
||||
- How you are using Babel: [e.g. `cli`, `register`, `loader`]
|
||||
16
.github/ISSUE_TEMPLATE/Support_question.md
vendored
Normal file
16
.github/ISSUE_TEMPLATE/Support_question.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
name: 🤗 Support Question
|
||||
about: If you have a question 💬, please check out our Slack or StackOverflow!
|
||||
|
||||
---
|
||||
|
||||
--------------^ Click "Preview" for a nicer view!
|
||||
We primarily use GitHub as an issue tracker; for usage and support questions, please check out these resources below. Thanks! 😁.
|
||||
|
||||
---
|
||||
|
||||
* Slack Community Chat: https://babeljs.slack.com (you can sign-up at https://slack.babeljs.io/ for an invite)
|
||||
* StackOverflow: https://stackoverflow.com/questions/tagged/babeljs using the tag `babeljs`
|
||||
* Twitter: If it's just a quick question you can ping our Twitter: https://twitter.com/babeljs
|
||||
* Also have a look at the readme for more information on how to get support:
|
||||
https://github.com/babel/babel/blob/master/README.md
|
||||
24
.github/ISSUE_TEMPLATE/Support_us.md
vendored
Normal file
24
.github/ISSUE_TEMPLATE/Support_us.md
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: 🤝 Support us on Babel
|
||||
about: If you would like to support our efforts in maintaining this community-driven project 🙌!
|
||||
|
||||
---
|
||||
|
||||
--------------^ Click "Preview" for a nicer view!
|
||||
> Open Collective: https://opencollective.com/babel
|
||||
> Henry's Patreon: https://www.patreon.com/henryzhu
|
||||
|
||||
Help support Babel!
|
||||
|
||||
Babel has always been a community project, not really backed or owned by any single (or group) of companies. While some maintainers used to work at Facebook (and Henry at Adobe) no one was working on it full time and there certainly isn't a huge company or team anywhere doing all this work.
|
||||
|
||||
---
|
||||
|
||||
As a group of volunteers you can help us in a few ways
|
||||
|
||||
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](https://slack.babeljs.io/) for guidance). Companies should be paying their employees to contribute back to the open source projects they use everyday.
|
||||
- Giving funds by becoming one of our sponsors/donators!
|
||||
|
||||
If you'd like to sustain the future of the project as a whole, we have an [Open Collective](https://opencollective.com/babel) that you can donate to. This is a way for funds to be allocated to the core team.
|
||||
|
||||
You can also support [Henry](https://github.com/hzoo) directly since I [left my job to work on Babel and Open Source full time](https://twitter.com/left_pad/status/969793227862790144) at my [Patreon](https://www.patreon.com/henryzhu).
|
||||
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,8 +1,10 @@
|
||||
<!--
|
||||
Before making a PR please make sure to read our contributing guidelines
|
||||
Before making a PR, please read our contributing guidelines
|
||||
https://github.com/babel/babel/blob/master/CONTRIBUTING.md
|
||||
|
||||
For issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR. It should be underlined in the preview if done correctly.
|
||||
For issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR. (it should be underlined in the preview if done correctly)
|
||||
|
||||
If you are making a change that should have a docs update: submit another PR to https://github.com/babel/website
|
||||
-->
|
||||
|
||||
| Q | A <!--(Can use an emoji 👍) -->
|
||||
@@ -12,7 +14,7 @@ For issue references: Add a comma-separated list of a [closing word](https://hel
|
||||
| Major: Breaking Change? |
|
||||
| Minor: New Feature? |
|
||||
| Tests Added + Pass? | Yes
|
||||
| Documentation PR | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
|
||||
| Documentation PR Link | <!-- If only readme change, add `[skip ci]` to your commits -->
|
||||
| Any Dependency Changes? |
|
||||
| License | MIT
|
||||
|
||||
|
||||
12
.github/lock.yml
vendored
Normal file
12
.github/lock.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# Configuration for lock-threads - https://github.com/dessant/lock-threads
|
||||
|
||||
# Number of days of inactivity before a closed issue or pull request is locked
|
||||
daysUntilLock: 91
|
||||
# Comment to post before locking. Set to `false` to disable
|
||||
lockComment: false
|
||||
only: issues
|
||||
lockLabel: 'outdated'
|
||||
|
||||
# Issues or pull requests with these labels will not be locked
|
||||
# exemptLabels:
|
||||
# - no-locking
|
||||
35
.gitignore
vendored
35
.gitignore
vendored
@@ -12,20 +12,27 @@ coverage
|
||||
dist
|
||||
/.package.json
|
||||
package-lock.json
|
||||
/packages/babel-runtime/core-js/**/*.js
|
||||
!/packages/babel-runtime/core-js/map.js
|
||||
|
||||
/packages/babel-runtime/helpers/*.js
|
||||
!/packages/babel-runtime/helpers/toArray.js
|
||||
!/packages/babel-runtime/helpers/iterableToArray.js
|
||||
!/packages/babel-runtime/helpers/temporalRef.js
|
||||
/packages/babel-runtime/helpers/builtin/*.js
|
||||
!/packages/babel-runtime/helpers/builtin/toArray.js
|
||||
!/packages/babel-runtime/helpers/builtin/temporalRef.js
|
||||
/packages/babel-runtime/helpers/builtin/es6/*.js
|
||||
!/packages/babel-runtime/helpers/builtin/es6/toArray.js
|
||||
!/packages/babel-runtime/helpers/builtin/es6/temporalRef.js
|
||||
/packages/babel-runtime/helpers/es6/*.js
|
||||
!/packages/babel-runtime/helpers/es6/toArray.js
|
||||
!/packages/babel-runtime/helpers/es6/temporalRef.js
|
||||
/packages/babel-runtime/helpers/esm/*.js
|
||||
!/packages/babel-runtime/helpers/esm/toArray.js
|
||||
!/packages/babel-runtime/helpers/esm/iterableToArray.js
|
||||
!/packages/babel-runtime/helpers/esm/temporalRef.js
|
||||
|
||||
/packages/babel-runtime-corejs2/helpers/*.js
|
||||
!/packages/babel-runtime-corejs2/helpers/toArray.js
|
||||
!/packages/babel-runtime-corejs2/helpers/iterableToArray.js
|
||||
!/packages/babel-runtime-corejs2/helpers/temporalRef.js
|
||||
/packages/babel-runtime-corejs2/helpers/esm/*.js
|
||||
!/packages/babel-runtime-corejs2/helpers/esm/toArray.js
|
||||
!/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js
|
||||
!/packages/babel-runtime-corejs2/helpers/esm/temporalRef.js
|
||||
/packages/babel-runtime-corejs2/core-js/**/*.js
|
||||
!/packages/babel-runtime-corejs2/core-js/map.js
|
||||
|
||||
/packages/babel-register/test/.babel
|
||||
/packages/babel-cli/test/tmp
|
||||
/packages/babel-node/test/tmp
|
||||
@@ -34,6 +41,10 @@ package-lock.json
|
||||
/babel.sublime-workspace
|
||||
packages/babel-standalone/babel.js
|
||||
packages/babel-standalone/babel.min.js
|
||||
packages/babel-preset-env-standalone/babel-preset-env.js
|
||||
packages/babel-preset-env-standalone/babel-preset-env.min.js
|
||||
/codemods/*/lib
|
||||
/codemods/*/node_modules
|
||||
/packages/babylon/build
|
||||
/packages/babel-parser/build
|
||||
.idea/
|
||||
/.changelog
|
||||
|
||||
2
.prettierignore
Normal file
2
.prettierignore
Normal file
@@ -0,0 +1,2 @@
|
||||
package.json
|
||||
packages/babel-preset-env/data
|
||||
11
.prettierrc
11
.prettierrc
@@ -1,9 +1,16 @@
|
||||
{
|
||||
"arrowParens": "avoid",
|
||||
"trailingComma": "es5",
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"singleQuote": false,
|
||||
"bracketSpacing": true,
|
||||
"jsxBracketSameLine": false,
|
||||
"tabWidth": 2,
|
||||
"parser": "babylon",
|
||||
"printWidth": 80,
|
||||
"overrides": [{
|
||||
"files": [
|
||||
"**/experimental/*/src/**/*.js",
|
||||
"**/experimental/*/test/**/*.js",
|
||||
"**/codemods/*/src/**/*.js",
|
||||
"**/codemods/*/test/**/*.js",
|
||||
"**/packages/*/src/**/*.js",
|
||||
|
||||
19
.travis.yml
19
.travis.yml
@@ -5,11 +5,12 @@ language: node_js
|
||||
cache:
|
||||
yarn: true
|
||||
directories:
|
||||
- node_modules
|
||||
- node_modules
|
||||
node_js:
|
||||
# We test the latest version on circleci
|
||||
- '9'
|
||||
- '8'
|
||||
- '6'
|
||||
- '4'
|
||||
|
||||
env:
|
||||
global:
|
||||
@@ -19,15 +20,17 @@ env:
|
||||
before_install:
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
|
||||
install: yarn --ignore-engines
|
||||
|
||||
before_script:
|
||||
- 'if [ "$JOB" = "babylon-flow-tests" ]; then make bootstrap-flow; fi'
|
||||
- 'if [ "$JOB" = "babylon-test262-tests" ]; then make bootstrap-test262; fi'
|
||||
- 'if [ "$JOB" = "babel-parser-flow-tests" ]; then make bootstrap-flow; fi'
|
||||
- 'if [ "$JOB" = "babel-parser-test262-tests" ]; then make bootstrap-test262; fi'
|
||||
|
||||
script:
|
||||
- 'if [ "$JOB" = "test" ]; then make test-ci; fi'
|
||||
- 'if [ "$JOB" = "lint" ]; then make lint && make flow; fi'
|
||||
- 'if [ "$JOB" = "babylon-flow-tests" ]; then make test-flow-ci; fi'
|
||||
- 'if [ "$JOB" = "babylon-test262-tests" ]; then make test-test262-ci; fi'
|
||||
- 'if [ "$JOB" = "babel-parser-flow-tests" ]; then make test-flow-ci; fi'
|
||||
- 'if [ "$JOB" = "babel-parser-test262-tests" ]; then make test-test262-ci; fi'
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
@@ -35,9 +38,9 @@ matrix:
|
||||
- node_js: "node"
|
||||
env: JOB=lint
|
||||
- node_js: "node"
|
||||
env: JOB=babylon-flow-tests
|
||||
env: JOB=babel-parser-flow-tests
|
||||
- node_js: "node"
|
||||
env: JOB=babylon-test262-tests
|
||||
env: JOB=babel-parser-test262-tests
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
|
||||
7295
CHANGELOG.md
7295
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
contributors and maintainers pledge to make participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
|
||||
@@ -24,23 +24,24 @@ contributing, please read the
|
||||
## Not sure where to start?
|
||||
|
||||
- If you aren't just making a documentation change, you'll probably want to learn a bit about a few topics.
|
||||
- [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): The Babel AST [spec](https://github.com/babel/babel/tree/master/packages/babylon/blob/master/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://github.com/babel/babel/tree/master/packages/babylon#output).
|
||||
- [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): The Babel AST [spec](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://github.com/babel/babel/tree/master/packages/babel-parser#output).
|
||||
- Check out [`/doc`](https://github.com/babel/babel/tree/master/doc) for information about Babel's internals
|
||||
- Check out [the Babel Plugin Handbook](https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-plugin-handbook) - core plugins are written the same way as any other plugin!
|
||||
- Check out [AST Explorer](http://astexplorer.net/#/scUfOmVOG5) to learn more about ASTs or make your own plugin in the browser
|
||||
- When you feel ready to jump into the Babel source code, a good place to start is to look for issues tagged with [help wanted](https://github.com/babel/babel/labels/help%20wanted) and/or [good first issue](https://github.com/babel/babel/labels/good%20first%20issue).
|
||||
- Follow along with what we are working on by joining our Slack, following our announcements on [Twitter](https://twitter.com/babeljs), and reading (or participating!) in our [meeting notes](https://github.com/babel/notes).
|
||||
- Follow along with what we are working on by joining our [Slack](https://babeljs.slack.com) (you can sign-up [here](https://slack.babeljs.io/)
|
||||
for an invite), following our announcements on [Twitter](https://twitter.com/babeljs), and reading (or participating!) in our [meeting notes](https://github.com/babel/notes).
|
||||
- Check out our [website](http://babeljs.io/) and the [repo](https://github.com/babel/website)
|
||||
|
||||
## Chat
|
||||
|
||||
Feel free to check out the `#discussion`/`#development` channels on our [Slack](https://slack.babeljs.io). Some of us are always online to chat!
|
||||
Feel free to check out the `#discussion`/`#development` channels on our [Slack](https://slack.babeljs.io) (you can sign-up [here](https://slack.babeljs.io/) for an invite). Some of us are always online to chat!
|
||||
|
||||
## Developing
|
||||
|
||||
**Note:** Versions `< 5.1.10` can't be built.
|
||||
|
||||
Babel is built for Node 4 and up but we develop using Node 8 and yarn. You can check this with `node -v`.
|
||||
Babel is built for Node 6 and up but we develop using Node 8 and yarn. You can check this with `node -v`.
|
||||
|
||||
Make sure that Yarn is installed with version >= `0.28.0`.
|
||||
Installation instructions can be found here: https://yarnpkg.com/en/docs/install.
|
||||
@@ -115,8 +116,8 @@ $ TEST_ONLY=babel-cli make test
|
||||
`TEST_ONLY` will also match substrings of the package name:
|
||||
|
||||
```sh
|
||||
# Run tests for the babel-plugin-transform-classes package.
|
||||
$ TEST_ONLY=es2015-class make test
|
||||
# Run tests for the @babel/plugin-transform-classes package.
|
||||
$ TEST_ONLY=babel-plugin-transform-classes make test
|
||||
```
|
||||
|
||||
Use the `TEST_GREP` variable to run a subset of tests by name:
|
||||
@@ -139,6 +140,12 @@ $ TEST_DEBUG=true make test
|
||||
|
||||
You can combine `TEST_DEBUG` with `TEST_GREP` or `TEST_ONLY` to debug a subset of tests. If you plan to stay long in the debugger (which you'll likely do!), you may increase the test timeout by editing [test/mocha.opts](https://github.com/babel/babel/blob/master/test/mocha.opts).
|
||||
|
||||
To overwrite any test fixtures when fixing a bug or anything, add the env variable `OVERWRITE=true`
|
||||
|
||||
```sh
|
||||
$ OVERWRITE=true TEST_ONLY=babel-plugin-transform-classes make test-only
|
||||
```
|
||||
|
||||
To test the code coverage, use:
|
||||
|
||||
```sh
|
||||
@@ -161,43 +168,43 @@ In case you're locally getting errors which are not on the CI, it may be due to
|
||||
|
||||
Most packages in [`/packages`](https://github.com/babel/babel/tree/master/packages) have a `test` folder, however some tests might be in other packages or in [`/packages/babel-core`](https://github.com/babel/babel/tree/master/packages/babel-core/test/fixtures).
|
||||
|
||||
#### `babel-plugin-x`
|
||||
#### `@babel/plugin-x`
|
||||
|
||||
All the Babel plugins (and other packages) that have a `/test/fixtures` are written in a similar way.
|
||||
|
||||
For example, in [`babel-plugin-transform-exponentiation-operator/test`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test):
|
||||
For example, in [`@babel/plugin-transform-exponentiation-operator/test`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test):
|
||||
|
||||
- There is an `index.js` file. It imports our [test helper](https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner). (You don't have to worry about this).
|
||||
- There can be multiple folders under [`/fixtures`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures)
|
||||
- There is an [`options.json`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/options.json) file whose function is similar to a `.babelrc` file, allowing you to pass in the plugins and settings you need for your tests.
|
||||
- For this test, we only need the relevant plugin, so it's just `{ "plugins": ["@babel/transform-exponentiation-operator"] }`.
|
||||
- For this test, we only need the relevant plugin, so it's just `{ "plugins": ["@babel/plugin-transform-exponentiation-operator"] }`.
|
||||
- If necessary, you can have an `options.json` with different options in each subfolder.
|
||||
|
||||
- In each subfolder, you can organize your directory structure by categories of tests. (Example: these folders can be named after the feature you are testing or can reference the issue number they fix)
|
||||
- Generally, there are two kinds of tests for plugins
|
||||
- The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`actual.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/actual.js) file and an [`expected.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/expected.js) file.
|
||||
- If you need to expect an error, you can ignore creating the `expected.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created.
|
||||
- The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`input.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/input.js) file and an [`output.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/output.js) file. This kind of test only works in sub-subdirectories of `/fixtures`, i.e. `/fixtures/exponentian-operator/binary/input.js` and **not** `/fixtures/exponentian-operator/input.js`.
|
||||
- If you need to expect an error, you can ignore creating the `output.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created.
|
||||
- The second and preferred type is a test that actually evaluates the produced code and asserts that certain properties are true or false. We do this by creating an [`exec.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/comprehensive/exec.js) file.
|
||||
|
||||
In an actual/expected test, you simply write out the code you want transformed in `actual.js`.
|
||||
In a fixture test, you simply write out the code you want to transform in `input.js`.
|
||||
|
||||
```js
|
||||
// actual.js
|
||||
// input.js
|
||||
2 ** 2;
|
||||
```
|
||||
|
||||
and the expected output after transforming it with your `options.json` in `expected.js`.
|
||||
and the expected output after transforming it with your `options.json` in `output.js`.
|
||||
|
||||
```js
|
||||
// expected.js
|
||||
// output.js
|
||||
Math.pow(2, 2);
|
||||
```
|
||||
In an `exec.js` test, we run or check that the code actually does what it's supposed to do rather than just check the static output.
|
||||
|
||||
```js
|
||||
// exec.js
|
||||
assert.equal(8, 2 ** 3);
|
||||
assert.equal(24, 3 * 2 ** 3);
|
||||
expect(2 ** 3).toBe(8);
|
||||
expect(3 * 2 ** 3).toBe(24);
|
||||
```
|
||||
|
||||
If you need to check for an error that is thrown you can add to the `options.json`
|
||||
@@ -205,8 +212,8 @@ If you need to check for an error that is thrown you can add to the `options.jso
|
||||
```js
|
||||
// options.json example
|
||||
{
|
||||
"plugins": [["@babel/proposal-object-rest-spread", { "useBuiltIns": "invalidOption" }]],
|
||||
"throws": "@babel/proposal-object-rest-spread currently only accepts a boolean option for useBuiltIns (defaults to false)"
|
||||
"plugins": [["@babel/plugin-proposal-object-rest-spread", { "useBuiltIns": "invalidOption" }]],
|
||||
"throws": "@babel/plugin-proposal-object-rest-spread currently only accepts a boolean option for useBuiltIns (defaults to false)"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -219,33 +226,45 @@ If the test requires a minimum Node version, you can add `minNodeVersion` (must
|
||||
}
|
||||
```
|
||||
|
||||
#### `babylon`
|
||||
#### `@babel/parser` (babylon)
|
||||
|
||||
Writing tests for Babylon is very
|
||||
Writing tests for the babel parser is very
|
||||
similar to the other packages.
|
||||
Inside the `packages/babylon/tests/fixtures` folder are categories/groupings of test fixtures (es2015, flow,
|
||||
Inside the `packages/babel-parser/test/fixtures` folder are categories/groupings of test fixtures (es2015, flow,
|
||||
etc.). To add a test, create a folder under one of these groupings (or create a new one) with a
|
||||
descriptive name, and add the following:
|
||||
|
||||
* Create an `actual.js` file that contains the code you want Babylon to parse.
|
||||
* Create an `input.js` file that contains the code you want the babel parser to parse.
|
||||
|
||||
* Add an `expected.json` file with the expected parser output. For added convenience, if there is no `expected.json` present, the test runner will generate one for you.
|
||||
* Add an `output.json` file with the expected parser output. For added convenience, if there is no `output.json` present, the test runner will generate one for you.
|
||||
|
||||
After writing tests for @babel/parser, just build it by running:
|
||||
|
||||
```sh
|
||||
$ make build
|
||||
```
|
||||
|
||||
Then, to run the tests, use:
|
||||
|
||||
```sh
|
||||
$ TEST_ONLY=babel-parser make test-only
|
||||
```
|
||||
|
||||
#### Bootstrapping expected output
|
||||
|
||||
For both `babel-plugin-x` and `babylon`, you can easily generate an `expected.js`/`expected.json` automatically by just providing `actual.js` and running the tests as you usually would.
|
||||
For both `@babel/plugin-x` and `@babel/parser`, you can easily generate an `output.js`/`output.json` automatically by just providing `input.js` and running the tests as you usually would.
|
||||
|
||||
```
|
||||
// Example
|
||||
- packages
|
||||
- babylon
|
||||
- babel-parser
|
||||
- test
|
||||
- fixtures
|
||||
- comments
|
||||
- basic
|
||||
- block-trailing-comment
|
||||
- actual.js
|
||||
- expected.json (will be generated if not created)
|
||||
- input.js
|
||||
- output.json (will be generated if not created)
|
||||
```
|
||||
|
||||
### Debugging code
|
||||
@@ -267,7 +286,7 @@ To include the changes, we have to make sure to build Babel:
|
||||
$ make build
|
||||
```
|
||||
|
||||
Next, we need to execute `Generator.generate()`, which can be achieved by running a test case in the `babel-generator` package.
|
||||
Next, we need to execute `Generator.generate()`, which can be achieved by running a test case in the `@babel/generator` package.
|
||||
For example, we can run the test case that tests the generation of class declarations:
|
||||
|
||||
```bash
|
||||
@@ -275,7 +294,6 @@ $ TEST_DEBUG=true TEST_GREP=ClassDeclaration make test-only
|
||||
|
||||
./scripts/test.sh
|
||||
Debugger listening on port 9229.
|
||||
Warning: This is an experimental feature and could change at any time.
|
||||
To start debugging, open the following URL in Chrome:
|
||||
chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/3cdaebd2-be88-4e7b-a94b-432950ab72d0
|
||||
```
|
||||
@@ -291,15 +309,15 @@ Note that the code shown in Chrome DevTools is compiled code and therefore diffe
|
||||
|
||||
- Create a new issue that describes the proposal (ex: [#538](https://github.com/babel/babylon/issues/538)). Include any relevant information like proposal repo/author, examples, parsing approaches, meeting notes, presentation slides, and more.
|
||||
- The pull request should include:
|
||||
- [ ] An update to the [plugins](https://github.com/babel/babel/tree/master/packages/babylon#plugins) part of the readme. Add a new entry to that list for the new plugin flag (and link to the proposal)
|
||||
- [ ] If any new nodes or modifications need to be added to the AST, update [ast/spec.md](https://github.com/babel/babel/bloc/master/packages/babylon/ast/spec.md)
|
||||
- [ ] Make sure you use the `this.hasPlugin("plugin-name-here")` check in Babylon so that your new plugin code only runs when that flag is turned on (not default behavior)
|
||||
- [ ] An update to the [plugins](https://github.com/babel/babel/tree/master/packages/babel-parser#plugins) part of the readme. Add a new entry to that list for the new plugin flag (and link to the proposal)
|
||||
- [ ] If any new nodes or modifications need to be added to the AST, update [ast/spec.md](https://github.com/babel/babel/bloc/master/packages/babel-parser/ast/spec.md)
|
||||
- [ ] Make sure you use the `this.hasPlugin("plugin-name-here")` check in the babel parser so that your new plugin code only runs when that flag is turned on (not default behavior)
|
||||
- [ ] Add failing/passing tests according to spec behavior
|
||||
- Start working about the Babel transform itself!
|
||||
|
||||
## Internals
|
||||
- AST spec ([babylon/ast/spec.md](https://github.com/babel/babel/tree/master/packages/babylon/blob/master/ast/spec.md))
|
||||
- Versioning ([doc/design/versioning.md](https://github.com/babel/babel/blob/master/doc/design/versioning.md)
|
||||
- AST spec ([babel-parser/ast/spec.md](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md))
|
||||
- Versioning ([doc/design/versioning.md](https://github.com/babel/babel/blob/master/doc/design/versioning.md))
|
||||
- Monorepo ([doc/design/monorepo.md](https://github.com/babel/babel/blob/master/doc/design/monorepo.md))
|
||||
- Compiler environment support ([doc/design/compiler-environment-support.md](https://github.com/babel/babel/blob/master/doc/design/compiler-environment-support.md))
|
||||
- Compiler assumptions ([doc/design/compiler-assumptions.md](https://github.com/babel/babel/blob/master/doc/design/compiler-assumptions.md))
|
||||
|
||||
294
Gulpfile.js
294
Gulpfile.js
@@ -3,23 +3,24 @@
|
||||
const plumber = require("gulp-plumber");
|
||||
const through = require("through2");
|
||||
const chalk = require("chalk");
|
||||
const pump = require("pump");
|
||||
const uglify = require("gulp-uglify");
|
||||
const rename = require("gulp-rename");
|
||||
const newer = require("gulp-newer");
|
||||
const babel = require("gulp-babel");
|
||||
const watch = require("gulp-watch");
|
||||
const gulpWatch = require("gulp-watch");
|
||||
const gutil = require("gulp-util");
|
||||
const filter = require("gulp-filter");
|
||||
const gulp = require("gulp");
|
||||
const path = require("path");
|
||||
const merge = require("merge-stream");
|
||||
const RootMostResolvePlugin = require("webpack-dependency-suite")
|
||||
.RootMostResolvePlugin;
|
||||
const webpack = require("webpack");
|
||||
const webpackStream = require("webpack-stream");
|
||||
const merge = require("merge-stream");
|
||||
const rollup = require("rollup-stream");
|
||||
const source = require("vinyl-source-stream");
|
||||
const buffer = require("vinyl-buffer");
|
||||
const rollupBabel = require("rollup-plugin-babel");
|
||||
const rollupNodeResolve = require("rollup-plugin-node-resolve");
|
||||
const registerStandalonePackageTask = require("./scripts/gulp-tasks")
|
||||
.registerStandalonePackageTask;
|
||||
|
||||
const sources = ["codemods", "packages", "experimental"];
|
||||
const sources = ["codemods", "packages"];
|
||||
|
||||
function swapSrcWithLib(srcPath) {
|
||||
const parts = srcPath.split(path.sep);
|
||||
@@ -31,164 +32,141 @@ function getGlobFromSource(source) {
|
||||
return `./${source}/*/src/**/*.js`;
|
||||
}
|
||||
|
||||
gulp.task("default", ["build"]);
|
||||
function getIndexFromPackage(name) {
|
||||
return `${name}/src/index.js`;
|
||||
}
|
||||
|
||||
gulp.task("build", function() {
|
||||
function compilationLogger(rollup) {
|
||||
return through.obj(function(file, enc, callback) {
|
||||
gutil.log(
|
||||
`Compiling '${chalk.cyan(file.relative)}'${
|
||||
rollup ? " with rollup " : ""
|
||||
}...`
|
||||
);
|
||||
callback(null, file);
|
||||
});
|
||||
}
|
||||
|
||||
function errorsLogger() {
|
||||
return plumber({
|
||||
errorHandler(err) {
|
||||
gutil.log(err.stack);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function rename(fn) {
|
||||
return through.obj(function(file, enc, callback) {
|
||||
file.path = fn(file);
|
||||
callback(null, file);
|
||||
});
|
||||
}
|
||||
|
||||
function buildBabel(exclude) {
|
||||
return merge(
|
||||
sources.map(source => {
|
||||
const base = path.join(__dirname, source);
|
||||
const f = filter(["**", "!**/packages/babylon/**"]);
|
||||
|
||||
return gulp
|
||||
.src(getGlobFromSource(source), { base: base })
|
||||
.pipe(f)
|
||||
.pipe(
|
||||
plumber({
|
||||
errorHandler: function(err) {
|
||||
gutil.log(err.stack);
|
||||
},
|
||||
})
|
||||
)
|
||||
.pipe(
|
||||
newer({
|
||||
dest: base,
|
||||
map: swapSrcWithLib,
|
||||
})
|
||||
)
|
||||
.pipe(
|
||||
through.obj(function(file, enc, callback) {
|
||||
gutil.log("Compiling", "'" + chalk.cyan(file.relative) + "'...");
|
||||
callback(null, file);
|
||||
})
|
||||
)
|
||||
let stream = gulp.src(getGlobFromSource(source), { base: base });
|
||||
|
||||
if (exclude) {
|
||||
const filters = exclude.map(p => `!**/${p}/**`);
|
||||
filters.unshift("**");
|
||||
stream = stream.pipe(filter(filters));
|
||||
}
|
||||
|
||||
return stream
|
||||
.pipe(errorsLogger())
|
||||
.pipe(newer({ dest: base, map: swapSrcWithLib }))
|
||||
.pipe(compilationLogger())
|
||||
.pipe(babel())
|
||||
.pipe(
|
||||
through.obj(function(file, enc, callback) {
|
||||
// Passing 'file.relative' because newer() above uses a relative
|
||||
// path and this keeps it consistent.
|
||||
file.path = path.resolve(file.base, swapSrcWithLib(file.relative));
|
||||
callback(null, file);
|
||||
})
|
||||
// Passing 'file.relative' because newer() above uses a relative
|
||||
// path and this keeps it consistent.
|
||||
rename(file => path.resolve(file.base, swapSrcWithLib(file.relative)))
|
||||
)
|
||||
.pipe(gulp.dest(base));
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
gulp.task("watch", ["build"], function() {
|
||||
watch(sources.map(getGlobFromSource), { debounceDelay: 200 }, function() {
|
||||
gulp.start("build");
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task("build-babel-standalone", cb => {
|
||||
pump(
|
||||
[
|
||||
gulp.src(__dirname + "/packages/babel-standalone/src/index.js"),
|
||||
webpackBuild(),
|
||||
gulp.dest(__dirname + "/packages/babel-standalone"),
|
||||
uglify(),
|
||||
rename({ extname: ".min.js" }),
|
||||
gulp.dest(__dirname + "/packages/babel-standalone"),
|
||||
],
|
||||
cb
|
||||
);
|
||||
});
|
||||
|
||||
function webpackBuild() {
|
||||
let version = require("./packages/babel-core/package.json").version;
|
||||
|
||||
// If this build is part of a pull request, include the pull request number in
|
||||
// the version number.
|
||||
if (process.env.CIRCLE_PR_NUMBER) {
|
||||
version += "+pr." + process.env.CIRCLE_PR_NUMBER;
|
||||
}
|
||||
|
||||
const config = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: /node_modules/,
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
// Some of the node_modules may have their own "babel" section in
|
||||
// their project.json (or a ".babelrc" file). We need to ignore
|
||||
// those as we're using our own Babel options.
|
||||
babelrc: false,
|
||||
presets: [
|
||||
[
|
||||
"@babel/env",
|
||||
{
|
||||
loose: true,
|
||||
exclude: ["transform-typeof-symbol"],
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
// Some of the node_modules may have their own "babel" section in
|
||||
// their project.json (or a ".babelrc" file). We need to ignore
|
||||
// those as we're using our own Babel options.
|
||||
babelrc: false,
|
||||
presets: [
|
||||
[
|
||||
"@babel/env",
|
||||
{
|
||||
loose: true,
|
||||
exclude: ["transform-typeof-symbol"],
|
||||
},
|
||||
],
|
||||
["@babel/stage-0", { loose: true }],
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
// babylon is already bundled and does not require parsing
|
||||
noParse: [/babylon\/lib/],
|
||||
},
|
||||
node: {
|
||||
// Mock Node.js modules that Babel require()s but that we don't
|
||||
// particularly care about.
|
||||
fs: "empty",
|
||||
module: "empty",
|
||||
net: "empty",
|
||||
},
|
||||
output: {
|
||||
filename: "babel.js",
|
||||
library: "Babel",
|
||||
libraryTarget: "umd",
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
"process.env.NODE_ENV": '"production"',
|
||||
BABEL_VERSION: JSON.stringify(version),
|
||||
VERSION: JSON.stringify(version),
|
||||
}),
|
||||
/*new webpack.NormalModuleReplacementPlugin(
|
||||
/..\/..\/package/,
|
||||
"../../../../src/babel-package-shim"
|
||||
),*/
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
],
|
||||
resolve: {
|
||||
plugins: [
|
||||
// Dedupe packages that are used across multiple plugins.
|
||||
// This replaces DedupePlugin from Webpack 1.x
|
||||
new RootMostResolvePlugin(__dirname, true),
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
return webpackStream(config, webpack);
|
||||
// To write JSON for debugging:
|
||||
/*return webpackStream(config, webpack, (err, stats) => {
|
||||
require('gulp-util').log(stats.toString({colors: true}));
|
||||
require('fs').writeFileSync('webpack-debug.json', JSON.stringify(stats.toJson()));
|
||||
});*/
|
||||
}
|
||||
|
||||
function buildRollup(packages) {
|
||||
return merge(
|
||||
packages.map(pkg => {
|
||||
return rollup({
|
||||
input: getIndexFromPackage(pkg),
|
||||
format: "cjs",
|
||||
plugins: [
|
||||
rollupBabel({
|
||||
envName: "babel-parser",
|
||||
}),
|
||||
rollupNodeResolve(),
|
||||
],
|
||||
})
|
||||
.pipe(source("index.js"))
|
||||
.pipe(buffer())
|
||||
.pipe(errorsLogger())
|
||||
.pipe(compilationLogger(/* rollup */ true))
|
||||
.pipe(gulp.dest(path.join(pkg, "lib")));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
gulp.task("build", function() {
|
||||
const bundles = ["packages/babel-parser"];
|
||||
|
||||
return merge([buildBabel(/* exclude */ bundles), buildRollup(bundles)]);
|
||||
});
|
||||
|
||||
gulp.task("default", gulp.series("build"));
|
||||
|
||||
gulp.task("build-no-bundle", () => buildBabel());
|
||||
|
||||
gulp.task(
|
||||
"watch",
|
||||
gulp.series("build-no-bundle", function watch() {
|
||||
gulpWatch(
|
||||
sources.map(getGlobFromSource),
|
||||
{ debounceDelay: 200 },
|
||||
gulp.task("build-no-bundle")
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
registerStandalonePackageTask(
|
||||
gulp,
|
||||
"babel",
|
||||
"Babel",
|
||||
path.join(__dirname, "packages"),
|
||||
require("./packages/babel-core/package.json").version
|
||||
);
|
||||
|
||||
const presetEnvWebpackPlugins = [
|
||||
new webpack.NormalModuleReplacementPlugin(
|
||||
/\.\/available-plugins/,
|
||||
require.resolve(
|
||||
path.join(
|
||||
__dirname,
|
||||
"./packages/babel-preset-env-standalone/src/available-plugins"
|
||||
)
|
||||
)
|
||||
),
|
||||
new webpack.NormalModuleReplacementPlugin(
|
||||
/caniuse-lite\/data\/regions\/.+/,
|
||||
require.resolve(
|
||||
path.join(
|
||||
__dirname,
|
||||
"./packages/babel-preset-env-standalone/src/caniuse-lite-regions"
|
||||
)
|
||||
)
|
||||
),
|
||||
];
|
||||
|
||||
registerStandalonePackageTask(
|
||||
gulp,
|
||||
"babel-preset-env",
|
||||
"babelPresetEnv",
|
||||
path.join(__dirname, "packages"),
|
||||
require("./packages/babel-preset-env/package.json").version,
|
||||
presetEnvWebpackPlugins
|
||||
);
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-2017 Sebastian McKenzie <sebmck@gmail.com>
|
||||
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
86
Makefile
86
Makefile
@@ -1,57 +1,60 @@
|
||||
MAKEFLAGS = -j1
|
||||
FLOW_COMMIT = 4cc2b9f7fadf2e9e445ee9b7b980c65d69d3fbc0
|
||||
TEST262_COMMIT = 1282e842febf418ca27df13fa4b32f7e5021b470
|
||||
|
||||
export NODE_ENV = test
|
||||
FLOW_COMMIT = bea8b83f50f597454941d2a7ecef6e93a881e576
|
||||
TEST262_COMMIT = f90a52b39609a620c0854e0bd0b3a906c930fd17
|
||||
|
||||
# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
|
||||
export FORCE_COLOR = true
|
||||
|
||||
SOURCES = packages codemods experimental
|
||||
SOURCES = packages codemods
|
||||
|
||||
.PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap
|
||||
|
||||
build: clean
|
||||
make clean-lib
|
||||
# Build babylon before building all other projects
|
||||
make build-babylon
|
||||
build: clean clean-lib
|
||||
./node_modules/.bin/gulp build
|
||||
ifneq ("$(BABEL_ENV)", "cov")
|
||||
node ./packages/babel-types/scripts/generateTypeHelpers.js
|
||||
# call build again as the generated files might need to be compiled again.
|
||||
./node_modules/.bin/gulp build
|
||||
# generate flow and typescript typings
|
||||
node scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
|
||||
node scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts
|
||||
ifneq ("$(BABEL_COVERAGE)", "true")
|
||||
make build-standalone
|
||||
make build-preset-env-standalone
|
||||
endif
|
||||
|
||||
build-babylon:
|
||||
cd packages/babylon; \
|
||||
./node_modules/.bin/rollup -c
|
||||
|
||||
build-standalone:
|
||||
./node_modules/.bin/gulp build-babel-standalone
|
||||
|
||||
build-preset-env-standalone:
|
||||
./node_modules/.bin/gulp build-babel-preset-env-standalone
|
||||
|
||||
build-dist: build
|
||||
cd packages/babel-polyfill; \
|
||||
scripts/build-dist.sh
|
||||
cd packages/babel-runtime; \
|
||||
cd packages/babel-plugin-transform-runtime; \
|
||||
node scripts/build-dist.js
|
||||
node scripts/generate-babel-types-docs.js
|
||||
|
||||
watch: clean
|
||||
make clean-lib
|
||||
watch: clean clean-lib
|
||||
|
||||
# Ensure that build artifacts for types are created during local
|
||||
# development too.
|
||||
BABEL_ENV=development ./node_modules/.bin/gulp build-no-bundle
|
||||
node ./packages/babel-types/scripts/generateTypeHelpers.js
|
||||
node scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
|
||||
BABEL_ENV=development ./node_modules/.bin/gulp watch
|
||||
|
||||
flow:
|
||||
./node_modules/.bin/flow check --strip-root
|
||||
|
||||
lint:
|
||||
./node_modules/.bin/eslint scripts $(SOURCES) *.js --format=codeframe --rulesdir="./scripts/eslint_rules"
|
||||
./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe --rulesdir="./scripts/eslint_rules"
|
||||
|
||||
fix:
|
||||
./node_modules/.bin/eslint scripts $(SOURCES) *.js --format=codeframe --fix --rulesdir="./scripts/eslint_rules"
|
||||
./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe --fix --rulesdir="./scripts/eslint_rules"
|
||||
|
||||
clean: test-clean
|
||||
rm -rf packages/babel-polyfill/browser*
|
||||
rm -rf packages/babel-polyfill/dist
|
||||
# rm -rf packages/babel-runtime/helpers
|
||||
# rm -rf packages/babel-runtime/core-js
|
||||
rm -rf coverage
|
||||
rm -rf packages/*/npm-debug*
|
||||
|
||||
@@ -60,19 +63,17 @@ test-clean:
|
||||
$(call clean-source-test, $(source)))
|
||||
|
||||
test-only:
|
||||
./scripts/test.sh
|
||||
BABEL_ENV=test ./scripts/test.sh
|
||||
make test-clean
|
||||
|
||||
test: lint test-only
|
||||
|
||||
test-ci:
|
||||
make bootstrap
|
||||
make test-only
|
||||
test-ci: bootstrap test-only
|
||||
|
||||
test-ci-coverage: SHELL:=/bin/bash
|
||||
test-ci-coverage:
|
||||
BABEL_ENV=cov make bootstrap
|
||||
./scripts/test-cov.sh
|
||||
BABEL_COVERAGE=true BABEL_ENV=test make bootstrap
|
||||
BABEL_ENV=test TEST_TYPE=cov ./scripts/test-cov.sh
|
||||
bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json
|
||||
|
||||
bootstrap-flow:
|
||||
@@ -82,14 +83,12 @@ bootstrap-flow:
|
||||
cd build/flow && git checkout $(FLOW_COMMIT)
|
||||
|
||||
test-flow:
|
||||
node scripts/tests/flow/run_babylon_flow_tests.js
|
||||
node scripts/tests/flow/run_babel_parser_flow_tests.js
|
||||
|
||||
test-flow-ci:
|
||||
make bootstrap
|
||||
make test-flow
|
||||
test-flow-ci: bootstrap test-flow
|
||||
|
||||
test-flow-update-whitelist:
|
||||
node scripts/tests/flow/run_babylon_flow_tests.js --update-whitelist
|
||||
node scripts/tests/flow/run_babel_parser_flow_tests.js --update-whitelist
|
||||
|
||||
bootstrap-test262:
|
||||
rm -rf ./build/test262
|
||||
@@ -98,18 +97,19 @@ bootstrap-test262:
|
||||
cd build/test262 && git checkout $(TEST262_COMMIT)
|
||||
|
||||
test-test262:
|
||||
node scripts/tests/test262/run_babylon_test262.js
|
||||
node scripts/tests/test262/run_babel_parser_test262.js
|
||||
|
||||
test-test262-ci:
|
||||
make bootstrap
|
||||
make test-test262
|
||||
test-test262-ci: bootstrap test-test262
|
||||
|
||||
test-test262-update-whitelist:
|
||||
node scripts/tests/test262/run_babylon_test262.js --update-whitelist
|
||||
node scripts/tests/test262/run_babel_parser_test262.js --update-whitelist
|
||||
|
||||
publish:
|
||||
git pull --rebase
|
||||
make clean-lib
|
||||
rm -rf packages/babel-runtime/helpers
|
||||
rm -rf packages/babel-runtime-corejs2/helpers
|
||||
rm -rf packages/babel-runtime-corejs2/core-js
|
||||
BABEL_ENV=production make build-dist
|
||||
make test
|
||||
# not using lerna independent mode atm, so only update packages that have changed since we use ^
|
||||
@@ -117,12 +117,11 @@ publish:
|
||||
./node_modules/.bin/lerna publish --force-publish=* --exact --skip-temp-tag
|
||||
make clean
|
||||
|
||||
bootstrap:
|
||||
make clean-all
|
||||
yarn
|
||||
./node_modules/.bin/lerna bootstrap
|
||||
bootstrap: clean-all
|
||||
yarn --ignore-engines
|
||||
./node_modules/.bin/lerna bootstrap -- --ignore-engines
|
||||
make build
|
||||
cd packages/babel-runtime; \
|
||||
cd packages/babel-plugin-transform-runtime; \
|
||||
node scripts/build-dist.js
|
||||
|
||||
clean-lib:
|
||||
@@ -132,6 +131,7 @@ clean-lib:
|
||||
clean-all:
|
||||
rm -rf node_modules
|
||||
rm -rf package-lock.json
|
||||
rm -rf .changelog
|
||||
|
||||
$(foreach source, $(SOURCES), \
|
||||
$(call clean-source-all, $(source)))
|
||||
|
||||
143
README.md
143
README.md
@@ -24,10 +24,56 @@
|
||||
<a href="https://medium.com/friendship-dot-js/i-peeked-into-my-node-modules-directory-and-you-wont-believe-what-happened-next-b89f63d21558"><img alt="Business Strategy Status" src="https://img.shields.io/badge/business%20model-flavortown-green.svg"></a>
|
||||
</p>
|
||||
|
||||
Babel is community-driven and thus mostly maintained by a group of [volunteers](https://babeljs.io/team). It has a lot of [companies and projects](http://babeljs.io/users) using it but almost no sponsors/people funded to work on it. If you'd like to help maintain the future of the project, please consider:
|
||||
Babel is a community-driven project used by many companies and projects, and is maintained by a group of [volunteers](https://babeljs.io/team). If you'd like to help support the future of the project, please consider:
|
||||
|
||||
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](slack.babeljs.io))
|
||||
- [Giving funds by becoming a backer/sponsor on OpenCollective](https://opencollective.com/babel)
|
||||
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](https://slack.babeljs.io/) for guidance!)
|
||||
- Giving funds by becoming a sponsor (see below)!
|
||||
|
||||
## Open Collective Sponsors
|
||||
|
||||
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/babel#sponsor)]
|
||||
|
||||
<a href="https://opencollective.com/babel/sponsor/0/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/1/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/2/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/3/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/4/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/5/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/6/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/7/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/8/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/9/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/10/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/11/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/12/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/13/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/14/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/15/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/16/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/17/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/18/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/19/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/20/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/21/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/22/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/23/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/24/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/25/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/26/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/27/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/28/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/29/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/29/avatar.svg"></a>
|
||||
|
||||
## Patreon Sponsors
|
||||
|
||||
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://www.patreon.com/henryzhu)]
|
||||
|
||||
## Bronze
|
||||
|
||||
<a href="http://teamextension.io/" target="_blank"><img src="https://teamextension.io/dist/img/logo/te-logo-compact.png" height="64"></a>
|
||||
<a href="https://webflow.com/" target="_blank"><img src="https://opencollective.com/proxy/images/?src=https%3A%2F%2Fopencollective-production.s3-us-west-1.amazonaws.com%2F4a5024b0-8cf2-11e7-b1a2-b30b1de1463c.png&height=64"></a>
|
||||
<a href="https://issue.sh/?utm_medium=github&utm_campaign=babel" target="_blank"><img src="https://user-images.githubusercontent.com/5557143/43912065-c8cdff78-9c33-11e8-829a-0b4166ccc215.png"></a>
|
||||
<p><a href="https://twitter.com/mikesherov">Mike Sherov</a></p>
|
||||
|
||||
## Intro
|
||||
|
||||
@@ -50,11 +96,6 @@ Babel is a tool that helps you write code in the latest version of JavaScript. W
|
||||
|
||||
Try it out at our [REPL](https://babeljs.io/repl/build/master#?code_lz=NoRgNATGDMC6B0BbAhgBwBQDsAEBeAfNjgNTYgCUA3EA&lineWrap=true&presets=es2015%2Ces2016%2Ces2017&version=7.0.0-beta.2).
|
||||
|
||||
- [FAQ](#faq)
|
||||
- [Backers](#backers)
|
||||
- [Sponsors](#sponsors)
|
||||
- [License](#license)
|
||||
|
||||
## FAQ
|
||||
|
||||
### Who maintains Babel?
|
||||
@@ -63,19 +104,23 @@ Mostly a handful of volunteers! Please check out our [team page](https://babeljs
|
||||
|
||||
### Looking for support?
|
||||
|
||||
For questions and support please visit join our [Slack Community](https://slack.babeljs.io/), ask a question on [Stack Overflow](http://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs/).
|
||||
For questions and support please visit join our [Slack Community](https://slack.babeljs.io/) (you can sign-up [here](https://slack.babeljs.io/) for an invite), ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs).
|
||||
|
||||
### Is there a Babel song?
|
||||
|
||||
I'm so glad you asked: [Hallelujah —— In Praise of Babel](SONG.md) by [@angus-c](https://github.com/angus-c), [audio version](https://youtu.be/40abpedBKK8) by [@swyx](https://twitter.com/@swyx). Tweet us your recordings!
|
||||
|
||||
### Where are the docs?
|
||||
|
||||
Check out our website: [babeljs.io](http://babeljs.io/), and report issues/features at [babel/website](https://github.com/babel/website/issues).
|
||||
Check out our website: [babeljs.io](https://babeljs.io/), and report issues/features at [babel/website](https://github.com/babel/website/issues).
|
||||
|
||||
### Want to report a bug or request a feature?
|
||||
|
||||
Please read through our [CONTRIBUTING.md](https://github.com/babel/babel/blob/master/CONTRIBUTING.md) and fill out the issue template at [babel/issues](https://github.com/babel/babel/issues)!
|
||||
Please read through our [CONTRIBUTING.md](CONTRIBUTING.md) and fill out the issue template at [babel/issues](https://github.com/babel/babel/issues)!
|
||||
|
||||
### Want to contribute to Babel?
|
||||
|
||||
Check out our [CONTRIBUTING.md](https://github.com/babel/babel/blob/master/CONTRIBUTING.md) to get started with setting up the repo.
|
||||
Check out our [CONTRIBUTING.md](CONTRIBUTING.md) to get started with setting up the repo.
|
||||
|
||||
- If you have already joined Slack, join our [#development](https://babeljs.slack.com/messages/development) channel and say hi!
|
||||
- Check out the issues with the [good first issue](https://github.com/babel/babel/labels/good%20first%20issue) and [help wanted](https://github.com/babel/babel/labels/help%20wanted) label. We suggest also looking at the closed ones to get a sense of the kinds of issues you can tackle.
|
||||
@@ -84,78 +129,8 @@ Check out our [CONTRIBUTING.md](https://github.com/babel/babel/blob/master/CONTR
|
||||
|
||||
### How is the repo structured?
|
||||
|
||||
The Babel repo is managed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md) that is composed of many [npm packages](/packages#readme).
|
||||
|
||||
## Backers
|
||||
|
||||
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/babel#backer)]
|
||||
|
||||
<a href="https://opencollective.com/babel/backer/0/website" target="_blank"><img src="https://opencollective.com/babel/backer/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/1/website" target="_blank"><img src="https://opencollective.com/babel/backer/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/2/website" target="_blank"><img src="https://opencollective.com/babel/backer/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/3/website" target="_blank"><img src="https://opencollective.com/babel/backer/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/4/website" target="_blank"><img src="https://opencollective.com/babel/backer/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/5/website" target="_blank"><img src="https://opencollective.com/babel/backer/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/6/website" target="_blank"><img src="https://opencollective.com/babel/backer/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/7/website" target="_blank"><img src="https://opencollective.com/babel/backer/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/8/website" target="_blank"><img src="https://opencollective.com/babel/backer/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/9/website" target="_blank"><img src="https://opencollective.com/babel/backer/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/10/website" target="_blank"><img src="https://opencollective.com/babel/backer/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/11/website" target="_blank"><img src="https://opencollective.com/babel/backer/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/12/website" target="_blank"><img src="https://opencollective.com/babel/backer/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/13/website" target="_blank"><img src="https://opencollective.com/babel/backer/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/14/website" target="_blank"><img src="https://opencollective.com/babel/backer/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/15/website" target="_blank"><img src="https://opencollective.com/babel/backer/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/16/website" target="_blank"><img src="https://opencollective.com/babel/backer/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/17/website" target="_blank"><img src="https://opencollective.com/babel/backer/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/18/website" target="_blank"><img src="https://opencollective.com/babel/backer/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/19/website" target="_blank"><img src="https://opencollective.com/babel/backer/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/20/website" target="_blank"><img src="https://opencollective.com/babel/backer/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/21/website" target="_blank"><img src="https://opencollective.com/babel/backer/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/22/website" target="_blank"><img src="https://opencollective.com/babel/backer/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/23/website" target="_blank"><img src="https://opencollective.com/babel/backer/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/24/website" target="_blank"><img src="https://opencollective.com/babel/backer/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/25/website" target="_blank"><img src="https://opencollective.com/babel/backer/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/26/website" target="_blank"><img src="https://opencollective.com/babel/backer/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/27/website" target="_blank"><img src="https://opencollective.com/babel/backer/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/28/website" target="_blank"><img src="https://opencollective.com/babel/backer/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/backer/29/website" target="_blank"><img src="https://opencollective.com/babel/backer/29/avatar.svg"></a>
|
||||
|
||||
## Sponsors
|
||||
|
||||
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/babel#sponsor)]
|
||||
|
||||
<a href="https://opencollective.com/babel/sponsor/0/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/1/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/2/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/3/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/4/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/5/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/6/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/7/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/8/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/9/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/10/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/11/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/12/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/13/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/14/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/15/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/16/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/17/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/18/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/19/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/20/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/21/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/22/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/23/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/24/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/25/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/26/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/27/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/28/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/babel/sponsor/29/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/29/avatar.svg"></a>
|
||||
The Babel repo is managed as a [monorepo](doc/design/monorepo.md) that is composed of many [npm packages](packages/README.md).
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/babel/babel/blob/master/LICENSE)
|
||||
[MIT](LICENSE)
|
||||
|
||||
69
SONG.md
Normal file
69
SONG.md
Normal file
@@ -0,0 +1,69 @@
|
||||
## Hallelujah—In Praise of Babel
|
||||
|
||||
➤ [🎶 Audio version here!](https://youtu.be/40abpedBKK8)
|
||||
|
||||
I heard there was a clever trick
|
||||
That rewrote all your JavaScript
|
||||
But you don’t really care for magic, do you
|
||||
Well it goes like this: the source, the dist
|
||||
The ES five, the ES six
|
||||
The sacred script transforming Hallelujah
|
||||
|
||||
Hallelujah, Hallelujah
|
||||
Hallelujah, Hallelujah
|
||||
|
||||
So I added all the shiny things
|
||||
Classes, spreads and template strings
|
||||
Through syntax sugared code I tried to woo you
|
||||
Generators, const and let
|
||||
I used them all without regret
|
||||
And it’s a terse and a destructured Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
Well my faith was strong but I needed proof
|
||||
The standard was my source of truth
|
||||
But TC39 meant nothing to you
|
||||
So even though you weren’t impressed
|
||||
I checked the build against the spec
|
||||
And it’s a more-or-less compliant Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
Now you say the build step’s too complex
|
||||
And you claim no need for ES Next
|
||||
Well I used to think that way before I knew you
|
||||
But your code grows older with each line
|
||||
It’s a joyless dirge on a withered vine
|
||||
It’s a threnody for a bygone Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
Yes I learned about the danger signs
|
||||
How they’d polyfilled a thousand lines
|
||||
The cost of using Maps and Symbols threw you
|
||||
Still I disregarded common sense
|
||||
Now my source is small but the build’s immense
|
||||
And it’s a slow and unresponsive Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
There was a time when they let me know
|
||||
What’s really going on below
|
||||
But now there’s only source maps there to school you
|
||||
And debugging’s not a progress march
|
||||
It’s a frenzied fumble in the dark
|
||||
It’s a labyrinthine search for Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
Well, maybe there’s a god up there
|
||||
But all I ever got from prayers
|
||||
Was broken builds and errors that would spook you
|
||||
And that anguished cry you hear at night
|
||||
Is the plugin I forgot to write
|
||||
It’s a cold and it’s a broken Hallelujah
|
||||
|
||||
Hallelujah etc.
|
||||
|
||||
[Angus Croll](https://github.com/angus-c)
|
||||
128
babel.config.js
Normal file
128
babel.config.js
Normal file
@@ -0,0 +1,128 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function(api) {
|
||||
const env = api.env();
|
||||
|
||||
const includeCoverage = process.env.BABEL_COVERAGE === "true";
|
||||
|
||||
const envOpts = {
|
||||
loose: true,
|
||||
modules: false,
|
||||
exclude: ["transform-typeof-symbol"],
|
||||
};
|
||||
|
||||
let convertESM = true;
|
||||
let ignoreLib = true;
|
||||
let includeRuntime = false;
|
||||
|
||||
switch (env) {
|
||||
// Configs used during bundling builds.
|
||||
case "babel-parser":
|
||||
convertESM = false;
|
||||
ignoreLib = false;
|
||||
break;
|
||||
case "standalone":
|
||||
convertESM = false;
|
||||
ignoreLib = false;
|
||||
includeRuntime = true;
|
||||
break;
|
||||
case "production":
|
||||
// Config during builds before publish.
|
||||
envOpts.targets = {
|
||||
node: "6.9",
|
||||
};
|
||||
break;
|
||||
case "development":
|
||||
envOpts.debug = true;
|
||||
envOpts.targets = {
|
||||
node: "current",
|
||||
};
|
||||
break;
|
||||
case "test":
|
||||
envOpts.targets = {
|
||||
node: "current",
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
const config = {
|
||||
// Our dependencies are all standard CommonJS, along with all sorts of
|
||||
// other random files in Babel's codebase, so we use script as the default,
|
||||
// and then mark actual modules as modules farther down.
|
||||
sourceType: "script",
|
||||
comments: false,
|
||||
ignore: [
|
||||
// These may not be strictly necessary with the newly-limited scope of
|
||||
// babelrc searching, but including them for now because we had them
|
||||
// in our .babelignore before.
|
||||
"packages/*/test/fixtures",
|
||||
ignoreLib ? "packages/*/lib" : null,
|
||||
"packages/babel-standalone/babel.js",
|
||||
"packages/babel-preset-env-standalone/babel-preset-env.js",
|
||||
].filter(Boolean),
|
||||
presets: [["@babel/env", envOpts]],
|
||||
plugins: [
|
||||
// TODO: Use @babel/preset-flow when
|
||||
// https://github.com/babel/babel/issues/7233 is fixed
|
||||
"@babel/plugin-transform-flow-strip-types",
|
||||
["@babel/proposal-class-properties", { loose: true }],
|
||||
"@babel/proposal-export-namespace-from",
|
||||
"@babel/proposal-numeric-separator",
|
||||
[
|
||||
"@babel/proposal-object-rest-spread",
|
||||
{ useBuiltIns: true, loose: true },
|
||||
],
|
||||
|
||||
// Explicitly use the lazy version of CommonJS modules.
|
||||
convertESM ? ["@babel/transform-modules-commonjs", { lazy: true }] : null,
|
||||
].filter(Boolean),
|
||||
overrides: [
|
||||
{
|
||||
test: "packages/babel-parser",
|
||||
plugins: [
|
||||
"babel-plugin-transform-charcodes",
|
||||
["@babel/transform-for-of", { assumeArray: true }],
|
||||
],
|
||||
},
|
||||
{
|
||||
test: "./packages/babel-register",
|
||||
plugins: [
|
||||
// Override the root options to disable lazy imports for babel-register
|
||||
// because otherwise the require hook will try to lazy-import things
|
||||
// leading to dependency cycles.
|
||||
convertESM ? "@babel/transform-modules-commonjs" : null,
|
||||
].filter(Boolean),
|
||||
},
|
||||
{
|
||||
// The vast majority of our src files are modules, but we use
|
||||
// unambiguous to keep things simple until we get around to renaming
|
||||
// the modules to be more easily distinguished from CommonJS
|
||||
test: [
|
||||
"packages/*/src",
|
||||
"packages/*/test",
|
||||
"codemods/*/src",
|
||||
"codemods/*/test",
|
||||
],
|
||||
sourceType: "unambiguous",
|
||||
},
|
||||
{
|
||||
// The runtime transform shouldn't process its own runtime or core-js.
|
||||
exclude: [
|
||||
"packages/babel-runtime",
|
||||
/[\\/]node_modules[\\/](?:@babel\/runtime|babel-runtime|core-js)[\\/]/,
|
||||
],
|
||||
plugins: [includeRuntime ? "@babel/transform-runtime" : null].filter(
|
||||
Boolean
|
||||
),
|
||||
},
|
||||
].filter(Boolean),
|
||||
};
|
||||
|
||||
// we need to do this as long as we do not test everything from source
|
||||
if (includeCoverage) {
|
||||
config.auxiliaryCommentBefore = "istanbul ignore next";
|
||||
config.plugins.push("babel-plugin-istanbul");
|
||||
}
|
||||
|
||||
return config;
|
||||
};
|
||||
27
circle.yml
27
circle.yml
@@ -1,27 +0,0 @@
|
||||
general:
|
||||
artifacts:
|
||||
- "packages/babel-standalone/babel.js"
|
||||
- "packages/babel-standalone/babel.min.js"
|
||||
|
||||
machine:
|
||||
node:
|
||||
version:
|
||||
8
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
cache_directories:
|
||||
- ~/.yarn-cache
|
||||
override:
|
||||
- yarn
|
||||
|
||||
test:
|
||||
override:
|
||||
- make test-ci-coverage
|
||||
# Builds babel-standalone with the regular Babel config
|
||||
- make build
|
||||
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
|
||||
# data for a JS file that's several megabytes large is bound to fail. Here,
|
||||
# we just run the babel-standalone test separately.
|
||||
- ./node_modules/mocha/bin/_mocha packages/babel-standalone/test/ --opts test/mocha.opts
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"prettier/prettier": ["error", { "trailingComma": "all" }],
|
||||
"no-undefined-identifier": 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
# @babel/plugin-codemod-object-assign-to-object-spread
|
||||
|
||||
Transforms old code that uses `Object.assign` with an Object Literal as
|
||||
the first param to use Object Spread syntax.
|
||||
|
||||
## Examples
|
||||
|
||||
```js
|
||||
const obj = Object.assign({
|
||||
test1: 1,
|
||||
}, other, {
|
||||
test2: 2,
|
||||
}, other2);
|
||||
```
|
||||
|
||||
Is transformed to:
|
||||
|
||||
```js
|
||||
const obj = {
|
||||
test1: 1,
|
||||
...other,
|
||||
test2: 2,
|
||||
...other2,
|
||||
};
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-codemod-object-assign-to-object-spread
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@babel/plugin-codemod-object-assign-to-object-spread"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins @babel/plugin-codemod-object-assign-to-object-spread script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("@babel/core").transform("code", {
|
||||
plugins: ["@babel/plugin-codemod-object-assign-to-object-spread"]
|
||||
});
|
||||
```
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@babel/plugin-codemod-object-assign-to-object-spread",
|
||||
"version": "7.0.0-rc.2",
|
||||
"description": "Transforms Object.assign into object spread syntax",
|
||||
"repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-object-assign-to-object-spread",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"@babel/codemod",
|
||||
"@babel/plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/plugin-syntax-object-rest-spread": "7.0.0-rc.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-rc.2",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-rc.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread";
|
||||
|
||||
export default function({ types: t }) {
|
||||
return {
|
||||
inherits: syntaxObjectRestSpread,
|
||||
|
||||
visitor: {
|
||||
CallExpression(path) {
|
||||
if (!path.get("callee").matchesPattern("Object.assign")) return;
|
||||
|
||||
const args = path.get("arguments");
|
||||
if (args.length === 0) return;
|
||||
|
||||
const [objPath] = args;
|
||||
if (!objPath.isObjectExpression()) return;
|
||||
|
||||
const obj = objPath.node;
|
||||
const { properties } = obj;
|
||||
|
||||
for (let i = 1; i < args.length; i++) {
|
||||
const arg = args[i];
|
||||
const { node } = arg;
|
||||
|
||||
if (arg.isObjectExpression()) {
|
||||
properties.push(...node.properties);
|
||||
} else {
|
||||
properties.push(t.spreadElement(node));
|
||||
}
|
||||
}
|
||||
|
||||
path.replaceWith(obj);
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign({test: 1}, {test: 2});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
({
|
||||
test: 1,
|
||||
test: 2
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign({test: 1}, test2, {test: 2}, test3);
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
({
|
||||
test: 1,
|
||||
...test2,
|
||||
test: 2,
|
||||
...test3
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign(test);
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign(test);
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign({test: 1});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
({
|
||||
test: 1
|
||||
});
|
||||
@@ -36,21 +36,21 @@ npm install --save-dev @babel/plugin-codemod-optional-catch-binding
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@babel/codemod-optional-catch-binding"]
|
||||
"plugins": ["@babel/plugin-codemod-optional-catch-binding"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins @babel/codemod-optional-catch-binding script.js
|
||||
babel --plugins @babel/plugin-codemod-optional-catch-binding script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("@babel/core").transform("code", {
|
||||
plugins: ["@babel/codemod-optional-catch-binding"]
|
||||
plugins: ["@babel/plugin-codemod-optional-catch-binding"]
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
{
|
||||
"name": "@babel/plugin-codemod-optional-catch-binding",
|
||||
"version": "7.0.0-beta.32",
|
||||
"version": "7.0.0-rc.2",
|
||||
"description": "Remove unused catch bindings",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-remove-unused-catch-binding",
|
||||
"repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-remove-unused-catch-binding",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"@babel/codemod",
|
||||
"@babel/plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.32"
|
||||
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-rc.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.32"
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.32",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.32"
|
||||
"@babel/core": "7.0.0-rc.2",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-rc.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import syntaxOptionalCatchBinding from "@babel/plugin-syntax-optional-catch-binding";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
export default function({ types: t }) {
|
||||
return {
|
||||
inherits: syntaxOptionalCatchBinding,
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
The [AST specification](https://github.com/babel/babel/blob/master/packages/babylon/ast/spec.md) has been moved to the Babylon package, `packages/babylon`.
|
||||
The [AST specification](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md) has been moved to the babel parser package, `packages/babel-parser`.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
The Babel compiler is **only** supported in these environments:
|
||||
|
||||
- Modern browsers such as Chrome, Firefox, Safari, Edge etc.
|
||||
- Node.js 4 and upper versions
|
||||
- Node.js 6 and newer versions
|
||||
|
||||
## Unsupported environments
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ This is quite taboo but let's look at the pros and cons:
|
||||
* Easy to coordinate changes across modules.
|
||||
* Single place to report issues.
|
||||
* Easier to setup a development environment.
|
||||
* Tests across modules are ran together which finds bugs that touch multiple modules easier.
|
||||
* Tests across modules are run together which finds bugs that touch multiple modules easier.
|
||||
|
||||
**Cons:**
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"prettier/prettier": ["error", { "trailingComma": "all" }],
|
||||
"no-undefined-identifier": 2
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
/lib
|
||||
debug-fixtures
|
||||
fixtures
|
||||
/data
|
||||
/flow-typed
|
||||
test/tmp
|
||||
@@ -1,15 +0,0 @@
|
||||
coverage
|
||||
src
|
||||
test
|
||||
lib/types.js
|
||||
node_modules
|
||||
scripts
|
||||
.eslintignore
|
||||
.travis.yml
|
||||
codecov.yml
|
||||
yarn.lock
|
||||
.nyc_output
|
||||
.vscode
|
||||
.eslintrc
|
||||
babel-preset-env-*.tgz
|
||||
flow-typed
|
||||
@@ -1,668 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
## v1.6.1 (2017-10-17)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Update compat table to fix two small issues ([#445](https://github.com/babel/babel-preset-env/pull/445)) (@danez)
|
||||
|
||||
ES2015 destructuring is not fully supported in Edge 15 and the polyfill required again. `es6.math.imul` is supported on Android as of version 4.4
|
||||
|
||||
- Add polyfills for ES6 static Object methods ([#441](https://github.com/babel/babel-preset-env/pull/441)) (@danez)
|
||||
|
||||
Functions such as `Object.keys`, `Object.freeze`, ... do already exist in ES5, but their behaviour changed in ES2015. `babel-preset-env` with `builtIns: true` now adds the core-js polyfills for this methods if the browser only supports the ES5 variant of the method (like IE11 for example)
|
||||
|
||||
- Normalize module format of plugins/built-ins data ([#376](https://github.com/babel/babel-preset-env/pull/376)) (@rtsao)
|
||||
|
||||
## v1.6.0 (2017-07-04)
|
||||
|
||||
### :rocket: New Feature
|
||||
|
||||
- Bump compat-table for node8 support ([#363](https://github.com/babel/babel-preset-env/pull/363)) (@existentialism)
|
||||
|
||||
We updated our mappings to support native trailing function commas and string paddings in Node.js 8+.
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Handle `chromeandroid` browserslist value ([#367](https://github.com/babel/babel-preset-env/pull/367)) (@yavorsky)
|
||||
|
||||
We added support for using browserslist's `chromeandroid` in `targets`.
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
- Tweak uglify option docs ([#368](https://github.com/babel/babel-preset-env/pull/368)) (@existentialism)
|
||||
|
||||
Thanks to @graingert and @pfiaux for pointing out some needed updates to the `uglify-js`-related docs.
|
||||
|
||||
## v1.5.2 (2017-06-07)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Ensure explicit targets always override browsers key targets ([#346](https://github.com/babel/babel-preset-env/pull/346)) (@existentialism)
|
||||
|
||||
`browser` targets should be overridden by explicit targets, and we inadvertently broke this when we landed string version support.
|
||||
|
||||
## v1.5.1 (2017-05-22)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Compile with loose mode ([#322](https://github.com/babel/babel-preset-env/pull/332)) (@existentialism)
|
||||
|
||||
## v1.5.0 (2017-05-19)
|
||||
|
||||
### :rocket: New Feature
|
||||
|
||||
- Support target versions as strings ([#321](https://github.com/babel/babel-preset-env/pull/321)) (@existentialism)
|
||||
|
||||
We were originally waiting on 2.x for a breaking change, but since node v7.10
|
||||
and other targets are causing some pain, we decided to land a backwards
|
||||
compatible version.
|
||||
|
||||
### :house: Internal
|
||||
|
||||
- Backport: use preset-env and remove flow-strip-types ([#324](https://github.com/babel/babel-preset-env/pull/324)) (@yavorsky)
|
||||
- Bump electron-to-chromium ([#329](https://github.com/babel/babel-preset-env/pull/329)) (@existentialism)
|
||||
- Tweak version mappings to match compat-table updates ([#323](https://github.com/babel/babel-preset-env/pull/323)) (@existentialism)
|
||||
- Bump browserslist ([#319](https://github.com/babel/babel-preset-env/pull/319)) (@existentialism)
|
||||
- Bump compat-table ([#307](https://github.com/babel/babel-preset-env/pull/307)) (@existentialism)
|
||||
- Add debug-fixtures and test/tmp to .eslintignore ([#305](https://github.com/babel/babel-preset-env/pull/305)) (@yavorsky)
|
||||
|
||||
## v1.4.0 (2017-04-14)
|
||||
|
||||
### :rocket: New Feature
|
||||
|
||||
- Support `spec` option ([#98](https://github.com/babel/babel-preset-env/pull/98)) (@Kovensky)
|
||||
|
||||
Added an option to enable more spec compliant, but potentially slower, transformations for any plugins in this preset that support them.
|
||||
|
||||
- Bump compat-table for Edge 15 support ([#273](https://github.com/babel/babel-preset-env/pull/273)) (@existentialism)
|
||||
|
||||
We updated our mappings so that you can get native support for async/await and other goodies when targeting Edge 15!
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Add Android browser to name map ([#270](https://github.com/babel/babel-preset-env/pull/270)) (@existentialism)
|
||||
|
||||
Fixed a bug that was ignoring Android targets in browserslist queries (for example: "Android >= 4").
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
- Clarify note about loading polyfills only once ([#282](https://github.com/babel/babel-preset-env/pull/282)) (@darahak)
|
||||
- Add a reminder about include/exclude options ([#275](https://github.com/babel/babel-preset-env/pull/275)) (@existentialism)
|
||||
|
||||
### :house: Internal
|
||||
|
||||
- Chore: reduce package size. ([#281](https://github.com/babel/babel-preset-env/pull/281)) (@evilebottnawi)
|
||||
- Remove deprecated comment ([#271](https://github.com/babel/babel-preset-env/pull/271)) (@yavorsky)
|
||||
|
||||
## v1.3.3 (2017-04-07)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Support electron version in a string format ([#252](https://github.com/babel/babel-preset-env/pull/252)) (@yavorsky)
|
||||
|
||||
Adding electron as a target was an inadvertent breaking change as it no longer
|
||||
allowed string versions. We added an exception for now, even though it is
|
||||
inconsistent with other versions. Just as a note, the upcoming version 2.x will
|
||||
allow _both_ number and string versions.
|
||||
|
||||
- Ensure const-check plugin order ([#257](https://github.com/babel/babel-preset-env/pull/257)) (@existentialism)
|
||||
|
||||
We now force the `const-es2015-check` plugin to run first (so that it can
|
||||
correctly report issues before they get transpiled away).
|
||||
|
||||
### :rocket: New Feature
|
||||
|
||||
- Allow use `babel-plugin-` prefix for include and exclude ([#242](https://github.com/babel/babel-preset-env/pull/242)) (@yavorsky)
|
||||
|
||||
The `include` and `exclude` options now allow both prefixed (`babel-plugin-transform-es2015-spread`)
|
||||
and prefix-less (`transform-es2015-spread`) plugin names.
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
- Note babel plugin prefix handling in include/exclude ([#245](https://github.com/babel/babel-preset-env/pull/245)) (@existentialism)
|
||||
- Fix README: debug option shows info in stdout. ([#236](https://github.com/babel/babel-preset-env/pull/236)) (@Gerhut)
|
||||
|
||||
### :house: Internal
|
||||
|
||||
- Add simple smoke-test ([#240](https://github.com/babel/babel-preset-env/pull/240)) (@existentialism)
|
||||
- Add prepublish script (@existentialism)
|
||||
|
||||
## v1.3.2 (2017-03-30)
|
||||
|
||||
- Fixed an issue with a broken publish
|
||||
|
||||
## v1.3.1 (2017-03-30)
|
||||
|
||||
- Fixed a regression with missing files due to `.npmignore`.
|
||||
|
||||
## v1.3.0 (2017-03-30)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Add check for ArrayBuffer[Symbol.species] ([#233](https://github.com/babel/babel-preset-env/pull/233)) (@existentialism)
|
||||
|
||||
We now properly check for `Symbol.species` support in ArrayBuffer and include the
|
||||
polyfill if necessary. This should, as a side effect, fix ArrayBuffer-related
|
||||
errors on IE9.
|
||||
|
||||
### :nail_care: Polish
|
||||
|
||||
- Fill data with electron as a target. ([#229](https://github.com/babel/babel-preset-env/pull/229)) (@yavorsky)
|
||||
|
||||
We've simplified things by adding `electron` as a target instead of doing a bunch of
|
||||
things at runtime. Electron targets should now also be displayed in the debug output.
|
||||
|
||||
- separate default builtins for platforms ([#226](https://github.com/babel/babel-preset-env/pull/226)) (@restrry)
|
||||
|
||||
If you are targeting the `node` environment exclusively, the always-included web polyfills
|
||||
(like `dom.iterable`, and a few others) will now no longer be included.
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
* remove deprecated projects ([#223](https://github.com/babel/babel-preset-env/pull/223)) [skip ci] (@stevemao)
|
||||
|
||||
### :house: Internal
|
||||
|
||||
* npmignore: Add related to build data and codecov. ([#216](https://github.com/babel/babel-preset-env/pull/216)) (@yavorsky)
|
||||
|
||||
## v1.2.2 (2017-03-14)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Refactor browser data parsing to handle families ([#208](https://github.com/babel/babel-preset-env/pull/208)) (@existentialism)
|
||||
|
||||
When parsing plugin data, we weren't properly handling browser families. This caused
|
||||
`transform-es2015-block-scoping` and other plugins to be incorrectly added for Edge >= 12.
|
||||
(s/o to @mgol for the the report and review!)
|
||||
|
||||
- Add typed array methods to built-ins features. ([#198](https://github.com/babel/babel-preset-env/pull/198)) (@yavorsky)
|
||||
|
||||
Fixes an issue where some TypedArray features were not being polyfilled properly. (s/o to @alippai for the report!)
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
- Fixed minor typo in readme ([#199](https://github.com/babel/babel-preset-env/pull/199)) (@bl4ckdu5t)
|
||||
- Add built-ins, better links, compat-table url, etc ([#195](https://github.com/babel/babel-preset-env/pull/195)) (@yavorsky)
|
||||
- Change CONTRIBUTING.md to use absolute paths ([#194](https://github.com/babel/babel-preset-env/pull/194)) (@aaronang)
|
||||
|
||||
### :house: Internal
|
||||
|
||||
- Bump plugins ([#201](https://github.com/babel/babel-preset-env/pull/201)) (@yavorsky)
|
||||
- Enable code coverage ([#200](https://github.com/babel/babel-preset-env/pull/200)) (@alxpy)
|
||||
- Increase mocha timeout to 10s ([#202](https://github.com/babel/babel-preset-env/pull/202)) (@yavorsky)
|
||||
|
||||
## v1.2.1 (2017-03-06)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Add transform-duplicate-keys mapping ([#192](https://github.com/babel/babel-preset-env/pull/192)) (@existentialism)
|
||||
|
||||
Our 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!)
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
- Clarify reasons for the uglify option in README.md ([#188](https://github.com/babel/babel-preset-env/pull/188)) (@mikegreiling)
|
||||
|
||||
## v1.2.0 (2017-03-03)
|
||||
|
||||
### :rocket: New Feature
|
||||
|
||||
- Add uglify as a target ([#178](https://github.com/babel/babel-preset-env/pull/178)) (@yavorsky)
|
||||
|
||||
Support 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.
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"targets": {
|
||||
"chrome": 55,
|
||||
"uglify": true
|
||||
},
|
||||
"useBuiltIns": true,
|
||||
"modules": false
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Respect older versions in invert equals map ([#180](https://github.com/babel/babel-preset-env/pull/180)) (@danez)
|
||||
|
||||
Fixes a number of bugs that caused some incorrect and/or missing environment data when parsing `compat-table`.
|
||||
|
||||
## v1.1.11 (2017-03-01)
|
||||
|
||||
This release primarily upgrades `compat-table`, which adds support for async on Node 7.6!
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Fix hasBeenWarned condition. ([#175](https://github.com/babel/babel-preset-env/pull/175)) (@yavorsky)
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
- Add yarn example. ([#174](https://github.com/babel/babel-preset-env/pull/174)) (@yavorsky)
|
||||
|
||||
### :house: Internal
|
||||
|
||||
- Bump compat-table ([#177](https://github.com/babel/babel-preset-env/pull/177)) (@existentialism)
|
||||
- Add electron version exception test ([#176](https://github.com/babel/babel-preset-env/pull/176)) (@existentialism)
|
||||
|
||||
## v1.1.10 (2017-02-24)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Drop use of lodash/intersection from checkDuplicateIncludeExcludes ([#173](https://github.com/babel/babel-preset-env/pull/173)) (@existentialism)
|
||||
|
||||
## v1.1.9 (2017-02-24)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Add tests for debug output ([#156](https://github.com/babel/babel-preset-env/pull/156)) (@existentialism)
|
||||
|
||||
Since 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.
|
||||
|
||||
- Fixes #143. Log correct targets. ([#155](https://github.com/babel/babel-preset-env/pull/155)) (@yavorsky)
|
||||
|
||||
This fixes a bug in the `debug` output where incorrect target(s) were being displayed for why a particular plugin/preset was being included.
|
||||
|
||||
Given targets:
|
||||
|
||||
```txt
|
||||
{
|
||||
"firefox": 52,
|
||||
"node": 7.4
|
||||
}
|
||||
```
|
||||
|
||||
Before:
|
||||
|
||||
```txt
|
||||
Using plugins:
|
||||
transform-es2015-destructuring {"node":6.5}
|
||||
transform-es2015-for-of {"node":6.5}
|
||||
transform-es2015-function-name {"node":6.5}
|
||||
transform-es2015-literals {"node":4}
|
||||
transform-exponentiation-operator {"firefox":52}
|
||||
syntax-trailing-function-commas {"firefox":52}
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```txt
|
||||
Using plugins:
|
||||
transform-es2015-destructuring {"firefox":52}
|
||||
transform-es2015-for-of {"firefox":52}
|
||||
transform-es2015-function-name {"firefox":52}
|
||||
transform-es2015-literals {"firefox":52}
|
||||
transform-exponentiation-operator {"node":7.4}
|
||||
syntax-trailing-function-commas {"node":7.4}
|
||||
```
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
- Fix compat-table link in contributing.md (@existentialism)
|
||||
- Update README examples to fix website ([#151](https://github.com/babel/babel-preset-env/pull/)) (@existentialism)
|
||||
- Fix few typos ([#146](https://github.com/babel/babel-preset-env/pull/146)) (@existentialism)
|
||||
- Add configuration example to clarify `debug: true` ([#138](https://github.com/babel/babel-preset-env/pull/138)) (@yavorsky)
|
||||
- Fix CHANGELOG’s v1.1.8 updates typo. ([#136](https://github.com/babel/babel-preset-env/pull/136)) (@yavorsky)
|
||||
- README: Update `debug: true` example. ([#138](https://github.com/babel/babel-preset-env/pull/138)) (@yavorsky)
|
||||
|
||||
### :house: Internal
|
||||
|
||||
- update compat ([#169](https://github.com/babel/babel-preset-env/pull/169)) (@hzoo)
|
||||
- Use external Electron to Chromium library ([#144](https://github.com/babel/babel-preset-env/pull/144)) (@Kilian)
|
||||
- Update yarn lockfile ([#152](https://github.com/babel/babel-preset-env/pull/152)) (@existentialism)
|
||||
- Extract option normalization into independant file ([#125](https://github.com/babel/babel-preset-env/pull/125)) (@baer)
|
||||
- Update yarnfile ([#145](https://github.com/babel/babel-preset-env/pull/145)) (@baer)
|
||||
- devDeps: eslint-config-babel v5.0.0 ([#139](https://github.com/babel/babel-preset-env/pull/139)) (@kaicataldo)
|
||||
- Update compat-table, build data ([#135](https://github.com/babel/babel-preset-env/pull/135)) (@hzoo)
|
||||
|
||||
## v1.1.8 (2017-01-10)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Debug: Transformations before logs. ([#128](https://github.com/babel/babel-preset-env/pull/128)) (@yavorsky)
|
||||
|
||||
Makes 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)).
|
||||
|
||||
### :house: Internal
|
||||
|
||||
- Remove unnecessary extension. ([#131](https://github.com/babel/babel-preset-env/pull/131)) (@roman-yakobnyuk)
|
||||
- Include yarn.lock and update CI. ([#124](https://github.com/babel/babel-preset-env/pull/124)) (@existentialism)
|
||||
|
||||
## v1.1.7 (2017-01-09)
|
||||
|
||||
Had a publishing issue in the previous release.
|
||||
|
||||
## v1.1.6 (2017-01-06)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Explicitly resolve lowest browser version. ([#121](https://github.com/babel/babel-preset-env/pull/121)) (@brokenmass)
|
||||
|
||||
```js
|
||||
{
|
||||
"targets": {
|
||||
"browsers": ["ios >= 6"] // was resolving to {ios: 10} rather than {ios: 6}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## v1.1.5 (2017-01-04)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
- Show error if target version is not a number. ([#107](https://github.com/babel/babel-preset-env/pull/107)) (@existentialism)
|
||||
|
||||
```js
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"targets": {
|
||||
"chrome": "52", // will error since it's not a number,
|
||||
"chrome": 52 // correct!
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- Fix targets for the `debug` option. ([#109](https://github.com/babel/babel-preset-env/pull/109)) (@yavorsky)
|
||||
|
||||
Now it prints the transformed targets/environments rather than the browsers query.
|
||||
|
||||
```txt
|
||||
Using targets:
|
||||
{
|
||||
"chrome": 53,
|
||||
"ie": 10,
|
||||
"node": 6
|
||||
}
|
||||
|
||||
Modules transform: false
|
||||
|
||||
Using plugins:
|
||||
transform-es2015-arrow-functions {"chrome":47,"node":6}
|
||||
transform-es2015-block-scoped-functions {"chrome":41,"ie":11,"node":4}
|
||||
|
||||
Using polyfills:
|
||||
es6.typed.uint8-clamped-array {"chrome":5,"node":0.12}
|
||||
es6.map {"chrome":51,"node":6.5}
|
||||
```
|
||||
|
||||
## v1.1.4 (2016-12-16)
|
||||
|
||||
v1.1.2-v1.1.4
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
The new `exclude`/`include` options weren't working correctly for built-ins. ([#102](https://github.com/babel/babel-preset-env/pull/102)).
|
||||
|
||||
Also fixes an issue with debug option.
|
||||
|
||||
## v1.1.1 (2016-12-13)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
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.
|
||||
|
||||
## v1.1.0 (2016-12-13)
|
||||
|
||||
### :rocket: New Feature
|
||||
|
||||
- Add `exclude` option, rename `whitelist` to `include` ([#89](https://github.com/babel/babel-preset-env/pull/89)) (@hzoo)
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"targets": {
|
||||
"browsers": ["last 2 versions", "safari >= 7"]
|
||||
},
|
||||
"include": ["transform-es2015-arrow-functions"],
|
||||
"exclude": [
|
||||
"transform-regenerator",
|
||||
"transform-async-to-generator",
|
||||
"map"
|
||||
],
|
||||
"useBuiltIns": true
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
`"exclude": ["transform-regenerator"]` doesn't transform generators and removes `regeneratorRuntime` from being imported.
|
||||
|
||||
`"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).
|
||||
|
||||
`"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)).
|
||||
|
||||
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.`)
|
||||
|
||||
### :house: Internal
|
||||
|
||||
- Optimize result filtration. ([#77](https://github.com/babel/babel-preset-env/pull/77)) (@yavorsky)
|
||||
- Update eslint config to align with other babel projects ([#79](https://github.com/babel/babel-preset-env/pull/79)) (@baer)
|
||||
- Update pathnames to avoid uppercase ([#80](https://github.com/babel/babel-preset-env/pull/80)) (@baer)
|
||||
- Refactor build data for clarity/consistency ([#81](https://github.com/babel/babel-preset-env/pull/81)) (@baer)
|
||||
- Update linting rules to cover all js ([#82](https://github.com/babel/babel-preset-env/pull/82)) (@baer)
|
||||
- Cleanup lib before rebuilding ([#87](https://github.com/babel/babel-preset-env/pull/87)) (@baer)
|
||||
- Move linting dependency to be dev only ([#88](https://github.com/babel/babel-preset-env/pull/88)) (@baer)
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
- Fix typo ([#78](https://github.com/babel/babel-preset-env/pull/78)) (@rohmanhm)
|
||||
- Fix PR link in changelog. ([#75](https://github.com/babel/babel-preset-env/pull/75)) (@nhajidin)
|
||||
|
||||
## v1.0.2 (2016-12-10)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
* Fix issue with Object.getOwnPropertySymbols ([#71](https://github.com/babel/babel-preset-env/pull/71)) ([@existentialism](https://github.com/existentialism))
|
||||
|
||||
Was requiring the wrong module kinda of like in v1.0.1:
|
||||
|
||||
https://github.com/zloirock/core-js#ecmascript-6-symbol
|
||||
|
||||
```diff
|
||||
-import "core-js/modules/es6.object.get-own-property-symbols";
|
||||
```
|
||||
|
||||
The test is just a part of `Symbol`.
|
||||
|
||||
## v1.0.1 (2016-12-10)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
* Fix regenerator import ([#68](https://github.com/babel/babel-preset-env/pull/68)) ([@hzoo](https://github.com/hzoo))
|
||||
|
||||
We were outputting an invalid path for `regenerator`!
|
||||
|
||||
```diff
|
||||
+import "regenerator-runtime/runtime";
|
||||
-import "core-js/modules/regenerator-runtime/runtime"-
|
||||
```
|
||||
|
||||
## v1.0.0 (2016-12-09)
|
||||
|
||||
### :rocket: New Feature
|
||||
|
||||
* 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))
|
||||
|
||||
A way to apply `babel-preset-env` for polyfills (via `"babel-polyfill"``).
|
||||
|
||||
> 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.
|
||||
|
||||
Install
|
||||
|
||||
```
|
||||
npm install babel-polyfill --save
|
||||
```
|
||||
|
||||
In
|
||||
|
||||
```js
|
||||
import "babel-polyfill"; // create an entry js file that contains this
|
||||
// or
|
||||
import "core-js";
|
||||
```
|
||||
|
||||
Out (different based on environment)
|
||||
|
||||
```js
|
||||
// chrome 55
|
||||
import "core-js/modules/es7.string.pad-start"; // haha left_pad
|
||||
import "core-js/modules/es7.string.pad-end";
|
||||
import "core-js/modules/web.timers";
|
||||
import "core-js/modules/web.immediate";
|
||||
import "core-js/modules/web.dom.iterable";
|
||||
```
|
||||
|
||||
`.babelrc` Usage
|
||||
|
||||
```js
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"targets": {
|
||||
"electron": 1.4
|
||||
},
|
||||
"modules": false, // webpack 2
|
||||
"useBuiltIns": true // new option
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
> Also looking to make an easier integration point via Webpack with this method. Please reach out if you have ideas!
|
||||
|
||||
---
|
||||
|
||||
* Support [Electron](http://electron.atom.io/) ([#55](https://github.com/babel/babel-preset-env/pull/55)) ([@paulcbetts](https://github.com/paulcbetts))
|
||||
|
||||
Electron is also an environment, so [Paul went ahead](https://twitter.com/paulcbetts/status/804507070103851008) and added support for this!
|
||||
|
||||
`.babelrc` Usage
|
||||
|
||||
```js
|
||||
{
|
||||
"presets": [ ["env", {"targets": { "electron": 1.4 }}]]
|
||||
}
|
||||
```
|
||||
|
||||
> 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:)
|
||||
|
||||
|
||||
|
||||
## v0.0.9 (2016-11-24)
|
||||
|
||||
### :rocket: New Feature
|
||||
|
||||
* Support Opera ([#48](https://github.com/babel/babel-preset-env/pull/48)) (Henry Zhu)
|
||||
|
||||
Was as simple as modifying the chrome version and subtracting 13! (so chrome 54 = opera 41)
|
||||
|
||||
```js
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"targets": {
|
||||
"opera": 41
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## v0.0.8 (2016-11-16)
|
||||
|
||||
### :nail_care: Polish
|
||||
|
||||
* Only print the debug info once ([#46](https://github.com/babel/babel-preset-env/pull/46) (Henry Zhu)
|
||||
|
||||
When using the `debug` option it was printing the data for each file processed rather than once.
|
||||
|
||||
```js
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"debug": true
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## v0.0.7 (2016-11-02)
|
||||
|
||||
### :rocket: New Feature
|
||||
|
||||
* hardcode a current node version option ([#35](https://github.com/babel/babel-preset-env/pull/35)) (Henry Zhu)
|
||||
|
||||
```js
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"targets": {
|
||||
"node": "current" // parseFloat(process.versions.node)
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
* add 'whitelist' option ([#31](https://github.com/babel/babel-preset-env/pull/31)) (Henry Zhu)
|
||||
|
||||
```js
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"targets": {
|
||||
"chrome": 52
|
||||
},
|
||||
"whitelist": ["transform-es2015-arrow-functions"]
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
* Add more aliases (Henry Zhu)
|
||||
* Update plugin data: firefox 52 supports async/await! ([#29](https://github.com/babel/babel-preset-env/pull/29)) (Henry Zhu)
|
||||
|
||||
### :bug: Bug Fixes
|
||||
|
||||
* Use compat-table equals option ([#36](https://github.com/babel/babel-preset-env/pull/36)) (Henry Zhu)
|
||||
|
||||
Compute and use `compat-table` equivalents
|
||||
|
||||
```js
|
||||
{
|
||||
"safari6": "phantom",
|
||||
"chrome44": "iojs",
|
||||
"chrome50": "node64",
|
||||
"chrome51": "node65",
|
||||
"chrome54": "node7",
|
||||
"chrome30": "android44",
|
||||
"chrome37": "android50",
|
||||
"chrome39": "android51",
|
||||
"safari7": "ios7",
|
||||
"safari71_8": "ios8",
|
||||
"safari9": "ios9",
|
||||
"safari10": "ios10",
|
||||
"chrome50": "node6"
|
||||
}
|
||||
```
|
||||
|
||||
* Change default behavior to act the same as babel-preset-latest ([#33](https://github.com/babel/babel-preset-env/pull/33)) (Henry Zhu)
|
||||
|
||||
```js
|
||||
{ "presets": ["env"] } // should act the same as babel-preset-latest
|
||||
```
|
||||
|
||||
## Internal
|
||||
|
||||
* Add fixture helper for tests ([#28](https://github.com/babel/babel-preset-env/pull/28)) (Henry Zhu)
|
||||
@@ -1,572 +0,0 @@
|
||||
# @babel/preset-env [](https://www.npmjs.com/package/babel-preset-env) [](https://travis-ci.org/babel/babel-preset-env) [](https://www.npmjs.com/package/babel-preset-env) [](https://codecov.io/github/babel/babel-preset-env)
|
||||
|
||||
> A Babel preset that compiles [ES2015+](https://github.com/tc39/proposals/blob/master/finished-proposals.md) down to ES5 by automatically determining the Babel plugins and polyfills you need based on your targeted browser or runtime environments.
|
||||
|
||||
```sh
|
||||
npm install @babel/preset-env --save-dev
|
||||
```
|
||||
|
||||
Without any configuration options, @babel/preset-env behaves exactly the same as @babel/preset-latest (or @babel/preset-es2015, @babel/preset-es2016, and @babel/preset-es2017 together).
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": ["@babel/env"]
|
||||
}
|
||||
```
|
||||
|
||||
You can also configure it to only include the polyfills and transforms needed for the browsers you support. Compiling only what's needed can make your bundles smaller and your life easier.
|
||||
|
||||
This example only includes the polyfills and code transforms needed for the last two versions of each browser, and versions of Safari greater than or equal to 7. We use [browserslist](https://github.com/ai/browserslist) to parse this information, so you can use [any valid query format supported by browserslist](https://github.com/ai/browserslist#queries).
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"browsers": ["last 2 versions", "safari >= 7"]
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Similarly, if you're targeting Node.js instead of the browser, you can configure babel-preset-env to only include the polyfills and transforms necessary for a particular version:
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"node": "6.10"
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
For convenience, you can use `"node": "current"` to only include the necessary polyfills and transforms for the Node.js version that you use to run Babel:
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"node": "current"
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- [How it Works](#how-it-works)
|
||||
- [Install](#install)
|
||||
- [Usage](#usage)
|
||||
- [Options](#options)
|
||||
- [Examples](#examples)
|
||||
- [Issues](#issues)
|
||||
|
||||
## How it Works
|
||||
|
||||
### Determine environment support for ECMAScript features
|
||||
|
||||
Use external data such as [`compat-table`](https://github.com/kangax/compat-table) to determine browser support. (We should create PRs there when necessary)
|
||||
|
||||

|
||||
|
||||
We can periodically run [build-data.js](https://github.com/babel/babel-preset-env/blob/master/scripts/build-data.js) which generates [plugins.json](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json).
|
||||
|
||||
Ref: [#7](https://github.com/babel/babel-preset-env/issues/7)
|
||||
|
||||
### Maintain a mapping between JavaScript features and Babel plugins
|
||||
|
||||
> Currently located at [plugin-features.js](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js).
|
||||
|
||||
This should be straightforward to do in most cases. There might be cases where plugins should be split up more or certain plugins aren't standalone enough (or impossible to do).
|
||||
|
||||
### Support all plugins in Babel that are considered `latest`
|
||||
|
||||
> Default behavior without options is the same as `@babel/preset-latest`.
|
||||
|
||||
It won't include `stage-x` plugins. env will support all plugins in what we consider the latest version of JavaScript (by matching what we do in [`@babel/preset-latest`](http://babeljs.io/docs/plugins/preset-latest/)).
|
||||
|
||||
Ref: [#14](https://github.com/babel/babel-preset-env/issues/14)
|
||||
|
||||
### Determine the lowest common denominator of plugins to be included in the preset
|
||||
|
||||
If you are targeting IE 8 and Chrome 55 it will include all plugins required by IE 8 since you would need to support both still.
|
||||
|
||||
### Support a target option `"node": "current"` to compile for the currently running node version.
|
||||
|
||||
For example, if you are building on Node 6, arrow functions won't be converted, but they will if you build on Node 0.12.
|
||||
|
||||
### Support a `browsers` option like autoprefixer.
|
||||
|
||||
Use [browserslist](https://github.com/ai/browserslist) to declare supported environments by performing queries like `> 1%, last 2 versions`.
|
||||
|
||||
Ref: [#19](https://github.com/babel/babel-preset-env/pull/19)
|
||||
|
||||
### Browserslist support.
|
||||
|
||||
[Browserslist](https://github.com/ai/browserslist) is a library used to share a supported list of browsers between different front-end tools like [autoprefixer](https://github.com/postcss/autoprefixer), [stylelint](https://stylelint.io/), [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat) and many others.
|
||||
|
||||
By default, @babel/preset-env will use [browserslist config sources](https://github.com/ai/browserslist#queries).
|
||||
|
||||
For example, to enable only the polyfills and plugins needed for a project targeting *last 2 versions* and *IE10*:
|
||||
|
||||
**.babelrc**
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"useBuiltIns": "entry"
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**browserslist**
|
||||
```
|
||||
Last 2 versions
|
||||
IE 10
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
**package.json**
|
||||
```
|
||||
"browserslist": "last 2 versions, ie 10"
|
||||
```
|
||||
|
||||
Browserslist config will be ignored if: 1) `targets.browsers` was specified 2) or with `ignoreBrowserslistConfig: true` option ([see more](#ignoreBrowserslistConfig)):
|
||||
|
||||
#### Targets merging.
|
||||
|
||||
1. If [targets.browsers](#targetsbrowsers) is defined - the browserslist config will be ignored. The browsers specified in `targets` will be merged with [any other explicitly defined targets](#targets). If merged, targets defined explicitly will override the same targets received from `targets.browsers`.
|
||||
|
||||
2. If [targets.browsers](#targetsbrowsers) is _not_ defined - the program will search browserslist file or `package.json` with `browserslist` field. The search will start from the working directory of the process or from the path specified by the `configPath` option, and go up to the system root. If both a browserslist file and configuration inside a `package.json` are found, an exception will be thrown.
|
||||
|
||||
3. If a browserslist config was found and other targets are defined (but not [targets.browsers](#targetsbrowsers)), the targets will be merged in the same way as `targets` defined explicitly with `targets.browsers`.
|
||||
|
||||
## Install
|
||||
|
||||
With [npm](https://www.npmjs.com):
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/preset-env
|
||||
```
|
||||
|
||||
Or [yarn](https://yarnpkg.com):
|
||||
|
||||
```sh
|
||||
yarn add @babel/preset-env --dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The default behavior without options runs all transforms (behaves the same as [@babel/preset-latest](https://babeljs.io/docs/plugins/preset-latest/)).
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": ["@babel/env"]
|
||||
}
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
For more information on setting options for a preset, refer to the [plugin/preset options](http://babeljs.io/docs/plugins/#plugin-preset-options) documentation.
|
||||
|
||||
### `targets`
|
||||
|
||||
`{ [string]: number | string }`, defaults to `{}`.
|
||||
|
||||
Takes an object of environment versions to support.
|
||||
|
||||
Each target environment takes a number or a string (we recommend using a string when specifying minor versions like `node: "6.10"`).
|
||||
|
||||
Example environments: `chrome`, `opera`, `edge`, `firefox`, `safari`, `ie`, `ios`, `android`, `node`, `electron`.
|
||||
|
||||
The [data](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json) for this is generated by running the [build-data script](https://github.com/babel/babel-preset-env/blob/master/scripts/build-data.js) which pulls in data from [compat-table](https://kangax.github.io/compat-table).
|
||||
|
||||
### `targets.node`
|
||||
|
||||
`number | string | "current" | true`
|
||||
|
||||
If you want to compile against the current node version, you can specify `"node": true` or `"node": "current"`, which would be the same as `"node": process.versions.node`.
|
||||
|
||||
### `targets.browsers`
|
||||
|
||||
`Array<string> | string`
|
||||
|
||||
A query to select browsers (ex: last 2 versions, > 5%) using [browserslist](https://github.com/ai/browserslist).
|
||||
|
||||
Note, browsers' results are overridden by explicit items from `targets`.
|
||||
|
||||
### `spec`
|
||||
|
||||
`boolean`, defaults to `false`.
|
||||
|
||||
Enable more spec compliant, but potentially slower, transformations for any plugins in this preset that support them.
|
||||
|
||||
### `loose`
|
||||
|
||||
`boolean`, defaults to `false`.
|
||||
|
||||
Enable "loose" transformations for any plugins in this preset that allow them.
|
||||
|
||||
### `modules`
|
||||
|
||||
`"amd" | "umd" | "systemjs" | "commonjs" | false`, defaults to `"commonjs"`.
|
||||
|
||||
Enable transformation of ES6 module syntax to another module type.
|
||||
|
||||
Setting this to `false` will not transform modules.
|
||||
|
||||
### `debug`
|
||||
|
||||
`boolean`, defaults to `false`.
|
||||
|
||||
Outputs the targets/plugins used and the version specified in [plugin data version](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json) to `console.log`.
|
||||
|
||||
### `include`
|
||||
|
||||
`Array<string>`, defaults to `[]`.
|
||||
|
||||
An array of plugins to always include.
|
||||
|
||||
Valid options include any:
|
||||
|
||||
- [Babel plugins](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js) - both with (`@babel/plugin-transform-spread`) and without prefix (`transform-spread`) are supported.
|
||||
|
||||
- [Built-ins](https://github.com/babel/babel-preset-env/blob/master/data/built-in-features.js), such as `map`, `set`, or `object.assign`.
|
||||
|
||||
This option is useful if there is a bug in a native implementation, or a combination of a non-supported feature + a supported one doesn't work.
|
||||
|
||||
For example, Node 4 supports native classes but not spread. If `super` is used with a spread argument, then the `transform-classes` transform needs to be `include`d, as it is not possible to transpile a spread with `super` otherwise.
|
||||
|
||||
> NOTE: The `include` and `exclude` options _only_ work with the [plugins included with this preset](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js); so, for example, including `proposal-do-expressions` or excluding `proposal-function-bind` will throw errors. To use a plugin _not_ included with this preset, add them to your [config](https://babeljs.io/docs/usage/babelrc/) directly.
|
||||
|
||||
### `exclude`
|
||||
|
||||
`Array<string>`, defaults to `[]`.
|
||||
|
||||
An array of plugins to always exclude/remove.
|
||||
|
||||
The possible options are the same as the `include` option.
|
||||
|
||||
This option is useful for "blacklisting" a transform like `transform-regenerator` if you don't use generators and don't want to include `regeneratorRuntime` (when using `useBuiltIns`) or for using another plugin like [fast-async](https://github.com/MatAtBread/fast-async) instead of [Babel's async-to-gen](http://babeljs.io/docs/plugins/proposal-async-generator-functions/).
|
||||
|
||||
### `useBuiltIns`
|
||||
|
||||
`"usage"` | `"entry"` | `false`, defaults to `false`.
|
||||
|
||||
A way to apply `@babel/preset-env` for polyfills (via `@babel/polyfill`).
|
||||
|
||||
```sh
|
||||
npm install @babel/polyfill --save
|
||||
```
|
||||
|
||||
#### `useBuiltIns: 'usage'`
|
||||
|
||||
Adds specific imports for polyfills when they are used in each file. We take advantage of the fact that a bundler will load the same polyfill only once.
|
||||
|
||||
**In**
|
||||
|
||||
a.js
|
||||
|
||||
```js
|
||||
var a = new Promise();
|
||||
```
|
||||
|
||||
b.js
|
||||
|
||||
```js
|
||||
var b = new Map();
|
||||
```
|
||||
|
||||
**Out (if environment doesn't support it)**
|
||||
|
||||
```js
|
||||
import "core-js/modules/es6.promise";
|
||||
var a = new Promise();
|
||||
```
|
||||
|
||||
```js
|
||||
import "core-js/modules/es6.map";
|
||||
var b = new Map();
|
||||
```
|
||||
|
||||
**Out (if environment supports it)**
|
||||
|
||||
```js
|
||||
var a = new Promise();
|
||||
```
|
||||
|
||||
```js
|
||||
var b = new Map();
|
||||
```
|
||||
|
||||
#### `useBuiltIns: 'entry'`
|
||||
|
||||
> NOTE: Only use `require("@babel/polyfill");` once in your whole app.
|
||||
> Multiple imports or requires of `@babel/polyfill` will throw an error since it can cause global collisions and other issues that are hard to trace.
|
||||
> We recommend creating a single entry file that only contains the `require` statement.
|
||||
|
||||
This option enables a new plugin that replaces the statement `import "@babel/polyfill"` or `require("@babel/polyfill")` with individual requires for `@babel/polyfill` based on environment.
|
||||
|
||||
**In**
|
||||
|
||||
```js
|
||||
import "@babel/polyfill";
|
||||
```
|
||||
|
||||
**Out (different based on environment)**
|
||||
|
||||
```js
|
||||
import "core-js/modules/es7.string.pad-start";
|
||||
import "core-js/modules/es7.string.pad-end";
|
||||
```
|
||||
|
||||
#### `useBuiltIns: false`
|
||||
|
||||
Don't add polyfills automatically per file, or transform `import "@babel/polyfill"` to individual polyfills.
|
||||
|
||||
### `forceAllTransforms`
|
||||
|
||||
`boolean`, defaults to `false`.
|
||||
|
||||
<p><details>
|
||||
<summary><b>Example</b></summary>
|
||||
|
||||
With Babel 7's .babelrc.js support, you can force all transforms to be run if env is set to `production`.
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
presets: [
|
||||
["@babel/env", {
|
||||
targets: {
|
||||
chrome: 59,
|
||||
edge: 13,
|
||||
firefox: 50,
|
||||
},
|
||||
// for uglifyjs...
|
||||
forceAllTransforms: process.env === "production"
|
||||
}],
|
||||
],
|
||||
};
|
||||
```
|
||||
</details></p>
|
||||
|
||||
|
||||
> NOTE: `targets.uglify` is deprecated and will be removed in the next major in
|
||||
favor of this.
|
||||
|
||||
By default, this preset will run all the transforms needed for the targeted
|
||||
environment(s). Enable this option if you want to force running _all_
|
||||
transforms, which is useful if the output will be run through UglifyJS or an
|
||||
environment that only supports ES5.
|
||||
|
||||
> NOTE: Uglify has a work-in-progress "Harmony" branch to address the lack of
|
||||
ES6 support, but it is not yet stable. You can follow its progress in
|
||||
[UglifyJS2 issue #448](https://github.com/mishoo/UglifyJS2/issues/448). If you
|
||||
require an alternative minifier which _does_ support ES6 syntax, we recommend
|
||||
using [babel-minify](https://github.com/babel/minify).
|
||||
|
||||
### `configPath`
|
||||
|
||||
`string`, defaults to `process.cwd()`
|
||||
|
||||
The starting point where the config search for browserslist will start, and ascend to the system root until found.
|
||||
|
||||
### `ignoreBrowserslistConfig`
|
||||
|
||||
`boolean`, defaults to `false`
|
||||
|
||||
Toggles whether or not [browserslist config sources](https://github.com/ai/browserslist#queries) are used, which includes searching for any browserslist files or referencing the browserslist key inside package.json. This is useful for projects that use a browserslist config for files that won't be compiled with Babel.
|
||||
|
||||
### `shippedProposals`
|
||||
|
||||
`boolean`, defaults to `false`
|
||||
|
||||
Toggles enabling support for builtin/feature proposals that have shipped in browsers. If your target environments have native support for a feature proposal, its matching parser syntax plugin is enabled instead of performing any transform. Note that this _does not_ enable the same transformations as [`@babel/preset-stage3`](https://babeljs.io/docs/plugins/preset-stage-3/), since proposals can continue to change before landing in browsers.
|
||||
|
||||
The following are currently supported:
|
||||
|
||||
**Builtins**
|
||||
|
||||
- [Promise.prototype.finally](https://github.com/tc39/proposal-promise-finally)
|
||||
|
||||
**Features**
|
||||
|
||||
- [Asynchronous Iterators](https://github.com/tc39/proposal-async-iteration)
|
||||
- [Object rest/spread properties](https://github.com/tc39/proposal-object-rest-spread)
|
||||
- [Optional catch binding](https://github.com/tc39/proposal-optional-catch-binding)
|
||||
- [Unicode property escapes in regular expressions](https://github.com/tc39/proposal-regexp-unicode-property-escapes)
|
||||
|
||||
---
|
||||
|
||||
## Examples
|
||||
|
||||
### Export with various targets
|
||||
|
||||
```js
|
||||
export class A {}
|
||||
```
|
||||
|
||||
#### Target only Chrome 52
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"chrome": 52
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Out**
|
||||
|
||||
```js
|
||||
class A {}
|
||||
exports.A = A;
|
||||
```
|
||||
|
||||
#### Target Chrome 52 with webpack 2/rollup and loose mode
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"chrome": 52
|
||||
},
|
||||
"modules": false,
|
||||
"loose": true
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Out**
|
||||
|
||||
```js
|
||||
export class A {}
|
||||
```
|
||||
|
||||
#### Target specific browsers via browserslist
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"chrome": 52,
|
||||
"browsers": ["last 2 versions", "safari 7"]
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Out**
|
||||
|
||||
```js
|
||||
export var A = function A() {
|
||||
_classCallCheck(this, A);
|
||||
};
|
||||
```
|
||||
|
||||
#### Target latest node via `node: true` or `node: "current"`
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"node": "current"
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Out**
|
||||
|
||||
```js
|
||||
class A {}
|
||||
exports.A = A;
|
||||
```
|
||||
|
||||
### Show debug output
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"safari": 10
|
||||
},
|
||||
"modules": false,
|
||||
"useBuiltIns": "entry",
|
||||
"debug": true
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**stdout**
|
||||
|
||||
```sh
|
||||
Using targets:
|
||||
{
|
||||
"safari": 10
|
||||
}
|
||||
|
||||
Modules transform: false
|
||||
|
||||
Using plugins:
|
||||
transform-exponentiation-operator {}
|
||||
transform-async-to-generator {}
|
||||
|
||||
Using polyfills:
|
||||
es7.object.values {}
|
||||
es7.object.entries {}
|
||||
es7.object.get-own-property-descriptors {}
|
||||
web.timers {}
|
||||
web.immediate {}
|
||||
web.dom.iterable {}
|
||||
```
|
||||
|
||||
### Include and exclude specific plugins/built-ins
|
||||
|
||||
> always include arrow functions, explicitly exclude generators
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": [
|
||||
["@babel/env", {
|
||||
"targets": {
|
||||
"browsers": ["last 2 versions", "safari >= 7"]
|
||||
},
|
||||
"include": ["@babel/transform-arrow-functions", "es6.map"],
|
||||
"exclude": ["@babel/transform-regenerator", "es6.set"]
|
||||
}]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Issues
|
||||
|
||||
If you get a `SyntaxError: Unexpected token ...` error when using the [object-rest-spread](https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread) transform then make sure the plugin has been updated to, at least, `v6.19.0`.
|
||||
@@ -1,206 +0,0 @@
|
||||
const typedArrayMethods = [
|
||||
"typed arrays / %TypedArray%.from",
|
||||
"typed arrays / %TypedArray%.of",
|
||||
"typed arrays / %TypedArray%.prototype.subarray",
|
||||
"typed arrays / %TypedArray%.prototype.join",
|
||||
"typed arrays / %TypedArray%.prototype.indexOf",
|
||||
"typed arrays / %TypedArray%.prototype.lastIndexOf",
|
||||
"typed arrays / %TypedArray%.prototype.slice",
|
||||
"typed arrays / %TypedArray%.prototype.every",
|
||||
"typed arrays / %TypedArray%.prototype.filter",
|
||||
"typed arrays / %TypedArray%.prototype.forEach",
|
||||
"typed arrays / %TypedArray%.prototype.map",
|
||||
"typed arrays / %TypedArray%.prototype.reduce",
|
||||
"typed arrays / %TypedArray%.prototype.reduceRight",
|
||||
"typed arrays / %TypedArray%.prototype.reverse",
|
||||
"typed arrays / %TypedArray%.prototype.some",
|
||||
"typed arrays / %TypedArray%.prototype.sort",
|
||||
"typed arrays / %TypedArray%.prototype.copyWithin",
|
||||
"typed arrays / %TypedArray%.prototype.find",
|
||||
"typed arrays / %TypedArray%.prototype.findIndex",
|
||||
"typed arrays / %TypedArray%.prototype.fill",
|
||||
"typed arrays / %TypedArray%.prototype.keys",
|
||||
"typed arrays / %TypedArray%.prototype.values",
|
||||
"typed arrays / %TypedArray%.prototype.entries",
|
||||
"typed arrays / %TypedArray%.prototype[Symbol.iterator]",
|
||||
"typed arrays / %TypedArray%[Symbol.species]",
|
||||
];
|
||||
|
||||
const es2015 = {
|
||||
"es6.typed.array-buffer": "typed arrays / ArrayBuffer[Symbol.species]",
|
||||
"es6.typed.data-view": "typed arrays / DataView",
|
||||
"es6.typed.int8-array": {
|
||||
features: ["typed arrays / Int8Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.uint8-array": {
|
||||
features: ["typed arrays / Uint8Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.uint8-clamped-array": {
|
||||
features: ["typed arrays / Uint8ClampedArray"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.int16-array": {
|
||||
features: ["typed arrays / Int16Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.uint16-array": {
|
||||
features: ["typed arrays / Uint16Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.int32-array": {
|
||||
features: ["typed arrays / Int32Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.uint32-array": {
|
||||
features: ["typed arrays / Uint32Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.float32-array": {
|
||||
features: ["typed arrays / Float32Array"].concat(typedArrayMethods)
|
||||
},
|
||||
"es6.typed.float64-array": {
|
||||
features: ["typed arrays / Float64Array"].concat(typedArrayMethods)
|
||||
},
|
||||
|
||||
"es6.map": "Map",
|
||||
"es6.set": "Set",
|
||||
"es6.weak-map": "WeakMap",
|
||||
"es6.weak-set": "WeakSet",
|
||||
|
||||
// Proxy not implementable
|
||||
|
||||
"es6.reflect.apply": "Reflect / Reflect.apply",
|
||||
"es6.reflect.construct": "Reflect / Reflect.construct",
|
||||
"es6.reflect.define-property": "Reflect / Reflect.defineProperty",
|
||||
"es6.reflect.delete-property": "Reflect / Reflect.deleteProperty",
|
||||
"es6.reflect.get": "Reflect / Reflect.get",
|
||||
"es6.reflect.get-own-property-descriptor": "Reflect / Reflect.getOwnPropertyDescriptor",
|
||||
"es6.reflect.get-prototype-of": "Reflect / Reflect.getPrototypeOf",
|
||||
"es6.reflect.has": "Reflect / Reflect.has",
|
||||
"es6.reflect.is-extensible": "Reflect / Reflect.isExtensible",
|
||||
"es6.reflect.own-keys": "Reflect / Reflect.ownKeys",
|
||||
"es6.reflect.prevent-extensions": "Reflect / Reflect.preventExtensions",
|
||||
"es6.reflect.set": "Reflect / Reflect.set",
|
||||
"es6.reflect.set-prototype-of": "Reflect / Reflect.setPrototypeOf",
|
||||
|
||||
"es6.promise": {
|
||||
features: [
|
||||
"Promise / basic functionality",
|
||||
"Promise / constructor requires new",
|
||||
"Promise / Promise.prototype isn\'t an instance",
|
||||
"Promise / Promise.all",
|
||||
"Promise / Promise.all, generic iterables",
|
||||
"Promise / Promise.race",
|
||||
"Promise / Promise.race, generic iterables",
|
||||
"Promise / Promise[Symbol.species]"
|
||||
]
|
||||
},
|
||||
|
||||
"es6.symbol": {
|
||||
features: [
|
||||
"Symbol",
|
||||
"Object static methods / Object.getOwnPropertySymbols",
|
||||
"well-known symbols / Symbol.hasInstance",
|
||||
"well-known symbols / Symbol.isConcatSpreadable",
|
||||
"well-known symbols / Symbol.iterator",
|
||||
"well-known symbols / Symbol.match",
|
||||
"well-known symbols / Symbol.replace",
|
||||
"well-known symbols / Symbol.search",
|
||||
"well-known symbols / Symbol.species",
|
||||
"well-known symbols / Symbol.split",
|
||||
"well-known symbols / Symbol.toPrimitive",
|
||||
"well-known symbols / Symbol.toStringTag",
|
||||
"well-known symbols / Symbol.unscopables",
|
||||
]
|
||||
},
|
||||
|
||||
"es6.object.freeze": "Object static methods accept primitives / Object.freeze",
|
||||
"es6.object.seal": "Object static methods accept primitives / Object.seal",
|
||||
"es6.object.prevent-extensions": "Object static methods accept primitives / Object.preventExtensions",
|
||||
"es6.object.is-frozen": "Object static methods accept primitives / Object.isFrozen",
|
||||
"es6.object.is-sealed": "Object static methods accept primitives / Object.isSealed",
|
||||
"es6.object.is-extensible": "Object static methods accept primitives / Object.isExtensible",
|
||||
"es6.object.get-own-property-descriptor":
|
||||
"Object static methods accept primitives / Object.getOwnPropertyDescriptor",
|
||||
"es6.object.get-prototype-of": "Object static methods accept primitives / Object.getPrototypeOf",
|
||||
"es6.object.keys": "Object static methods accept primitives / Object.keys",
|
||||
"es6.object.get-own-property-names": "Object static methods accept primitives / Object.getOwnPropertyNames",
|
||||
|
||||
"es6.object.assign": "Object static methods / Object.assign",
|
||||
"es6.object.is": "Object static methods / Object.is",
|
||||
"es6.object.set-prototype-of": "Object static methods / Object.setPrototypeOf",
|
||||
|
||||
"es6.function.name": "function \"name\" property",
|
||||
|
||||
"es6.string.raw": "String static methods / String.raw",
|
||||
"es6.string.from-code-point": "String static methods / String.fromCodePoint",
|
||||
|
||||
"es6.string.code-point-at": "String.prototype methods / String.prototype.codePointAt",
|
||||
// "String.prototype methods / String.prototype.normalize" not implemented
|
||||
"es6.string.repeat": "String.prototype methods / String.prototype.repeat",
|
||||
"es6.string.starts-with": "String.prototype methods / String.prototype.startsWith",
|
||||
"es6.string.ends-with": "String.prototype methods / String.prototype.endsWith",
|
||||
"es6.string.includes": "String.prototype methods / String.prototype.includes",
|
||||
|
||||
"es6.regexp.flags": "RegExp.prototype properties / RegExp.prototype.flags",
|
||||
"es6.regexp.match": "RegExp.prototype properties / RegExp.prototype[Symbol.match]",
|
||||
"es6.regexp.replace": "RegExp.prototype properties / RegExp.prototype[Symbol.replace]",
|
||||
"es6.regexp.split": "RegExp.prototype properties / RegExp.prototype[Symbol.split]",
|
||||
"es6.regexp.search": "RegExp.prototype properties / RegExp.prototype[Symbol.search]",
|
||||
|
||||
"es6.array.from": "Array static methods / Array.from",
|
||||
"es6.array.of": "Array static methods / Array.of",
|
||||
|
||||
"es6.array.copy-within": "Array.prototype methods / Array.prototype.copyWithin",
|
||||
"es6.array.find": "Array.prototype methods / Array.prototype.find",
|
||||
"es6.array.find-index": "Array.prototype methods / Array.prototype.findIndex",
|
||||
"es6.array.fill": "Array.prototype methods / Array.prototype.fill",
|
||||
|
||||
"es6.array.iterator": {
|
||||
features: [
|
||||
"Array.prototype methods / Array.prototype.keys",
|
||||
// can use Symbol.iterator, not implemented in many environments
|
||||
// "Array.prototype methods / Array.prototype.values",
|
||||
"Array.prototype methods / Array.prototype.entries",
|
||||
]
|
||||
},
|
||||
|
||||
"es6.number.is-finite": "Number properties / Number.isFinite",
|
||||
"es6.number.is-integer": "Number properties / Number.isInteger",
|
||||
"es6.number.is-safe-integer": "Number properties / Number.isSafeInteger",
|
||||
"es6.number.is-nan": "Number properties / Number.isNaN",
|
||||
"es6.number.epsilon": "Number properties / Number.EPSILON",
|
||||
"es6.number.min-safe-integer": "Number properties / Number.MIN_SAFE_INTEGER",
|
||||
"es6.number.max-safe-integer": "Number properties / Number.MAX_SAFE_INTEGER",
|
||||
"es6.number.parse-float": "Number properties / Number.parseFloat",
|
||||
"es6.number.parse-int": "Number properties / Number.parseInt",
|
||||
|
||||
"es6.math.acosh": "Math methods / Math.acosh",
|
||||
"es6.math.asinh": "Math methods / Math.asinh",
|
||||
"es6.math.atanh": "Math methods / Math.atanh",
|
||||
"es6.math.cbrt": "Math methods / Math.cbrt",
|
||||
"es6.math.clz32": "Math methods / Math.clz32",
|
||||
"es6.math.cosh": "Math methods / Math.cosh",
|
||||
"es6.math.expm1": "Math methods / Math.expm1",
|
||||
"es6.math.fround": "Math methods / Math.fround",
|
||||
"es6.math.hypot": "Math methods / Math.hypot",
|
||||
"es6.math.imul": "Math methods / Math.imul",
|
||||
"es6.math.log1p": "Math methods / Math.log1p",
|
||||
"es6.math.log10": "Math methods / Math.log10",
|
||||
"es6.math.log2": "Math methods / Math.log2",
|
||||
"es6.math.sign": "Math methods / Math.sign",
|
||||
"es6.math.sinh": "Math methods / Math.sinh",
|
||||
"es6.math.tanh": "Math methods / Math.tanh",
|
||||
"es6.math.trunc": "Math methods / Math.trunc",
|
||||
};
|
||||
|
||||
const es2016 = {
|
||||
"es7.array.includes": "Array.prototype.includes",
|
||||
};
|
||||
|
||||
const es2017 = {
|
||||
"es7.object.values": "Object static methods / Object.values",
|
||||
"es7.object.entries": "Object static methods / Object.entries",
|
||||
"es7.object.get-own-property-descriptors": "Object static methods / Object.getOwnPropertyDescriptors",
|
||||
"es7.string.pad-start": "String padding / String.prototype.padStart",
|
||||
"es7.string.pad-end": "String padding / String.prototype.padEnd",
|
||||
};
|
||||
|
||||
const proposals = require("./shipped-proposals").builtIns;
|
||||
|
||||
module.exports = Object.assign({}, es2015, es2016, es2017, proposals);
|
||||
@@ -1,953 +0,0 @@
|
||||
{
|
||||
"es6.typed.array-buffer": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.data-view": {
|
||||
"chrome": "5",
|
||||
"opera": "12",
|
||||
"edge": "12",
|
||||
"firefox": "15",
|
||||
"safari": "5.1",
|
||||
"node": "0.12",
|
||||
"ie": "10",
|
||||
"android": "4",
|
||||
"ios": "6",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.typed.int8-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.uint8-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.uint8-clamped-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.int16-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.uint16-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.int32-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.uint32-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.float32-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.typed.float64-array": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.map": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.set": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.weak-map": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "9",
|
||||
"node": "6.5",
|
||||
"ios": "9",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.weak-set": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "9",
|
||||
"node": "6.5",
|
||||
"ios": "9",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.reflect.apply": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.construct": {
|
||||
"chrome": "49",
|
||||
"edge": "13",
|
||||
"firefox": "44",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.define-property": {
|
||||
"chrome": "49",
|
||||
"edge": "13",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.delete-property": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.get": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.get-own-property-descriptor": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.get-prototype-of": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.has": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.is-extensible": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.own-keys": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.prevent-extensions": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.set": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.reflect.set-prototype-of": {
|
||||
"chrome": "49",
|
||||
"edge": "12",
|
||||
"firefox": "42",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.promise": {
|
||||
"chrome": "51",
|
||||
"edge": "13",
|
||||
"firefox": "45",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.symbol": {
|
||||
"chrome": "51",
|
||||
"firefox": "51",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.object.freeze": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.seal": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.prevent-extensions": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.is-frozen": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.is-sealed": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.is-extensible": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.get-own-property-descriptor": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.get-prototype-of": {
|
||||
"chrome": "44",
|
||||
"edge": "12",
|
||||
"firefox": "3.5",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "31",
|
||||
"electron": "0.31"
|
||||
},
|
||||
"es6.object.keys": {
|
||||
"chrome": "40",
|
||||
"edge": "12",
|
||||
"firefox": "35",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "27",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"es6.object.get-own-property-names": {
|
||||
"chrome": "40",
|
||||
"edge": "12",
|
||||
"firefox": "33",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "27",
|
||||
"electron": "0.21"
|
||||
},
|
||||
"es6.object.assign": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.object.is": {
|
||||
"chrome": "19",
|
||||
"edge": "12",
|
||||
"firefox": "22",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"android": "4.1",
|
||||
"ios": "9",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.object.set-prototype-of": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "31",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ie": "11",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.function.name": {
|
||||
"chrome": "51",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.string.raw": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "34",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.from-code-point": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "29",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.code-point-at": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "29",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.repeat": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "24",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.starts-with": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "29",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.ends-with": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "29",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.string.includes": {
|
||||
"chrome": "41",
|
||||
"edge": "12",
|
||||
"firefox": "40",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "28",
|
||||
"electron": "0.24"
|
||||
},
|
||||
"es6.regexp.flags": {
|
||||
"chrome": "49",
|
||||
"firefox": "37",
|
||||
"safari": "9",
|
||||
"node": "6",
|
||||
"ios": "9",
|
||||
"opera": "36",
|
||||
"electron": "1"
|
||||
},
|
||||
"es6.regexp.match": {
|
||||
"chrome": "50",
|
||||
"firefox": "49",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.regexp.replace": {
|
||||
"chrome": "50",
|
||||
"firefox": "49",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.regexp.split": {
|
||||
"chrome": "50",
|
||||
"firefox": "49",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.regexp.search": {
|
||||
"chrome": "50",
|
||||
"firefox": "49",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
"es6.array.from": {
|
||||
"chrome": "51",
|
||||
"edge": "15",
|
||||
"firefox": "36",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"ios": "10",
|
||||
"opera": "38",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"es6.array.of": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.array.copy-within": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "32",
|
||||
"safari": "9",
|
||||
"node": "4",
|
||||
"ios": "9",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.array.find": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "4",
|
||||
"ios": "8",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.array.find-index": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "4",
|
||||
"ios": "8",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.array.fill": {
|
||||
"chrome": "45",
|
||||
"edge": "12",
|
||||
"firefox": "31",
|
||||
"safari": "7.1",
|
||||
"node": "4",
|
||||
"ios": "8",
|
||||
"opera": "32",
|
||||
"electron": "0.35"
|
||||
},
|
||||
"es6.array.iterator": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "28",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.is-finite": {
|
||||
"chrome": "19",
|
||||
"edge": "12",
|
||||
"firefox": "16",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"android": "4.1",
|
||||
"ios": "9",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.is-integer": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "16",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.is-safe-integer": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "32",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.is-nan": {
|
||||
"chrome": "19",
|
||||
"edge": "12",
|
||||
"firefox": "15",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"android": "4.1",
|
||||
"ios": "9",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.epsilon": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.min-safe-integer": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "31",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.max-safe-integer": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "31",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.parse-float": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.number.parse-int": {
|
||||
"chrome": "34",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "21",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.acosh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.asinh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.atanh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.cbrt": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.clz32": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "31",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.cosh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.expm1": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.fround": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "26",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.hypot": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "27",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.imul": {
|
||||
"chrome": "30",
|
||||
"edge": "12",
|
||||
"firefox": "23",
|
||||
"safari": "7",
|
||||
"node": "0.12",
|
||||
"android": "4.4",
|
||||
"ios": "7",
|
||||
"opera": "17",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.log1p": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.log10": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.log2": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.sign": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "9",
|
||||
"node": "0.12",
|
||||
"ios": "9",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.sinh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.tanh": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es6.math.trunc": {
|
||||
"chrome": "38",
|
||||
"edge": "12",
|
||||
"firefox": "25",
|
||||
"safari": "7.1",
|
||||
"node": "0.12",
|
||||
"ios": "8",
|
||||
"opera": "25",
|
||||
"electron": "0.2"
|
||||
},
|
||||
"es7.array.includes": {
|
||||
"chrome": "47",
|
||||
"edge": "14",
|
||||
"firefox": "43",
|
||||
"safari": "10",
|
||||
"node": "6",
|
||||
"ios": "10",
|
||||
"opera": "34",
|
||||
"electron": "0.36"
|
||||
},
|
||||
"es7.object.values": {
|
||||
"chrome": "54",
|
||||
"edge": "14",
|
||||
"firefox": "47",
|
||||
"safari": "10.1",
|
||||
"node": "7",
|
||||
"ios": "10.3",
|
||||
"opera": "41",
|
||||
"electron": "1.5"
|
||||
},
|
||||
"es7.object.entries": {
|
||||
"chrome": "54",
|
||||
"edge": "14",
|
||||
"firefox": "47",
|
||||
"safari": "10.1",
|
||||
"node": "7",
|
||||
"ios": "10.3",
|
||||
"opera": "41",
|
||||
"electron": "1.5"
|
||||
},
|
||||
"es7.object.get-own-property-descriptors": {
|
||||
"chrome": "54",
|
||||
"edge": "15",
|
||||
"firefox": "50",
|
||||
"safari": "10.1",
|
||||
"node": "7",
|
||||
"ios": "10.3",
|
||||
"opera": "41",
|
||||
"electron": "1.5"
|
||||
},
|
||||
"es7.string.pad-start": {
|
||||
"chrome": "57",
|
||||
"edge": "15",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "8",
|
||||
"ios": "10",
|
||||
"opera": "44",
|
||||
"electron": "1.7"
|
||||
},
|
||||
"es7.string.pad-end": {
|
||||
"chrome": "57",
|
||||
"edge": "15",
|
||||
"firefox": "48",
|
||||
"safari": "10",
|
||||
"node": "8",
|
||||
"ios": "10",
|
||||
"opera": "44",
|
||||
"electron": "1.7"
|
||||
},
|
||||
"es7.promise.finally": {
|
||||
"chrome": "63",
|
||||
"opera": "50"
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
const es2015 = {
|
||||
"check-constants": {
|
||||
features: [
|
||||
"const",
|
||||
],
|
||||
},
|
||||
"transform-arrow-functions": {
|
||||
features: [
|
||||
"arrow functions",
|
||||
],
|
||||
},
|
||||
"transform-block-scoped-functions": {
|
||||
features: [
|
||||
"block-level function declaration"
|
||||
],
|
||||
},
|
||||
"transform-block-scoping": {
|
||||
features: [
|
||||
"const",
|
||||
"let",
|
||||
],
|
||||
},
|
||||
"transform-classes": {
|
||||
features: [
|
||||
"class",
|
||||
"super",
|
||||
],
|
||||
},
|
||||
"transform-computed-properties": {
|
||||
features: [
|
||||
"object literal extensions / computed properties",
|
||||
],
|
||||
},
|
||||
"transform-destructuring": {
|
||||
features: [
|
||||
"destructuring, assignment",
|
||||
"destructuring, declarations",
|
||||
"destructuring, parameters",
|
||||
],
|
||||
},
|
||||
"transform-duplicate-keys": {
|
||||
features: [
|
||||
"miscellaneous / duplicate property names in strict mode",
|
||||
],
|
||||
},
|
||||
"transform-for-of": {
|
||||
features: [
|
||||
"for..of loops",
|
||||
],
|
||||
},
|
||||
"transform-function-name": {
|
||||
features: [
|
||||
"function \"name\" property",
|
||||
]
|
||||
},
|
||||
"transform-literals": {
|
||||
features: [
|
||||
"Unicode code point escapes",
|
||||
],
|
||||
},
|
||||
"transform-object-super": {
|
||||
features: [
|
||||
"super",
|
||||
],
|
||||
},
|
||||
"transform-parameters": {
|
||||
features: [
|
||||
"default function parameters",
|
||||
"rest parameters",
|
||||
],
|
||||
},
|
||||
"transform-shorthand-properties": {
|
||||
features: [
|
||||
"object literal extensions / shorthand properties",
|
||||
],
|
||||
},
|
||||
"transform-spread": {
|
||||
features: [
|
||||
"spread (...) operator",
|
||||
],
|
||||
},
|
||||
"transform-sticky-regex": {
|
||||
features: [
|
||||
"RegExp \"y\" and \"u\" flags / \"y\" flag, lastIndex",
|
||||
"RegExp \"y\" and \"u\" flags / \"y\" flag",
|
||||
],
|
||||
},
|
||||
"transform-template-literals": {
|
||||
features: [
|
||||
"template literals",
|
||||
],
|
||||
},
|
||||
"transform-typeof-symbol": {
|
||||
features: [
|
||||
"Symbol / typeof support"
|
||||
],
|
||||
},
|
||||
"transform-unicode-regex": {
|
||||
features: [
|
||||
"RegExp \"y\" and \"u\" flags / \"u\" flag, case folding",
|
||||
"RegExp \"y\" and \"u\" flags / \"u\" flag, Unicode code point escapes",
|
||||
"RegExp \"y\" and \"u\" flags / \"u\" flag",
|
||||
],
|
||||
},
|
||||
"transform-new-target": {
|
||||
features: [
|
||||
"new.target",
|
||||
],
|
||||
},
|
||||
"transform-regenerator": {
|
||||
features: [
|
||||
"generators",
|
||||
],
|
||||
}
|
||||
};
|
||||
|
||||
const es2016 = {
|
||||
"transform-exponentiation-operator": {
|
||||
features: [
|
||||
"exponentiation (**) operator",
|
||||
],
|
||||
}
|
||||
};
|
||||
|
||||
const es2017 = {
|
||||
"transform-async-to-generator": {
|
||||
features: [
|
||||
"async functions",
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
const proposals = require("./shipped-proposals").features;
|
||||
|
||||
module.exports = Object.assign({}, es2015, es2016, es2017, proposals);
|
||||
@@ -1,22 +0,0 @@
|
||||
// These mappings represent the builtin/feature proposals that have been
|
||||
// shipped by browsers, and are enabled by the `shippedProposals` option.
|
||||
|
||||
const builtIns = {
|
||||
"es7.promise.finally": "Promise.prototype.finally"
|
||||
};
|
||||
|
||||
const features = {
|
||||
"proposal-async-generator-functions": "Asynchronous Iterators",
|
||||
"proposal-object-rest-spread": "object rest/spread properties",
|
||||
"proposal-optional-catch-binding": "optional catch binding",
|
||||
"proposal-unicode-property-regex": "RegExp Unicode Property Escapes",
|
||||
};
|
||||
|
||||
const pluginSyntaxMap = new Map([
|
||||
["proposal-async-generator-functions", "syntax-async-generators"],
|
||||
["proposal-object-rest-spread", "syntax-object-rest-spread"],
|
||||
["proposal-optional-catch-binding", "syntax-optional-catch-binding"],
|
||||
["proposal-unicode-property-regex", null],
|
||||
]);
|
||||
|
||||
module.exports = { builtIns, features, pluginSyntaxMap };
|
||||
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"name": "@babel/preset-env",
|
||||
"version": "7.0.0-beta.32",
|
||||
"description": "A Babel preset for each environment.",
|
||||
"author": "Henry Zhu <hi@henryzoo.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/babel/babel/tree/master/experimental/babel-preset-env",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"build-data": "node ./scripts/build-data.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/plugin-check-constants": "7.0.0-beta.32",
|
||||
"@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.32",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.32",
|
||||
"@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.32",
|
||||
"@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.32",
|
||||
"@babel/plugin-syntax-async-generators": "7.0.0-beta.32",
|
||||
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.32",
|
||||
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-arrow-functions": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-async-to-generator": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-block-scoping": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-classes": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-computed-properties": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-destructuring": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-duplicate-keys": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-for-of": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-function-name": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-literals": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-modules-amd": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-modules-commonjs": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-modules-systemjs": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-modules-umd": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-new-target": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-object-super": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-parameters": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-regenerator": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-shorthand-properties": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-spread": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-sticky-regex": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-template-literals": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-typeof-symbol": "7.0.0-beta.32",
|
||||
"@babel/plugin-transform-unicode-regex": "7.0.0-beta.32",
|
||||
"browserslist": "^2.4.0",
|
||||
"invariant": "^2.2.2",
|
||||
"semver": "^5.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.32"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.0.0-beta.32",
|
||||
"@babel/core": "7.0.0-beta.32",
|
||||
"@babel/helper-fixtures": "7.0.0-beta.32",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.32",
|
||||
"compat-table": "kangax/compat-table#957f1ff15972e8fb2892a172f985e9af27bf1c75",
|
||||
"electron-to-chromium": "^1.3.27"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"prettier/prettier": ["error", { "trailingComma": "es5" }]
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
export default {
|
||||
"check-constants": require("@babel/plugin-check-constants"),
|
||||
"syntax-async-generators": require("@babel/plugin-syntax-async-generators"),
|
||||
"syntax-object-rest-spread": require("@babel/plugin-syntax-object-rest-spread"),
|
||||
"syntax-optional-catch-binding": require("@babel/plugin-syntax-optional-catch-binding"),
|
||||
"transform-async-to-generator": require("@babel/plugin-transform-async-to-generator"),
|
||||
"proposal-async-generator-functions": require("@babel/plugin-proposal-async-generator-functions"),
|
||||
"transform-arrow-functions": require("@babel/plugin-transform-arrow-functions"),
|
||||
"transform-block-scoped-functions": require("@babel/plugin-transform-block-scoped-functions"),
|
||||
"transform-block-scoping": require("@babel/plugin-transform-block-scoping"),
|
||||
"transform-classes": require("@babel/plugin-transform-classes"),
|
||||
"transform-computed-properties": require("@babel/plugin-transform-computed-properties"),
|
||||
"transform-destructuring": require("@babel/plugin-transform-destructuring"),
|
||||
"transform-duplicate-keys": require("@babel/plugin-transform-duplicate-keys"),
|
||||
"transform-for-of": require("@babel/plugin-transform-for-of"),
|
||||
"transform-function-name": require("@babel/plugin-transform-function-name"),
|
||||
"transform-literals": require("@babel/plugin-transform-literals"),
|
||||
"transform-modules-amd": require("@babel/plugin-transform-modules-amd"),
|
||||
"transform-modules-commonjs": require("@babel/plugin-transform-modules-commonjs"),
|
||||
"transform-modules-systemjs": require("@babel/plugin-transform-modules-systemjs"),
|
||||
"transform-modules-umd": require("@babel/plugin-transform-modules-umd"),
|
||||
"transform-object-super": require("@babel/plugin-transform-object-super"),
|
||||
"transform-parameters": require("@babel/plugin-transform-parameters"),
|
||||
"transform-shorthand-properties": require("@babel/plugin-transform-shorthand-properties"),
|
||||
"transform-spread": require("@babel/plugin-transform-spread"),
|
||||
"transform-sticky-regex": require("@babel/plugin-transform-sticky-regex"),
|
||||
"transform-template-literals": require("@babel/plugin-transform-template-literals"),
|
||||
"transform-typeof-symbol": require("@babel/plugin-transform-typeof-symbol"),
|
||||
"transform-unicode-regex": require("@babel/plugin-transform-unicode-regex"),
|
||||
"transform-exponentiation-operator": require("@babel/plugin-transform-exponentiation-operator"),
|
||||
"transform-new-target": require("@babel/plugin-transform-new-target"),
|
||||
"proposal-object-rest-spread": require("@babel/plugin-proposal-object-rest-spread"),
|
||||
"proposal-optional-catch-binding": require("@babel/plugin-proposal-optional-catch-binding"),
|
||||
"transform-regenerator": require("@babel/plugin-transform-regenerator"),
|
||||
"proposal-unicode-property-regex": require("@babel/plugin-proposal-unicode-property-regex"),
|
||||
};
|
||||
@@ -1,109 +0,0 @@
|
||||
// TODO: this is the opposite of built-in-features so maybe generate one from the other?
|
||||
export const definitions = {
|
||||
builtins: {
|
||||
DataView: "es6.typed.data-view",
|
||||
Int8Array: "es6.typed.int8-array",
|
||||
Uint8Array: "es6.typed.uint8-array",
|
||||
Uint8ClampedArray: "es6.typed.uint8-clamped-array",
|
||||
Int16Array: "es6.typed.int16-array",
|
||||
Uint16Array: "es6.typed.uint16-array",
|
||||
Int32Array: "es6.typed.int32-array",
|
||||
Uint32Array: "es6.typed.uint32-array",
|
||||
Float32Array: "es6.typed.float32-array",
|
||||
Float64Array: "es6.typed.float64-array",
|
||||
Map: "es6.map",
|
||||
Set: "es6.set",
|
||||
WeakMap: "es6.weak-map",
|
||||
WeakSet: "es6.weak-set",
|
||||
Promise: "es6.promise",
|
||||
Symbol: "es6.symbol",
|
||||
},
|
||||
|
||||
instanceMethods: {
|
||||
name: ["es6.function.name"],
|
||||
fromCodePoint: ["es6.string.from-code-point"],
|
||||
codePointAt: ["es6.string.code-point-at"],
|
||||
repeat: ["es6.string.repeat"],
|
||||
startsWith: ["es6.string.starts-with"],
|
||||
endsWith: ["es6.string.ends-with"],
|
||||
includes: ["es6.string.includes", "es7.array.includes"],
|
||||
flags: ["es6.regexp.flags"],
|
||||
match: ["es6.regexp.match"],
|
||||
replace: ["es6.regexp.replace"],
|
||||
split: ["es6.regexp.split"],
|
||||
search: ["es6.regexp.search"],
|
||||
copyWithin: ["es6.array.copy-within"],
|
||||
find: ["es6.array.find"],
|
||||
findIndex: ["es6.array.find-index"],
|
||||
fill: ["es6.array.fill"],
|
||||
padStart: ["es7.string.pad-start"],
|
||||
padEnd: ["es7.string.pad-end"],
|
||||
},
|
||||
|
||||
staticMethods: {
|
||||
Array: {
|
||||
from: "es6.array.from",
|
||||
of: "es6.array.of",
|
||||
},
|
||||
|
||||
Object: {
|
||||
assign: "es6.object.assign",
|
||||
is: "es6.object.is",
|
||||
getOwnPropertySymbols: "es6.object.get-own-property-symbols",
|
||||
setPrototypeOf: "es6.object.set-prototype-of",
|
||||
values: "es7.object.values",
|
||||
entries: "es7.object.entries",
|
||||
getOwnPropertyDescriptors: "es7.object.get-own-property-descriptors",
|
||||
},
|
||||
|
||||
Math: {
|
||||
acosh: "es6.math.acosh",
|
||||
asinh: "es6.math.asinh",
|
||||
atanh: "es6.math.atanh",
|
||||
cbrt: "es6.math.cbrt",
|
||||
clz32: "es6.math.clz32",
|
||||
cosh: "es6.math.cosh",
|
||||
expm1: "es6.math.expm1",
|
||||
fround: "es6.math.fround",
|
||||
hypot: "es6.math.hypot",
|
||||
imul: "es6.math.imul",
|
||||
log1p: "es6.math.log1p",
|
||||
log10: "es6.math.log10",
|
||||
log2: "es6.math.log2",
|
||||
sign: "es6.math.sign",
|
||||
sinh: "es6.math.sinh",
|
||||
tanh: "es6.math.tanh",
|
||||
trunc: "es6.math.trunc",
|
||||
},
|
||||
|
||||
String: {
|
||||
raw: "es6.string.raw",
|
||||
},
|
||||
|
||||
Number: {
|
||||
isFinite: "es6.number.is-finite",
|
||||
isInteger: "es6.number.is-integer",
|
||||
isSafeInteger: "es6.number.is-safe-integer",
|
||||
isNaN: "es6.number.is-nan",
|
||||
EPSILON: "es6.number.epsilon",
|
||||
MIN_SAFE_INTEGER: "es6.number.min-safe-integer",
|
||||
MAX_SAFE_INTEGER: "es6.number.max-safe-integer",
|
||||
},
|
||||
|
||||
Reflect: {
|
||||
apply: "es6.reflect.apply",
|
||||
construct: "es6.reflect.construct",
|
||||
defineProperty: "es6.reflect.define-property",
|
||||
deleteProperty: "es6.reflect.delete-property",
|
||||
get: "es6.reflect.get",
|
||||
getOwnPropertyDescriptor: "es6.reflect.get-own-property-descriptor",
|
||||
getPrototypeOf: "es6.reflect.get-prototype-of",
|
||||
has: "es6.reflect.has",
|
||||
isExtensible: "es6.reflect.is-extensible",
|
||||
ownKeys: "es6.reflect.own-keys",
|
||||
preventExtensions: "es6.reflect.prevent-extensions",
|
||||
set: "es6.reflect.set",
|
||||
setPrototypeOf: "es6.reflect.set-prototype-of",
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1,75 +0,0 @@
|
||||
/*eslint quotes: ["error", "double", { "avoidEscape": true }]*/
|
||||
import semver from "semver";
|
||||
import { prettifyVersion, semverify } from "./utils";
|
||||
|
||||
const wordEnds = size => {
|
||||
return size > 1 ? "s" : "";
|
||||
};
|
||||
|
||||
export const logMessage = (message, context) => {
|
||||
const pre = context ? `[${context}] ` : "";
|
||||
const logStr = ` ${pre}${message}`;
|
||||
console.log(logStr);
|
||||
};
|
||||
|
||||
export const logPlugin = (plugin, targets, list, context) => {
|
||||
const envList = list[plugin] || {};
|
||||
const filteredList = Object.keys(targets).reduce((a, b) => {
|
||||
if (!envList[b] || semver.lt(targets[b], semverify(envList[b]))) {
|
||||
a[b] = prettifyVersion(targets[b]);
|
||||
}
|
||||
return a;
|
||||
}, {});
|
||||
|
||||
const formattedTargets = JSON.stringify(filteredList)
|
||||
.replace(/,/g, ", ")
|
||||
.replace(/^\{"/, '{ "')
|
||||
.replace(/"\}$/, '" }');
|
||||
|
||||
logMessage(`${plugin} ${formattedTargets}`, context);
|
||||
};
|
||||
|
||||
export const logEntryPolyfills = (
|
||||
importPolyfillIncluded,
|
||||
polyfills,
|
||||
filename,
|
||||
onDebug,
|
||||
) => {
|
||||
if (!importPolyfillIncluded) {
|
||||
console.log(
|
||||
`
|
||||
[${filename}] \`import '@babel/polyfill'\` was not found.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!polyfills.size) {
|
||||
console.log(
|
||||
`
|
||||
[${filename}] Based on your targets, none were added.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(
|
||||
`
|
||||
[${filename}] Replaced \`@babel/polyfill\` with the following polyfill${wordEnds(
|
||||
polyfills.size,
|
||||
)}:`,
|
||||
);
|
||||
onDebug(polyfills);
|
||||
};
|
||||
|
||||
export const logUsagePolyfills = (polyfills, filename, onDebug) => {
|
||||
if (!polyfills.size) {
|
||||
console.log(
|
||||
`
|
||||
[${filename}] Based on your code and targets, none were added.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
console.log(
|
||||
`
|
||||
[${filename}] Added following polyfill${wordEnds(polyfills.size)}:`,
|
||||
);
|
||||
onDebug(polyfills);
|
||||
};
|
||||
@@ -1,272 +0,0 @@
|
||||
//@flow
|
||||
|
||||
import semver from "semver";
|
||||
import builtInsList from "../data/built-ins.json";
|
||||
import { logPlugin } from "./debug";
|
||||
import { defaultWebIncludes } from "./default-includes";
|
||||
import moduleTransformations from "./module-transformations";
|
||||
import normalizeOptions from "./normalize-options.js";
|
||||
import pluginList from "../data/plugins.json";
|
||||
import {
|
||||
builtIns as proposalBuiltIns,
|
||||
features as proposalPlugins,
|
||||
pluginSyntaxMap,
|
||||
} from "../data/shipped-proposals.js";
|
||||
import useBuiltInsEntryPlugin from "./use-built-ins-entry-plugin";
|
||||
import addUsedBuiltInsPlugin from "./use-built-ins-plugin";
|
||||
import getTargets from "./targets-parser";
|
||||
import availablePlugins from "./available-plugins";
|
||||
import { filterStageFromList, prettifyTargets, semverify } from "./utils";
|
||||
import type { Plugin, Targets } from "./types";
|
||||
|
||||
const getPlugin = (pluginName: string) => {
|
||||
const plugin = availablePlugins[pluginName];
|
||||
|
||||
if (!plugin) {
|
||||
throw new Error(
|
||||
`Could not find plugin "${pluginName}". Ensure there is an entry in ./available-plugins.js for it.`,
|
||||
);
|
||||
}
|
||||
|
||||
return plugin;
|
||||
};
|
||||
|
||||
const builtInsListWithoutProposals = filterStageFromList(
|
||||
builtInsList,
|
||||
proposalBuiltIns,
|
||||
);
|
||||
|
||||
const pluginListWithoutProposals = filterStageFromList(
|
||||
pluginList,
|
||||
proposalPlugins,
|
||||
);
|
||||
|
||||
export const isPluginRequired = (
|
||||
supportedEnvironments: Targets,
|
||||
plugin: Targets,
|
||||
): boolean => {
|
||||
const targetEnvironments: Array<string> = Object.keys(supportedEnvironments);
|
||||
|
||||
if (targetEnvironments.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const isRequiredForEnvironments: Array<
|
||||
string,
|
||||
> = targetEnvironments.filter(environment => {
|
||||
// Feature is not implemented in that environment
|
||||
if (!plugin[environment]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const lowestImplementedVersion: string = plugin[environment];
|
||||
const lowestTargetedVersion: string = supportedEnvironments[environment];
|
||||
|
||||
if (!semver.valid(lowestTargetedVersion)) {
|
||||
throw new Error(
|
||||
// eslint-disable-next-line max-len
|
||||
`Invalid version passed for target "${environment}": "${lowestTargetedVersion}". Versions must be in semver format (major.minor.patch)`,
|
||||
);
|
||||
}
|
||||
|
||||
return semver.gt(
|
||||
semverify(lowestImplementedVersion),
|
||||
lowestTargetedVersion,
|
||||
);
|
||||
});
|
||||
|
||||
return isRequiredForEnvironments.length > 0;
|
||||
};
|
||||
|
||||
let hasBeenLogged = false;
|
||||
|
||||
const getBuiltInTargets = targets => {
|
||||
const builtInTargets = Object.assign({}, targets);
|
||||
if (builtInTargets.uglify != null) {
|
||||
delete builtInTargets.uglify;
|
||||
}
|
||||
return builtInTargets;
|
||||
};
|
||||
|
||||
export const transformIncludesAndExcludes = (opts: Array<string>): Object => {
|
||||
return opts.reduce(
|
||||
(result, opt) => {
|
||||
const target = opt.match(/^(es\d+|web)\./) ? "builtIns" : "plugins";
|
||||
result[target].add(opt);
|
||||
return result;
|
||||
},
|
||||
{
|
||||
all: opts,
|
||||
plugins: new Set(),
|
||||
builtIns: new Set(),
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
const getPlatformSpecificDefaultFor = (targets: Targets): ?Array<string> => {
|
||||
const targetNames = Object.keys(targets);
|
||||
const isAnyTarget = !targetNames.length;
|
||||
const isWebTarget = targetNames.some(name => name !== "node");
|
||||
|
||||
return isAnyTarget || isWebTarget ? defaultWebIncludes : null;
|
||||
};
|
||||
|
||||
const filterItems = (
|
||||
list,
|
||||
includes,
|
||||
excludes,
|
||||
targets,
|
||||
defaultItems,
|
||||
): Set<string> => {
|
||||
const result = new Set();
|
||||
|
||||
for (const item in list) {
|
||||
const excluded = excludes.has(item);
|
||||
|
||||
if (!excluded) {
|
||||
if (isPluginRequired(targets, list[item])) {
|
||||
result.add(item);
|
||||
} else {
|
||||
const shippedProposalsSyntax = pluginSyntaxMap.get(item);
|
||||
|
||||
if (shippedProposalsSyntax) {
|
||||
result.add(shippedProposalsSyntax);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defaultItems) {
|
||||
defaultItems.forEach(item => !excludes.has(item) && result.add(item));
|
||||
}
|
||||
|
||||
includes.forEach(item => result.add(item));
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
export default function buildPreset(
|
||||
api: Object,
|
||||
opts: Object = {},
|
||||
): { plugins: Array<Plugin> } {
|
||||
const {
|
||||
configPath,
|
||||
debug,
|
||||
exclude: optionsExclude,
|
||||
forceAllTransforms,
|
||||
ignoreBrowserslistConfig,
|
||||
include: optionsInclude,
|
||||
loose,
|
||||
modules,
|
||||
shippedProposals,
|
||||
spec,
|
||||
targets: optionsTargets,
|
||||
useBuiltIns,
|
||||
} = normalizeOptions(opts);
|
||||
// TODO: remove this in next major
|
||||
let hasUglifyTarget = false;
|
||||
|
||||
if (optionsTargets && optionsTargets.uglify) {
|
||||
hasUglifyTarget = true;
|
||||
delete optionsTargets.uglify;
|
||||
|
||||
console.log("");
|
||||
console.log("The uglify target has been deprecated. Set the top level");
|
||||
console.log("option `forceAllTransforms: true` instead.");
|
||||
console.log("");
|
||||
}
|
||||
|
||||
const targets = getTargets(optionsTargets, {
|
||||
ignoreBrowserslistConfig,
|
||||
configPath,
|
||||
});
|
||||
const include = transformIncludesAndExcludes(optionsInclude);
|
||||
const exclude = transformIncludesAndExcludes(optionsExclude);
|
||||
|
||||
const transformTargets = forceAllTransforms || hasUglifyTarget ? {} : targets;
|
||||
|
||||
const transformations = filterItems(
|
||||
shippedProposals ? pluginList : pluginListWithoutProposals,
|
||||
include.plugins,
|
||||
exclude.plugins,
|
||||
transformTargets,
|
||||
);
|
||||
|
||||
let polyfills;
|
||||
let polyfillTargets;
|
||||
|
||||
if (useBuiltIns) {
|
||||
polyfillTargets = getBuiltInTargets(targets);
|
||||
|
||||
polyfills = filterItems(
|
||||
shippedProposals ? builtInsList : builtInsListWithoutProposals,
|
||||
include.builtIns,
|
||||
exclude.builtIns,
|
||||
polyfillTargets,
|
||||
getPlatformSpecificDefaultFor(polyfillTargets),
|
||||
);
|
||||
}
|
||||
|
||||
const plugins = [];
|
||||
const pluginUseBuiltIns = useBuiltIns !== false;
|
||||
|
||||
// NOTE: not giving spec here yet to avoid compatibility issues when
|
||||
// transform-modules-commonjs gets its spec mode
|
||||
if (modules !== false && moduleTransformations[modules]) {
|
||||
plugins.push([getPlugin(moduleTransformations[modules]), { loose }]);
|
||||
}
|
||||
|
||||
transformations.forEach(pluginName =>
|
||||
plugins.push([
|
||||
getPlugin(pluginName),
|
||||
{ spec, loose, useBuiltIns: pluginUseBuiltIns },
|
||||
]),
|
||||
);
|
||||
|
||||
const regenerator = transformations.has("transform-regenerator");
|
||||
|
||||
if (debug && !hasBeenLogged) {
|
||||
hasBeenLogged = true;
|
||||
console.log("@babel/preset-env: `DEBUG` option");
|
||||
console.log("\nUsing targets:");
|
||||
console.log(JSON.stringify(prettifyTargets(targets), null, 2));
|
||||
console.log(`\nUsing modules transform: ${modules.toString()}`);
|
||||
console.log("\nUsing plugins:");
|
||||
transformations.forEach(transform => {
|
||||
logPlugin(transform, targets, pluginList);
|
||||
});
|
||||
|
||||
if (!useBuiltIns) {
|
||||
console.log(
|
||||
"\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.",
|
||||
);
|
||||
} else {
|
||||
console.log(
|
||||
`
|
||||
Using polyfills with \`${useBuiltIns}\` option:`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (useBuiltIns === "usage" || useBuiltIns === "entry") {
|
||||
const pluginOptions = {
|
||||
debug,
|
||||
polyfills,
|
||||
regenerator,
|
||||
onDebug: (polyfills, context) => {
|
||||
polyfills.forEach(polyfill =>
|
||||
logPlugin(polyfill, polyfillTargets, builtInsList, context),
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
plugins.push([
|
||||
useBuiltIns === "usage" ? addUsedBuiltInsPlugin : useBuiltInsEntryPlugin,
|
||||
pluginOptions,
|
||||
]);
|
||||
}
|
||||
|
||||
return {
|
||||
plugins,
|
||||
};
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
export default {
|
||||
amd: "transform-modules-amd",
|
||||
commonjs: "transform-modules-commonjs",
|
||||
systemjs: "transform-modules-systemjs",
|
||||
umd: "transform-modules-umd",
|
||||
};
|
||||
@@ -1,175 +0,0 @@
|
||||
//@flow
|
||||
|
||||
import invariant from "invariant";
|
||||
import browserslist from "browserslist";
|
||||
import builtInsList from "../data/built-ins.json";
|
||||
import { defaultWebIncludes } from "./default-includes";
|
||||
import moduleTransformations from "./module-transformations";
|
||||
import pluginsList from "../data/plugins.json";
|
||||
import type { Targets, Options, ModuleOption, BuiltInsOption } from "./types";
|
||||
|
||||
const validIncludesAndExcludes = new Set([
|
||||
...Object.keys(pluginsList),
|
||||
...Object.keys(moduleTransformations).map(m => moduleTransformations[m]),
|
||||
...Object.keys(builtInsList),
|
||||
...defaultWebIncludes,
|
||||
]);
|
||||
|
||||
export const validateIncludesAndExcludes = (
|
||||
opts: Array<string> = [],
|
||||
type: string,
|
||||
): Array<string> => {
|
||||
invariant(
|
||||
Array.isArray(opts),
|
||||
`Invalid Option: The '${type}' option must be an Array<String> of plugins/built-ins`,
|
||||
);
|
||||
|
||||
const unknownOpts = opts.filter(opt => !validIncludesAndExcludes.has(opt));
|
||||
|
||||
invariant(
|
||||
unknownOpts.length === 0,
|
||||
`Invalid Option: The plugins/built-ins '${unknownOpts.join(
|
||||
", ",
|
||||
)}' passed to the '${type}' option are not
|
||||
valid. Please check data/[plugin-features|built-in-features].js in babel-preset-env`,
|
||||
);
|
||||
|
||||
return opts;
|
||||
};
|
||||
|
||||
const validBrowserslistTargets = [
|
||||
...Object.keys(browserslist.data),
|
||||
...Object.keys(browserslist.aliases),
|
||||
];
|
||||
|
||||
export const normalizePluginName = (plugin: string): string =>
|
||||
plugin.replace(/^babel-plugin-/, "");
|
||||
|
||||
export const normalizePluginNames = (plugins: Array<string>): Array<string> =>
|
||||
plugins.map(normalizePluginName);
|
||||
|
||||
export const checkDuplicateIncludeExcludes = (
|
||||
include: Array<string> = [],
|
||||
exclude: Array<string> = [],
|
||||
): void => {
|
||||
const duplicates: Array<string> = include.filter(
|
||||
opt => exclude.indexOf(opt) >= 0,
|
||||
);
|
||||
|
||||
invariant(
|
||||
duplicates.length === 0,
|
||||
`Invalid Option: The plugins/built-ins '${duplicates.join(
|
||||
", ",
|
||||
)}' were found in both the "include" and
|
||||
"exclude" options.`,
|
||||
);
|
||||
};
|
||||
|
||||
export const validateConfigPathOption = (
|
||||
configPath: string = process.cwd(),
|
||||
) => {
|
||||
invariant(
|
||||
typeof configPath === "string",
|
||||
`Invalid Option: The configPath option '${configPath}' is invalid, only strings are allowed.`,
|
||||
);
|
||||
return configPath;
|
||||
};
|
||||
|
||||
export const validateBoolOption = (
|
||||
name: string,
|
||||
value: ?boolean,
|
||||
defaultValue: boolean,
|
||||
) => {
|
||||
if (typeof value === "undefined") {
|
||||
value = defaultValue;
|
||||
}
|
||||
|
||||
if (typeof value !== "boolean") {
|
||||
throw new Error(`Preset env: '${name}' option must be a boolean.`);
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
export const validateIgnoreBrowserslistConfig = (
|
||||
ignoreBrowserslistConfig: boolean,
|
||||
) =>
|
||||
validateBoolOption(
|
||||
"ignoreBrowserslistConfig",
|
||||
ignoreBrowserslistConfig,
|
||||
false,
|
||||
);
|
||||
|
||||
export const validateModulesOption = (
|
||||
modulesOpt: ModuleOption = "commonjs",
|
||||
) => {
|
||||
invariant(
|
||||
modulesOpt === false ||
|
||||
Object.keys(moduleTransformations).indexOf(modulesOpt) > -1,
|
||||
`Invalid Option: The 'modules' option must be either 'false' to indicate no modules, or a
|
||||
module type which can be be one of: 'commonjs' (default), 'amd', 'umd', 'systemjs'.`,
|
||||
);
|
||||
|
||||
return modulesOpt;
|
||||
};
|
||||
|
||||
export const objectToBrowserslist = (object: Targets) => {
|
||||
return Object.keys(object).reduce((list, targetName) => {
|
||||
if (validBrowserslistTargets.indexOf(targetName) >= 0) {
|
||||
const targetVersion = object[targetName];
|
||||
return list.concat(`${targetName} ${targetVersion}`);
|
||||
}
|
||||
return list;
|
||||
}, []);
|
||||
};
|
||||
|
||||
export const validateUseBuiltInsOption = (
|
||||
builtInsOpt: BuiltInsOption = false,
|
||||
): BuiltInsOption => {
|
||||
invariant(
|
||||
builtInsOpt === "usage" || builtInsOpt === false || builtInsOpt === "entry",
|
||||
`Invalid Option: The 'useBuiltIns' option must be either
|
||||
'false' (default) to indicate no polyfill,
|
||||
'"entry"' to indicate replacing the entry polyfill, or
|
||||
'"usage"' to import only used polyfills per file`,
|
||||
);
|
||||
|
||||
return builtInsOpt;
|
||||
};
|
||||
|
||||
export default function normalizeOptions(opts: Options) {
|
||||
if (opts.exclude) {
|
||||
opts.exclude = normalizePluginNames(opts.exclude);
|
||||
}
|
||||
|
||||
if (opts.include) {
|
||||
opts.include = normalizePluginNames(opts.include);
|
||||
}
|
||||
|
||||
checkDuplicateIncludeExcludes(opts.include, opts.exclude);
|
||||
|
||||
return {
|
||||
configPath: validateConfigPathOption(opts.configPath),
|
||||
debug: opts.debug,
|
||||
exclude: validateIncludesAndExcludes(opts.exclude, "exclude"),
|
||||
forceAllTransforms: validateBoolOption(
|
||||
"forceAllTransforms",
|
||||
opts.forceAllTransforms,
|
||||
false,
|
||||
),
|
||||
ignoreBrowserslistConfig: validateIgnoreBrowserslistConfig(
|
||||
opts.ignoreBrowserslistConfig,
|
||||
),
|
||||
include: validateIncludesAndExcludes(opts.include, "include"),
|
||||
loose: validateBoolOption("loose", opts.loose, false),
|
||||
modules: validateModulesOption(opts.modules),
|
||||
shippedProposals: validateBoolOption(
|
||||
"shippedProposals",
|
||||
opts.shippedProposals,
|
||||
false,
|
||||
),
|
||||
spec: validateBoolOption("loose", opts.spec, false),
|
||||
targets: opts.targets,
|
||||
useBuiltIns: validateUseBuiltInsOption(opts.useBuiltIns),
|
||||
};
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import browserslist from "browserslist";
|
||||
import semver from "semver";
|
||||
import { semverify } from "./utils";
|
||||
import { objectToBrowserslist } from "./normalize-options";
|
||||
import type { Targets } from "./types";
|
||||
|
||||
const browserNameMap = {
|
||||
android: "android",
|
||||
chrome: "chrome",
|
||||
and_chr: "chrome",
|
||||
edge: "edge",
|
||||
firefox: "firefox",
|
||||
ie: "ie",
|
||||
ios_saf: "ios",
|
||||
safari: "safari",
|
||||
};
|
||||
|
||||
const isBrowsersQueryValid = (browsers: string | Array<string>): boolean =>
|
||||
typeof browsers === "string" || Array.isArray(browsers);
|
||||
|
||||
const semverMin = (first: ?string, second: string): string => {
|
||||
return first && semver.lt(first, second) ? first : second;
|
||||
};
|
||||
|
||||
const mergeBrowsers = (fromQuery: Targets, fromTarget: Targets) => {
|
||||
return Object.keys(fromTarget).reduce((queryObj, targKey) => {
|
||||
if (targKey !== "browsers") {
|
||||
queryObj[targKey] = fromTarget[targKey];
|
||||
}
|
||||
return queryObj;
|
||||
}, fromQuery);
|
||||
};
|
||||
|
||||
const getLowestVersions = (browsers: Array<string>): Targets => {
|
||||
return browsers.reduce((all: Object, browser: string): Object => {
|
||||
const [browserName, browserVersion] = browser.split(" ");
|
||||
const normalizedBrowserName = browserNameMap[browserName];
|
||||
|
||||
if (!normalizedBrowserName) {
|
||||
return all;
|
||||
}
|
||||
|
||||
try {
|
||||
// Browser version can return as "10.0-10.2"
|
||||
const splitVersion = browserVersion.split("-")[0];
|
||||
const parsedBrowserVersion = semverify(splitVersion);
|
||||
|
||||
all[normalizedBrowserName] = semverMin(
|
||||
all[normalizedBrowserName],
|
||||
parsedBrowserVersion,
|
||||
);
|
||||
} catch (e) {}
|
||||
|
||||
return all;
|
||||
}, {});
|
||||
};
|
||||
|
||||
const outputDecimalWarning = (decimalTargets: Array<Object>): void => {
|
||||
if (!decimalTargets || !decimalTargets.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("Warning, the following targets are using a decimal version:");
|
||||
console.log("");
|
||||
decimalTargets.forEach(({ target, value }) =>
|
||||
console.log(` ${target}: ${value}`),
|
||||
);
|
||||
console.log("");
|
||||
console.log(
|
||||
"We recommend using a string for minor/patch versions to avoid numbers like 6.10",
|
||||
);
|
||||
console.log("getting parsed as 6.1, which can lead to unexpected behavior.");
|
||||
console.log("");
|
||||
};
|
||||
|
||||
const targetParserMap = {
|
||||
__default: (target, value) => [target, semverify(value)],
|
||||
|
||||
// Parse `node: true` and `node: "current"` to version
|
||||
node: (target, value) => {
|
||||
const parsed =
|
||||
value === true || value === "current"
|
||||
? process.versions.node
|
||||
: semverify(value);
|
||||
|
||||
return [target, parsed];
|
||||
},
|
||||
};
|
||||
|
||||
type ParsedResult = {
|
||||
targets: Targets,
|
||||
decimalWarnings: Array<Object>,
|
||||
};
|
||||
const getTargets = (targets: Object = {}, options: Object = {}): Targets => {
|
||||
const targetOpts: Targets = {};
|
||||
// Parse browsers target via browserslist;
|
||||
const queryIsValid = isBrowsersQueryValid(targets.browsers);
|
||||
const browsersquery = queryIsValid ? targets.browsers : null;
|
||||
if (queryIsValid || !options.ignoreBrowserslistConfig) {
|
||||
browserslist.defaults = objectToBrowserslist(targets);
|
||||
|
||||
const browsers = browserslist(browsersquery, { path: options.configPath });
|
||||
const queryBrowsers = getLowestVersions(browsers);
|
||||
targets = mergeBrowsers(queryBrowsers, targets);
|
||||
}
|
||||
// Parse remaining targets
|
||||
const parsed = Object.keys(targets)
|
||||
.sort()
|
||||
.reduce(
|
||||
(results: ParsedResult, target: string): ParsedResult => {
|
||||
if (target !== "browsers") {
|
||||
const value = targets[target];
|
||||
|
||||
// Warn when specifying minor/patch as a decimal
|
||||
if (typeof value === "number" && value % 1 !== 0) {
|
||||
results.decimalWarnings.push({ target, value });
|
||||
}
|
||||
|
||||
// Check if we have a target parser?
|
||||
const parser = targetParserMap[target] || targetParserMap.__default;
|
||||
const [parsedTarget, parsedValue] = parser(target, value);
|
||||
|
||||
if (parsedValue) {
|
||||
// Merge (lowest wins)
|
||||
results.targets[parsedTarget] = parsedValue;
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
},
|
||||
{
|
||||
targets: targetOpts,
|
||||
decimalWarnings: [],
|
||||
},
|
||||
);
|
||||
|
||||
outputDecimalWarning(parsed.decimalWarnings);
|
||||
|
||||
return parsed.targets;
|
||||
};
|
||||
|
||||
export default getTargets;
|
||||
@@ -1,30 +0,0 @@
|
||||
//@flow
|
||||
|
||||
// Targets
|
||||
export type Target = string;
|
||||
export type Targets = {
|
||||
[target: string]: Target,
|
||||
};
|
||||
|
||||
// Options
|
||||
// Use explicit modules to prevent typo errors.
|
||||
export type ModuleOption = false | "amd" | "commonjs" | "systemjs" | "umd";
|
||||
export type BuiltInsOption = false | "entry" | "usage";
|
||||
|
||||
export type Options = {
|
||||
configPath: string,
|
||||
debug: boolean,
|
||||
exclude: Array<string>,
|
||||
forceAllTransforms: boolean,
|
||||
ignoreBrowserslistConfig: boolean,
|
||||
include: Array<string>,
|
||||
loose: boolean,
|
||||
modules: ModuleOption,
|
||||
shippedProposals: boolean,
|
||||
spec: boolean,
|
||||
targets: Targets,
|
||||
useBuiltIns: BuiltInsOption,
|
||||
};
|
||||
|
||||
// Babel
|
||||
export type Plugin = [Object, Object];
|
||||
@@ -1,82 +0,0 @@
|
||||
// @flow
|
||||
import { logEntryPolyfills } from "./debug";
|
||||
import {
|
||||
createImport,
|
||||
isPolyfillSource,
|
||||
isRequire,
|
||||
type RequireType,
|
||||
} from "./utils";
|
||||
|
||||
type Plugin = {
|
||||
visitor: Object,
|
||||
pre: Function,
|
||||
post: Function,
|
||||
name: string,
|
||||
};
|
||||
|
||||
export default function({ types: t }: { types: Object }): Plugin {
|
||||
function createImports(
|
||||
polyfills: Array<string>,
|
||||
requireType: RequireType,
|
||||
regenerator: boolean,
|
||||
): Array<Object> {
|
||||
const items = Array.isArray(polyfills) ? new Set(polyfills) : polyfills;
|
||||
const imports = [];
|
||||
|
||||
items.forEach(p => imports.push(createImport(t, p, requireType)));
|
||||
|
||||
if (regenerator) {
|
||||
imports.push(createImport(t, "regenerator-runtime", requireType));
|
||||
}
|
||||
|
||||
return imports;
|
||||
}
|
||||
|
||||
const isPolyfillImport = {
|
||||
ImportDeclaration(path, state) {
|
||||
if (
|
||||
path.node.specifiers.length === 0 &&
|
||||
isPolyfillSource(path.node.source.value)
|
||||
) {
|
||||
this.importPolyfillIncluded = true;
|
||||
path.replaceWithMultiple(
|
||||
createImports(state.opts.polyfills, "import", state.opts.regenerator),
|
||||
);
|
||||
}
|
||||
},
|
||||
Program(path, state) {
|
||||
path.get("body").forEach(bodyPath => {
|
||||
if (isRequire(t, bodyPath)) {
|
||||
bodyPath.replaceWithMultiple(
|
||||
createImports(
|
||||
state.opts.polyfills,
|
||||
"require",
|
||||
state.opts.regenerator,
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
name: "transform-polyfill-require",
|
||||
visitor: isPolyfillImport,
|
||||
pre() {
|
||||
this.numPolyfillImports = 0;
|
||||
this.importPolyfillIncluded = false;
|
||||
},
|
||||
post() {
|
||||
const { debug, onDebug, polyfills } = this.opts;
|
||||
|
||||
if (debug) {
|
||||
logEntryPolyfills(
|
||||
this.importPolyfillIncluded,
|
||||
polyfills,
|
||||
this.file.opts.filename,
|
||||
onDebug,
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import semver from "semver";
|
||||
import type { Targets } from "./types";
|
||||
|
||||
// Convert version to a semver value.
|
||||
// 2.5 -> 2.5.0; 1 -> 1.0.0;
|
||||
export const semverify = (version: string | number): string => {
|
||||
if (typeof version === "string" && semver.valid(version)) {
|
||||
return version;
|
||||
}
|
||||
|
||||
const split = version.toString().split(".");
|
||||
|
||||
while (split.length < 3) {
|
||||
split.push("0");
|
||||
}
|
||||
|
||||
return split.join(".");
|
||||
};
|
||||
|
||||
export const prettifyVersion = (version: string): string => {
|
||||
if (typeof version !== "string") {
|
||||
return version;
|
||||
}
|
||||
|
||||
const parts = [semver.major(version)];
|
||||
const minor = semver.minor(version);
|
||||
const patch = semver.patch(version);
|
||||
|
||||
if (minor || patch) {
|
||||
parts.push(minor);
|
||||
}
|
||||
|
||||
if (patch) {
|
||||
parts.push(patch);
|
||||
}
|
||||
|
||||
return parts.join(".");
|
||||
};
|
||||
|
||||
export const prettifyTargets = (targets: Targets): Object => {
|
||||
return Object.keys(targets).reduce((results, target) => {
|
||||
let value = targets[target];
|
||||
|
||||
if (typeof value === "string") {
|
||||
value = prettifyVersion(value);
|
||||
}
|
||||
|
||||
results[target] = value;
|
||||
return results;
|
||||
}, {});
|
||||
};
|
||||
|
||||
export const filterStageFromList = (list: any, stageList: any) => {
|
||||
return Object.keys(list).reduce((result, item) => {
|
||||
if (!stageList[item]) {
|
||||
result[item] = list[item];
|
||||
}
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
};
|
||||
|
||||
export const isPolyfillSource = (source: string): boolean =>
|
||||
source === "@babel/polyfill";
|
||||
|
||||
export const isRequire = (t: Object, path: Object): boolean =>
|
||||
t.isExpressionStatement(path.node) &&
|
||||
t.isCallExpression(path.node.expression) &&
|
||||
t.isIdentifier(path.node.expression.callee) &&
|
||||
path.node.expression.callee.name === "require" &&
|
||||
path.node.expression.arguments.length === 1 &&
|
||||
t.isStringLiteral(path.node.expression.arguments[0]) &&
|
||||
isPolyfillSource(path.node.expression.arguments[0].value);
|
||||
|
||||
const modulePathMap = {
|
||||
"regenerator-runtime": "regenerator-runtime/runtime",
|
||||
};
|
||||
|
||||
export const getModulePath = (mod: string) =>
|
||||
modulePathMap[mod] || `core-js/modules/${mod}`;
|
||||
|
||||
export type RequireType = "require" | "import";
|
||||
|
||||
export const createImport = (
|
||||
t: Object,
|
||||
polyfill: string,
|
||||
requireType?: RequireType = "import",
|
||||
): Object => {
|
||||
const modulePath = getModulePath(polyfill);
|
||||
|
||||
if (requireType === "import") {
|
||||
const declar = t.importDeclaration([], t.stringLiteral(modulePath));
|
||||
declar._blockHoist = 3;
|
||||
return declar;
|
||||
}
|
||||
|
||||
return t.expressionStatement(
|
||||
t.callExpression(t.identifier("require"), [t.stringLiteral(modulePath)]),
|
||||
);
|
||||
};
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"mocha": true
|
||||
},
|
||||
"rules": {
|
||||
"max-len": 0
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user