swc-project
swc
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Optimizations
Branches
Benchmarks
Runs
Performance History
Latest Results
test(es/parser): Keep the module-only Flow fixture out of `tests/flow` `swc_ecma_transforms_typescript` reparses every `tests/flow` fixture with `parse_file_as_program`, which still rejects a top-level `for await` in Flow (the Hermes corpus requires this). The module-only fixture failed that test in CI. Move it to `tests/flow-module`, which is parsed with `parse_module` only, and add a `tests/flow` fixture where `for await` follows an `import`, which is valid under `parse_program`. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kdy1/fix-issue-12749
7 hours ago
perf(es/minifier): Avoid repeated simplification of unused values (#12736) <!-- Note: CI script will automatically rebase your PR so please do not rebase unless required --> <!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. --> **Description:** Duplicate simplification caused exponential work in nested IIFEs and spread arrays. Simplify only tail returns before conversion and let the return traversal handle the rest. Keep spread arrays after reducing their ordinary elements so iterators are consumed without revisiting nested expressions. <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> **BREAKING CHANGE:** <!-- If this PR introduces a breaking change, it must contain a notice for it to be included in the CHANGELOG. Add description or remove entirely if not breaking. You may need to update `MIGRATION.md` for the breaking changes. --> **Related issue (if exists):** - Close swc-project/swc-ai-issues#71 - Close swc-project/swc-ai-issues#73 Co-authored-by: Donny/ź°ėģ¤ <kdy.1997.dev@gmail.com>
main
7 hours ago
fix(es/parser): Export `TokenFlags` from `unstable` (#12751) **Description:** The public `Tokens` trait uses `TokenFlags` in `update_token_flags` and `token_flags`. `TokenFlags` was private to the crate. Because of this, no crate outside the parser could implement `Tokens`. This PR exports `TokenFlags` from `swc_ecma_parser::unstable`, next to the other token types. It also adds an integration test. The test wraps `Lexer` in a `Tokens` implementation from outside the crate and parses a module with it. Local validation: `cargo test -p swc_ecma_parser` passed. `cargo test -p swc_ecma_parser --features unstable --test unstable_tokens` passed. `cargo clippy -p swc_ecma_parser --all-targets --features unstable -- -D warnings` passed. I did not run the workspace-wide `cargo clippy --all`. CI has not run yet. **BREAKING CHANGE:** None. **Related issue (if exists):** Closes #12747 Co-authored-by: mellyeliu <64865235+mellyeliu@users.noreply.github.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
main
10 hours ago
fix(es/parser): Allow private brand checks in Flow mode (#12752) **Description:** Flow mode rejected every `#name` inside an expression. This also rejected the valid private brand check `#x in o`, which failed with `Expected an identifier`. Now Flow mode accepts `#name` only as the direct left operand of an `in` that binds tighter than the enclosing operator. This is the rule Babel uses. `#x;`, `(#x) in o`, `-#x in o` and `1 + #x in o` still error, so the Hermes behavior from #11699 is kept. Tests: new Flow fixtures cover the valid brand checks (`#x in o`, `o != null && #x in o`, `true == #x in o`) and the four invalid positions. I ran `cargo test -p swc_ecma_parser --all-features` (all passed, including the Hermes parity tests), `cargo fmt --all` and `cargo clippy -p swc_ecma_parser --all-targets --all-features -- -D warnings` (clean) on the final code. I did not run the workspace-wide clippy. **BREAKING CHANGE:** None. **Related issue (if exists):** Closes #12748 --------- Co-authored-by: mellyeliu <64865235+mellyeliu@users.noreply.github.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
main
10 hours ago
fix(es/parser): Export `TokenFlags` from `unstable` The public `Tokens` trait uses `TokenFlags` in `update_token_flags` and `token_flags`, but the type was private. Crates outside the parser could not implement `Tokens`. Export it from `swc_ecma_parser::unstable` next to the other token types. Co-authored-by: mellyeliu <64865235+mellyeliu@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kdy1/fix-issue-12747
11 hours ago
Merge branch 'main' into perf/minifier-pure-traversal
perf/minifier-pure-traversal
11 hours ago
chore: Add changeset Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kdy1/fix-issue-12748
11 hours ago
fix(es/parser): Allow top-level `for await` in Flow modules The Flow-only `for await` check in `parse_for_stmt` also ran under `parse_module`, so `for await (const x of y) {}` at the top level of a module failed to parse. Top-level await makes this valid in modules, so skip the check when the module context is active. Scripts, regular functions and static blocks still report an error. Fixes #12749 Co-authored-by: mellyeliu <64865235+mellyeliu@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kdy1/fix-issue-12749
11 hours ago
Latest Branches
CodSpeed Performance Gauge
-4%
fix(es/parser): Allow top-level `for await` in Flow modules
#12750
7 hours ago
40282b3
kdy1/fix-issue-12749
CodSpeed Performance Gauge
0%
fix(es/parser): Export `TokenFlags` from `unstable`
#12751
11 hours ago
e432385
kdy1/fix-issue-12747
CodSpeed Performance Gauge
0%
perf(es/minifier): Avoid repeated simplification of unused values
#12736
11 hours ago
18870ae
perf/minifier-pure-traversal
Ā© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs