-
Notifications
You must be signed in to change notification settings - Fork 663
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Introduce typescript migration pipeline #352
Conversation
Codecov Report
@@ Coverage Diff @@
## dev-v4 #352 +/- ##
===========================================
+ Coverage 88.97% 99.77% +10.79%
===========================================
Files 44 24 -20
Lines 1234 900 -334
Branches 183 0 -183
===========================================
- Hits 1098 898 -200
+ Misses 136 2 -134 Continue to review full report at Codecov.
|
Can't find any up-to-date types for @slack/client. Looks like they're transitioning to TS, though: slackapi/node-slack-sdk#352
one constraint i'd have for a migration to typescript-authored source is that i'd want that fact to remain an implementation detail. a goal of this project is to have maximum reach with our developers and therefore, all the examples / guides / documentation should talk about the interfaces as JavaScript-first. here's a question related to this: how do we go about generating reference documentation? its clear that JSDoc annotations are the infrastructure for nearly all tools in the ecosystem, and i'd love for reuse. while investigating a solution, i came across microsoft/TypeScript#10. it seems like this is not a solved problem, so i'm open to other solutions as well. more interesting links:
|
@aoberoi I've peek into existing documentation (i.e: https://slackapi.github.io/node-slack-sdk/reference/SlackDataStore), and I don't think there is strong differences between documentation generated by In a high level, there could be possibly few differences -
My suggestion in here is not to limit options to transform TS codes to JS-doc-compatible but try out other ooto documentation as well. If those results are highly different to plain JS then considering transformation should be way to go. |
Also in addition to ng's |
@kwonoj i like your idea about trying out tsdoc and then inspecting whether it suits the needs of a JavaScript only developer. we can refer back to this conversation to try out other options when we know what worked and what didn't. |
@aoberoi yes, makes sense. Let's try to find out if things are not working with tsdocs. |
@kwonoj so i've gone ahead and created a |
absolutely ✨ I'll prep changes. |
Rebased, and target base changed to |
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.
gate for proposal
@kwonoj thanks for these very excellent contributions. i'm very happy to say we're rolling forward with the typescript pipeline and this really helps establish a base. of course i might tweak some of the details ahead. |
PR Summary
This PR is opposite approach of #329, instead of introducing ambient type definition which requires manual handcraft of types directly migrates codebases into TypeScript in gradual way.
While this PR doesn't actually migrates lot of codes into TypeScript yet (only except index entry point), allows let TypeScript compiler works with existing JS codebases as well as TypeScript both for gradual migration with community contributions as well.
What it does
What it doesn't (yet)
: TypeScript compiler doesn't support to generate type declaration while accepting JS (
--allowJS
).Once migration is done actual type declarattion can be published
What it breaks
: TSLint rules are not 100% 1:1 correponds to ESLint rules.
: Tooling around TypeScript compiler generally targets Node > 4, so test might be skipped on 0.12 environment which can cause breaking changes to 0.12.
Related Issues
Relates to #329
Test strategy
Nothing, this is just initial discussion proposal and won't be likely merged by some breaking changes.