54 Commits
Author SHA1 Message Date
liuxingbaoyuandGitHub 711562808d Remove corejs exports for @babe/runtime-corejs3 (#18036) 2026-06-14 10:23:29 +02:00
liuxingbaoyuandGitHub 30e8350825 chore: Some minor cleaning (#17914)
clean
2026-04-16 15:04:04 -04:00
liuxingbaoyuandGitHub c344460fb9 Enable strictNullChecks for more packages (#17828) 2026-02-27 18:06:28 +01:00
Nicolò Ribaudo 3a912d1a39 Remove Babel 7 from the codebase (#17618) 2025-12-05 12:33:52 +01:00
015e8b6300 Improve @babel/core types (#17404)
Co-authored-by: Huáng Jùnliàng <[email protected]>
Co-authored-by: Nicolò Ribaudo <[email protected]>
2025-10-17 10:16:54 +02:00
Huáng JùnliàngandGitHub b6dbecbf9e Type check runtime scripts (#17522) 2025-09-26 18:54:20 -04:00
Nicolò Ribaudo ad58c5e80f Split regeneratorRuntime into multiple helpers (#17238) 2025-05-29 17:54:24 +02:00
Huáng JùnliàngandGitHub 254525d565 Enforce node protocol import (#17207)
* enable prefer-node-protocol rule

* prefer node protocol import

* fix broken scripts

* fix e2e-old-babel error

* strip node: protocol for old node versions

* update Makefile.mjs
2025-03-31 10:49: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 ec0c9d3a30 Generate helper metadata at build time (#16501) 2024-05-22 09:49:02 +03:00
liuxingbaoyuandGitHub 6eb9ffae94 Use eslint v9 (#16479)
* update

* skip old eslint

* review

* compat
2024-05-09 23:50:06 -04:00
Nicolò RibaudoandGitHub ceeb82b43f Remove core-js and regenerator entrypoints from @babel/runtime-* (#16347)
* Remove core-js and regenerator entrypoints from `@babel/runtime-*`

* bool

* Skip tests on Babel 8

* Fix test

* Skip other test on Babel 8
2024-03-15 08:23:23 +01:00
Nicolò RibaudoandGitHub 9a7a5ce035 Remove ./helpers/esm exports from @babel/runtime (#16346) 2024-03-14 23:36:34 +01:00
Nicolò RibaudoandGitHub 4e71800644 [babel 8] Cleanup plugin-transform-runtime options (#16311) 2024-03-06 19:26:45 +01:00
Huáng JùnliàngandGitHub f2f694a064 Simplify helper dependencies (#15771) 2023-07-12 17:01:20 +02:00
3f15d3dccd Implement transform support for using declarations (#15633)
Co-authored-by: liuxingbaoyu <[email protected]>
2023-05-24 20:04:56 +02:00
5b3fe3a993 docs: fix typos (#15432)
Co-authored-by: Huáng Jùnliàng <[email protected]>
2023-02-18 18:12:31 +01:00
Huáng JùnliàngandGitHub 3667a8df04 Ensure @babel/runtime-corejs3/core-js/*.js can be imported on Node.js 17+ (#15060)
* Add Node 19 test and build Babel on latest node

* bump webpack 5 to latest version

* test262 does not require yarn cache

* use sha256 for webpack 3/4 config

* fix: add * exports support for runtime-corejs

* avoid invoking yarn for runtime integration tests

* polish test title
2022-10-20 00:51:12 -04:00
Nicolò RibaudoandGitHub f883dcaf38 Don't load plugins synchronously in tests (#14679)
* Don't load plugins synchronously in tests

* Full paths
2022-06-22 21:33:22 +02:00
Nicolò RibaudoandGitHub dc88cc54d0 Fix remaining imports to be ESM-compatible (#14674) 2022-06-20 18:43:13 +02:00
Nicolò RibaudoandGitHub d63035ce2d Fix import { types } from "@babel/core" with native ESM (#14663)
* Fix `import { types } from "@babel/core"` with native ESM

* Avoid default `@babel/core` import in tests (not available in ESM)
2022-06-19 00:39:31 +02:00
940b15aa3c [babel 8] Disallow synchronous usage of babel.* callback methods (#12695)
* [babel 8] Disallow synchronous usage of `babel.{parse,transform{,FromAst,File}}`

Disallow babel.transformFromAst synchronously

Disallow using babel.transform, babel.transformFile, babel.parse synchronously

chore: throw error behind BABEL_8_BREAKING flag

fix: use transformFromAstSync

fix: use transformSync

refactor: use Babel.transformSync in standalone

fix: use parseSync

feat: emit deprecation message on callback-less usage

chore: add tests on thrown error

call sync method on undefined callback

review comments

address review comments

chore: use loadOptionsSync for OptionManager

Co-authored-by: Huáng Jùnliàng <[email protected]>
Co-authored-by: Nicolò Ribaudo <[email protected]>

* Comment out warning for now

Co-authored-by: Pranav <[email protected]>
Co-authored-by: Nicolò Ribaudo <[email protected]>
2022-06-05 21:26:11 +02:00
John DalyandGitHub f141d822ce Fixing a few small typos (#14466) 2022-04-14 21:07:38 -04:00
liuxingbaoyuandGitHub 5c2a56c442 fix adjustImportPath on windows (#14461) 2022-04-13 15:38:07 -04:00
Nicolò RibaudoandGitHub fc5e72adde Remove workaround for _typeof in runtime build script (#14157) 2022-01-18 17:06:35 +01:00
Endrit BajoandGitHub ea5106aecd Import the correct ./typeof.js helper in @babel/runtime (#14081) 2021-12-31 00:58:07 +01:00
6a8dc36e55 minify helpers-generated.ts (#13837)
Co-authored-by: Nicolò Ribaudo <[email protected]>
2021-11-18 23:51:28 +01:00
Nicolò RibaudoandGitHub 674129823d Expose @babel/eslint-parser/experimental-worker (#13398)
* Expose `@babel/eslint-parser/experimental-worker`

* Fix `@babel/runtime` build on Windows
2021-08-03 23:23:32 +02:00
Nicolò RibaudoandGitHub c7e074d214 Put back ESM helpers in a folder where we can use .js (#12919) 2021-03-01 17:31:12 +01:00
Nicolò RibaudoandGitHub 3929966c6e Allow require() of runtime helpers in Node.js 13.2-13.6 (#12893) 2021-02-25 12:28:50 +01:00
Nicolò RibaudoandGitHub 0a8d359ebe Improve @babel/runtime esm stability (#12883) 2021-02-24 20:04:03 +01:00
Nicolò Ribaudo d4408ed4eb Add back export maps for the helpers/esm folder 2021-02-23 19:08:30 +01:00
Nicolò RibaudoandGitHub fc263a588f Define fallback exports for @babel/runtime on old Node (#12877)
* Define fallback `exports` for `@babel/runtime` on old Node

* Update .github/workflows/ci.yml
2021-02-23 18:32:48 +01:00
Nicolò RibaudoandGitHub 40785dfa67 Always load the CJS helpers when using require (#12865) 2021-02-23 11:21:01 +01:00
Nicolò RibaudoandGitHub b0a24c1cb2 Correctly update module.exports.default of typeof helper (#12858) 2021-02-23 02:59:03 +01:00
Nicolò RibaudoandGitHub 2f73e42ff2 Rename index.mjs to _index.mjs in @babel/runtime (#12855) 2021-02-23 02:08:41 +01:00
Nicolò RibaudoandGitHub 14ce387cdf Use babel-plugin-polyfill-* packages in transform-runtime (#12845) 2021-02-22 22:30:27 +01:00
Nicolò RibaudoandGitHub 29d6fd13c2 Don't use useESModules in @babel/runtime build script (#12842) 2021-02-22 16:12:32 +01:00
Nicolò RibaudoandGitHub 537539bb06 Use conditional exports in @babel/runtime for CJS/ESM (#12632) 2021-02-21 17:41:10 +01:00
Nicolò RibaudoandGitHub 6691dac633 Convert runtime helpers build script to ESM (#12756) 2021-02-04 18:15:30 +01:00
Nicolò RibaudoandGitHub 298fd4a40d Use native Node.js functions when available (#12458) 2020-12-09 00:03:47 +01:00
Nicolò RibaudoandGitHub 3ed649db49 Allow importing @babel/runtime/package (#12184) 2020-10-15 23:15:03 +02:00
Huáng JùnliàngandGitHub 7ad7ae7512 Specify runtime exports (#10853) 2020-10-14 20:06:56 +02:00
8d85af7a12 Use Yarn 2 (#11962)
* chore: use yarn 2

* chore: remove redundant yarn locks

* chore: remove publishEslintPkg

* chore: remove redundant make bootstrap

* Update .yarnrc.yml

Co-authored-by: Kristoffer K. <[email protected]>

* chore: use workspace protocol for eslint packages in the root

Co-Authored-By: merceyz <[email protected]>

* chore: pin caniuse-lite versions

Testcases in packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie
depends on specific caniuse-lite versions. We pinned the version here
so we don't have to deal with fixture different in e2e-tests
where all deps will be updated and tested.

* chore: resolve yarn install warnings

* chore: update yarn cache path on circle/travis

* chore: add yarn deduplicate plugin

* chore: deduplicate lock files

* chore: move devDependencies to leaf packages

* chore: remove @yarnpkg/plugin-constraints

* chore: remove unused dedupe options

* test: fix unwanted self reference

* chore: remove output-file-sync dependency

* chore: update browserify to 16.5.2

Co-authored-by: Kristoffer K. <[email protected]>
2020-08-25 14:37:30 -04:00
f5d89ac429 Update prettier to v2 (#11579)
Co-authored-by: Nicolò Ribaudo <[email protected]>
2020-06-07 22:21:33 +02:00
Huáng JùnliàngandGitHub a0055fd8c5 Create File class for babel helpers (#10575)
* add test

* fix: pass File to helper traverser

* pass babel.File to helpers.ensure
2020-03-17 09:58:46 +01:00
Nicolò RibaudoandGitHub 5fa8c2da96 Do not transpile typeof helper with itself in babel/runtime (#10788)
* Do not transpile typeof helper with itself in babel/runtime

* Nits

* Remove console.log
2019-12-04 01:09:14 +01:00
Denis PushkarevandNicolò Ribaudo ddcc88fe82 Add to preset-env ES3 transforms for ES3 targets (#9781)
* add to preset-env ES3 transforms for ES3 targets

* add `transform-reserved-words`

* fix `transform-reserved-words` plugin in `@babel/standalone`
2019-03-30 23:25:12 +01:00
Denis PushkarevandNicolò Ribaudo 73028f3946 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/[email protected]/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
Jimmy JiaandNicolò Ribaudo 05037fa3b8 fix: Don't transpile ES2018 symbol properties (#9650)
This is a repeat of #5195 to work around the same upstream issue.
2019-03-10 23:22:59 +01:00