Comments (10)
unless someone steps up and commits to being the person who will maintain the typescript type definitions this will not happen anytime in the near future. if you would like to do this, please open a pr to add typescript definition to react-navigation and also some way for them to be tested automatically on CI for each PR (see how for flow we run the definition against NavigationPlayground). I can add you as a collaborator to help you keep them up to date
from rfcs.
congrats and good luck @jhalborg :)
from rfcs.
@brentvatne I just put up a PR to start this effort. See react-navigation/react-navigation#4075
I can pull the d.ts
file from DefinitelyTyped until the source files are generating more accurate type definitions.
I paved the way, so who wants to help me convert stuff to TypeScript!? @fbartho, @jhalborg, you in?
from rfcs.
@brentvatne -- so just to be clear, the option you'd be suggesting would be side-written TypeScript types, that are manually kept in sync, rather than migrating the core codebase to self-generate the TypeScript interface?
If that is your suggestion, I'll have a think about my availability and answer next friday about such a commitment.
from rfcs.
right. we recently removed flow from the codebase for some reasons described here: react-navigation/react-navigation#3350 and I'm not super eager to add a comparable tool back right now. I'd prefer to just provide flow/typescript definitions and not actually use them to build the library for the moment -- in the future when the API/design of react-navigation stabilizes more and either flow stabilizes or typescript integration with react native is more smooth (eg: http://artsy.github.io/blog/2017/11/27/Babel-7-and-TypeScript/) we're open to reconsidering that! for now we lean more on unit tests
from rfcs.
Thanks for the context!
from rfcs.
+1 for this. And just providing a d.ts file along with the repo, published along with SDK updates is fine for me, as a user.
I can't commit to being responsible though, as I have a baby on the way (as in due date this very day), so my availability in the next month(s) is more limited than usual. I can help out when things settle, though, at least with minor changes.
I hope @fbartho or someone else might be able to take on the task
from rfcs.
I am wholeheartedly ready to contribute to this effort, whatever the cost.
I am concerned about manually typing the .d.ts
files, because it doesn't have as much integrity as generated type definitions. I've already gone through this with the PostCSS library, where I converted the entire library to TypeScript just to generate perfect type defs that are now a bit stale because (back then) the author thought introducing TypeScript would deter community contributions somehow?
I think a good strategy for this would be to:
- Introduce TypeScript into the build system first.
- Configure it in such a way that TypeScript and JavaScript can co-exist.
- Incrementally convert existing JavaScript files into TypeScript, starting with the ones that have no dependencies and working our way up to the root.
I'll submit a PR with the build configuration and we'll see who likes it or not.
from rfcs.
As much as I'd like to help out, it won't be possible within the foreseeable future on my part, unfortunately. I really do hope that some process can be built :)
from rfcs.
tracking here: https://github.com/react-navigation/react-navigation-core/issues/2
if anyone wants to help out you can collaborate there
from rfcs.
Related Issues (20)
- Action property that indicates to routes that they should not change index HOT 1
- Improve ergonomics of back HOT 1
- Navigator config to pass params down HOT 1
- Add unsetParams to navigation prop HOT 2
- Reset state action HOT 2
- Expose logic for initializing state of createAppContainer HOT 4
- On will/didFocus subscribe, stop firing the listener if current screen is focused HOT 2
- Idea: Preloading HOT 6
- <StaticNavigator> for tests/storybook HOT 14
- StackActions.popToRouteName(routeName) HOT 2
- Alternative API for defining navigators HOT 12
- how to send navigation events between peer navigators? HOT 4
- Deep linking with authentication
- How to hide tab bar item n react-navigation HOT 3
- Ability to show screens on top of native modals
- useNavigationParams hook HOT 1
- Add useMaterialTabsHeight HOT 1
- Typesafe Stack & Navigation HOT 1
- devTools prop HOT 5
- [RFC] TabView API change
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rfcs.