department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
281 stars 196 forks source link

Pensions Typescript Work #67688

Open mjknight50 opened 9 months ago

mjknight50 commented 9 months ago

Issue Description

What is Typescript and why should we use it? "TypeScript is a typed superset of JavaScript developed by Microsoft that compiles to plain JavaScript. Unlike JavaScript, TypeScript adds optional static typing and other features like interfaces, generics, and enums to enable stronger tooling and code quality at scale." https://prismic.io/blog/compare-javascript-vs-typescript

To put it in my (Matt) own words, Typescript is what you want to use for enterprise development.

Is Typescript a fad or just some passing technology?

No, Typescript is the default or supported language for most popular frameworks such as Angular, React, Vue.js, NestJs, Next.js, TypeOrm, etc.

According to the annual StackOverflow survey, Typescript is the fourth most popular language. Javascript remains the most popular, but Javascript lacks all of the type safety and features identified previously. Javascript in the wild is a bad idea and will always result in worse code quality.

Solution: [A proof of concept] (https://github.com/mjknight50/vets-website-typescript-poc ) has already been completed. Next steps would be to:

  1. Bring the idea to the VA COP front-end meeting (scheduled for March 2nd at 2:00 EST)

  2. Change the webpack build to allow for Typescript

  3. Incrementally change our vets-website files from .jsx to .tsx

### Tasks
- [ ] https://github.com/department-of-veterans-affairs/va.gov-team/issues/80640
- [ ] https://github.com/department-of-veterans-affairs/va.gov-team/issues/78684
- [ ] https://github.com/department-of-veterans-affairs/va.gov-team/issues/78685
- [ ] https://github.com/department-of-veterans-affairs/va.gov-team/issues/67631
- [ ] https://github.com/department-of-veterans-affairs/va.gov-team/issues/68305
mjknight50 commented 9 months ago

@ToddWebDev If you identify any parts of this you can delegate or bring in others, please let me know.