Skip to content

An example of how to migrate an old JavaScript application to modern syntax, features, and technologies with TypeScript

License

Notifications You must be signed in to change notification settings

DunedinJS/migrating-to-modern-js-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Migrating to modern JS — TypeScript

This is a TypeScript fork of https://github.com/DunedinJS/migrating-to-modern-js

A simple stopwatch application which serves as an example of how to migrate an old JavaScript application to modern syntax, features, and technologies.

What do I need?

  • Git

  • Git Bash — if using Windows (included with Git)

  • Node.js version 6.9

    Everything probably works with version 4 or higher but has not been checked. Run node -v to check your current version. Follow the instructions here to install Node.js

  • A text editor with first-class JavaScript and TypeScript support.

    VSCode strongly recommended because it is ready to go and has the best support for TypeScript.

  • A modern web browser with good debugging tools such as Chrome, Firefox, or Edge.

Let's begin

  1. Clone this repository by running git clone https://github.com/DunedinJS/migrating-to-modern-js-typescript.git

  2. cd ./migrating-to-modern-js-typescript

If using NVM to manage Node.js versions you can also run nvm use here to make sure that the correct version is active.

  1. Checkout the 00-original branch by running git checkout 00-original

  2. Make sure to view the readme file for each branch. These contain any further setup instructions and information about each stage.

  3. Explore the code.

Make changes if you'd like. To discard changes before checking out another branch run git reset --hard HEAD.

  1. Checkout the next branch and continue.

Each stage is stored in a different branch

Our starting application. Built on Backbone.js and state of the art from late 2010 to around 2013.

  • Add NPM for package management
  • Remove third-party libraries from repository
  • Add Webpack and TypeScript to compile and bundle modular source code into a single browser-ready script
  • Import third-party libraries as modules
  • Add type definitions for third-party libraries
  • Use TypeScript features in source file
  • Separate all source code into TypeScript modules

About

An example of how to migrate an old JavaScript application to modern syntax, features, and technologies with TypeScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published