-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Implements custom resolvers #6132
Conversation
cc @mroch |
The Appveyor error seems unrelated (sqlite3), and the Travis one is one that I cannot reproduce locally (I had it some time ago, but then I updated the mli file to include module_resolver and it worked). Could it be possible that the mli file is cached somewhere? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arcanis has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
54f36d0
to
7b3847b
Compare
7b3847b
to
ae1c7c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arcanis has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arcanis has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arcanis has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arcanis has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
could this solve #6305 ? |
Summary: This diff adds a new configuration option to Flow: `module_resolver`. It points to an executable that consumes a stream of JSON objects under the form `[request, issuer]`, and outputs a stream of paths in response. Since it's been my first work with OCaml since quite a long time there's probably errors and odity in my code, feel free to point them 🙂 Some of them I have in mind (maybe they can be fixed in a followup pass, you tell me): - The JSON payload is crafted with sprintf, I wasn't sure how to properly generate a JSON string - For the same reason, the resolver returns a stream of paths instead of an actual JSON object because I wasn't sure how to parse them in Flow - Related to the previous point, the resolver doesn't have a way to notify Flow that a request cannot be satisfied (it would be solved if the return object was a `[err, result]` entity). - If the `module_resolver` is invalid, Flow will currently hang (I thought `create_process` would "throw", but maybe it doesn't make sense in OCaml?) Closes #6132 Reviewed By: gabelevi Differential Revision: D7619501 Pulled By: arcanis fbshipit-source-id: a4bf8b89a6f94a8f1e8dac92ae1789a3c7be77f2
This diff adds a new configuration option to Flow:
module_resolver
. It points to an executable that consumes a stream of JSON objects under the form[request, issuer]
, and outputs a stream of paths in response.Since it's been my first work with OCaml since quite a long time there's probably errors and odity in my code, feel free to point them 🙂 Some of them I have in mind (maybe they can be fixed in a followup pass, you tell me):
[err, result]
entity).module_resolver
is invalid, Flow will currently hang (I thoughtcreate_process
would "throw", but maybe it doesn't make sense in OCaml?)