Skip to content

[rust-compiler] Green the snap suite: Flow match parsing + fixture nesting#36707

Merged
poteto merged 3 commits into
pr-36173from
lauren/snap-flow-match-parser
Jun 7, 2026
Merged

[rust-compiler] Green the snap suite: Flow match parsing + fixture nesting#36707
poteto merged 3 commits into
pr-36173from
lauren/snap-flow-match-parser

Conversation

@poteto

@poteto poteto commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

The "Test babel-plugin-react-compiler" CI job has failed 7 fixtures on this branch lineage since the Flow match fixtures landed. This makes it fully green so the suite can act as a hard gate again (rust burn-down failures stay in the rust job, where they belong).

  • Six match-* fixtures never parsed in CI. Flow match requires hermes-parser >= 0.28 plus the enableExperimentalFlowMatchSyntax parser option; snap pinned 0.25.1 and never passed the flag (0.26 carries an incompatible draft grammar). Bump snap's hermes-parser to ^0.28.0 and pass the flag in parseInput. All six checked-in snapshots pass unchanged. babel-plugin-syntax-hermes-parser stays at 0.25.1: nothing in snap's pipeline re-parses match syntax, since hermes desugars match to an IIFE in babel mode before sprout evaluates.
  • method-call-scope-merge-mutable-range-sync had a logs-only sprout divergence. It renders a bare <tr> into sprout's container; React's validateDOMNesting warning fires in exactly one of the two evaluations (warning dedup shares process state), so logs differed while rendered output was identical. Renamed tr/td to div/span: valid nesting, no warning, compiled shape unchanged (37 memo slots before and after; the snapshot diff is tag literals only).
  • yarn.lock also gains the previously-missing typescript entry for the babel-plugin-react-compiler-rust workspace (pre-existing drift that any yarn install regenerates; included so it stops appearing in unrelated PRs).

Test plan

  • yarn snap: 1800 Tests, 1800 Passed, 0 Failed (was 1793/1800)
  • yarn snap -p 'match-*': 6/6 against checked-in snapshots, no regeneration
  • yarn workspace babel-plugin-react-compiler lint: clean
  • No snapshot churn beyond the one edited fixture

Second commit: the prettier check

Run prettier failed on the same lineage for two reasons: the six match fixtures fail to parse (prettier's Flow parser predates the experimental syntax; now in .prettierignore with an unignore note), and 53 files of accumulated formatting drift (now formatted, with the 45 affected fixture snapshots regenerated; churn is Input-section text only).

  • node scripts/prettier/index.js: exit 0 (was 59 failures)
  • yarn snap after regeneration: 1800/1800

Update (third commit): replaces the .prettierignore approach with a real formatter. A .prettierrc.js override scoped to the match-* fixture paths formats them via prettier-plugin-hermes-parser ^0.32.0 (shares the root hermes 0.32 family, minimal lockfile churn). The four fixtures whose checked-in formatting differed from hermes output are reformatted with snapshots regenerated. Both suites verified green after the swap: node scripts/prettier/index.js exit 0 with the match fixtures actually checked, yarn snap 1800/1800.

…sting

The "Test babel-plugin-react-compiler" CI job has failed 7 fixtures
since the Flow `match` fixtures landed.

Six match-* fixtures never parsed in CI: Flow match syntax requires
hermes-parser >= 0.28 and the enableExperimentalFlowMatchSyntax parser
option, while snap pinned 0.25.1 and never passed the flag. Bump snap's
hermes-parser to ^0.28.0 and pass the flag in parseInput. The six
checked-in .expect.md snapshots pass unchanged, so they were authored
under a compatible parser. babel-plugin-syntax-hermes-parser stays at
0.25.1: nothing in snap's pipeline re-parses match syntax (hermes
desugars match to an IIFE in babel mode before sprout evaluates).

method-call-scope-merge-mutable-range-sync rendered a bare <tr> into
sprout's container; React's validateDOMNesting warning fires in exactly
one of the two evaluations (warning dedup shares process state), so the
recorded logs diverged while rendered output was identical. Rename
tr/td to div/span: valid nesting, no warning, and the compiled shape is
unchanged (37 memo slots before and after; the snapshot diff is tag
literals only). The regenerated eval output is a real render replacing
a stale toSorted exception recorded on an older Node.

yarn.lock also gains the previously-missing typescript entry for the
babel-plugin-react-compiler-rust workspace (pre-existing drift that any
yarn install regenerates).

Test plan:
- yarn snap: 1800 Tests, 1800 Passed, 0 Failed (was 1793/1800)
- yarn snap -p 'match-*': 6/6 against checked-in snapshots
- yarn workspace babel-plugin-react-compiler lint: clean
@meta-cla meta-cla Bot added the CLA Signed label Jun 6, 2026
@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label Jun 6, 2026
poteto added 2 commits June 6, 2026 16:54
…at drift

The repo-wide prettier check (scripts/prettier/index.js) failed on 59
files, all pre-existing on this branch lineage. Two classes:

Six Flow `match` fixtures fail to PARSE: prettier's Flow parser does
not support the experimental match syntax (snap parses these with
hermes-parser plus enableExperimentalFlowMatchSyntax, fixed alongside
this commit). Add them to .prettierignore with an unignore-when-caught-
up note; their formatting is curated with the fixture corpus.

The remaining 53 files are accumulated formatting drift (fixtures plus
a handful of source files like bridge.ts and minimize.ts). Format them
with the repo formatter and regenerate the 45 affected fixture
snapshots; the snapshot churn is Input-section text only, and the full
snap suite stays green.

Test plan:
- node scripts/prettier/index.js: exit 0 (was 59 failures)
- yarn snap: 1800 Tests, 1800 Passed, 0 Failed
Replace the .prettierignore entries for the Flow match fixtures with a
real formatter: a .prettierrc.js override scoped to the match-* fixture
paths uses prettier-plugin-hermes-parser (added at ^0.32.0, sharing the
root hermes-parser 0.32 family, minimal lockfile churn), whose parser
handles the experimental match syntax. The four fixtures whose checked-
in formatting differed from hermes output are reformatted and their
snapshots regenerated.

Test plan:
- node scripts/prettier/index.js: exit 0, match fixtures now checked
- yarn snap: 1800 Tests, 1800 Passed, 0 Failed
@poteto poteto merged commit 0dc7f2e into pr-36173 Jun 7, 2026
191 of 194 checks passed
@poteto poteto deleted the lauren/snap-flow-match-parser branch June 7, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant