Repository navigation
chore: dedupe hermes-parser and oxc-parser - #4460
Conversation
Bump hermes-parser to ^0.35.0 (matches metro 0.84) and oxc-parser to ^0.155.0 (matches knip 6.44.1). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Agent evals❌ 2 failed · ✅ 17 passed ❌ Failed (2)
✅ Passed (17)
Warning This audited 64b1994, not the head of the pull request (8fa2851). Push the changes, or audit the session that made them, and run Audited 64b1994. This check only reports. |
Agent evals
|
Description
rnx-kit was the only consumer of its
hermes-parserandoxc-parserversions inyarn.lock. This bumps them to versions other packages already use:hermes-parser:^0.34.0→^0.35.0in@rnx-kit/tools-babel(same as metro 0.84)oxc-parser: catalog^0.134.0→^0.155.0, and rootknip^6.0.0→^6.44.1(usesoxc-parser@^0.155.0). This affects@rnx-kit/metro-transformer-oxc,@rnx-kit/tools-babelandevals.yarn.locknow has oneoxc-parserversion (0.155.0; knip's old 0.120 is also gone) and onehermes-parserversion used by rnx-kit packages (0.35.0, shared with metro). All new versions are older than the 7-daynpmMinimalAgeGate. I also ranyarn dedupefor the transitive packages that knip 6.44.1 updated.Breaking changes reviewed
hermes-parser 0.35: only additions (
decoratorsonClassProperty/ClassPrivateProperty,readonlyvariance kind). No code changes needed.oxc-parser 0.135–0.155: the
[BREAKING]changelog entries are Rust AST refactors. On the JS side, the ESTree types (@oxc-project/types) only got looser (typeAnnotation,decoratorson rest params). However, some TypeScript/JSX checks moved into the parser (e.g. fix(parser): report comma operator in JSX expression in the parser oxc-project/oxc#23030), soparseSyncnow returns errors for invalid code that Babel accepts: comma operator in JSX (TS18007),abstract async, definite assignment without a type, a required parameter after an optional one, and similar. The returned AST is byte-identical to 0.134's.This broke
tools-babel's AST diagnostic tests on 9 fixtures that intentionally contain such syntax. The test helper (test/fixtures.ts) now parses with oxc directly and ignores these errors.src/parse.tsis unchanged.User-facing impact:
@rnx-kit/tools-babeland@rnx-kit/metro-transformer-oxcnow throw on this kind of invalid TS/JSX, which oxc 0.134 accepted.tscalready rejects such code.Test plan
Run in each package directory:
incubator/tools-babel:yarn build --dependencies✅,yarn test✅ (40/40, all fixtures parse with oxc)incubator/metro-transformer-oxc:yarn build --dependencies✅,yarn test✅ (4/4)evals:yarn build --dependencies✅,yarn test✅ (35/35)Run from the repository root:
yarn knip✅yarn dedupe --check✅yarn rnx-align-deps✅yarn change:check✅