pandov Posted June 13, 2019 Share Posted June 13, 2019 Hi, guys! I have one question. I would like to enable a language Typescript for my client-side. How I can do it? Wiki page don't help me: https://wiki.rage.mp/index.php?title=Using_Typescript (because there is an instruction for setting up vscode, but I want to use this language in my developed) Thanks for the answer! Link to comment Share on other sites More sharing options...
TheMysteriousVincent Posted June 13, 2019 Share Posted June 13, 2019 @pandov I hope you know what kind of language TypeScript (TS) is and what it is used to be. If not: TS is a static and object oriented language which is build upon the Javascript-Syntax - means that JS-Syntax and -code is all valid to TS. Now, to use TS you will need a TS-compiler, which literally does just parsing TS-code and converts it to JS-Code. Thus, the answer is that you will need the TS compiler. The TS compiler can then be used with the "tsc" command, if installed. Though, configuring a TS project - yes, you will have to configure things like the entry file, excluded and included libs and so on - can be confusing at first. Furthermore, you should configure packaging of files with a packer like browserify or webpack. I would recommend it but actually it is optional. Nevertheless, and this is important to say, TS will, for web- and RageMP client-side development, always need a compiler which converts TS-code into JS-code, which later then can be used as "the script". But hey, I think you are doing well if you want to use TS, since the written code is more clear than JS to write. Hope this helps. Link to comment Share on other sites More sharing options...
pandov Posted June 13, 2019 Author Share Posted June 13, 2019 @TheMysteriousVincent, thanks for your reply! Can you give me a guide to installing a Typscript on the client side? I do not understand how to set everything up. Link to comment Share on other sites More sharing options...
TheMysteriousVincent Posted June 13, 2019 Share Posted June 13, 2019 You literally can google "Typescript installation" and find proper results. Nvm. Here's something that should help: https://code.visualstudio.com/docs/languages/typescript Link to comment Share on other sites More sharing options...
pandov Posted June 13, 2019 Author Share Posted June 13, 2019 @TheMysteriousVincent But after all here it is told how to include support for the Typescript language in the development environment VSCode. But I use fulled Visual Studio Enterprise. But I want to enable language support when I develop. I don't need syntax hints. I want to start writing code on Typescript. How can I do this (enable support)? Or it is enabled by default? Link to comment Share on other sites More sharing options...
TheMysteriousVincent Posted June 13, 2019 Share Posted June 13, 2019 (edited) @pandov I thought you've meant vscode - how could I know you meant VS? You didn't wrote VS. So I helped you with a VSC-link. On Visual Studio, things work different. There you have to use the Visual Studio Installer where you can install TypeScript or you use the first parts of the tutorial I've sent and use the command line. Since the npm TS package is both the linter and the compiler, you get both by installing that package (globally). Syntax hints are a part of a language support in general. Again, VS supports writing TS. But as far as I know, the version of TS used in VS was some older version when I last used it. Go ahead and use VS, but I strongly recommend using VSC, since TS is (I think) an inbuild feature of VSC. The language support you get with VSC is definetely sufficient. Edited June 13, 2019 by TheMysteriousVincent Link to comment Share on other sites More sharing options...
pandov Posted June 13, 2019 Author Share Posted June 13, 2019 @TheMysteriousVincent Good. But what do I need to do to start writing code using Typescript via VS? I really do not understand what you mean. Please, you can write me a step-by-step instruction that will answer my question. Link to comment Share on other sites More sharing options...
TheMysteriousVincent Posted June 13, 2019 Share Posted June 13, 2019 (edited) You just simply modify your VS version with the VS Installer and install the Node.js in the Workload section. Seriously: You should try getting your stuff fixed by yourself - and this problem is not that hard to solve at all... I am not the MS support. Edited June 13, 2019 by TheMysteriousVincent Link to comment Share on other sites More sharing options...
robearded Posted June 13, 2019 Share Posted June 13, 2019 https://www.typescriptlang.org/index.html If you scroll down the page there is literally a tutorial on how to to get it for Visual studio 2017/2019/Code Link to comment Share on other sites More sharing options...
DevGrab Posted July 4, 2019 Share Posted July 4, 2019 Typescript is a transpiler != compiler. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now