Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(comments): update comments module to typescript #2513

Merged
merged 9 commits into from
Aug 21, 2024

Conversation

cdriesler
Copy link
Member

@cdriesler cdriesler commented Jul 17, 2024

⚠️ IMO this PR is exempt from the latest "prioritize PRs over everything else" directive. Review at your leisure and I'll ping when it's getting stale/becomes urgent.
⚠️ The diffs are mad annoying here but I've done my best to keep them legible (git mv etc). The individual commits may be easier to check for specific file changes.

Description & motivation

  • Multi-region looms in the distance, with a mountain of refactor work to be done

Changes:

  • Moves comment module files to .ts
  • Ignored test files and migrations. I'll get them too but they're they failed the pain-priority math

To-do before merge:

  • How does SmartTextEditorValueSchema interact with the string typing on CommentRecord? Looks like a later change that .js didn't care about but .ts does? It appears we want SmartTextEditorValueSchema in all cases now, but there were just enough string references that I wasn't sure.
  • A few queries were not typed (at the gql level) to provide filter args. I defaulted their values to false because that's what the missing values (often written as (...input.filter || {})) would resolve to
  • Several resolvers did not strictly assert that optional/nullable values existed. I opted for non-null assertions here, even though they're icky, instead of throwing errors. This was to limit changes to business logic.

Screenshots:

Validation of changes:

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

References

Copy link

linear bot commented Jul 17, 2024

@cdriesler cdriesler marked this pull request as ready for review July 17, 2024 14:03
@iainsproat
Copy link
Contributor

@cdriesler - this looks good to me. I see you have a bunch of notes in the TODO before merge section, so I'll not approve until that's clear.
Additionally, did you take a look over the tests for this? Are there sufficient tests? (What's the coverage if you run the code coverage report locally?)
Should we port the tests to typescript?

@cdriesler
Copy link
Member Author

@iainsproat multi-region mentioned again today so resurrecting this, TODO's are in order and in line with some style stuff we've decided on since

I do think the tests should be moved to ts as well but will catch that in a future PR?

cc @alemagio if you'd like to pick this up too

alemagio
alemagio previously approved these changes Aug 21, 2024
@cdriesler cdriesler merged commit 79d4e2d into main Aug 21, 2024
22 of 24 checks passed
@cdriesler cdriesler deleted the chuck/web-1283-update-comments-module-to-typescript branch August 21, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants