Anyone had any luck with using Typescript (compiles to JS) to develop plugins?

Discussion in 'Learning Javascript' started by Rave, Mar 16, 2018.

  1. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,574
    Likes Received:
    1,342
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    [​IMG]
     
    #21
    Gamefall Team likes this.
  2. Clock Out

    Clock Out Veteran Veteran

    Messages:
    92
    Likes Received:
    44
    First Language:
    English
    Primarily Uses:
    RMMV
    It's already been said but TypeScript is JS so it has all the same problems as JS such as having both == and === operators. TypeScript is directly by Microsoft so that's out anyway. Since Lua was mentioned perhaps something like Fengari would be more suitable that TypeScript?
     
    #22
  3. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    Not for my stated goal of writing RMMV plugins, no. Although if someone would write a plugin based on it that adds a possibility of writing RMMV plugins/scripts whatever in Lua (basically exposing RMMV API to lua), I'd be game.
     
    #23
  4. nio kasgami

    nio kasgami VampCat Veteran

    Messages:
    8,590
    Likes Received:
    2,340
    Location:
    Canada / Quebec
    First Language:
    French
    okay wow I will stop u there guys lol Typescript IS javascript but with static defined type. Typescript was designed for being OPP based and help on debugguing a lots.

    This not a magical new language it's just Javascript with indeep tracing purpose. It's built for a mindset to if you write something u expect to know what this type or method should return.

    Stop arguying on the fact that Javascript is less good than typescript. They are BOTH the same just one is statically typed the other is dynamic typped. OVERALL that you take Vue, Dart, Babel, typescript etc they ALL return to one language : Javascript.

    As for any bad or good practice NONE are bad it's purelly a preference style and nothing is wrong by mixing both if you think it's work better for you.

    I used to dev with typescript but with the MV mindset of plugins and overriding and alias. Typescript lost his powerfullness
     
    #24
  5. Kino

    Kino EIS Game Dev Veteran

    Messages:
    515
    Likes Received:
    671
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    @Rave Typescript does work in MV; if you want to use it I recommend the ts definitions or I feel it's not worth it.

    JavaScript is a great language. Typescript allows you to use types and create interfaces among other things. I've made about 50 or so plugins with it; the language holds up and significantly reduces common JS errors.
     
    #25
    Rave likes this.
  6. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    Oh, I know it can be used, after all TS compiles to JS, but I don't know HOW.

    @Kino Can you post a step by step tutorial on how to setup the environment to do TypeScript development. Setting up Atom (can't stand Visual Studio, can't afford Sublime), putting definitions, making a simple plugin doing nothing special (simple hello world sort of thing), and compiling it to JS.
     
    #26
  7. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,574
    Likes Received:
    1,342
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    you need use terminal like this for compile module ts
    a lot of video are available on youtube.
    [​IMG]
     
    #27
  8. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    Yeah, but I need something in the context of making MV plugins. I've already got typescript running on my craptop, just it doesn't help me if I don't know how to set up Atom to work with it and how to compile the code into a valid JS that is recognized by MV as a correct plugin.
     
    #28
  9. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,574
    Likes Received:
    1,342
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    sorry, I don't have enough experience for help and guide you with this process. i just know the basic that worked for me .
     
    #29
  10. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    That's why my question about specifics was directed to @Kino since he apparently did it before. It's always the details you get stuck on.
     
    #30
  11. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,574
    Likes Received:
    1,342
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    You must be less lazy my friend, you need study, I can not write to you ,months of study in some lines.
    Like kino say, ts dont work in rmmv , ans also 99% of game editor.
    TS it a language for help you to transcode easily in the language you need.
    https://fr.wikipedia.org/wiki/TypeScript

    The engine rmmv work with JS, but you can dev in TS and compile after in JS.
    Many PIXI modules will offer no more production version(js version), and will be available only in TS.
    So you will need to pass by terminal and NPM to compile a compatible developer JS version to Rmmv.
    this is already the case for updating pixi filter, and pixi light.

    take a look here this will help you
    https://codeburst.io/https-chidume-nnamdi-com-npm-module-in-typescript-12b3b22f0724

    EDIT:
    PS: ok sorry for your sentence
    I was not sure I understood her, I translated her and she seemed an insult.
    Translated to another engine it is ok.
    Desolate my friend, I had to interpret your sentence as an attack lol!
     
    Last edited: Apr 4, 2018
    #31
  12. Clock Out

    Clock Out Veteran Veteran

    Messages:
    92
    Likes Received:
    44
    First Language:
    English
    Primarily Uses:
    RMMV
    Follow the instructions to install atom-typescript if that hasn't been done yet. TypeScript uses a file name tsconfig.json and there's a nifty option to compile on save and I think there's also a watch mode.
     
    Last edited: Apr 4, 2018
    #32
  13. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    Kino hasn't said anything about Typescript not being usable with MV. In fact, he said the opposite (emphasis mine):


    @Clock Out I've already managed to set up the Atom with Typescript (which works nicely), but I need those definitions files and some basic template (which I will then make a github repo of so all future Typescript plugin developers have to do is to setup typescript with their favorite editor and clone the template, then start coding) that would produce a working MV plugin (even if a just basic hello world) upon compile.
     
    Last edited: Apr 5, 2018
    #33
  14. Kino

    Kino EIS Game Dev Veteran

    Messages:
    515
    Likes Received:
    671
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    The only definition files for MV really are the ones I wrote with a few others last year. You could find them on endlessillusoft.com. Along with instructions for using them. You can compile in watch mode using the console with tsc -w which will compile ts to js based on your tsconfig.json.


    I'll add a tutorial for TS on my website later; most likely tomorrow.

    Also Microsoft aside VSCode is definitely the better choice of editor imo. Integrated terminals and first class typescript support. Plus, works a lot faster than Atom from my experience.
     
    #34
    Jonforum and LTN Games like this.
  15. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    I'm sick of VS. Didn't liked the whole thing, why would I like "vs lite"? Anyway, thanks. Will check out the instructions and the definitions out. Have a great day, friend :)

    //edit: Can't find these on your site, could you link them directly, please?
     
    #35
  16. Kino

    Kino EIS Game Dev Veteran

    Messages:
    515
    Likes Received:
    671
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Still gotta post todays been pretty busy. And it's definitely not VS light. Imo best text editor I've used. And I hate VS just as much as the next guy
     
    #36
  17. Rave

    Rave Veteran Veteran

    Messages:
    99
    Likes Received:
    27
    First Language:
    Polish
    No, I meant definitions. I think I'd be able to take it from there.
     
    #37
  18. Kino

    Kino EIS Game Dev Veteran

    Messages:
    515
    Likes Received:
    671
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV

Share This Page