-
Notifications
You must be signed in to change notification settings - Fork 138
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-07-04 to 2022-10-26 #784
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 6fd6ce1df8 Add json schema of fixture runner options (#12619) π« Babel-internal. 1c79224431 Misc fixes to `@babel/types` AST definitions (#14730) π« Plugin-related change that doesn't affect Sucrase. ea1eedaa35 v7.18.8 π« Release only. 2b163d8082 Prepare for compiling Babel to native ESM (#13414) π« Babel-internal. f1ac2906b1 v7.18.9 π« Release only. ea5ff29f3e Extract string parsing to a separate package (#14772) π« Refactor within Babel (though it looks like it may be best to keep an eye on changes/fixes to @babel/helper-string-parser). a483aa2fbf Convert `@babel/parser` to TypeScript (#14783) π« Babel-internal (but cool to see!). acee429ebf chore: remove flow check scripts (#14785) π« Babel-internal. 24d5fce6a2 Make ParseError much simpler now that we can use TypeScript (#14796) π« Only affects error handling, not relevant to Sucrase. b7e09455c8 Fix position of errors in template literals after newlines (#14798) π« Only affects position information. b0114cc9f7 parser node types improvements (#14791) π« Babel-internal. a5a8a31de3 fix(parser): allow TS declare readonly fields with initializers (#14817) β Already worked in Sucrase, but I added a test. 9f603cf84c v7.18.10 π« Release only. 8d17ae62da babel parser type improvements (#14801) π« Babel-internal. 757a425bd1 v7.18.11 π« Release only. 81158a58c5 [parser] Improve `getPluginOptions` type (#14861) π« Babel-internal. e5ab1512fc v7.18.13 π« Release only. 6c5ebd12fa fix: parse a<b>>>c as a<(b>>>c) (#14819) β Already worked in Sucrase, presumably due to some tokenizer differences, so I just added a test. 2626f18c57 Update typescript to 4.8 (#14880) π« Babel-internal. eec95740ca chore: add eslint rule `consistent-type-imports` (#14901) π« Babel-internal. 14ea25fbb3 Default to hash syntax for Record&Tuple (#14744) π« Record and tuple not currently supported. 05deb60405 Enable `ban-ts-comment` (#14908) π« Babel-internal. d855f9d60c [parser] Make `decoratorsBeforeExport` default to `false` (#14695) π« Seems to only affect error handling. 85ce832a7a support private name in decorator member expr (#14666) β Already worked in Sucrase (with disableESTransforms). 16d3220bbf Add 2022-03 decorators version (stage 3) (#14836) β Made small tweak to skip extra args in the `@()` case. 70a13e49be v7.19.0 π« Release only. 642adbcd98 [ts] allow redeclaring a var/type with the same name as import (#14900) π« Error handling fix that doesn't affect Sucrase. 580d730186 [estree] attach comments after directives at the end of file (#14920) π« Sucrase doesn't support estree. eb621ac822 v7.19.1 π« Release only. ae10b496d0 fix: allow ts redeclaration with `import =` and `var` (#14940) π« Error handling fix that doesn't affect Sucrase. 40dfe9ac46 fix: Support local exports in TS `declare module`s (#14941) π« Error handling fix that doesn't affect Sucrase. c602be9315 chore: use `c8` for coverage testing (#14961) π« Babel-internal. 6be6e04f39 fix: parsing of `JSXText` following `JSXSpreadChild` (#14974) π« Fix for context system that was removed from Sucrase. 3d46a59956 v7.19.3 π« Release only. 98c3bb99e2 Improve module expression parsing/printing (#14980) π« Appears to be an AST-specific fix, not relevant to Sucrase. 4fb29a372b Never throw for invalid escapes in tagged templates (#14964) π« Error reporting only. 7a38850a83 v7.19.4 π« Release only. ef0749df26 Use `startLoc.index` instead of carrying around `start` (#15056) π« Refactor not relevant to Sucrase. 66d4fe9d3f fix: improve module block program location tracking (#15052) π« AST only. 73c9aef872 Fix parsing of block comments nested in flow comments (#15062) π« AST only. aadd7a3d52 v7.19.6 π« Release only. 362f15b83c Fix handling of comments with decorators before `export` (#15032) π« Only appears to affect AST and error handling. df733b18ae [ts] Add support for `expr satisfies Type` expressions (#14211) β Already done in #766
Codecov Report
@@ Coverage Diff @@
## main #784 +/- ##
==========================================
+ Coverage 87.56% 87.61% +0.05%
==========================================
Files 55 55
Lines 5888 5888
Branches 1395 1395
==========================================
+ Hits 5156 5159 +3
+ Misses 464 461 -3
Partials 268 268
π£ Weβre building smart automated test selection to slash your CI/CD build times. Learn more |
Benchmark resultsBefore this PR: 413.2 thousand lines per second Measured change: 0.73% slower (0.83% slower to 1.24% faster) |
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
6fd6ce1df8 Add json schema of fixture runner options (#12619)
π« Babel-internal.
1c79224431 Misc fixes to
@babel/types
AST definitions (#14730)π« Plugin-related change that doesn't affect Sucrase.
ea1eedaa35 v7.18.8
π« Release only.
2b163d8082 Prepare for compiling Babel to native ESM (#13414)
π« Babel-internal.
f1ac2906b1 v7.18.9
π« Release only.
ea5ff29f3e Extract string parsing to a separate package (#14772)
π« Refactor within Babel (though it looks like it may be best to keep an eye on changes/fixes to @babel/helper-string-parser).
a483aa2fbf Convert
@babel/parser
to TypeScript (#14783)π« Babel-internal (but cool to see!).
acee429ebf chore: remove flow check scripts (#14785)
π« Babel-internal.
24d5fce6a2 Make ParseError much simpler now that we can use TypeScript (#14796)
π« Only affects error handling, not relevant to Sucrase.
b7e09455c8 Fix position of errors in template literals after newlines (#14798)
π« Only affects position information.
b0114cc9f7 parser node types improvements (#14791)
π« Babel-internal.
a5a8a31de3 fix(parser): allow TS declare readonly fields with initializers (#14817)
β Already worked in Sucrase, but I added a test.
9f603cf84c v7.18.10
π« Release only.
8d17ae62da babel parser type improvements (#14801)
π« Babel-internal.
757a425bd1 v7.18.11
π« Release only.
81158a58c5 [parser] Improve
getPluginOptions
type (#14861)π« Babel-internal.
e5ab1512fc v7.18.13
π« Release only.
6c5ebd12fa fix: parse a>>c as a<(b>>>c) (#14819)
β Already worked in Sucrase, presumably due to some tokenizer differences, so I just added a test.
2626f18c57 Update typescript to 4.8 (#14880)
π« Babel-internal.
eec95740ca chore: add eslint rule
consistent-type-imports
(#14901)π« Babel-internal.
14ea25fbb3 Default to hash syntax for Record&Tuple (#14744)
π« Record and tuple not currently supported.
05deb60405 Enable
ban-ts-comment
(#14908)π« Babel-internal.
d855f9d60c [parser] Make
decoratorsBeforeExport
default tofalse
(#14695)π« Seems to only affect error handling.
85ce832a7a support private name in decorator member expr (#14666)
β Already worked in Sucrase (with disableESTransforms).
16d3220bbf Add 2022-03 decorators version (stage 3) (#14836)
β Made small tweak to skip extra args in the
@()
case.70a13e49be v7.19.0
π« Release only.
642adbcd98 [ts] allow redeclaring a var/type with the same name as import (#14900)
π« Error handling fix that doesn't affect Sucrase.
580d730186 [estree] attach comments after directives at the end of file (#14920)
π« Sucrase doesn't support estree.
eb621ac822 v7.19.1
π« Release only.
ae10b496d0 fix: allow ts redeclaration with
import =
andvar
(#14940)π« Error handling fix that doesn't affect Sucrase.
40dfe9ac46 fix: Support local exports in TS
declare module
s (#14941)π« Error handling fix that doesn't affect Sucrase.
c602be9315 chore: use
c8
for coverage testing (#14961)π« Babel-internal.
6be6e04f39 fix: parsing of
JSXText
followingJSXSpreadChild
(#14974)π« Fix for context system that was removed from Sucrase.
3d46a59956 v7.19.3
π« Release only.
98c3bb99e2 Improve module expression parsing/printing (#14980)
π« Appears to be an AST-specific fix, not relevant to Sucrase.
4fb29a372b Never throw for invalid escapes in tagged templates (#14964)
π« Error reporting only.
7a38850a83 v7.19.4
π« Release only.
ef0749df26 Use
startLoc.index
instead of carrying aroundstart
(#15056)π« Refactor not relevant to Sucrase.
66d4fe9d3f fix: improve module block program location tracking (#15052)
π« AST only.
73c9aef872 Fix parsing of block comments nested in flow comments (#15062)
π« AST only.
aadd7a3d52 v7.19.6
π« Release only.
362f15b83c Fix handling of comments with decorators before
export
(#15032)π« Only appears to affect AST and error handling.
df733b18ae [ts] Add support for
expr satisfies Type
expressions (#14211)β Already done in #766