GithubHelp home page GithubHelp logo

Comments (9)

ryyppy avatar ryyppy commented on May 8, 2024 1

As of the state right now, there are only two ways to properly consume types from npm packages:

  1. Either Convince the project maintainers to provide a build step to basically recursively copy all src/ files to dist/ to the same position as the ES5 files with a flow.js suffix (AFAIK draft.js will do this in the future)
  2. Or create and consume a libdef file separately (as currently done in flow-typed)

Option 2 will also be required if you try to use an minified browser build of course, since in my knowledge there is no automated way to extract all types into a single file ...

For this project, Option 1 would actually be a good fit

from express-graphql.

nodkz avatar nodkz commented on May 8, 2024 1

Also, you may track progress with graphql-js here graphql/graphql-js#359

from express-graphql.

mwalkerwells avatar mwalkerwells commented on May 8, 2024

Just found this: flow-typed/flow-typed#16

from express-graphql.

mwalkerwells avatar mwalkerwells commented on May 8, 2024

@leebyron Curious if #1 is something you'd consider?

from express-graphql.

leebyron avatar leebyron commented on May 8, 2024

Yes, this is something I think is worth considering, though the graphql package itself should export types in the same fashion first.

It's also worth point out that the Flow team does not encourage libraries export types in this way due to possible breakage when Flow updates.

from express-graphql.

mwalkerwells avatar mwalkerwells commented on May 8, 2024

Ah, interesting—that makes sense.

from express-graphql.

mwalkerwells avatar mwalkerwells commented on May 8, 2024

Flow v32 Release Notes:

We're starting work on flow gen-flow-files, which consumes Flow code and outputs .flow files containing only the types exported. It's alpha-level and we're still iterating on it, so use at your own peril!

:)

from express-graphql.

nodkz avatar nodkz commented on May 8, 2024

Yep, incredible synchronous work of Facebook's OSS teams.

team-work

Lee posted about flow 0.32 in tweeter yesterday.

from express-graphql.

mwalkerwells avatar mwalkerwells commented on May 8, 2024

Thanks—& yes, they're OTS.

from express-graphql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.