Skip to content

Prune unused vendored Flow parser modules - #8593

Open
cknitt wants to merge 1 commit into
masterfrom
codex/prune-vendored-flow-parser
Open

Prune unused vendored Flow parser modules#8593
cknitt wants to merge 1 commit into
masterfrom
codex/prune-vendored-flow-parser

Conversation

@cknitt

@cknitt cknitt commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

  • remove unused ESTree, JSDoc, location, and token translation modules from the vendored Flow parser
  • remove unused collection helpers
  • list retained vendored modules explicitly in Dune
  • document why the remaining parser modules are required

This removes approximately 4,450 lines, or 12% of the vendored OCaml sources.

Further mechanical pruning is not feasible because ReScript uses the parser for both complete JavaScript programs and individual expressions in %raw. The Flow parser connects expression parsing transitively to statements, declarations, types, JSX, patterns, comments, and its shared AST.

Removing substantially more would therefore require disabling accepted syntax or restructuring the parser, rather than simply deleting unused modules. That would need a clearly defined %raw JavaScript syntax contract and broader parser-specific test coverage.

This is the fifth PR in the “Flow Forward” series, stacked on the OCaml 5.5 toolchain upgrade.

Related to #8567.

@cknitt
cknitt force-pushed the codex/prune-vendored-flow-parser branch from 4801df7 to a0519c0 Compare August 28, 2026 18:39
@pkg-pr-new

pkg-pr-new Bot commented Aug 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@8593

@rescript/belt

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/belt@8593

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@8593

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@8593

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@8593

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@8593

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@8593

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@8593

commit: 13ed511

@cknitt
cknitt force-pushed the codex/prune-vendored-flow-parser branch from a0519c0 to da9b483 Compare August 28, 2026 19:41
Base automatically changed from codex/upgrade-ocaml-5.5 to master August 28, 2026 20:19
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt
cknitt force-pushed the codex/prune-vendored-flow-parser branch from da9b483 to 13ed511 Compare August 28, 2026 20:19
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.92%. Comparing base (9be2ff5) to head (13ed511).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8593   +/-   ##
=======================================
  Coverage   75.92%   75.92%           
=======================================
  Files         475      475           
  Lines       63015    63029   +14     
=======================================
+ Hits        47842    47854   +12     
- Misses      15173    15175    +2     

see 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants