Migrating a 10,000-line legacy JavaScript codebase to TypeScript
I curious how using Typescript makes the project more "structured" compared to using plain JS.<p>Typescript just gives you static types and classes. I can understand "classes" make the code more modular and thereby more structured, but can't you already do that using ES5 "class"? Types help in catching errors early and can help in documenting the interface of the methods etc.<p>Also, if the other problem was isolating the scope of modules and dependency injection, it could be easily done using Requirejs and all the modules could be concatenated during build time. Webpack is a cool tool, but given the nature of its documentation, the maintenance would be really costly in the long run. Requirejs is just more established and satisfies all the author's requirements.<p>It would've been really helpful if the author had included additional reasoning behind the choices made.