Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Port babel-parser changes from 2021-02-18 to 2021-03-14 #635

Merged
merged 2 commits into from Jul 6, 2021

Conversation

alangpierce
Copy link
Owner

@alangpierce alangpierce commented Jul 6, 2021

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

2f755ef052 v7.12.17
🚫 Release only.

16e9f1c8e5 Support Flow this parameter annotations (#12234)
🚫 Seems to be working already.

5b99b8f221 Flow Enums with unknown members support (#12193)
🚫 For now, Flow enums won't be supported in Sucrase.

e4588bed22 Support TypeScript 4.2 abstract constructor signatures (#12628)
βœ… Ported with a similar implementation, but made a new enum value instead of passing a flag.

9c567baa9b Parse JS Module Blocks proposal (#12469)
βœ… Added basic parsing support, though the transformer doesn't yet do anything special. Filed #634 as follow-up.

03d7911be6 Implement class features in estree (#12370)
🚫 Sucrase doesn't support estree.

c827193d9c v7.13.0
🚫 Release only.

c30039029a Don't enable class features by default in estree (#12867)
🚫 Sucrase doesn't support estree.

e940b8c4b9 v7.13.4
🚫 Release only.

b62fc3d44f babel-parser(flow): Set this property to null for FunctionTypeAnnotation without parens (#12930)
🚫 AST only.

efdca01409 fix: add tokens when tokens: true is passed to parseExpression (#12939)
🚫 Only applies to Babel-specific API.

2c0e8d0008 v7.13.9
🚫 Release only.

b416847b61 (ts) Raise syntax error for abstract methods with a body (#12687)
🚫 Validation only.

d04842a700 Avoid using CJS globals in internal source files (#12963)
🚫 Babel change not relevant for Sucrase.

d1d404b9a3 v7.13.10
🚫 Release only.

1a05b81387 Support multiple static blocks (#12738)
🚫 Only affects validation, multiple static blocks were already supported.

0988c471e9 Parse type imports in TSImportEqualsDeclaration (#12962)
βœ… Implemented independently using similar logic as in Babel.

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

2f755ef052 v7.12.17
🚫 Release only.

16e9f1c8e5 Support Flow `this` parameter annotations (#12234)
🚫 Seems to be working already.

5b99b8f221 Flow Enums with unknown members support (#12193)
🚫 For now, Flow enums won't be supported in Sucrase.

e4588bed22 Support TypeScript 4.2 abstract constructor signatures (#12628)
βœ… Ported with a similar implementation, but made a new enum value instead of passing a flag.

9c567baa9b Parse JS Module Blocks proposal (#12469)
βœ… Added basic parsing support, though the transformer doesn't yet do anything special. Filed #634 as follow-up.

03d7911be6 Implement class features in estree (#12370)
🚫 Sucrase doesn't support entree.

c827193d9c v7.13.0
🚫 Release only.

c30039029a Don't enable class features by default in `estree` (#12867)
🚫 Sucrase doesn't support entree.

e940b8c4b9 v7.13.4
🚫 Release only.

b62fc3d44f babel-parser(flow): Set `this` property to `null` for FunctionTypeAnnotation without parens (#12930)
🚫 AST only.

efdca01409 fix: add tokens when tokens: true is passed to parseExpression (#12939)
🚫 Only applies to Babel-specific API.

2c0e8d0008 v7.13.9
🚫 Release only.

b416847b61 (ts) Raise syntax error for abstract methods with a body (#12687)
🚫 Validation only.

d04842a700 Avoid using CJS globals in internal source files (#12963)
🚫 Babel change not relevant for Sucrase.

d1d404b9a3 v7.13.10
🚫 Release only.

1a05b81387 Support multiple static blocks (#12738)
🚫 Only affects validation, multiple static blocks were already supported.

0988c471e9 Parse type imports in TSImportEqualsDeclaration (#12962)
βœ… Implemented independently using similar logic as in Babel.
@codecov
Copy link

codecov bot commented Jul 6, 2021

Codecov Report

Merging #635 (d11d908) into main (fa424bd) will increase coverage by 0.09%.
The diff coverage is 93.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #635      +/-   ##
==========================================
+ Coverage   82.44%   82.54%   +0.09%     
==========================================
  Files          56       56              
  Lines        5880     5684     -196     
  Branches     1327     1342      +15     
==========================================
- Hits         4848     4692     -156     
+ Misses        749      708      -41     
- Partials      283      284       +1     
Impacted Files Coverage Ξ”
src/parser/traverser/util.ts 83.33% <85.71%> (-5.04%) ⬇️
src/parser/traverser/statement.ts 82.22% <88.88%> (-0.39%) ⬇️
src/parser/plugins/typescript.ts 85.06% <90.90%> (+0.83%) ⬆️
src/parser/traverser/expression.ts 88.39% <100.00%> (+0.29%) ⬆️
src/transformers/ESMImportTransformer.ts 87.28% <100.00%> (+0.94%) ⬆️
src/Options-gen-types.ts 75.00% <0.00%> (-25.00%) ⬇️
src/parser/index.ts 77.77% <0.00%> (-7.94%) ⬇️
src/computeSourceMap.ts 83.33% <0.00%> (-5.56%) ⬇️
src/util/getNonTypeIdentifiers.ts 94.44% <0.00%> (-5.56%) ⬇️
src/parser/plugins/types.ts 91.66% <0.00%> (-3.34%) ⬇️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update fa424bd...d11d908. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Jul 6, 2021

Benchmark results

Before this PR: 306.6 thousand lines per second
After this PR: 301.7 thousand lines per second

Measured change: 1.61% slower (3% slower to 0.32% faster)
Summary: Likely no significant difference

@alangpierce alangpierce merged commit 284bda6 into main Jul 6, 2021
@alangpierce alangpierce deleted the port-babel-parser-2021-02-18-to-2021-03-14 branch July 6, 2021 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant