Official TypeScript compiler coming to Meteor

That is quiet hard to say. If we look at the relevant state of JS result for 2018 that 46% of js devs use it with another 33% looking to give it a try soon.

1 Like

That is not quite what the survey reports:

  • 33% Heard of it, would like to learn (!== “…try soon”)
  • 46% Used it, would use again (!== “use it”)

But ok, 46% of responding devs know TS – fine. Given the selection bias of the survey, I’d bet on 10% or so, in the real world. See Who Took the State of JavaScript 2018 Survey?

(Also, given the many esoteric features of TS, “to know TS” is not well-defined. 1% might also be a valid answer.)

Oh well – it’s clear there isn’t much interest in this point.
// end of lament

1 Like

I am a newbie for Typescript.
I tired with Meteor-1.8.2.x.
I worked, but don’t bug error when I assign difference data type in function

// Method (ts)
Meteor.methods({
  hello(
    name: string,
    gender: string = "M",
    age: number,
    address?: string
  ): string {
    console.log(name, gender, age, address);
    return name;
  }
});
------------- 
// Client call

    Meteor.call("hello", "Rabbit", "M", "5 year", "BTB", (err, res) => {
      console.log(res);
    });

It still work … (age: number???)
Please help me…

Could share me the Example Application?

I doubt this can work, because Meteor methods are not regular method calls, they work like remote procedure calls. In this case, you have to check the validity of the parameters with other means, e.g. using the check package.

2 Likes

@waldgeist, very thanks.
Have any example Meteo1.8.2 + Typescript?

It is documented here:
https://docs.meteor.com/api/check.html

This will not enable TypeScript checkings, though, because Meteor methods are different from regular functions.

I would like to need Meteo1.8.2 + Typescript Example OR Document?

Method typings should work if you use mdg:validated-method for your method definitions

2 Likes