openculinary / frontend

The RecipeRadar Frontend is a recipe search and meal planning application
GNU Affero General Public License v3.0
13 stars 2 forks source link

Continue and complete migration of the core application codebase to TypeScript #203

Closed jayaddison closed 3 years ago

jayaddison commented 3 years ago

Describe the reason for these changes and the problem that they solve

TypeScript can provide some useful guardrails during JavaScript application development, mainly by way of typechecking.

We began migrating some of the RecipeRadar application codebase to TypeScript in July last year as part of the migration to the dexie.js database library.

This changeset continues and completes the migration.

Briefly summarize the changes

  1. Migrate all JavaScript code under the src/app to TypeScript
  2. Update eslint configuration to apply TypeScript linting rules

How have the changes been tested?

  1. Existing test coverage continues to pass
  2. Local development testing

During QA, only one minor (non-blocking) behaviour difference was discovered: there is now an alphabetical sorting of shopping list categories, as opposed to the previously-existing insertion-order-defined sorting.

List any issues that this change relates to Resolves #161.

jayaddison commented 3 years ago

It'd be nice to remove allowJs from the tsconfig.json along with this changeset as a kind of 'confirmation of completeness'. We can't do that quite yet - there is at least one dependency upon it, and that's for a forked d3-sankey dependency (which doesn't have a minified distribution package, so we import it 'from source').

Even despite that, and even if we hit some minor issues as a result, this seems solid enough to roll forward with.