Skip to content

Use pinned flow_parser #7390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 15, 2025
Merged

Conversation

cometkim
Copy link
Member

Experimented with using the upstream parser to catch up with updates and reduce maintenance costs.

Some errors from the Ounit tests are fixed by #7381.

There are some unintended changes in JS artifacts; I really don't get how the JS parser causes them. This needs investigation.

@cknitt
Copy link
Member

cknitt commented Apr 12, 2025

Just tried this locally (after rebasing on latest master).
Did not see any unintended changes in JS artifacts so far, but did get compile errors in tests.

cometkim and others added 2 commits April 13, 2025 07:17
@cometkim cometkim marked this pull request as ready for review April 12, 2025 22:20
@cometkim
Copy link
Member Author

After fixing the part @cknitt pointed out, this works properly.

I would support this change as long as it doesn't cause serious problems in performance or binary size. We don't want to maintain the whole JS parser logic anyway.

The only problem is that it requires OCaml compiler 5.2 or higher, but since it doesn't actually require a higher version of OCaml (yet), we can just fork the package and fix the range.

@cometkim cometkim force-pushed the dep-flow-parser branch 3 times, most recently from 2746fd3 to 343fe61 Compare April 13, 2025 00:05
@cometkim
Copy link
Member Author

Windows again... I have no idea why opam pin is failing on Windows :/

@cometkim
Copy link
Member Author

Opened an issue: ocaml/opam#6472

@cknitt
Copy link
Member

cknitt commented Apr 13, 2025

Until this is fixed in OPAM, can we vendor the new version?

@cometkim
Copy link
Member Author

Not needed, I fixed all issues in our fork facebook/flow@main...rescript-lang:flow:rescript

@cometkim
Copy link
Member Author

This increases the binary size ~1MiB per platform. But once #6183 is done, it would be a minor range.

It's a somewhat expected impact since the flow_parser includes a lot of additional syntax. Since we only use a small portion of its functionality, we might have a lighter dedicated parser later.

@cknitt
Copy link
Member

cknitt commented Apr 15, 2025

Not needed, I fixed all issues in our fork facebook/[email protected]:flow:rescript

Wow, nice work! 🎉

Could warrant a CHANGELOG entry. 😉

Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, will merge now and update the CHANGELOG while preparing the next alpha release.

@cknitt cknitt merged commit c330bbf into rescript-lang:master Apr 15, 2025
20 checks passed
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