131 Commits

Author SHA1 Message Date
Sven SAULEAU
beae0ff9ba docs: [skip ci] type in plugin's name 2017-04-05 16:43:56 +02:00
Henry Zhu
f3ef03abfd use caret for devDeps 2017-03-27 16:32:13 -04:00
Henry Zhu
7a1ccf076c Misc (#5545)
* normalize npmignores

* fixup eslint ignore, etc

* lint

* remove unused

* rm from gitignore

* use strict
2017-03-25 21:46:16 -04:00
Henry Zhu
ab68800e06 v7.0.0-alpha.3 2017-03-23 15:49:01 -04:00
Robert Jackson
c4ebc8553b Properly preserve import ordering with AMD format. (#5474)
Previously, all "bare imports" (e.g. `import './foo';`) were moved to the
end of the array of sources. I presume this was done to remove needless
variables in the callback signature.

Unfortunately, doing this actually changes the intent of the program.
Modules should be evaluated in the order that they were in the source.

In the case of a bare import, it is quite possible that the bare import
has side effects that a later required module should see. With the current
implementation the later imported modules are evaluated before that "side
effecty" module has been evaluated.

Obviously, it is better to avoid these sorts of side effect ridden modules
but even still you could imagine a similar issue with cycles.

This change ensures that module source order is preserved in the AMD
dependencies list, and avoids making needless variables as much as possible.
2017-03-22 16:24:17 -04:00
Henry Zhu
230712e091 Internal: back to fixed, publish everything (#5436) 2017-03-08 22:56:00 -05:00
Robert Jackson
23de276718
Add docs for strict and noInterop with es2015-modules-commonjs. 2017-03-06 20:19:38 -05:00
Robert Jackson
0d1edb9811
Add noInterop option to babel-plugin-transform-es2015-modules-commonjs.
The intent of this option is to toggle module interop behavior. When `true`
no `interopRequireXXX` helper invocations will be emitted.
2017-03-06 19:51:35 -05:00
Brian Ng
8a82cc060a Run new lint rules (#5413) 2017-03-04 10:46:01 -05:00
Henry Zhu
11e54a6bd3 v7.0.0-alpha.1 2017-03-02 16:04:47 -05:00
Logan Smyth
4ee385e96c Avoid usage of exports/module.exports/require(). 2017-02-21 16:52:42 -08:00
Daniel Tschinder
6c03cb0783
Merge branch 'master' into merge-master
# Conflicts:
#	lerna.json
#	packages/babel-cli/package.json
#	packages/babel-core/package.json
#	packages/babel-generator/package.json
#	packages/babel-helper-builder-react-jsx/package.json
#	packages/babel-helper-function-name/package.json
#	packages/babel-helper-optimise-call-expression/package.json
#	packages/babel-helper-replace-supers/package.json
#	packages/babel-helper-transform-fixture-test-runner/package.json
#	packages/babel-helpers/package.json
#	packages/babel-plugin-transform-class-properties/package.json
#	packages/babel-plugin-transform-es2015-block-scoping/package.json
#	packages/babel-plugin-transform-es2015-classes/package.json
#	packages/babel-plugin-transform-es2015-modules-commonjs/package.json
#	packages/babel-plugin-transform-es2015-modules-systemjs/package.json
#	packages/babel-plugin-transform-es2015-modules-umd/package.json
#	packages/babel-plugin-transform-es2015-parameters/package.json
#	packages/babel-plugin-transform-react-jsx/package.json
#	packages/babel-register/package.json
#	packages/babel-template/package.json
#	packages/babel-traverse/package.json
#	packages/babel/package.json
2017-02-14 12:46:23 +01:00
Logan Smyth
48573f1fb4 v6.23.0 2017-02-13 17:14:12 -08:00
Henry Zhu
9083bd6283 Merge branch 'master' into 7.0 2017-02-09 18:36:02 -05:00
Logan Smyth
b845f2b69d Re-enable the max-len ESLint rule. (#5265) 2017-02-04 11:07:15 -05:00
Brian Ng
160bd3924b Normalize options sections in docs [skip ci] (#5244) 2017-01-31 08:46:01 -05:00
Matthew Stewart
d4790888a3 Limit export node default assignment stack size #4323
Signed-off-by: Matthew Stewart <mattdste@gmail.com>
2017-01-28 12:51:37 -05:00
Kai Cataldo
e09ea222c9 Remove babel-runtime from packages' dependencies (#5218) 2017-01-27 09:04:35 -05:00
Henry Zhu
e9fc38bcd3 v6.22.0 2017-01-19 19:33:22 -05:00
Brian Ng
8c35b320d3 Bump eslint-config-babel and fix lint (#5129) 2017-01-17 10:51:16 +01:00
Sergey Rubanov
292c3ca206 Refactor test packages to use ES modules instead of CJS (#5138) 2017-01-16 11:25:04 -05:00
Henry Zhu
672adba9a1 enable prefer const (#5113) 2017-01-14 09:48:52 -05:00
Brian Ng
f71efbce92 Update transform-es2015 READMEs from babel.github.io [skip ci] (#4926)
Signed-off-by: Brian Ng <bng412@gmail.com>
2016-12-01 16:11:36 -05:00
Henry Zhu
e86f62b304 README: add --save-dev [skip ci]
Closes gh-4910
2016-11-29 08:40:27 -05:00
Sven SAULEAU
2311b5b53a README: remove dollar in sh snippets [skip ci] 2016-11-29 08:39:23 -05:00
Henry Zhu
12f9cd0826 v6.18.0 2016-10-24 17:18:36 -04:00
Andrew Levine
de46827be7 Handle remapping of JSXIdentifier to MemberExpression in CommonJS transform. Closes #3728 (#4763) 2016-10-24 10:23:43 -04:00
Andrew Levine
c0038221d7 Run ESLint on test files, and fix lint errors in test files (#4732) 2016-10-15 18:27:48 -04:00
Moti Zilberman
9fc51d6292 Consolidate contiguous var declarations in destructuring transform (#4690)
* Consolidate contiguous var declarations in destructuring transform

Fixes #3081.

* Simplify var node coalescing in es2015-destructuring

* Revert "Simplify var node coalescing in es2015-destructuring"

This reverts commit 15cb373f0726f68225f7080a7ae206a63af174ee.

* More careful condition for var coalescing in es2015-destructuring
2016-10-14 11:51:22 -04:00
Flavio Corpa
9b02a6d298 Add missing description to all package.json files (#4703) [skip ci] 2016-10-12 10:15:50 -04:00
Henry Zhu
6d22f258db v6.16.0 2016-09-28 15:38:45 -04:00
Logan Smyth
819cde936c Merge pull request #4511 from motiz88/fix-4462
Fix UpdateExpression handling in es2015-modules-commonjs, resolve #4462
2016-09-25 14:16:53 -07:00
Justin Ridgewell
c2ed9de7fb Flip default parameter template (#4515)
* Flip default parameter template

YMMV, I saved ~10b on a 2kb library. Not noticeable at the small scale, by why not do it anyway?

I've (unscientifically) found that flipping the default parameter conditional yields better gzip results. I think this is due to the slightly longer string it can now repeatedly match:

```js
// old
var param = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0]
--------------------------------------------------------------^

// new
var param = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null
------------------------------------------------------------------------^
```

Though it's entirely likely gzip will also choose up to the index of the arguments if you many default parameters at different indexes.

* Update tests
2016-09-25 14:05:53 -07:00
Kai Cataldo
1db8c02d05 Remove duplicate default error (#4543)
* Revert "Throw error for multiple exports default (#3518)"

This reverts commit aa51dd4a3dbb956d8b619d884acf40194d5ffac8.

* Fix export default tests
2016-09-22 12:00:18 -04:00
Kai Cataldo
f3a6e4b0ae Fix tests with duplicate named exports (#4538)
* Fix babel-plugin-transform-flow-strip-types tests

* Fix babel-plugin-transform-es2015-modules-umd tests

* Fix babel-generator tests

* Fix babel-plugin-transform-es2015-modules-systemjs tests

* Fix babel-plugin-transform-es2015-modules-commonjs tests

* Fix babel-plugin-transform-es2015-modules-amd tests
2016-09-21 10:52:59 +02:00
Daniel Tschinder
cbbc1c7333 fix default exported classes without a name (#4518)
* fix default exported classes without a name

This correctly requeues class without name so the es3 transform can
transform the default keyword.

* Replace phabricator issue number with github
2016-09-17 22:50:54 -04:00
Moti Zilberman
43e0cfb08d Fix UpdateExpression handling in es2015-modules-commonjs, resolve #4462 2016-09-13 19:06:52 +03:00
Henry Zhu
5ce325c399 v6.14.0 2016-08-24 17:40:46 -06:00
Kai Cataldo
aa51dd4a3d Throw error for multiple exports default (#3518)
Fixes https://phabricator.babeljs.io/T7242
2016-08-16 13:21:00 -04:00
Henry Zhu
98dea13afa v6.11.5 2016-07-23 14:09:34 -04:00
Henry Zhu
253918c30f Fix buildExportAll to account for commonjs/amd/systemjs (#3591)
* Fix buildExportAll to account for commonjs/amd

If the re-exported module was generated with Babel and it is a commonjs or amd module and so is the current module, this will result in an attempt to redefine the __esModule property, which throws a runtime error.

* Add test: don't overwrite __esModule on re-export

(Failing.)

* fixup tests

* Add fix for systemjs
2016-07-23 13:21:07 -04:00
Logan Smyth
1bbf109e8e Move aux comments entirely into printer. 2016-07-17 21:51:01 -07:00
Logan Smyth
38b91235cc Print inter-node newlines before other node items. 2016-07-17 21:51:00 -07:00
James Kyle
c561312bee Adds strictMode option to strict-mode transform (#3562) 2016-07-02 13:27:57 -07:00
Logan Smyth
cc22b1cc23 v6.10.3 2016-06-18 16:55:21 -07:00
Logan Smyth
2ba27c73d7 Allow empty 'export {};' statements - fixes T7439 2016-06-18 12:41:44 -07:00
Henry Zhu
05bf216339 v6.8.0 2016-05-02 19:43:49 -04:00
Henry Zhu
4c23b01798 change plugins to use babel-runtime 6 2016-04-24 20:06:23 -04:00
Logan Smyth
696c74933a v6.7.7 2016-04-20 20:09:20 -07:00
Henry Zhu
c24b0b043a Add test for T7272 2016-04-08 09:02:02 -04:00