-
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
Feature request: Type providers #722
Comments
Great idea ! F# users love this feature ! |
It’d be nice if flow understood JSON Schema. Less need to double up on schema/interface declarations. |
This would be a huge help. The opposite already exists (https://github.com/seanhess/runtime-types) for converting Flow types to simple JSON. I may start work on a very simple POC that reverses the process - we download schemata from a database on boot and I'd really like to work it into our build process so we can validate everything flowing through the system. |
@STRML Any progress on converting JSON schema to Flow types? |
Yeah, I have a project working with https://github.com/STRML/json-to-flow. You can create your own templates & hooks if you need custom functionality. |
Just wanted to check in on whether anyone had made progress or explored this. I'm very interested in a standard way to do type generation from other schemas like API contracts, GraphQL queries, etc. |
I've explored RPC-based plugin approach. Seems doable, but hard to predict performance implications. |
Any progress on this one? Is it on some kind of roadmap? If no one else is working on such a thing, I'd consider taking it on as a weekend project (once I've gotten some experience with OCaml). TIA |
I'm looking for contracts (or guards) based on Flow type definitions e.g. I declare a type signature in Flow, and I would be able to do runtime check if JSON response from the server is the same as my expected signature. If not it will return |
It would be really cool to be able to create types from something other than inference/annotations at compile time. In particular, I can think of two use cases:
schema(schema: string) -> type
, which would take a JSON schema document and output a type. This capability would allow us to use the same schema document on the server/other contexts, while keeping the type checking in sync automatically. We might want to make the argument a path, or have a separate builtin type-level function to read files.Relay.QL
tagged template.For nuts and bolts, I was thinking that we could use something like OCaml's Dynlink, so the providers would be OCaml bytecode, which would register their capabilities with some builtin API.
The text was updated successfully, but these errors were encountered: