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 2022-03-06 to 2022-04-29 #717

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

alangpierce
Copy link
Owner

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

4bb9b89b2d Remove length restriction from JSX entities, and ignore Object.prototype (#14327)
✅ Fixed prototype issue by switching to Map. Fixed length restriction by porting
code in a similar way.

9ba894c123 Type-safe ParseErrors (#14320)
🚫 Appears to only affect error handling, so not relevant to Sucrase.

24f0944e2d Report single error for invalid num seps in unicode escapes (#14338)
🚫 Only affects error handling.

bae5027844 Allow variable and function with the same name in static blocks (#14344)
🚫 Already worked in Sucrase, and Sucrase never does this type of checking, so
doesn't seem useful to add a test.

983f707611 move static-block and private-in tests to es2022 (#14346)
🚫 Babel-internal change.

4f1617cdd0 v7.17.7
🚫 Release only.

01380a61f1 Allow keywords in TS qualified types (#14362)
🚫 Fixes regression that didn't happen in Sucrase.

4392e4f69f Defer <T>() => {} TSX error to Babel 8 (#14367)
🚫 Only affects error handling. Sucrase handles this syntax without the trailing comma.

1a58c7ed6a v7.17.8
🚫 Release only.

cb74c3772e refactor: replace deprecated String.prototype.substr() (#14377)
🚫 Already done in Sucrase.

c79709a669 Parenthesize non-simple decorator expression (#14378)
🚫 Only affects paren parsing, which Sucrase doesn't need to handle.

326c4208fc fix: parse type parameters with inType context (#14384)
✅ Fixed by switching tokenizing approach to be more similar to Babel. We now
always treat > as greater-than in a type context and rescan if necessary after
an as operator. The original fix from this PR was unnecessary because type
aliases already are in a type context.

84336bb184 Merge babel-check-duplicated-nodes into monorepo (#14420)
🚫 Internal Babel change that doesn't affect Sucrase.

7a473ed0c6 Restore numeric seaprators support in @babel/standalone (#14427)
🚫 Fix for regression that didn't happen in Sucrase.

3c762e876d v7.17.9
🚫 Release only.

99842ace6e chore: correct typos (#14440)
🚫 These typos aren't present in Sucrase.

df5c1ebb45 Add missing startColumn to ParserOptions type definition (#14453)
🚫 Only affects type definitions.

09b335ad5d v7.17.10
🚫 Release only.

c90add779a Provide plugin/preset typings from plugin-utils (#14499)
🚫 Only affects types for the Babel project.

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

4bb9b89b2d Remove length restriction from JSX entities, and ignore `Object.prototype` (#14327)
✅ Fixed prototype issue by switching to Map. Fixed length restriction by porting
code in a similar way.

9ba894c123 Type-safe ParseErrors (#14320)
🚫 Appears to only affect error handling, so not relevant to Sucrase.

24f0944e2d Report single error for invalid num seps in unicode escapes (#14338)
🚫 Only affects error handling.

bae5027844 Allow variable and function with the same name in static blocks (#14344)
🚫 Already worked in Sucrase, and Sucrase never does this type of checking, so
doesn't seem useful to add a test.

983f707611 move static-block and private-in tests to es2022 (#14346)
🚫 Babel-internal change.

4f1617cdd0 v7.17.7
🚫 Release only.

01380a61f1 Allow keywords in TS qualified types (#14362)
🚫 Fixes regression that didn't happen in Sucrase.

4392e4f69f Defer `<T>() => {}` TSX error to Babel 8 (#14367)
🚫 Only affects error handling. Sucrase handles this syntax without the trailing comma.

1a58c7ed6a v7.17.8
🚫 Release only.

cb74c3772e refactor: replace deprecated String.prototype.substr() (#14377)
🚫 Already done in Sucrase.

c79709a669 Parenthesize non-simple decorator expression (#14378)
🚫 Only affects paren parsing, which Sucrase doesn't need to handle.

326c4208fc fix: parse type parameters with inType context (#14384)
✅ Fixed by switching tokenizing approach to be more similar to Babel. We now
always treat > as greater-than in a type context and rescan if necessary after
an `as` operator. The original fix from this PR was unnecessary because type
aliases already are in a type context.

84336bb184 Merge `babel-check-duplicated-nodes` into monorepo (#14420)
🚫 Internal Babel change that doesn't affect Sucrase.

7a473ed0c6 Restore numeric seaprators support in `@babel/standalone` (#14427)
🚫 Fix for regression that didn't happen in Sucrase.

3c762e876d v7.17.9
🚫 Release only.

99842ace6e chore: correct typos (#14440)
🚫 These typos aren't present in Sucrase.

df5c1ebb45 Add missing `startColumn` to `ParserOptions` type definition (#14453)
🚫 Only affects type definitions.

09b335ad5d v7.17.10
🚫 Release only.

c90add779a Provide plugin/preset typings from plugin-utils (#14499)
🚫 Only affects types for the Babel project.
@codecov
Copy link

codecov bot commented Jul 8, 2022

Codecov Report

Merging #717 (2d0b14a) into main (173e4fe) will increase coverage by 0.04%.
The diff coverage is 97.29%.

@@            Coverage Diff             @@
##             main     #717      +/-   ##
==========================================
+ Coverage   86.86%   86.91%   +0.04%     
==========================================
  Files          54       54              
  Lines        5665     5679      +14     
  Branches     1333     1338       +5     
==========================================
+ Hits         4921     4936      +15     
  Misses        472      472              
+ Partials      272      271       -1     
Impacted Files Coverage Δ
src/transformers/JSXTransformer.ts 97.16% <96.15%> (+0.63%) ⬆️
src/parser/plugins/jsx/xhtml.ts 100.00% <100.00%> (ø)
src/parser/tokenizer/index.ts 86.05% <100.00%> (+0.09%) ⬆️
src/parser/traverser/expression.ts 88.46% <100.00%> (+0.02%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@github-actions
Copy link

github-actions bot commented Jul 8, 2022

Benchmark results

Before this PR: 328.1 thousand lines per second
After this PR: 330.1 thousand lines per second

Measured change: 0.62% faster (0.21% slower to 1.07% faster)
Summary: Likely no significant difference

@alangpierce alangpierce merged commit ef4a9c5 into main Jul 8, 2022
@alangpierce alangpierce deleted the port-babel-parser-2022-03-06-to-2022-04-29 branch July 8, 2022 14:52
1Lighty pushed a commit to Astra-mod/sucrase that referenced this pull request Aug 14, 2022
)

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

4bb9b89b2d Remove length restriction from JSX entities, and ignore `Object.prototype` (#14327)
✅ Fixed prototype issue by switching to Map. Fixed length restriction by porting
code in a similar way.

9ba894c123 Type-safe ParseErrors (#14320)
🚫 Appears to only affect error handling, so not relevant to Sucrase.

24f0944e2d Report single error for invalid num seps in unicode escapes (#14338)
🚫 Only affects error handling.

bae5027844 Allow variable and function with the same name in static blocks (#14344)
🚫 Already worked in Sucrase, and Sucrase never does this type of checking, so
doesn't seem useful to add a test.

983f707611 move static-block and private-in tests to es2022 (#14346)
🚫 Babel-internal change.

4f1617cdd0 v7.17.7
🚫 Release only.

01380a61f1 Allow keywords in TS qualified types (#14362)
🚫 Fixes regression that didn't happen in Sucrase.

4392e4f69f Defer `<T>() => {}` TSX error to Babel 8 (#14367)
🚫 Only affects error handling. Sucrase handles this syntax without the trailing comma.

1a58c7ed6a v7.17.8
🚫 Release only.

cb74c3772e refactor: replace deprecated String.prototype.substr() (#14377)
🚫 Already done in Sucrase.

c79709a669 Parenthesize non-simple decorator expression (#14378)
🚫 Only affects paren parsing, which Sucrase doesn't need to handle.

326c4208fc fix: parse type parameters with inType context (#14384)
✅ Fixed by switching tokenizing approach to be more similar to Babel. We now
always treat > as greater-than in a type context and rescan if necessary after
an `as` operator. The original fix from this PR was unnecessary because type
aliases already are in a type context.

84336bb184 Merge `babel-check-duplicated-nodes` into monorepo (#14420)
🚫 Internal Babel change that doesn't affect Sucrase.

7a473ed0c6 Restore numeric seaprators support in `@babel/standalone` (#14427)
🚫 Fix for regression that didn't happen in Sucrase.

3c762e876d v7.17.9
🚫 Release only.

99842ace6e chore: correct typos (#14440)
🚫 These typos aren't present in Sucrase.

df5c1ebb45 Add missing `startColumn` to `ParserOptions` type definition (#14453)
🚫 Only affects type definitions.

09b335ad5d v7.17.10
🚫 Release only.

c90add779a Provide plugin/preset typings from plugin-utils (#14499)
🚫 Only affects types for the Babel project.
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.

1 participant