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.

Question: shared types between packages

See original GitHub issue

I help maintain the Flow libdefs for react-navigation. For our upcoming 3.0 release, we’re planning on splitting the project into multiple npm packages. We’d ideally be able to define types that are shared across packages only once, but my understanding is that it’s not yet possible to import types between libdefs.

My question is: what is the best practice for this today? Is copy-pasting types between libdefs the only way to do it? If so, does anybody know of a build system that automates/simplifies this process?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

6reactions
Brianzchencommented, Jul 14, 2022

Initial RFC here Implementation we plan to ship here

We’re just working out the release plan atm as to not break users on current version

1reaction
Brianzchencommented, Jul 23, 2022

@Ashoat I’ve just merged the v4 CLI which is to be published as an alpha initially but the test framework is fully functional and available on the main branch. Feel free to start raising PRs to that branch if you want to try out the new feature.

https://github.com/flow-typed/flow-typed/blob/main/CONTRIBUTING.md#importing-types-from-other-libdefs

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to share Typescript Types between Projects?
If you just want to share types, you use index.ts and then include the path to the folder where shared type is inside...
Read more >
how do you share type definitions across multiple projects?
I've got a question for all TS folks around. How do you handle sharing common types/interfaces/enums across multiple TypeScript projects? Do you ...
Read more >
Sharing TypeScript Types between Backend and Frontend ...
Important — The recommended way to share types. We highly recommend sharing types between your frontend and backend using a component.
Read more >
Best way to share types/code between apps - Reddit
Hi guys,. What is considered as best method to share code and types between apps? I have been looking around, and went with...
Read more >
Make sharing TypeScript code and types quick and easy
Explore the ways you can save time and more easily share the TypeScript code and types you and your team need in this...
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