Identifying dependencies

The first step before we begin migrating v1 Personal Trainer is to identify the external libraries that we are using in the AngularJS version of Personal Trainer.

The external libraries that we are using in v1 are:

  • angular-media-player
  • angular-local-storage
  • angular-translate
  • angular-ui-bootstrap
  • owl. carousel

Libraries such as angular-media-player and angular-local-storage are easy to migrate/replace. We have already done this in earlier chapters of this book.

The angular-translate library can be replaced with ngx-translate, and as we will see in the coming sections, it is not a very challenging task.

We use angular-ui-bootstrap for modal dialogs in Personal Trainer v1. We replace it with ngx-modialog (http://bit.ly/ngx-modialog) as the only control we were using from angular-ui-bootstrap was the dialog control.

Now that we have sorted out the external dependencies, let's decide the language to use.

While the existing code base is JavaScript, we love TypeScript. Its type safety, its terse syntax, and how well it plays with Angular makes it our language of choice. Hence, it's going to be TypeScript all the way.

Another thing that tilts the decision in favor of TypeScript is that we do not need to migrate the existing code base to TypeScript. Anything we migrate/build new, we build it in TypeScript. Legacy code still remains in JavaScript.

Let's start. As a first migration task, we need to set up a module loader for our v1 Personal Trainer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.3.208