Logan Smyth
43e7d1d2cc
Use an object instead of a 2-tuple.
2017-12-21 12:31:48 -08:00
Logan Smyth
de63443762
Split babelrc and babelignore searching into two functions.
2017-12-21 12:28:51 -08:00
Logan Smyth
1178799f07
Remove the LoadedFile class.
2017-12-19 15:36:54 -08:00
Logan Smyth
b2f1d01965
Add type annotations to utility file.
2017-12-19 15:36:19 -08:00
Logan Smyth
4f53496546
Drop the OptionManager class in favor of function.
2017-12-19 14:19:37 -08:00
Logan Smyth
1312a30d54
Perform normalization in the chain building process.
2017-12-19 14:19:37 -08:00
Logan Smyth
4afbc02476
Move descriptor merging into config chain processing.
2017-12-19 14:19:37 -08:00
Maaz Syed Adeeb
17b37b5013
Handling babylon parsing errors in a better way ( #6961 )
...
* Handling babylon parsing errors in a better way
* Better error messages + Helpful URLs
* Replaced message from babylon completely
* Add importMeta plugin to the map
2017-12-18 15:49:34 -05:00
Henry Zhu
8a4124b2ff
v7.0.0-beta.35
2017-12-14 16:47:27 -05:00
Nicolò Ribaudo
05b22d2597
Update @babel/helper-wrap-function templates ( #6984 )
...
This commit introduces 4 changes:
1) Function declarations are wrapped using function declarations.
This has two advantages:
- We can rely on native hoisting, instead of using _blockHoist
- The function isn't wrapped until it is called. This avoids
problems where `regeneratorRuntime.wrap` was called before
that `babel-polyfill` was imported.
Example:
function fn() {}
// becomes
function fn() { return _fn.apply(this, arguments); }
function _fn() {
_fn = _wrapper(/* Original function ... */);
return _fn.apply(this, arguments);
}
2) Use a single template for both named and anonymous function
expressions. They already had the same behavior, but the one
used for named functions was a bit longer.
3) Use normal functions instead of arrow functions to wrap
function expressions.
4) Generate a name based on the original one for wrapped
functions (e.g. `foo` becomes `_foo` instead of `_ref`).
2017-12-13 16:21:58 +01:00
Brian Ng
c7980b2b90
Bump prettier ( #6991 )
2017-12-07 17:36:49 -05:00
Henry Zhu
a7c9264c79
v7.0.0-beta.34
2017-12-02 09:38:52 -05:00
Henry Zhu
413aa79711
v7.0.0-beta.33
2017-12-01 09:27:57 -05:00
Logan Smyth
8fc8a1f2ee
Use public options API for tests.
2017-11-28 13:25:10 -08:00
Logan Smyth
189c56628a
Replace repeated plugins/preset in top-level config instead of running both.
2017-11-25 18:47:13 -08:00
Logan Smyth
8be488652f
Allow plugins and presets to have explicit names.
2017-11-25 18:46:00 -08:00
Logan Smyth
cdf420d4d8
Rewrite config chain tests to use public loadOptions API. ( #6909 )
2017-11-25 18:25:20 -08:00
Nicolas Marien
cf62908bbd
Keep user options intact in transformFile ( #6890 )
...
* Preserve user options in transformFile
* Improve tests for transformFile user opts handling
2017-11-25 10:13:56 -08:00
Logan Smyth
6cb9d20a0a
Tie presets pass metadata to descriptors.
2017-11-24 19:45:15 -08:00
Logan Smyth
b5cb78d33a
Move plugin pass initialization logic a bit.
2017-11-24 19:45:15 -08:00
Logan Smyth
1d0a3d6772
Remove duplicated assertion. Covered by validate()
2017-11-24 19:45:14 -08:00
Logan Smyth
18ea5aca51
Expose a 'cwd' option for Babel's root options.
2017-11-24 19:43:25 -08:00
Logan Smyth
db28c18458
Disallow nested '.env' blocks since they are useless.
2017-11-24 17:45:27 -08:00
Logan Smyth
a89171910f
Merge pull request #6834 from loganfsmyth/caching-refactor
...
Expose `envName` as a top-level Babel option to avoid using environmental variables
2017-11-24 17:42:16 -08:00
Gidi Meir Morris
edbf5d33dc
Fix "Better error messaging for unexpected tokens #6715 " ( #6875 )
2017-11-22 15:31:03 -06:00
Logan Smyth
39dae28d5c
Add missing argument and remove nonexistent one. ( #6842 )
2017-11-16 16:32:47 -08:00
Logan Smyth
aa2d415507
Expose the envName as a programmatic and CLI option.
2017-11-15 11:24:39 -08:00
Logan Smyth
74439889d8
Centralize envName lookup using caching sidechannel.
2017-11-15 10:05:48 -08:00
Logan Smyth
74ea70718e
Allow passing an cachable 'sidechannel' object into cache handlers.
2017-11-15 10:05:47 -08:00
Logan Smyth
bbff566024
Use expanded caching API to simplify usage.
2017-11-15 09:51:13 -08:00
Logan Smyth
3942862a2a
Expose more caching flexibility for Babel's internal use.
2017-11-15 09:51:12 -08:00
Logan Smyth
44c2791849
Expose a function for plugins to check if async plugins are supported by the current compilation.
2017-11-13 11:58:31 -08:00
Logan Smyth
0e88156d0c
Add warnings to places where we might allow promises to be returned in later minors.
2017-11-13 11:58:30 -08:00
Sven SAULEAU
42c740ca0a
Merge branch 'master' into async-to-generator-pure
2017-11-13 11:49:16 +01:00
Henry Zhu
4e6cd298c7
v7.0.0-beta.32
2017-11-12 08:32:53 -05:00
Satyajit Sahoo
7ae6e1e5a0
Add /*#__PURE__*/ annotatiotion for babel-plugin-async-to-generator. Fixes #6572
2017-11-12 18:31:48 +05:30
Logan Smyth
1165ecc616
Update README with new Sync-suffix functions. ( #6794 )
2017-11-10 15:19:24 -08:00
Logan Smyth
432a9b5092
Allow sourceType:unambiguous as a way to tell Babylon to guess the type. ( #6789 )
...
* Allow sourceType:unambiguous as a way to tell Babylon to guess the type.
* Update some docs.
2017-11-10 15:00:06 -08:00
Logan Smyth
4a5d551370
Set babelrc:false on config load for more consistent loading.
2017-11-09 12:26:40 -08:00
Logan Smyth
2bfa2eb5cd
Apply option defaults when transforming, not up front.
2017-11-09 12:20:52 -08:00
Logan Smyth
fc7fcfac0a
Expose a clear API for plugins to override the parser/generator.
2017-11-09 10:34:12 -08:00
Logan Smyth
52d337e4d9
Move plugin object validation into plugin file.
2017-11-09 10:24:04 -08:00
Logan Smyth
98969b8a73
Standardize on Sync suffix for sync APIs (with backward-compat) ( #6780 )
2017-11-09 10:22:51 -08:00
Logan Smyth
4d7d4605b6
Centralize parserOpts and generatorOpts normalization.
2017-11-08 17:06:01 -08:00
Logan Smyth
39119f88e7
Pass explicit options list to babel-code-frame
2017-11-08 17:00:02 -08:00
Logan Smyth
6684986372
Expose an official API to access the current filename.
2017-11-08 16:48:25 -08:00
Logan Smyth
82513465ee
Pass an explicit whitelist of options down into babel-generator.
2017-11-08 16:41:33 -08:00
Henry Zhu
f76ac0b197
v7.0.0-beta.31
2017-11-03 16:03:01 -04:00
Logan Smyth
9e2828322e
Merge pull request #6556 from loganfsmyth/early-validation
...
Strictly validate Babel's options to centralize Flow refinement of datatype
2017-11-02 16:24:36 -07:00
Daniel Tschinder
3b540e3f5a
Integrate babylon into babel workflow
2017-11-01 23:26:51 +01:00