-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
perf(es/compat): Merge async_to_generator
#11311
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
base: kdy1/exponentation-operator
Are you sure you want to change the base?
Conversation
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
async_to_generator
Code Review - PR #11311: perf(es/compat): Merge
|
fc9bae2 to
2757573
Compare
CodSpeed Performance ReportMerging #11311 will degrade performances by 6.34%Comparing Summary
Benchmarks breakdown
Footnotes |
Code ReviewCritical Issues1. Typo in Parameter Name (High Priority)Location: There's a typo in the parameter name pub(crate) fn hook(
unresolved_ctxt: SyntaxContext,
options: Es2017Options,
asseumptions: Assumptions, // ❌ Typo: should be 'assumptions'
) -> impl VisitMutHook<TraverseCtx> {
OptionalHook(if options.async_to_generator {
Some(self::async_to_generator::hook(
unresolved_ctxt,
asseumptions.ignore_function_length, // ❌ Used again here
))This would cause a compilation error. Please fix the spelling to 2. Missing Implementation (Blocker)Location: The impl VisitMutHook<TraverseCtx> for AsyncToGeneratorPass {}This is a critical issue. The entire 800+ lines of async-to-generator transformation logic were deleted from Action Required: The actual visitor implementation must be added. You need to:
Architecture & Design Concerns3. Incomplete Migration to New ArchitectureThis PR appears to be part of a larger refactoring to merge transforms into a unified
Suggestion: Consider whether this should be:
4. Circular Dependency ConcernLocation: Added dependency: This creates a dependency from
Code Quality & Best Practices5. Missing DocumentationThe new
Per CLAUDE.md guideline #7: "Write documentation for your code." 6. Test Coverage ConcernThe PR removes substantial logic but doesn't appear to add or modify tests. Given the complexity of async-to-generator transformation:
Per CLAUDE.md guideline #5: "Write unit tests for your code." Performance Considerations7. Performance Impact Assessment NeededThe PR title indicates this is a performance optimization ("perf(es/compat): Merge
Suggestion: Once implemented, measure performance impact with realistic workloads. Minor Issues8. PR Description is EmptyThe PR description has placeholder text but no actual content:
Please fill this out to help reviewers understand:
SummaryThis PR cannot be merged in its current state due to:
Once these are fixed, please also address:
Status: ❌ Changes Requested The concept of migrating to a hook-based architecture looks promising for the stated performance goal, but the implementation needs to be completed before this can be reviewed for merge. |
Updated Code Review - PR #11311I've reviewed the previous comments and the PR more thoroughly. Here's an updated assessment: Critical Issue - TypoLocation: There's a typo that will prevent compilation: // Line 18 - parameter name has typo
pub(crate) fn hook(
unresolved_ctxt: SyntaxContext,
options: Es2017Options,
asseumptions: Assumptions, // ❌ Should be 'assumptions'
) -> impl VisitMutHook<TraverseCtx> {
OptionalHook(if options.async_to_generator {
Some(self::async_to_generator::hook(
unresolved_ctxt,
asseumptions.ignore_function_length, // ❌ Should be 'assumptions'
))
} else {
None
})
}Fix Required: Rename Architecture UnderstandingAfter deeper review, I now understand this is part of a larger refactoring to move transformations to a hook-based system. The PR:
Missing ImplementationThe impl VisitMutHook<TraverseCtx> for AsyncToGeneratorPass {}Questions:
Testing StatusThe CI shows a test failure. This is likely due to the typo preventing compilation. Once fixed, please verify: cargo test --package swc_ecma_transforms_compat --test es2017_async_to_generatorAdherence to CLAUDE.mdPer the project guidelines: ✅ Performance (Rule #1): Hook-based architecture should enable better performance Recommendations
Stack ContextThis appears to be part of a Graphite stack with PRs #11309-#11313. Consider:
Verdict: Do not merge until the typo is fixed. Consider whether the empty implementation is intentional given the stack context. cc: @kdy1 |
Binary Sizes
Commit: 4a84d10 |
28a97ff to
267c144
Compare
2757573 to
8504ebb
Compare
Pull Request Review - PR #11311: perf(es/compat): Merge
|
Code Review for PR #11311: perf(es/compat): Merge
|
8504ebb to
567ffbf
Compare
Pull Request ReviewThank you for working on this performance optimization to merge the 🐛 Critical Issues1. Incorrect dependency version (crates/swc_ecma_compat_es2017/Cargo.toml:22)-swc_ecma_transformer = { version = "0.1.0", path = "../swc_ecma_transformer" }
+swc_ecma_transformer = { version = "1.0.0", path = "../swc_ecma_transformer" }Issue: The version is set to 2. Typo: "asseumptions" instead of "assumptions" (crates/swc_ecma_transformer/src/es2017/mod.rs:18, 23)- asseumptions: Assumptions,
+ assumptions: Assumptions,- asseumptions.ignore_function_length,
+ assumptions.ignore_function_length,Impact: This typo will cause compilation errors and needs to be fixed.
|
567ffbf to
1a78f6f
Compare
Pull Request Review: PR #11311 - Merge
|
Code ReviewOverviewThis PR merges the transform into the new crate as part of the ongoing single-pass compiler refactoring. The change removes ~850 lines of code from and replaces it with a stub that delegates to the new transformer infrastructure. Critical Issues❌ 1. Empty ImplementationFile: The impl VisitMutHook<TraverseCtx> for AsyncToGeneratorPass {}This is a critical bug - the async/await transformation will not work at all with this implementation. The entire logic that was removed (handling of ❌ 2. Typo in Variable NameFile: asseumptions: Assumptions, // Should be "assumptions"This typo exists in both the function signature and the usage at line 23. Code Quality Issues
|
Code Review - PR #11311: perf(es/compat): Merge
|
Code ReviewOverviewThis PR merges the async_to_generator transform into the new swc_ecma_transformer crate as part of the ongoing single-pass compiler refactoring. The change removes ~850 lines of code from swc_ecma_compat_es2017 and replaces it with a stub that delegates to the new transformer infrastructure. Critical Issues❌ 1. Empty ImplementationFile: crates/swc_ecma_transformer/src/es2017/async_to_generator.rs:21 The AsyncToGeneratorPass struct implements VisitMutHook but has no methods defined. This means the transformation logic is completely missing: impl VisitMutHook<TraverseCtx> for AsyncToGeneratorPass {}This is a critical bug - the async/await transformation will not work at all with this implementation. The entire logic that was removed (handling of AwaitExpr, YieldExpr, for-await-of loops, etc.) needs to be ported to the new hook-based system. ❌ 2. Typo in Variable NameFile: crates/swc_ecma_transformer/src/es2017/mod.rs:18 asseumptions: Assumptions, // Should be "assumptions"This typo exists in both the function signature and the usage at line 23. Code Quality Issues
|

Description:
BREAKING CHANGE:
Related issue (if exists):