question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should we accept purposely incomplete lib defs of huge libraries?

See original GitHub issue

Problem

There are huge libraries in the JS ecosystem that are not flow-typed. Namely material-ui which many have asked for and firebase which I’m starting to get into now.

I’m slowly typing out my stub for firebase which works well but it’s a huge effort for myself or anyone for that matter if the first submission of the type def had to be fully complete because I doubt I’ll use all the features to be able to ensure it works for everyone.

I did previously add the definition for cypress, but even that was a huge effort that took me days/weeks but I had the motivation because someone else had previously attempted a PR I could base the definitions off. I don’t use all the functions from cypress so I couldn’t validate that they’re all accurate but from the previous attempt I was confident enough to make a submission.

Not having things like material-ui I think really hurts the flow community’s growth because although the avid flow users don’t use material-ui since I personally see it as a more hobbyist library, a lot of new comers would come from that and would find the ecosystem not worth it without their most depended on library typed in comparison to TS.

Proposal

What I’m wondering is if the general community here would accept a partially typed definition, so that something can at least be started even if it doesn’t work for everyone initially. If not the case, I doubt I would ever feel confident enough to submit my stub back to the community.

Of course whatever submitted would include thorough testing against the lib def of what’s there so that quality is kept, just that complete definitions won’t be there.

I would also note that I my thoughts are that incomplete objects are typed as {| |} instead of { ... } and more object properties are simply added over time.


What’s your thoughts? Tagging some active contributors to get the conversation going @pascalduez @AndrewSouthpaw @villesau @GAntoine @jedwards1211 @Ashoat @atabel

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
villesaucommented, Apr 21, 2021

I think incomplete typedefs are also better than nothing. But it could be good to communicate it somehow and have guidelines for people to follow: Let’s say you have following type: () => NotReallyTypedType. Should it return mixed or any? any for ease of use, mixed for soundess. Flow advocates for soundness, but returning mixed is a huge pain in the ass. I’d go with any, or if we know it’s an object, some object type etc.

Guidelines would help people revieweing to review incomplete libdefs as well as implementing partial libdefs.

0reactions
Brianzchencommented, Aug 27, 2022

To close this off. Probably just need to add some docs to bless this standard

Read more comments on GitHub >

github_iconTop Results From Across the Web

342. Informed Consent and Incomplete Disclosure or Deception
When deceptive methodologies are used, participants are given incomplete or misleading information about what to expect during the study activities which ...
Read more >
Easy check for unresolved symbols in shared libraries?
I am looking for an easy way to check if I have all the symbols I need at compile time, perhaps something I...
Read more >
Library as Place: Rethinking Roles, Rethinking Space
If libraries are to remain dynamic, the spaces that define them and the services they offer must continually stimulate users to create new...
Read more >
Equity, Diversity, Inclusion: An Interpretation of the Library Bill ...
The American Library Association affirms that equity, diversity, and inclusion are central to the promotion and practice of intellectual freedom.
Read more >
Best practices for writing code comments - Stack Overflow Blog
Famed MIT professor Hal Abelson said: “Programs must be written for people to read and only incidentally for machines to execute.” While he...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found