Skip to content

Commit

Permalink
Convert nodes.js to TypeScript (#1748)
Browse files Browse the repository at this point in the history
## Summary:
After updating nodes.js to ues ES6 classes in #1747, the move to TypeScript became much more feasible.  While this PR mostly just adds types in a bunch of places, there are some changes to the code itself in order to minimize the number of casts and @ts-expect-errors that were require.  I've tried to keep these kinds of changes to a minimum.

I ended up converting a bunch of function expressions to arrow functions.  Hopefully that doesn't add too much additional overhead when reviewing.  There's still more cleanup that could be done (adding more missing types, converting all `var`s to either `const` or `let`, etc.), but I'm going to leave that for a future PR.

Issue: None

## Test plan:
- yarn test packages/kas/src

Author: kevinb-khan

Reviewers: kevinb-khan, handeyeco, jeremywiebe

Required Reviewers:

Approved By: handeyeco

Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald

Pull Request URL: #1748
  • Loading branch information
kevinb-khan authored Oct 17, 2024
1 parent 81ee69b commit 93bd39b
Show file tree
Hide file tree
Showing 2 changed files with 751 additions and 688 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-pumas-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/kas": patch
---

Convert nodes.js to use TypeScript
Loading

0 comments on commit 93bd39b

Please sign in to comment.