72 Commits
Author SHA1 Message Date
215afa9f57 Fallback to assuming ESM support with modules: auto (#18069)
Co-authored-by: Babel Bot <[email protected]>
2026-06-16 10:03:37 +02:00
Nicolò Ribaudo 38bb9b543f RUN: node scripts/remove-babel-7-tests.mjs 2025-12-05 12:33:52 +01:00
863c75147c fix: support JSXFrament in react-constant-elements transform (#16582)
* fix: plugin react-constant-elements transform JSXFrament not add container

* test: add a jsx-in-frament test case for plugin-react-constant-elements

* feat: hoist JSXFragment if possible

* add more test cases

---------

Co-authored-by: Huáng Jùnliàng <[email protected]>
2024-07-27 08:58:22 -04:00
Nicolò RibaudoandGitHub 1255a2af9a Use type: module in all package.jsons (#16535)
* Use `type: module` in all `package.json`s

* Remove now unnecessary `{ "type": "module" }` package.jsons

* Use `type: commonjs` where needed
2024-05-30 09:27:35 +02:00
Nicolò RibaudoandGitHub 3c210ed5b3 Inline exports.XXX = update in simple variable declarations (#15984) 2023-09-19 16:25:14 +02:00
Nicolò RibaudoandGitHub 9eb3602afe Rename -proposal-s that became standard to -transform- (#15614) 2023-05-22 12:41:31 +02:00
65b1f4e89e Improve comments generation (#14979)
Co-authored-by: Nicolò Ribaudo <[email protected]>
2022-10-09 17:21:02 +02:00
8ab7a1a194 fix: mark var declarations in loops as not constant (#15027)
* fix: babel-traverse constant flag in bindings

flag bindings in loops as not constant.

Fixes: #13760

* Only mark `var`s directly inside loops

* Fix CI error

Co-authored-by: Stephane Rufer <[email protected]>
2022-10-09 00:42:29 +02:00
Huáng JùnliàngandGitHub 8d24353d8a fix: react-cons-elem should not hoist router comp (#14828) 2022-08-04 17:28:05 -04:00
Nicolò RibaudoandGitHub fcabe4b4d5 Never hoist JSX elts referencing vars from the current scope (#14536) 2022-05-09 09:43:12 -04:00
Nicolò RibaudoandGitHub 6e3f93e0b6 allowMutablePropsOnTags: cache JSX const elements w/ fn props (#12975) 2022-02-21 23:19:51 +01:00
Nicolò RibaudoandGitHub df22d9da48 Run tests in a native Node.js ESM environment (#13966) 2021-12-03 15:32:58 +01:00
Huáng JùnliàngandGitHub 92f3cfaded [babel 8] Enable preset-env bugfixes by default (#13866) 2021-10-24 15:17:19 +02:00
Huáng JùnliàngandGitHub 7e48b7b5d2 Implement @babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression (#13842)
* fix: register function expression id after params

* implement bugfix plugin

* add more testcases

* fix: do not skip pattern binding referencing id

* update compat-table

* add bugfix plugin to preset-env

* update Babel 8 test fixtures

* Update packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/README.md

* chore: bundle bugfix plugin

* address review comments

* add runtime version check

* update compat table

* fix syntax error

* update test fixtures

* revert bugfixes targets update

* update Babel 8 test fixtures
2021-10-20 15:53:40 -04:00
Alan OrozcoandGitHub dc034f8196 Hoist omitted keys from object spread operator (#13384) 2021-05-28 18:32:30 +02:00
fea051b787 fix: Don't hoist JSX elements referencing mutable variables (#13054)
issue-13051

Co-authored-by: Clint Goodman <[email protected]>
2021-03-25 16:38:31 +01:00
Huáng JùnliàngandGitHub 5de2862609 [babel 8] fallback targets to "defaults, not ie 11" (#12989) 2021-03-23 20:17:16 +01:00
d86910533e Lazily initialize and cache constant JSX elements (#12967)
Co-authored-by: Justin Ridgewell <[email protected]>
2021-03-06 17:33:43 +01:00
Nicolò RibaudoandGitHub ad0dd901a2 Avoid using CJS globals in internal source files (#12963)
* Lint against CJS globals in modules

* Use `import.meta.url` instead of `__filename` in `src` files

* Prepare fixtures runner for `import.meta.url`

* Use `import.meta.url` instead of `__filename` in `test/index` files

* Remove `__dirname` from remaining test files

dirname

* Avoid using `module` in `src` files

* Avoid using `require` in `src` files

* Avoid using `require` in `test` files

* Update `@types/node`

* Compile dynamic import in `@babel/node`

* Fix windows

* Use `@babel/plugin-proposal-dynamic-import` from npm
2021-03-05 19:55:36 +01:00
360e501253 Enable external-helpers by default in tests (#12911)
Co-authored-by: Huáng Jùnliàng <[email protected]>
Co-authored-by: Babel Bot <[email protected]>
2021-02-26 23:33:26 +01:00
3df22f4ed7 [babel 8] Use the JSX automatic runtime by default (#12630)
Co-authored-by: Nicolò Ribaudo <[email protected]>
Co-authored-by: Arun Kumar Mohan <[email protected]>
2021-01-19 01:41:07 +01:00
Nicolò RibaudoandGitHub a7e4db14ab Mark transpiled JSX elements as pure (#11126)
* Mark transpiled JSX elements as pure

* Avoid duble annotation

* Add "pure" option to the React preset

* Fix generator indentation

* Update tests

* Add tests for the "pure" option

* Update windows fixtures
2020-03-19 15:43:54 +01:00
Nicolò RibaudoandGitHub b406d255b7 Skip newlines around inline #__PURE__ annotations (#11133)
* Skip newlines around #__PURE__ annotations

* Update tests
2020-02-13 19:16:33 +01:00
Nicolò RibaudoandGitHub 7be502116b Archive syntax plugins enabled by default (#10820)
* Remove syntax plugins enabled by default

Moved to babel-archive: babel/babel-archive@8f23ddce03

- `@babel/plugin-syntax-async-generators`
- `@babel/plugin-syntax-bigint`
- `@babel/plugin-syntax-dynamic-import`
- `@babel/plugin-syntax-json-strings`
- `@babel/plugin-syntax-nullish-coalescing-operator`
- `@babel/plugin-syntax-object-rest-spread`
- `@babel/plugin-syntax-optional-catch-binding`
- `@babel/plugin-syntax-optional-chaining`

* Fix build script

* Fix jest config

* Remove archived plugins from tests
2020-01-13 00:31:48 +01:00
Nicolò RibaudoandGitHub 36b7a20666 Do not hoist jsx referencing a mutable binding (#10529) 2019-10-08 18:50:03 +02:00
Serge HavasandNicolò Ribaudo ac57ab7450 [fix] jsx helper calls order (#10307)
imitate properly react createElement calls order
2019-08-08 22:43:57 +02:00
Artem ButusovandNicolò Ribaudo d51fc842f7 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
Logan SmythandGitHub d57db9a48c Format fixture JSON with Prettier. (#8658) 2018-09-09 17:57:52 -07:00
Justin RidgewellandGitHub 95d0e301b6 Optimize async to generator (#8267)
* Optimize async to generator

We can reuse the step function, avoiding a closure on every invocation.

* Rename step
2018-07-05 10:51:16 -04:00
Nicolò RibaudoandGitHub 61b4be8a3b [class-properties] Remove unnecessary return and temp variable (#8123)
* Remove unnecessary temp variable

* Update tests
2018-06-08 07:02:36 +02:00
Justin RidgewellandGitHub 2a18d91b0c Private Properties phase 1 (#7666)
* Private Properties phase 1

Co-authored-by: CodingItWrong

* Private fields are optional

* Docs update
2018-04-05 11:17:34 +01:00
Logan Smyth a8d8f15e21 Require output fixture extension to match sourceType output. 2018-03-04 13:31:33 -08:00
Logan Smyth def4a287fe Rename test fixtures using module syntax to .mjs files. 2018-03-04 13:31:32 -08:00
Mateusz BurzyńskiandGitHub ecde96cef8 Mark hoisted react constant elements as #__PURE__ (#7372) 2018-02-21 18:58:56 +01:00
Jorrit SchippersandMateusz Burzyński 7789c3ebf3 Prevent object shape change in jsx helper (#7170)
Keeping the shape of an object constant is a performance improvement for modern javascript engines. At the point of the code change it is certain that the `children` property will be set later, so the property can already be set to `undefined`.
2018-01-15 16:37:57 +01:00
Nicolò RibaudoandBrian Ng a1c0d724ae Remove old expected.{js,json} files (#7187) 2018-01-09 13:10:30 -06:00
Raja SekarandNicolò Ribaudo 4b5e34de4e Renamed files 2018-01-09 15:36:42 +01:00
Henry ZhuandGitHub 5393e73937 remove es20xx prefixes from plugins and rename folders (#6575) 2017-10-28 20:43:15 -04:00
Henry ZhuandGitHub c2370ccf1c Rename all proposal plugins to -proposal- from -transform- (#6570) 2017-10-27 15:26:38 -04:00
Henry Zhu b59bc74947 Scoped: change test imports to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Mateusz BurzyńskiandLogan Smyth fe2423e1bc Fixed asyncToGenerator helper using arrow function (#6289) 2017-09-21 17:09:43 -07:00
Pranav PrakashandJustin Ridgewell da418a4ee9 Use new Array instead of Array for V8 optimization (#6250)
* Use new Array instead of Array for V8 optimization

* fix spacing [skip ci]

* Remove extraneous use strict clauses
2017-09-18 14:14:46 -04:00
Logan Smyth 67f69fe1ba Represent helpers as simple modules. 2017-09-12 22:15:16 -07:00
Noah LemenandHenry Zhu ad51611b81 Update Class Fields to Stage 3 and change default behavior (#6076)
* add transform-class-properties to stage 3, set spec mode to default

* update readme with examples; use `buildUndefinedNode()`; change behavior to always define both static and nonstatic class properties regardless of spec/loose mode; update tests
2017-08-10 11:19:49 -04:00
Logan SmythandBrian Ng 5ff967bb31 Remove _blockHoist usage from param processing. 2017-08-03 20:56:50 -05:00
Henry ZhuandGitHub 551b23548c Newlines in fixtures (#6044)
* write newlines for fixtures

* rerun fixtures
2017-08-02 15:35:29 -04:00
Samuel ReedandBrian Ng bc2cbeaa08 feature: Support whitelisting mutable props for react-constant-elements (#5307) 2017-07-25 13:34:21 -05:00
Peeyush KushwahaandBrian Ng 76bc2a64a8 Non string computed keys in object-rest-spread (#5757) 2017-07-25 09:46:52 -05:00
Daniel TschinderandBrian Ng 5efda75cf8 Remove whitespace generation (#5833)
* Remove whitespace generation and rely on default printing

Changes to printing:
* Add newline after last empty SwitchCase
* Add newlines around block comments if they are non-flow comments or contain newlines

* Fix a few more fixtures
2017-06-27 21:57:02 -05:00
Henry ZhuandBrian Ng 2942ef876e Hardcode to double quotes, indent to 2 spaces (#5824) 2017-06-05 22:14:37 -05:00