-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Initial TypeScript implementation #1319
Conversation
# The first commit's message is: Add types to Networks and Addresses # This is the 2nd commit message: Added types
how about |
dist implies that the files are only for "distribution" and are not "source" (src) files. Since we are committing JS to git, JS files should always be checked and verified along side TS files. dist is more common, but that is because most TS projects do not commit (or even look at) the JS code. This project is not like that... so a new naming convention is needed.......... but I don't like ts_src... haha |
JS files generated with a specific typescript version + configs should be practically the same, maybe same spaces/tabs/EOL diffs but that shouldn't alter the behavior of the Lib whether a developer use the JS files or the TS ones |
Verifiability. The JS files are committed because people should be given the option to not trust TypeScript/Microsoft if they wish. TypeScript is only here for two reasons:
An application has the luxury of deciding whether it wants to trust MS. However, this library is used by people who may want to just verify the JS and not use TS at all. Having git diffs helps that verification. |
It's common to commit only By doing so, users don't necessarily trust TypeScript/Microsoft. |
Now i see the point of keeping the JS files |
@d-yokoi That is true, but keeping JS files on git makes it easier for anyone forking us to verify their changes to the ts files are all that is added to the js files. (via git diff) Plus, that would mean everytime I publish I need to manually verify the whole JS folder. |
I understand your thoughts. Then, why don't we leave Making the size of the package smaller helps users. |
I have finally noticed So, please ignore my comment above. Everything looks good to me now :) |
ci: add a tslint rule to require type definitions
In order to add static typing while working on BitcoinJS-lib and automatically generate the type files for use in other TypeScript libraries, I have re-written the library using TypeScript.
A few caveats:
ToDos before merging:
Any and all feedback is appreciated, and I will try to keep things up to date with master functionality as things change.
I currently have the ES6 PRs and the WitnessBlock checking PRs merged into this branch.
Working on this gave me a new found appreciation for TypeScript.
Any comments are appreciated.
Edit: At this point, diffs kind of lose meaning... so a review would probably consist of:
git diff master -- test/
and see that it's only the new block stuff and a few things to accommodate the new TypeScript structure.