- Notifications
You must be signed in to change notification settings - Fork142
Improve typings#45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
coveralls commentedNov 18, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
coveralls commentedNov 18, 2016
1 similar comment
coveralls commentedNov 18, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
coveralls commentedNov 18, 2016
2 similar comments
coveralls commentedNov 18, 2016
coveralls commentedNov 18, 2016
coveralls commentedNov 18, 2016
1 similar comment
coveralls commentedNov 18, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks for the PR! Made some minor comments about style and being consistent with the rest of the repo (please look overtypings-test.ts again), but I'll look more deeply later.
package.json Outdated
| "prepublish":"npm test && npm run build", | ||
| "pretest":"npm run lint", | ||
| "test":"cross-env NODE_ENV=test nyc mocha" | ||
| "test":"cross-env NODE_ENV=test nyc mocha && tsc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Please use theposttest lifecycle hook fortsc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice, never use posttest before. :)
test/typings-test.ts Outdated
| @@ -0,0 +1,68 @@ | |||
| import{FluxStandardAction,isError,isFSA}from'../src' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I would prefer to see semi-colons to be consistent withindex.d.ts and the JS files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Ok.
coveralls commentedNov 19, 2016
1 similar comment
coveralls commentedNov 19, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Updated based on feedback. 🌷 |
coveralls commentedNov 19, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
coveralls commentedNov 21, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
1 similar comment
coveralls commentedNov 21, 2016
The last change I made worth debating. On one side it helps on the type guard usage, on the other side it makes action creation harder: What do you think? |
I think it is the right change. When Would that be any case that this is not true? |
cc/@tkqubo who add typings to DT. |
Since `payload` and `meta` is generic, user can specify `void` or `undefined` to indicate it does not present.Removing the optional designation improves type guard.see `isCustomAction4()` for example
coveralls commentedDec 11, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@JaKXz do you have anything for me to change before we can merge this? 🌷 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@unional so sorry for the delay! I finally have some OSS cycles again. 🌹
I have a couple more notes:
- please run
yarnto updateyarn.lock - the
posttestaction that runstscwill return an exit code of 1 if there is a problem with the typings, correct?
There are some more nitpicks I could make intypings-test.ts about code style [e.g. missing semicolons 😱 ] - can that file [and other.ts files in the repo] be linted somehow?
And last question, what is the status on the typescript issue you posted earlier? I saw that it's still open and was updated recently, but it's a long thread so I haven't read it closely yet. Will that be a fix that comes in later or does it block this PR?
@JaKXz good to hear from you!
It still have? Seems like I'm getting very comfortable with my own linting standard 😛 .
Yes, but since it is
I personally do not recommend checking in
They are working on it, likely will still take a few months to land. We can update the typing when that is released and get mainstreamed. |
coveralls commentedJan 9, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Found the comment I made about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@unional re:yarn.lock - as a maintainer it has actually made my lifemuch easier and helped me catch a number of issues regarding deps before merging PRs. I think the purpose of theyarn.lock file is to give some reassurance about what versions of dependencies and sub-dependencies are resolved & installed. Having a way of knowing which dependencies are installed, and then being able to investigate why certain dependencies are installed at certain versions are reassurances we haven't had before with node modules.
It makes breakage detection harder for the maintainer.
I disagree with this statement. I am able to trace the history of my dependencies (and their dependencies) in agit bisect. I am going to ask that you update theyarn.lock before I can merge this PR.
re: linting - I'm just considering the cost of maintenance [so if people want to contribute it the future, how can we make it so that they can get feedback about code style from a robot rather than me having to comment on every line of their changes]. Do you know of ahoundCI for TypeScript? Or would we have to add those dependencies to the project [which I don't really prefer since this is just a generic JS project]?
Also, it would be ideal if thetsc command exited with a non-zero code when the compilation fails so that there's feedback that the typings have broken. I'm pretty sure ifposttest fails, any commands that depend ontest will not execute.
perhapshttps://github.com/nzakas/eslint-plugin-typescript would help? |
coveralls commentedJan 23, 2017
2 similar comments
coveralls commentedJan 23, 2017
coveralls commentedJan 23, 2017
unional commentedJan 24, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
It does exist with non-zero. I was just concerning that
yes, that's true for applications. For modules/packages, IMO it will hide the problem until a user reports it. E.g. if your module depends on This is because during consumption, the The article (https://yarnpkg.com/blog/2016/11/24/lockfiles-for-all) about devDeps vs deps is correct thou. All in all, maybe this topic is still in flux and it will clear out as more module authors adopt one way or the other. This is just a friendly discussion. 🌷 Maybe using I have updated the |
package.json Outdated
| "lodash.isstring":"^4.0.1", | ||
| "lodash.issymbol":"^4.0.1" | ||
| "lodash.issymbol":"^4.0.1", | ||
| "typescript-eslint-parser":"^1.0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think all typescript dependencies should be indevDeps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes, of course. 😛
@unional thank you for your thoughts, hard work, and patience on this. I'm excited to get it merged after onelast issue and release v1.1.0 :) |
coveralls commentedJan 24, 2017
2 similar comments
coveralls commentedJan 24, 2017
coveralls commentedJan 24, 2017
package.json Outdated
| "typescript-eslint-parser":"^1.0.2" | ||
| }, | ||
| "dependencies": { | ||
| "eslint-plugin-typescript":"^0.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
missed this one as well
Uh oh!
There was an error while loading.Please reload this page.
I have added a few things:
isFSAandisErrorThis allows users to specify the type of the
payloadandmetaeasily.See
typings-test.tsfor examples.In the future, I would like to make the
Metatype optional.But need to wait formicrosoft/TypeScript#2175
For now, I think this is the best it can get. 🌷