5773 Commits

Author SHA1 Message Date
Sosuke Suzuki
d5ba355867
Support TypeScript 4.5 type-only import/export specifiers (#13802) 2021-10-29 01:23:23 +02:00
Huáng Jùnliàng
872086a9a0
feat: support startColumn option (#13887) 2021-10-29 01:20:32 +02:00
Nicolò Ribaudo
718c6cb7de
Handle .mts and .cts files in @babel/preset-typescript (#13838) 2021-10-29 01:13:37 +02:00
J. S. Choi
ad59a2c618
Caret topic (pipe operator) (#13749)
* parser: Add caret as topic reference (tests)

* parser: Add caret as topic reference (implement)

* generator: Avoid reconstructing validTopicTokenSet

* babel-parser: Remove redundant throws in expression.js

* Minimize diff

* Update error message

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-10-28 16:04:55 -04:00
Sosuke Suzuki
ddc45a5a50
Enable class static blocks by default (#13713)
* Remove classStaticBlock plugin

* Update tests

* Remove class static blocks from proposalPlugins

* Update tests

* Remove classStaticBlock from mapping for test262

* chore: update babel-types

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2021-10-28 14:39:04 -04:00
Mickey Rose
99a3fefede
add skipTransparentExprWrapperNodes helper (#13687)
* overload `skipTransparentExprWrappers`

* fixes isSimpleMemberExpression
  in @babel/plugin-proposal-optional-chaining

* use skipTransparentExprWrappers<Expression> instead of the NodePath
  overload where possible in @babel/plugin-proposal-optional-chaining

* Revert "overload `skipTransparentExprWrappers`"

This reverts commit fad47596a64a8d33aadacb7695dbf1aa60a528ae.

* add helper `skipTransparentExprWrapperNodes`

* avoids constructing NodePaths when only the Node is needed

* fixes isSimpleMemberExpression
  in @babel/plugin-proposal-optional-chaining

* use this new helper instead of skipTransparentExprWrappers
  where possible in @babel/plugin-proposal-optional-chaining
2021-10-28 14:16:22 -04:00
Justin Ridgewell
b1793656e6
Add aliases for Standardized, TypeScript, and Flow (#13666)
* Ensure non-standard types have an appropriate alias

This helps with filter out the types. Eg, I'm concerned with just the core JS types, and in I can derive them via:

```typescript
type Core = Exclude<t.Node, t.TypeScript | t.Flow>;
```

* Lint

* Export deprecated alias types

* Add docs descriptions for new aliases

* Add Standardized alias

* Fix inherits aliases

* Filter aliases from node types

* Remove Proposal alias
2021-10-28 14:14:32 -04:00
Nicolò Ribaudo
fb7ddf4d38
[ts] Support private methods overloads (#13876)
* [parser] Allow private methods overloads when parsing TS

* Add transform tests

* Fix estree

* Fix flow
2021-10-26 07:29:20 +02:00
Nicolò Ribaudo
c7ddb1ae93
Use workspace:^ to specify @babel/ dependencies (#13772)
* Enforce `workspace:^` to specify `@babel/` dependencies

* `yarn constraints --fix`

* Update lockfile
2021-10-25 07:22:08 +02:00
Nicolò Ribaudo
62b2c5ebb9
Regenerate parser fixtures (#13882) 2021-10-24 18:12:10 +02:00
Huáng Jùnliàng
e45d86c333
[babel 8] Enable preset-env bugfixes by default (#13866) 2021-10-24 15:17:19 +02:00
Mickey Rose
b5907ef967
remove executable permission from files that shouldn't have it (#13873) 2021-10-23 14:18:30 +02:00
Mickey Rose
cfe6739dc0
fix: allow enum member without initializer after non-literal member (#13865) 2021-10-22 08:52:23 -04:00
Mickey Rose
35ec4394a7
Simplify (transpiled) babel-types builder wrappers (#13843) 2021-10-21 18:55:42 +02:00
Emily Marigold Klassen
fca5c9a501
Don't transform declare class in proposal-class-properties (#13854)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-10-21 00:30:05 +02:00
Huáng Jùnliàng
29f697c84e
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
Nicolò Ribaudo
780aa48d2a
Force loading plugins/presets from the monorepo in tests (#13858) 2021-10-18 14:03:50 +02:00
Mickey Rose
24aa1b44fe
[ts] precise return type on createTypeAnnotationBasedOnTypeof (#13844) 2021-10-14 09:00:19 +02:00
Mickey Rose
2403a4889d
remove ineffectual helper names filter (#13841) 2021-10-12 10:30:28 -04:00
Nicolò Ribaudo
2df453d2da
Update failing fixture (#13840) 2021-10-11 15:55:40 -05:00
Huáng Jùnliàng
21eeb8e7a9
Restore traversal context after enter / traverse (#13813) 2021-10-11 19:04:01 +02:00
Nicolò Ribaudo
6880898510
[babel 8] Remove make-dir polyfill for fs.mkdirSync (#13828)
* [babel 8] Remove `make-dir` polyfill for `fs.makeDitSync`

* `yarn`

* fix

* Inject polyfills in jest tests when needed
2021-10-11 07:01:30 +02:00
Huáng Jùnliàng
49a0d65be1
Mark static block as FunctionParent (#13832)
* refactor: move StaticBlock definition to core

* update generated types

* fix: mark StaticBlock as FunctionParent

* revise testcase

* update babel-types docs
2021-10-10 20:22:27 -04:00
Mickey Rose
00f8ee3484
ignore non-js files in babel-helpers/src/helpers (#13833)
* ignore non-js files in `babel-helpers/src/helpers`

* fix misnamed `generateAsserts` -> `generateHelpers`
2021-10-11 00:21:55 +02:00
Nicolò Ribaudo
65e963e5de
Regenerate helpers-generated.ts (#13831) 2021-10-08 22:02:07 +02:00
Nicolò Ribaudo
b9ea196259
Await promises from sync iterators with for-await (#13824)
Co-authored-by: Mickey Rose <lightmare@users.noreply.github.com>
2021-10-07 23:57:25 +02:00
overlookmotel
6029252bec
Fix missing inner comments in function expressions (#13825) 2021-10-07 23:34:12 +02:00
Huáng Jùnliàng
c2f747c9b9
Improve transform-react-jsx typings (#13820)
* improve transform-react-jsx typings

* rename test fixtures

* remove unreachable sourceSelf check

* update test fixtures

* Update packages/babel-core/src/index.ts

* Update packages/babel-plugin-transform-react-jsx/src/create-plugin.ts

Co-authored-by: Henry Zhu <hi@henryzoo.com>

* Update packages/babel-plugin-transform-react-jsx/src/create-plugin.ts

Co-authored-by: Henry Zhu <hi@henryzoo.com>
2021-10-07 14:01:50 -04:00
Babel Bot
c4b13725aa v7.15.8 2021-10-06 20:45:15 +00:00
overlookmotel
58a65e99c0
Fix missing inner comments in class expressions (#13821) 2021-10-06 14:54:20 +02:00
Patrick Eriksson
7acc68a86b
Improve debug logging for IgnoreList (#13814) 2021-10-06 14:53:28 +02:00
Alexander Zaytsev
42c9edaf6e
Optimization of string splitting (#13812) 2021-10-05 20:15:55 +02:00
Nicolò Ribaudo
64f14b05fa
Collect comments around parentheses in expressions (#13803)
Co-authored-by: Brian Ng <bng412@gmail.com>
2021-10-05 20:15:24 +02:00
Hirotaka Tagawa / wafuwafu13
6c684f9b54
Convert @babel/plugin-transform-spread to TypeScript (#13770)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-10-01 01:37:04 +02:00
Huáng Jùnliàng
89cab4311c
fix: remove imported types from export (#13800)
* fix: remove imported types from export

* add onlyRemoveTypeImports testcase
2021-09-28 15:13:37 -04:00
Huáng Jùnliàng
14572e1881
Sort module export names (#13788)
* fix: sort export init statements by name

* update test fixtures

* refactor: reduce memory footprint

* review comments
2021-09-26 10:12:18 -04:00
Julien Wajsberg
6818b22dc0
[@babel/node] Forward the signal SIGTERM as well (#13784) 2021-09-25 10:18:10 +02:00
Huáng Jùnliàng
178d43ff17
Tokenize keywords-like identifier as new tokens (#13769)
* refactor: add more identifier token helpers

* refactor: explode tt.name into multiple tokens

* fix: disallow escape in interface keyword

* refactor: simplify isMaybeDefaultImport

* review comments

* refactor: avoid string comparison
2021-09-23 10:54:44 -04:00
Nicolò Ribaudo
613ae6fac7
Update polyfill plugins (#13781)
* Update polyfill plugins

* Babel 8
2021-09-23 09:24:45 +02:00
Nicolò Ribaudo
2e2d202694
[babel 8] Materialize ESTree's classFeatures option (#13752)
* [babel 8] Enable ESTree classFeatures by default in @babel/parser

* Fix `visitorKeys`

* Update tests
2021-09-22 15:28:10 -04:00
Babel Bot
8d0294edf8 v7.15.7 2021-09-17 22:54:10 +00:00
Nicolò Ribaudo
422b87a76f
Update to @nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3 (#13775) 2021-09-17 11:29:12 -04:00
Huáng Jùnliàng
d2076a531f
Store token type as number (#13768)
* refactor: abstract token metadata access

* refactor: move token-specific update context logic

* refactor: centralize token definitions

* refactor: abstract token type creation

* refactor: use number as token storage

* build: replace tt.* as number

* fix flow errors

* fix: build on Node 12

* Update packages/babel-parser/src/tokenizer/types.js

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* refactor: rename token types exports to tt

* update unit test

* test: update Babel 8 test fixtures

* fix: centralize obsolete token type updateContext

* fix flow errors

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-09-17 09:36:11 -04:00
JuniorTour
da79c90f2a
fix(babel-parser): Allow line break before assert return type (#13771) 2021-09-16 23:24:11 +02:00
Nicolò Ribaudo
8fb50429ea
Throw a better error when transforming imported bindings in types (#13739)
* Throw a better error when transforming imported bindings in types

* Also type casts

* Update error message
2021-09-16 23:14:41 +02:00
Steven Degutis
137fecc765
Move pipeline operator to Stage 2 (#13754) 2021-09-16 17:54:31 +02:00
Huáng Jùnliàng
a27c1b8881
Update Identifier definitions to Unicode 14 (#13759) 2021-09-15 07:33:13 -04:00
Nicolò Ribaudo
f57bb79791
Update regexpu-core (#13764) 2021-09-15 07:30:21 -04:00
Nicolò Ribaudo
710b3919fa
[estree] Fix conversion of PrivateName in MemberExpression (#13755)
* Update test

* [estree] Fix conversion of `PrivateName` in `MemberExpression`
2021-09-14 17:14:04 +02:00
TagawaHirotaka
9780c5667f
Replace the deprecated produceCachedData option used in vm module with script.createCachedData() (#13741)
* Replace the deprecated vm produceCachedData option with createCachedData

* Use BABEL_8_BREAKING flag
2021-09-12 01:09:05 +02:00