Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Port babel-parser changes from 2023-01-11 to 2023-03-14 #786

Merged
merged 2 commits into from
Mar 20, 2023

Conversation

alangpierce
Copy link
Owner

Instructions: https://github.com/alangpierce/sucrase/wiki/Porting-changes-from-Babel's-parser

Fixes #783

f7e231fc97 Allow negative number in ambient const initializer (#15338)
🚫 Only affects error handling.

89f38880ce v7.20.13
🚫 Release only.

41aac8b803 fix: new (foo?.bar)() incorrectly throws exception OptionalChainingNoNew (#15377)
🚫 Only affects error handling.

91b24d5d55 chore: Remove meaningless typeof undefined (#15395)
🚫 Babel-internal change.

3aee4e367a Disallows specifiers after export * as ns (#15385)
🚫 Only affects error handling.

e5e923d99c Disallow await as bound name in using declaration (#15391)
🚫 Only affects error handling.

6e1cc6e958 v7.20.15
🚫 Release only.

812ad554ab polish: improve "await as identifier" error in modules (#15400)
🚫 Only affects error handling.

d3bd1a3f2f [ts] Fix restrictions for optional parameters (#15414)
🚫 Appears to only affect error handling.

9be2c7fd79 [ts] treat single type param with a constraint as unambiguous (#15436)
🚫 Only affects error handling.

3c26949819 Add annexb: false parser option to disable Annex B (#15320)
🚫 I believe all Annex B syntax support was removed long ago.

6e8ce9da64 [ts] Support export type * from (#15381)
✅ Ported and added test.

2a7495f2c8 Parser option to allow new.target outside functions (#15114)
🚫 Only affects error handling.

eae47c9ec8 Implement decorators as presented at 2023-01 TC39 meeting (#15405)
✅ No parser changes were necessary, but added support for decorators after export with imports transform.

2f3ef392d6 [ts] Support const modifier in type parameters (#15384)
✅ This was already accidentally working, but I added some logic to make it work intentionally and added a test.

34136c53f8 docs: fix typos (#15432)
🚫 Babel-internal change.

de7d75a78b v7.21.0
🚫 Release only.

7feaa36ad5 Fix problems found while publishing 7.21.0 (#15440)
🚫 Not relevant to Sucrase.

fa77313884 v7.21.1
🚫 Release only.

a2fdc207ce fix: Throws on new foo?.bar!() (#15439)
🚫 Only affects error handling.

fc33467911 v7.21.2
🚫 Release only.

6e3dffe51a disallow mixins/implements in flow interface (#15479)
🚫 Only affects error handling.

4035521068 chore: Enable rule no-confusing-void-expression (#15485)
🚫 Babel-internal change.

80863c220b [ts] Allow keywords in tuple labels (#15423)
✅ Type parsing already allowed keywords, added a test for this case.

fbfbd1da8c v7.21.3
🚫 Release only.

Instructions: https://github.com/alangpierce/sucrase/wiki/Porting-changes-from-Babel's-parser

Fixes #783

f7e231fc97 Allow negative number in ambient const initializer (#15338)
🚫 Only affects error handling.

89f38880ce v7.20.13
🚫 Release only.

41aac8b803 fix: `new (foo?.bar)()` incorrectly throws exception `OptionalChainingNoNew` (#15377)
🚫 Only affects error handling.

91b24d5d55 chore: Remove meaningless `typeof undefined` (#15395)
🚫 Babel-internal change.

3aee4e367a Disallows specifiers after export * as ns (#15385)
🚫 Only affects error handling.

e5e923d99c Disallow await as bound name in using declaration (#15391)
🚫 Only affects error handling.

6e1cc6e958 v7.20.15
🚫 Release only.

812ad554ab polish: improve "`await` as identifier" error in modules (#15400)
🚫 Only affects error handling.

d3bd1a3f2f [ts] Fix restrictions for optional parameters (#15414)
🚫 Appears to only affect error handling.

9be2c7fd79 [ts] treat single type param with a constraint as unambiguous (#15436)
🚫 Only affects error handling.

3c26949819 Add `annexb: false` parser option to disable Annex B (#15320)
🚫 I believe all Annex B syntax support was removed long ago.

6e8ce9da64 [ts] Support `export type * from` (#15381)
✅ Ported and added test.

2a7495f2c8 Parser option to allow `new.target` outside functions (#15114)
🚫 Only affects error handling.

eae47c9ec8 Implement decorators as presented at `2023-01` TC39 meeting (#15405)
✅ No parser changes were necessary, but added support for decorators after export with imports transform.

2f3ef392d6 [ts] Support `const` modifier in type parameters (#15384)
✅ This was already accidentally working, but I added some logic to make it work intentionally and added a test.

34136c53f8 docs: fix typos (#15432)
🚫 Babel-internal change.

de7d75a78b v7.21.0
🚫 Release only.

7feaa36ad5 Fix problems found while publishing 7.21.0 (#15440)
🚫 Not relevant to Sucrase.

fa77313884 v7.21.1
🚫 Release only.

a2fdc207ce fix: Throws on `new foo?.bar!()` (#15439)
🚫 Only affects error handling.

fc33467911 v7.21.2
🚫 Release only.

6e3dffe51a disallow mixins/implements in flow interface (#15479)
🚫 Only affects error handling.

4035521068 chore: Enable rule `no-confusing-void-expression` (#15485)
🚫 Babel-internal change.

80863c220b [ts] Allow keywords in tuple labels (#15423)
✅ Type parsing already allowed keywords, added a test for this case.

fbfbd1da8c v7.21.3
🚫 Release only.
@github-actions
Copy link

github-actions bot commented Mar 20, 2023

Benchmark results

Before this PR: 387.9 thousand lines per second
After this PR: 389.5 thousand lines per second

Measured change: 0.43% faster (0.07% slower to 1.24% faster)
Summary: Likely no significant difference

@codecov
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

Merging #786 (b42b477) into main (c65dd7b) will increase coverage by 0.17%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #786      +/-   ##
==========================================
+ Coverage   88.14%   88.32%   +0.17%     
==========================================
  Files          55       55              
  Lines        5915     5945      +30     
  Branches     1404     1410       +6     
==========================================
+ Hits         5214     5251      +37     
+ Misses        434      430       -4     
+ Partials      267      264       -3     
Impacted Files Coverage Δ
src/parser/plugins/typescript.ts 90.50% <100.00%> (+0.29%) ⬆️
src/transformers/CJSImportTransformer.ts 89.57% <100.00%> (+1.01%) ⬆️
src/transformers/ESMImportTransformer.ts 95.15% <100.00%> (+0.18%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@alangpierce alangpierce merged commit 4b03ee3 into main Mar 20, 2023
@alangpierce alangpierce deleted the port-babel-parser-2023-01-11-to-2023-03-14 branch March 20, 2023 07:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeScript 5.0 support
1 participant