Hi, just wanted to stop by and leave a comment to tell you how awesome I think this package is. I've been messing around with it, and decided to try doing something with it with typescript and redux.
I've pushed ink-typescript-redux-test which is essentially the Counter example, but with more awesomeness.
custom_typings/ink directory.typescript-fsa for action creators and typescript-fsa-reducers for the reducerIf you want to include the typings in your project, feel free.
Hi, just wanted to stop by and leave a comment to tell you how awesome I think this package is. I've been messing around with it, and decided to try doing something with it with typescript and redux.
Thank you as well, comments like this are a rare and super exciting occasion for OSS maintainers 馃挋
As for TypeScript typings, I'd be more than happy to support them, but at a bit later point, since the package is in its very early stages and I expect the render/mount API to change. The component API (from React) isn't going to change though, just to clarify.
If you'd be willing to help in the near future, I can ping you later :)
Yeah, no problem! Drop me a line if you want help with it, or if you want to write the whole thing in Typescript (which would eliminate the need to maintain separate bindings :), lol)
@vadimdemedes Are you open to this being done now?
Yeah, sure.
@vadimdemedes I extended the TypeScript definitions @xdave originally wrote for a project I'm working on. Should I open a pull request?
@sindresorhus I had to manually duplicate the property and method types from Chalk, since the types are exported under a class. If Chalk refactored it's own type definitions to export the properties and methods as an interface, I would prefer to use that to keep the projects in sync.
https://github.com/chalk/chalk/blob/bc3dd75329b43eeda3200ac9a161b6e5a9b9dfe3/types/index.d.ts#L28 looks like an interface to me?
What I mean is that there are types under the Chalk interface that are for a class.
import { Chalk } from "chalk/types";
export class Text extends Component<Partial<Chalk>, {}> {}
Ends up not being assignable when using:
return <Text green={true}>{`${this.state.i} tests passed`}</Text>;
See: https://github.com/chalk/chalk/issues/215#issuecomment-337459457
Why don't we rewrite all in TypeScript?
Why don't we rewrite all in TypeScript?
I'm not a fan.
What's the issue with providing definitions?
i've started some work here.
For now, there is a port of progress-bar and divider + flexbox and chalk (a bit hacky) typings.
after switching to v2 I was able to run react-router and normal react typings so it is huge step forward to me. @vadimdemedes - thanks for this move 馃憤
What's the issue with providing definitions?
from my point of view no issue, however if you are introducing component and there are only prop-types defined, it is a bit painful in ts - would be easier to have this in place, and apply changes when necessary around this repo, especially that complexity of cli apps is growing and it is better to have static type check over runtime.
If I'm working with some-pkg and notice that its' type defs are outdated, I'll usually try to fix them. However, if the typedefs are provided by @types/some-pkg which means the definitions are stored in DefinitelyTyped/DefinitelyTyped I won't even bother, I'll create a new file in ./type-stubs containing just declare module 'some-pkg'; and say f馃帀ck it. Because a) that repo won't even load in my browser because there's so many files in it b) the people there are snobby about writing tests even for minor changes c) the issues/PR sections have issues/PRs from thousands of other packages and my changes get drowned out
That's why I prefer typedefs be kept in the same repo as the projects source. If I PR a change, somebody will (usually) merge it pretty quickly.
/ rant
I've already written some (rough) type defs for v2 and would be happy to PR them AND keep them updated.
@rozzzly Awesome! Try to follow this style guide: https://github.com/sindresorhus/typescript-definition-style-guide
@rozzzly would you be able to put together that PR? Happy to chip in if you want some help
Opened up a PR with the changes I had to make locally to make it compile against @rozzzly's typings: https://github.com/rozzzly/template-ts-jest-webpack/pull/1
I've opened up #136 as a start
Most helpful comment
Yeah, no problem! Drop me a line if you want help with it, or if you want to write the whole thing in Typescript (which would eliminate the need to maintain separate bindings :), lol)