-
Notifications
You must be signed in to change notification settings - Fork 0
Chapter 1 #1
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
base: initial
Are you sure you want to change the base?
Conversation
|
||
Around 2010, Microsoft noticed that a lot of their teams were using a community project called Script# (ScriptSharp) to build their JavaScript apps. This library allowed developers to write code in C#, and then turn it to JavaScript. C# had excellent features for building large applications - so it made the experience of building these apps more pleasant. In fact, many teams had found this was the only way they could build complex applications in large teams. | ||
|
||
Anders Hejlsberg, the creator of C#, was tasked to investigate this phenomenon. He was astonished. People were so annoyed with JavaScript that they were willing to code in a completely different language in order to get the powerful IDE features they were used 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.
I'm not sure if this is entirely true based on my recollection of the TS documentary but I could certainly be wrong. If I recall Anders joined the effort at some early stage after seeing an internal presentation on what was TS at the time. I definitely remember that he said things along those lines there:
He was astonished. People were so annoyed with JavaScript that they were willing to code in a completely different language in order to get the powerful IDE features they were used to.
So dunno, maybe that presentation was about ScriptSharp? I'd double-check this with the documentary just to be sure.
|
||
This is where TypeScript's `tsc` CLI comes in, which transforms your `.ts` files into `.js` files. You are able to take advantage of TypeScript's features while writing your code, but the output is still plain JavaScript. | ||
|
||
 |
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.
does this exist anywhere? I can't find it
"devDependencies": { | ||
"@total-typescript/exercise-cli": "0.4.0", | ||
"@total-typescript/helpers": "~0.0.1", | ||
"cross-fetch": "~3.1.5", |
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 guess this might make sense here but I came to prefer undici
lately as it's the library that powers Node.js native fetch (see how it's included in the node's repo here). So it's guaranteed~ to be spec-compliant and future-proof.
npm install –-global typescript | ||
``` | ||
|
||
TypeScript is usually also installed in your `package.json` to make sure that all developers using the project are using the same version. For the purposes of this book, a global installation will do just fine. |
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.
It might be worth mentioning here that to use the same version of TS in VS Code you actually have to go through Command Palette and "Select TypeScript version..." to choose the workspace version. Even though it generates a .vscode/settings.json
file that you could commit... that file is not enough to ensure that other collaborators use the same version of the TS Server. VS Code requires explicit user consent so everybody on the team has to do it manually. It's like that for security reasons
No description provided.