Latest Results
feat(es/parser): complete Hermes Flow stripping parity (#11702)
## Summary
This PR completes Hermes-based Flow stripping parity by extending parser
support and adding strip correctness coverage for Hermes corpus cases.
### What changed
- Extended Flow syntax flags/options in parser config:
- `decorators`
- `components`
- `pattern_matching`
- Updated Hermes Flow options loader to read:
- `esproposal_decorators`
- `components`
- `pattern_matching`
- plus fallback enablement for `match/*`, `components/*`, and
`hook_syntax/*` fixtures.
- Implemented Flow `component`/`hook` parsing with lowering to existing
AST nodes:
- declaration forms (`component`, `hook`, `declare component`, export
forms)
- type forms (`component (...) renders T`, `hook (...) => T`)
- Implemented Flow `match` parsing and lowering (statement + expression
paths) under `pattern_matching`:
- supports Hermes corpus pattern forms (literal/unary literal, wildcard,
bindings, object/array, `|`, `as`, guard)
- expression lowering includes non-exhaustive fallback throw.
- Added Hermes strip correctness test:
- `crates/swc/tests/flow_strip_hermes.rs`
- checks `expected-errors=false` fixtures, `IsModule::Unknown`, no
`__flow_` leakage, ES reparse success
- supports strip-known-fail list + stale known-fail detection.
- Added strip known-fail file with agreed 2 cases:
- `async_await/migrated_0020.js`
- `async_await/migrated_0024.js`
- Emptied Hermes parser `known-fail.txt` and updated sync script to stop
category-based known-fail generation.
## Verification
Executed locally:
- `git submodule update --init --recursive`
- `cargo test -p swc_ecma_parser --test flow_hermes --features flow`
- `cargo test -p swc --test flow_strip_hermes --features flow`
- `cargo test -p swc --test flow_strip_correctness --features flow --
--ignored`
- `cargo test -p swc_ecma_parser`
- `cargo fmt --all`
- `cargo clippy --all --all-targets -- -D warnings`
Additional note:
- `cargo test -p swc` was also run, but `tests/source_map.rs::issue_622`
failed due `sourcemap-validator` runtime assertion (`There were no
mappings in the file`) in local environment; this appears unrelated to
the Flow/Hermes parser-strip changes. Active Branches
0%
0%
0%
© 2026 CodSpeed Technology