-
Notifications
You must be signed in to change notification settings - Fork 143
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Report
@@ 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
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Benchmark resultsBefore this PR: 328.1 thousand lines per second Measured change: 0.62% faster (0.21% slower to 1.07% faster) |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 typealiases 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
toParserOptions
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.