247 Commits

Author SHA1 Message Date
Nicolò Ribaudo
0dbf99bedb
v7.5.2 2019-07-08 21:46:49 +02:00
Nicolò Ribaudo
406a65c894
Don't rely on getOwnPropertyDescriptors in objectSpread2 (#10171) 2019-07-07 11:24:36 +02:00
Nicolò Ribaudo
d0519fa907
v7.5.1 2019-07-06 10:07:59 +02:00
Nicolò Ribaudo
24dde2e8e8
Fix objectSpread2 backward compatibility (#10170) 2019-07-06 09:48:36 +02:00
Nicolò Ribaudo
49da9a07c8
v7.5.0 2019-07-04 14:52:17 +02:00
Artem Butusov
5b86353b35 Added es3 backward compatibility for react helper code (#10155)
* Added es3 backward compatibility for react helper code

* tweak comment [skip ci]
2019-07-03 16:49:20 +02:00
Erik Arvidsson
8f8a457798 Simplify the helpers for classPrivateField{Get,Set} (#10117)
No need to do the hash lookup twice. If the descriptor is not in the
WeakMap `get` returns `undefined`.
2019-06-22 00:23:26 +02:00
Kagami Sascha Rosylight
a596da2822 Retry to fix object spread helper compatibility (#9384)
This reverts commit 43b83f8ed7545b9c049eeed85541fa162842fb8f.

Fix objectSpread helper breaking old codes

remove tests to regenerate later

renamed output

new name

try using word

add comment as requested

revert inline name changes

add 2 for consistency

Update packages/babel-helpers/src/helpers.js

Co-Authored-By: Daniel Tschinder <daniel@tschinder.de>
2019-05-25 12:57:13 +02:00
Nicolò Ribaudo
2c88694388
v7.4.4 2019-04-26 23:00:07 +02:00
Nicolò Ribaudo
508fde4009
v7.4.3 2019-04-02 21:36:09 +02:00
Conrad Buck
ff04d3535c Allow coreJS Symbol to be type object (#9756) 2019-03-24 09:47:09 +01:00
Nicolò Ribaudo
7dea0f23de
v7.4.2 2019-03-21 10:55:50 +01:00
Nicolò Ribaudo
bf94bb9d43
Fix typo in wrapRegExp helper (#9726) 2019-03-21 00:18:43 +01:00
Nicolò Ribaudo
f1328fb913
v7.4.0 2019-03-19 21:27:16 +01:00
Denis Pushkarev
3303b079c5 Update to core-js@3 (#7646)
### `@babel/runtime`
- Added `@babel/runtime-corejs3` package and `corejs: 3` options to `@babel/plugin-transform-runtime`.
- Added support of instance methods, fixes #8928.
- Added flag `proposals` (in `corejs: { version: 3, proposals: true }` format) for support all proposals polyfills from `core-js`.
- Used separate directories in runtime for `core-js` entry points with proposals and without.
- Used `get-iterator-method` helper for getting iterators, fixes #2500.
- As a cheap bonus, added support of IE8- (except some cases of `regenerator`).

### `@babel/polyfill`
- Should be deprecated in favor of separate usage required features from `core-js` and `regenerator-runtime` with an informative message.

### `@babel/preset-env`
- Uses for built-ins data from [`core-js-compat`](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat) instead of `compat-table` since information from `compat-table` [is not enough](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat).
- `useBuilIns` now requires direct setting of `corejs` version option, without it will be used `2` by default and shown deprecation warning.
- Added support of minor `core-js` versions for simplify updating in the future.
- For preventing some order-related problems, polyfills in the both `core-js@3` plugins added on `post` stage in the order of `core-js-compat` data.
- Divided plugins and polyfills parts of `preset-env`, instead of 2 internal plugins for adding polyfills, we have 6: usage and entry versions of plugins for `core-js@2`, ### Current state:
`core-js@3`, `regenerator-runtime`.
- Added support `samsung` target (for Samsung Internet) since `core-js-compat` and `compat-table` now contains mapping for this, fixes #6602.

#### `useBuilIns: entry` with `corejs: 3`
- No longer transforms `@babel/polyfill`.
- Transforms **all possible** `core-js` entry points to import of related modules (based on data from [`core-js-compat`](https://unpkg.com/core-js-compat@3.0.0-beta.15/entries.json)).
- Since of this, we no longer need `shippedProposals` / `proposals` flags with `useBuilIns: entry`.
- Removes `regenerator-runtime/runtime` import where it's not required.

#### `useBuilIns: usage` with `corejs: 3`
- In addition to `shippedProposals`, added flag `proposals`  (in `corejs: { version: 3, proposals: true }` format) for polyfill all proposals from `core-js`.
- Fixed list of dependencies in built-in definitions.
- Improved the way of determination method / built-in name and source of this method.
- Adds import of required polyfills on `MemberExpression`, `ObjectPattern`, `in` operator.
- Adds import of required polyfills on access to global object properties.
- Adds import of all required common iterators on all syntax features which use iterators protocol (`for-of`, destructuring, spread, `yield` delegation, etc.).
- Adds import of promises on syntax features which use promises (async functions/generators, dynamic import, etc.), fixes #9250, #7402, etc.

### `core-js@2` stuff
I didn't want to tough `core-js@2`-related stuff, however
- Fixed some serious errors in definitions which breaks `Object.getOwnPropertySymbols`, `Symbol.toStringTag` logic, `Promise#finally`, `Array#forEach`, etc.
- `Array#flatMap` and trim methods moved to stable features as a part of ES2019 and loaded by deprecated `@babel/polyfill` and `@babel/preset-env` with `corejs: 2` option.
2019-03-19 21:07:45 +01:00
Tim McClure
81c130ffc9 Private Static Class Methods (Stage 3) (#9446) 2019-03-13 00:11:16 +01:00
Nicolò Ribaudo
f2af6c1170 v7.3.1 2019-01-22 08:07:23 +01:00
Daniel Tschinder
43b83f8ed7 Revert "Differentiate object spread and non-spread properties (#9341)" (#9379)
This reverts commit 3ae5e79ec8ab1e6d1c6927f35d4a1eeac04faf9a.
2019-01-21 23:03:54 -08:00
Nicolò Ribaudo
f6ee26c3da v7.3.0 2019-01-21 22:22:39 +01:00
Tim McClure
e8de6fa5d4 Private Class Methods Stage 3: Private Accessors (#9101)
* Add accessor loose support

* Add private accessors spec support

* Fix private dupe name check

* Changes from code review

* Add duplicated names tests

* Add get/set-only tests

* Move accessors tests

* Split out updates tests

* Add helper change tests

* Update test output

* Update test options
2019-01-21 22:05:37 +01:00
Kagami Sascha Rosylight
3ae5e79ec8 Differentiate object spread and non-spread properties (#9341)
* add isSpread field

* use argument

* t.booleanLiteral

* fix typo

* push empty-argument object

* .object

* .value

* object field should be an expression

* lint

* update outputs

* isSpread for the second argument is redundant

* add test

* alternating spread
2019-01-21 22:04:47 +01:00
Nicolò Ribaudo
a27b9b4299
Add @babel/plugin-transform-named-capturing-groups-regex (#7105)
When the `runtime` flag is on (by default), this plugin adds a new helper which wraps the native `RegExp` class to provide groups support. People nees to use a polyfill (I implemented it in core-js) for browsers that don't support ES6 regexps.
2019-01-15 18:21:17 +01:00
Nicolò Ribaudo
8e051cae46
[decorators] Set method names at compile time instead of at runtime (#9244) 2019-01-10 00:45:02 +01:00
Nicolò Ribaudo
9d1d0fe57a
Add mixins support to the _decorate helper (#9166) 2018-12-29 22:54:30 +01:00
Nicolò Ribaudo
282129ea66 v7.2.0 2018-12-03 20:00:35 +01:00
Tim McClure
0859535b62 Private class methods stage 3 (#8654)
* Add private method syntax support

* Add private method spec support

* Add private method loose support

* Throw error if static private method is used

* Add more isStatic & isMethod checks

* Remove `writable:false` from private method inits

`writable` is false by default.

* Add private method func obj equality check

* Throw if private accessor is used

* Add check for fields === private method loose mode

* Throw buildCodeFrameErrors instead of Errors

* Move obj destructuring inside for loop

* Remove "computed" from ClassPrivateMethod type def
2018-11-28 16:20:09 -08:00
Henry Zhu
afe67a7035 v7.1.5 2018-11-06 17:21:22 -05:00
Nicolò Ribaudo
d35563ee1a Set correct methods name 2018-11-02 13:59:57 +01:00
Nicolò Ribaudo
38397ce11f Use toPropertyKey in the "decorate" helper
This commit also makes the "toPropertyKey" helper call @@toPrimitive
when needed.
2018-11-02 13:59:57 +01:00
Henry Zhu
3f5b7554b8 v7.1.2 2018-09-28 18:19:38 -04:00
Henry Zhu
ead23d7112 v7.1.1 2018-09-28 16:02:43 -04:00
Nicolò Ribaudo
5150f5f500
[decorators] Fields are enumerable (#8761) 2018-09-24 23:36:32 +02:00
Henry Zhu
fad74959f8 v7.1.0 2018-09-17 15:29:37 -04:00
Nicolò Ribaudo
aac8118b7f
Update helpers version fro 7.0.1 to 7.0.2 (#8703) 2018-09-14 22:55:27 +02:00
Logan Smyth
79b2af5997
Format fixture JSON with Prettier. (#8658) 2018-09-09 17:57:52 -07:00
Nicolò Ribaudo
9aec4ad159
Add support for the new decorators proposal (#7976) 2018-09-07 15:58:42 +02:00
Nicolò Ribaudo
c5279eeca4
[static private] Use explicit descriptors instead of an object (#8620)
This is similar to ec69b4bb1256c061ac76f53dfed09c4283ec6a31, which
was about private instance fields.

Private properties can be non-writable (thanks to decorators), or have
get/set accessors. If we stored this information on the `privateClass`
object, we would need to always use `Object.getOwnPropertyDescriptor`
before reading or writing a property because accessors need to be called
with the correct `this` context (it should be the actual class, not the
object hat stores the private properties). This commit simplifies that
operation a bit by removing the container object.

It also have another advantage, which instance fields already have
thanks to the use of separate weakmaps: unused private static fields
can be tree-shaken away or garbage-collected, while properties of an
object can't. Also, they can be easilier minified.
2018-09-05 15:08:40 +02:00
Nicolò Ribaudo
d4e23b5b2a
[static private] Unify loose handling of static and instance props (#8614) 2018-09-04 08:10:46 +02:00
Nicolò Ribaudo
4beb977f15 [static private] Use correct min version in helpers (#8613)
* [staic private] Use correct min version in helpers

* Always use patch version
2018-09-03 11:36:26 -07:00
Robin Ricard
fb66fa6f90 Private Static Fields Features: Stage 3 (#8205)
* Private Static Class Fields Implementation

* Redo testing without class transform for static private

* Add a call() test for private static

* Use Object.defineProperty in loose mode
2018-09-01 00:42:18 -04:00
Henry Zhu
04d09cc754
add access public to all packages [skip ci] (#8573)
If people copy paste to make an new package they might miss this and we will get a publish error later so figured we should add it to all.
2018-08-29 09:54:53 -04:00
Henry Zhu
90fb82a535 v7.0.0 2018-08-27 17:41:21 -04:00
Henry Zhu
814c564c45 v7.0.0-rc.4 2018-08-27 12:42:00 -04:00
Henry Zhu
cada040bec v7.0.0-rc.3 2018-08-24 14:06:00 -04:00
Nicolò Ribaudo
1f9b2a5c41
[_wrapNativeSuper] Don't wrap non-native constructors (#8501) 2018-08-24 19:58:49 +02:00
Nicolò Ribaudo
c5e3b6d4bc
[decorators] Don't set writable on accessors (#8513) 2018-08-23 00:54:28 +02:00
Henry Zhu
f1d774b34f v7.0.0-rc.2 2018-08-21 15:22:07 -04:00
Yeonghoon Park
c75a00bd56 Fix default descriptor setting for class properties with decorators (#7429)
(legacy decorators)
2018-08-17 10:49:03 +02:00
Henry Zhu
0a958861c9 v7.0.0-rc.1 2018-08-09 16:06:08 -04:00
Henry Zhu
8b1406127a v7.0.0-rc.0 2018-08-09 11:56:00 -04:00