TypeScript Tutorial #2 - Compiling TypeScript
HTML-код
- Опубликовано: 6 май 2020
- Hey gang, in this tutorial I'll show you how we can compile typescript files into JavaScript files.
🐱👤🐱👤 JOIN THE GANG -
/ @netninja
----------------------------------------
🐱💻 🐱💻 My Udemy Courses:
+ Modern JavaScript - www.thenetninja.co.uk/udemy/m...
+ Vue JS & Firebase - www.thenetninja.co.uk/udemy/vu...
+ D3.js & Firebase - www.thenetninja.co.uk/udemy/d...
🐱💻 🐱💻 Course Files:
github.com/iamshaunjp/typescr...
🐱💻 🐱💻 Other Related Free Courses:
+ HTML & CSS Crash Course - • HTML & CSS Crash Cours...
+ Modern JavaScript - • Modern JavaScript Tuto...
🐱💻 🐱💻 TypeScript Docs:
www.typescriptlang.org/docs/h...
🐱💻 🐱💻 The Net Ninja Community Boards:
community.thenetninja.co.uk/
I don't know much English, but your way of speaking is so clean that I can understand everything perfectly. Thanks a lot!
I love how after all these videos you're still doing the upward intonation on "query selector" lol.
Great content, as always!
Waiting for this course a long time 🙏🙏❤️
Hey thanks waiting for this ts series for a very long time thanks!
Just wow can't wait to see your react typescript series :)
Thank you Net Ninja! I would love to see a series which built a React app in typescript. Cheers!
Thanks Shaun Pelling. Learning a lot from your TypeScript Series.
Looking forward for the next parts!
I came here after your React tutorial.
As I said there in the comments,
I get a new job, and there are projects on react + typescript.
but mostly i know Java.
That's why I'm here.
Don't want to watch javascript tutorials because they are so long.
Arigato, Ninja!
I have learned two things from Shaun Pelling sir Computer programming and English language first of all he explain each code line by line so that's why I have learned programming from Shaun Pelling sir and second his accent is very clear so because of that I have also learned English language from Shaun Pelling sir.
Thank you very much for sharing your knowledge.
Thanks for new series
Thanks! My man is there going to be the Typescript-React tutorial? Highly needed
As soon as I started watching this tutorial I went on google to check whether you can write ts in react or not :D
+1
You are the best!
U're AWESOMEE. I had a problem with ts and js (i am new in frontend) and couldnt figure out why it wasn't working
Just finished previous series!
You're amazing⚡
Thankyou :)
I have a question regarding the compiler, and I was not able to find a concrete answer to this.
Can you maintain the line breaks from the TS file? Or will the compiler always ignore them and pack everything together?
Thank you so much! You are really important for many people.
Thanks for your support Alejandro :)
Thank you for your straight forward explanation. :)
Would you recommend writing frontend apps with typescript?
Typechecking and compilation into 'older' javascript for cross-browser-support seems like quite an advantage.
Greetings from Germany. Love watching your videos!
Hey, I think that it definitely helps you to think more about about your code & will lead to cleaner code in the long-run, so yeah. I still use plain JS for a lot of projects, especially when trying to fix something up quickly. But more frameworks/libs are quickly adopting TS support and I see that as a good thing.
Why would you give a a class called list-item?
Great, thanks
What theme are you using for VSCode ?
I love you so much! its amaizing course
Thanks! :)
error TS2339: Property 'forEach' does not exist on type 'NodeListOf'. i am getting this error after forEach compilation in terminal
Nice video, really helpful
Thanks! Glad it helped :)
i'm getting this error when converting ts to js
tsc : File C:\Users\\AppData\Roaming
pm\tsc.ps1 cannot be loaded because running scripts is disabled on this system.
Switching from powershell to command prompt solved the issue for me.
How can i use tsc with nodemon? is it possible?
Hi, i am learning JavaScript and I keep seeing everywhere "please don't use car use let or const" but if I use typescript and it's converting my const or let to var isn't it bad ?
Fantastic
and for me... it asked to include the allowJs flag... this is specific to newer versions of typescript. It might be different in the future too
used npm install @types/node, if you get Typescript error TS2583 Cannot find name 'Set' while compiling ts to js
thanks
what theme do you use in vscode?
ty.
What theme are you using?
which theme you are using ?
I tried to follow this, but compilation doesn't give a result instead it comes back with an error: allowJs isn't true. what am I missing?
Is there like a live compiler that can be used instead of having to convert all TypeScript file to JS manually each time. In case someone's working on a bigger project
idk if there is but you can always make a batch file
I can smell Ionic tut after this series. Shaun, please make Ionic and React tut after this series. Thank you so much for all your tut.
U uploaded both part 1 and part 2 within 1 min
He's a Ninja after all ;)
Shaun, you're missing the doctype in the index.html file
can you show me how to use anime
js for onload animation ?
I had to add npx prefix "npx tsc sandbox.ts sandbox.js" to make it work
My broke ass can't afford to join and support you. But I'll watch every add that's on your video. Even if it's 2 mins long. I hope it helps. Cheers mate!
Hi there, need advice because something is not working: after node js installation I go to my command prompt window and when run 'npm install -g typescript' but outcome is only "changed 1 package, and audited 1 package in 2s
found 0 vulnerabilities" and when I go to VS terminal and type 'TSC sandbox.ts ' is giving me an error saying: , which means the first part was not completed which I don't understand but I managed to find a way to install a JSon file on for now to carry on using this in my terminal (npm install --save-dev typescript), but still I want to figure out why my first part is not working. Cheers!
A recent change added a security flag to run ps1 scripts in Powershell following global installs. 2 solutions: 1) Compile with the command `tsc.cmd` - 2) Run the compile command in Command Prompt, not Powershell
Shaun, do you have some special plan for 500k subs? Some event or smth?
Great videoo
Thank you Onca :)
Sir which theme it is?
please, can you make a video about Typescript-vue-vuetify?
Greate video but why put the form in the footer instead of a section or a div? That's really not semantic. 😅
Good video and explanation but can you tell why did we create the .ts file ...and convert it to a same to same js file ? What's the advantage
It looks like nobody replied to you so in case you still need an answer: The .ts file is TypeScript code. you can write JavaScript in a TypeScript file but not the other way round. TS is an extension on top of JS so it can do a lot more than JS can. (It's the same with other languages like C and C++, you can generally write C code in a .cpp but you can't write c++ code in a .c file)
@@phraggers hmm makes sense thanks !
@@phraggers Thanks for your reply
hi .where is the link of git hub ?
i don't understand why is a server used. Can't the html just be opened in the browser ?
It's easier to open it via live server because it automatically refreshes the changes that you made in your code on your browser.
🎉🎃
If anyone facing problem in compiling TS just put this code in PowerShell (in Admin) and compile---> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Thank you😀
THIS is dangerous, you reduce the security level, and it won't work on administered machines. Better use "tsc.cmd" from the Powershell terminal or compile from the Command Prompt terminal.
Hey, man, i liked your theme! What is it?
Hey it's Monokai++ :)
@@NetNinja thanks!
Live Server is good
Nice tutorial but the project setup is not shown and I can't follow because I'm probably missing something
I did a git clone but the only thing there is a README.md :(
Hey, you just need to checkout the correct lesson branch in the terminal. E.g. git checkout lesson-4
If somebody is getting this error (While running tsc command) File C:\Users\AppData\Roaming
pm\tsc.ps1 cannot be loaded because running scripts is disabled on this system . Open powershell in admin mode and write this cmd (Set-ExecutionPolicy -ExecutionPolicy RemoteSigned)
THIS is dangerous, you reduce the security level, and it won't work on administered machines. Better use "tsc.cmd" from the Powershell terminal or compile from the Command Prompt terminal.
@@wildpat03 Thank you! I literally was stuck on this problem for the past 3 hours.
I really didn't want to mess with the execution policy and had no idea about tsc.cmd or just running it using the cmd terminal in VSCode.
I'm surprised no one mentioned it, because this solution is quicker and safer. I don't know why everyone is so quick to jump the gun and say "Just let all scripts run on your computer"
@@derekc.gorman595 Thanks. Re. your last question, yup, it's ... puzzling to say the least. I'm a dev, this is my job, and it seems that a lot of people including pros don't think about security. Nowadays, this should be at the forefront along documenting and code architecture, IMHO.
I don't like that the way you teach this is dependent on a specific text editor/IDE. I use WSL
I use svelte to develop projects now, so typescript is irrelevant, but thank you Mr. Shaun Pelling for this series anyway, it helps a lot of people who are still addicted to reactjs and not recovered yet, let those who are reactjs dependent embrace typescript !!!
Typescript with deno
Hey Shaun I think you lack self-confidence, what you mean "possibly the best website on the internet", that`s 100% the best website on the internet ,come on.
query selecTAAURR
translate to korean....plz
Headsup, if you get error with tsc sandbox.ts, try instead to write tsc.cmd sandbox.ts