Gatsby: Remove flow annotations

Created on 8 Aug 2019  路  14Comments  路  Source: gatsbyjs/gatsby

We don't really use them and there are very few sprinkled through the code base.

good first issue stale?

Most helpful comment

I'll make sure to include the types in .d.ts files

All 14 comments

I'll take this one if that's okay with everyone

Sure @crutchcorn Thank you for picking it up! 馃檶

Can we somehow rescue the scattered types from type builders, field extensions and node model and put them in TS?

@stefanprobst Could definitely do that but I reckon TS will need more repo wide tooling setup? 馃槥 Or do you propose .d.ts files? That would be good I think

yes, just .d.ts files

I'll make sure to include the types in .d.ts files

Do we also want to do JSDoc types additional to .d.ts definition files?

For example, something like this:

type QueryJob = {
  id: string,
  hash?: string,
  query: string,
  componentPath: string,
  context: Object,
  isPage: Boolean,
}

// Run query
module.exports = async (queryJob: QueryJob) => {

Could turn into something like this:

/**
 * @typedef QueryJob
 * @param {string} id
 * @param {string} [hash]
 * @param {string} query
 * @param {string} componentPath
 * @param {Object} context
 * @param {Boolean} isPage
 */

// Run query
/**
 * @param {QueryJob} queryJob
 */
module.exports = async queryJob => {

Probably best to not duplicate them across both. Since that鈥檚 one more thing that鈥檒l need to be kept consistent. I think typescript definitions are a good source of truth and sufficient.

I agree. I just was wondering your thoughts on this.

Just wanted to jump in and mention that I have some initial work on this branch:

https://github.com/crutchcorn/gatsby/tree/remove-flow-definitions

But it seems to be causing various test failures. I intend to be looking into them today and tomorrow

This PR has been opened and should be good-to-go (once merge conflicts are handled)

That said, it did introduce some broader questions raised in this comment:

https://github.com/gatsbyjs/gatsby/pull/16952#issuecomment-524958035

I'd love to get this resolved relatively soon so that merge conflicts don't grow to too high of scale

I'm interested in checking those conflicts

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Hey again!

It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.

Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikestopcontinues picture mikestopcontinues  路  3Comments

theduke picture theduke  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

ghost picture ghost  路  3Comments

rossPatton picture rossPatton  路  3Comments