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 2021-03-15 to 2021-04-28 #636

Merged
merged 2 commits into from
Jul 7, 2021

Conversation

alangpierce
Copy link
Owner

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

4b674ea031 v7.13.11
🚫 Release only.

beb7cf8b24 Sort error keys with ESLint (#13020)
🚫 Babel-internal change.

edb11baabf v7.13.12
🚫 Release only.

4f727139ec fix(ts): Allow parenthesized "assert and assign" (#12933)
🚫 Seems to work fine in Sucrase.

0067fd9e02 Disallow await before exponential (#12441)
🚫 Validation only.

2f8203f190 v7.13.13
🚫 Release only.

8efbac4a5d fix: the LHS in for-of loop should not start with let (#13049)
🚫 Validation only.

a647b9ea6b Convert @babel/core to TypeScript (#12929)
🚫 Babel-internal.

7fe3ebf4db fix: raise SyntaxError for unparenthesized assert and assign (#13099)
🚫 Validation only.

42e630e8a2 Allow trailing comma after rest parameter in TSDeclareFunction (#13101)
🚫 Seems to work fine in Sucrase.

e50f6f7eef v7.13.15
🚫 Release only.

368bf893fa [ts] raise SyntaxError for declare before getter/setter (#13143)
🚫 Validation only.

d94a8e50ed v7.13.16
🚫 Release only.

10f4d08efb refactor: avoid parsing logic on locations (#13200)
🚫 Refactor not relevant to Sucrase.

0ee98139a6 Introduce parser error codes (#13033)
🚫 Error handling not relevant to Sucrase.

eac0259ce2 Support TS 4.3 static index signature in classes (#13096)
✅ Ported and updated parser to mark all modifiers as type tokens.

f8aa32f767 Support parsing Flow's Indexed Access Types (#13053)
✅ Straightforward port.

bf14a106ad Support TS 4.3 override syntax in class (#13097)
✅ Ported non-validation parts and implemented the feature in the transformer as well.

2521c666f7 Add internal ESLint rule for consistent parser error messages (#13130)
🚫 Error messaging only.

7484b51e56 Support TS 4.3 get/set type members (#13089)
✅ Ported, though the implementation needed some changes to avoid depending on the AST.

c949660b34 babel-parser: Deep freeze for makeErrorTemplates (#13142)
🚫 Babel internal.

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

4b674ea031 v7.13.11
🚫 Release only.

beb7cf8b24 Sort error keys with ESLint (#13020)
🚫 Babel-internal change.

edb11baabf v7.13.12
🚫 Release only.

4f727139ec fix(ts): Allow parenthesized "assert and assign" (#12933)
🚫 Seems to work fine in Sucrase.

0067fd9e02 Disallow await before exponential (#12441)
🚫 Validation only.

2f8203f190 v7.13.13
🚫 Release only.

8efbac4a5d fix: the LHS in for-of loop should not start with let (#13049)
🚫 Validation only.

a647b9ea6b Convert `@babel/core` to TypeScript (#12929)
🚫 Babel-internal.

7fe3ebf4db fix: raise `SyntaxError` for unparenthesized assert and assign (#13099)
🚫 Validation only.

42e630e8a2 Allow trailing comma after rest parameter in TSDeclareFunction (#13101)
🚫 Seems to work fine in Sucrase.

e50f6f7eef v7.13.15
🚫 Release only.

368bf893fa [ts] raise `SyntaxError` for `declare` before getter/setter (#13143)
🚫 Validation only.

d94a8e50ed v7.13.16
🚫 Release only.

10f4d08efb refactor: avoid parsing logic on locations (#13200)
🚫 Refactor not relevant to Sucrase.

0ee98139a6 Introduce parser error codes (#13033)
🚫 Error handling not relevant to Sucrase.

eac0259ce2 Support TS 4.3 static index signature in classes (#13096)
✅ Ported and updated parser to mark all modifiers as type tokens.

f8aa32f767 Support parsing Flow's Indexed Access Types (#13053)
✅ Straightforward port.

bf14a106ad Support TS 4.3 `override` syntax in class (#13097)
✅ Ported non-validation parts and implemented the feature in the transformer as well.

2521c666f7 Add internal ESLint rule for consistent parser error messages (#13130)
🚫 Error messaging only.

7484b51e56 Support TS 4.3 `get`/`set` type members (#13089)
✅ Ported, though the implementation needed some changes to avoid depending on the AST.

c949660b34 babel-parser: Deep freeze for `makeErrorTemplates` (#13142)
🚫 Babel internal.
@codecov
Copy link

codecov bot commented Jul 6, 2021

Codecov Report

Merging #636 (453245b) into main (284bda6) will increase coverage by 0.02%.
The diff coverage is 96.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #636      +/-   ##
==========================================
+ Coverage   82.54%   82.57%   +0.02%     
==========================================
  Files          56       56              
  Lines        5684     5686       +2     
  Branches     1342     1342              
==========================================
+ Hits         4692     4695       +3     
  Misses        708      708              
+ Partials      284      283       -1     
Impacted Files Coverage Δ
src/parser/tokenizer/readWordTree.ts 100.00% <ø> (ø)
src/transformers/TypeScriptTransformer.ts 95.55% <ø> (ø)
src/util/getClassInfo.ts 89.70% <ø> (ø)
src/parser/tokenizer/types.ts 57.87% <83.33%> (-0.07%) ⬇️
src/parser/plugins/flow.ts 65.20% <100.00%> (+0.13%) ⬆️
src/parser/plugins/typescript.ts 85.33% <100.00%> (+0.26%) ⬆️
src/parser/tokenizer/keywords.ts 100.00% <100.00%> (ø)
src/parser/traverser/lval.ts 98.57% <100.00%> (-0.03%) ⬇️
src/parser/traverser/statement.ts 82.16% <100.00%> (-0.07%) ⬇️
... and 2 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 284bda6...453245b. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Jul 6, 2021

Benchmark results

Before this PR: 285.7 thousand lines per second
After this PR: 294.4 thousand lines per second

Measured change: 3.05% faster (2.79% faster to 4.56% faster)
Summary: Probably faster

@alangpierce alangpierce merged commit 45d20de into main Jul 7, 2021
@alangpierce alangpierce deleted the port-babel-parser-2021-03-15-to-2021-04-28 branch July 7, 2021 04:37
# 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.

1 participant