Ionic 5, Vue and Typescript

Hi

I’m migrating a ionic 5 angular app to ionic 5 Vue. Am wondering if its worth using typescript as well.

I’ve got no working knowledge of typescript, and minimal java script knowledge. Mostly using Java in my day job.

Question is, are there enough resources to build/migrate to Vue Typescript?

Warning: opinion ahead, feel free to ignore.

Leaving aside the issue of what framework to choose, it’s a fundamental truth that web apps run in JavaScript, which means if you’re going to work on them, you have two choices:

  • write JavaScript
  • find some other language that transpiles to JavaScript, and work in that

If you are coming from Java, chances are you are going to absolutely hate JavaScript. Frankly, if you have any programming background in any language not named JavaScript, chances are you are going to hate JavaScript. TypeScript is a much more comfortable environment for somebody coming from any strongly-typed language, and you will end up much more productive in it, even taking into account the learning curve.

The only people I would not give the advice in the previous paragraph to are those who have been writing JavaScript for 10+ years, and are thoroughly accustomed to it.

The reason I’m laying it out this way is this: if you’re planning to port an existing, running, functional Angular app to Vue simply because you’ve heard that Vue has an easier learning curve than Angular, I would suggest you at least read through the Angular Tour of Heroes and decide if you really think it’s that scary.

Whatever framework you choose to use, learning TypeScript (and, by way of osmosis, some of how JavaScript works under the hood as well) is going to be a bigger task than picking a framework. Having the Angular project as an existing codebase will, IMHO, make learning Angular easier than trying to learn Vue from scratch.

Porting software generally entails having at least rudimentary skills in both environments involved, so you will have to pick up some Angular in order to be able to do the port, unless you’re planning on just reverse-engineering the entire thing from interacting with it, totally ignoring the existing codebase.

So, to answer your direct question, whatever you do, yes TypeScript is going to be worth it. I would still urge you to at least consider sticking with Angular, and make a full evaluation of the pros and cons of doing so versus moving to Vue.

Of course, I guess none of that matters if you were tasked specifically to port this to Vue for some other political reason.

1 Like

Thanks @rapropos.

No politics, but staying with angular isn’t an option.

There are two reasons I’m doing it.

We mainly use Vue at work, so want to learn it. I initially wanted to build the app that I’m porting in ionic Vue, but at the time I think Vue wasn’t mature enough. Or… There weren’t enough tutorials out yet :slight_smile:

I’ve run into a bug for the ios version that I’m unable to fix, thus rebuilding the project.

What I’m worried is that the tutorials I need to follow only use javascript.

Now at work we only use java script although I would prefer that we use typescript, for the very reasons you mentioned and I belive, but unable to back it up, that typescript would provide us with more manageable code.

Again, thanks.

If you are building a medium or large size project, I typically recommend using TypeScript. There is definitely a learning curve initially, but once you get going I have found that TypeScript catches a lot of errors that would normally be there if I were to only use JavaScript.

Ionic Vue starters ship with TypeScript by default, but you can remove it if you want: Ionic Vue Quickstart - Ionic Documentation

I 200% recommend learning and using TypeScript. I started my first Vue Ionic app maybe 6 months ago with a background in C# and PHP. I had used Vue and Javascript dabbled throughout some smaller projects but never as much as I have in the Ionic app.

There was definitely a learning curve learning TypeScript. Some of the learning curve was probably also just learning Javascript itself. I started off with TypeScript, then removed it, and then added it back. I am soooo glad I stuck with it. Not having types and intellisense/auto-completion in the IDE (I use VS Code) is not a fun and enjoyable experience. TypeScript has also eliminated so many errors that would have happened without it.

Since you are coming from a Java background which is strongly typed, I think you would hate yourself for not going with TypeScript…lol.