How to: Ionic2 with Javascript

Today I’ve learned that ionic 2 now uses typescript only. I’ve also found here:

We’re going all in on TS.
You could do your own work and covert it toa es6 workflow, but we want people to use typescript

For many reasons I would like to use Javascript, how can I do that?

Also, which is the reason of no more .js?

Thanks in advance! :slight_smile:

TypeScript is an extension of JavaScript, normal JavaScript code still works when using TypeScript. Why is it that you don’t want to use TypeScript? Aside from the files being .ts instead of .js, you can pretty much just pretend that you are using normal JS.

1 Like

I like that all the online examples are going to be consistently TypeScript (rather than a mixture). I like that TypeScript is pretty similar to JS. I like that better developers than me say its going to be great. I trust the Ionic team to make the right calls.

However there are some JS libraries, that its a real struggle to get working - with all the typings initialization. This is probably a temporary situation as over time, hopefully most libraries will have solutions for typescript (but perhaps not rare ones). Currently though, its very new for everyone - JS library creators, Ionic developers, documentation writers… so just a lot of time sunk spent working out if typings exist, if a typings workaround will work… etc

When you have multiple things that are potentially broken (due to not quite knowing Angular 2 or Ionic), being able to precisely know if its a typings issue or an angular issue would really help when debugging something erroring.

1 Like

Nice to know!

I’m trying to improve the performance of my Ionic1 app but I’m not satisfied by the animations, so I want to try to migrate to Ionic2 to see if I can achieve my goals.
I prefer not to use Typescript because (I’m a ts noob) I don’t have time to rewrite my application with types and I would like to avoid problems with the libraries I am already using.

PS: I’ve been on your blog many times, I really like it! :grin:

I’m curious what configuration you were working on. What caused you trouble with types?

I don’t want to name companies, as I imagine these issues are temporary, so naming wouldn’t achieve much!

Everyones going the right direction so thats great.

TS is an extension catering for a common lowest denominator among programming acumen thus making JS tractable to more programmers