Converting your vanilla Javascript app to TypeScript

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • anvil-ts-upgrade-example

    Example repository for Javascript to TypeScript upgrade blog post

  • This post will go through an example TODO app repo we’ve set up here: https://github.com/anvilco/anvil-ts-upgrade-example. This repo is in plain vanilla Javascript and runs on Node.js and uses Express. There are some basic tests included, but it’s as simple as can be. We will go through a few strategies that one can take when attempting to migrate to using TypeScript from Javascript.

  • bases

    Hosts TSConfigs to extend in a TypeScript app, tuned to a particular runtime environment

  • After installing, we also need to set up a basic tsconfig.json file for how we want tsc to behave with our app. We will use one of the recommended tsconfig files here: https://github.com/tsconfig/bases#centralized-recommendations-for-tsconfig-bases. This contains a list of community recommended configs depending on your app type. We’re using Node 16 and want to be extremely strict on the first pass to clean up any bad code habits and enforce some consistency. We’ll use the one located: https://github.com/tsconfig/bases/blob/main/bases/node16-strictest.combined.json.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • DefinitelyTyped

    The repository for high quality TypeScript type definitions.

  • These error messages tell us how to fix the errors and also point to how parts of the typing system works in TypeScript. Packages can provide typing declarations (with the *.d.ts file extension). These are generated automatically through the tsc compiler. If you have a publicly accessible TypeScript app, you can also provide official typing declarations by submitting a pull request to the DefinitelyTyped repo: https://github.com/DefinitelyTyped/DefinitelyTyped.

  • Nodemon.io

    Monitor for any changes in your node.js application and automatically restart the server - perfect for development

  • Note that you will need to compile your app code every time your entry point needs to be updated. This can be done automatically as you develop with packages such as tsc-watch and nodemon.

  • coffeescript

    Unfancy JavaScript

  • The Javascript language has gone through many updates throughout its long (in internet terms) history. Along with its rapidly changing ecosystem and maturing developer base came attempts to ease some of Javascript’s shortcomings. Of note, one of the more significant attempts was CoffeeScript (initial release in 2009) which adds syntactic sugar and features that make programming easier.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts