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

refactor(routerlicious): use strictNullChecks #23054

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

znewton
Copy link
Contributor

@znewton znewton commented Nov 11, 2024

Description

Setting TSConfig strictNullChecks: true can help avoid numerous runtime errors by catching unhandled null/undefined cases at compiletime. R11s has had this disabled for a very long time, and the code has not handled nulls very well because of it.

This PR

Breaking Changes

Many types now have | null or | undefined added to reflect the actual, implemented return/param values. Behavior should not be changing, but types are.

Reviewer Guidance

This ended up being a large PR. I tried to keep the changes focused purely to handling undefined and null explicitly. This ended up requiring that I add a lot of | null and eslint-ignore-next-line @rushstack/no-new-null. These should be switched to | undefined with explicit conversion of null -> undefined where needed, but I did not want to rock the boat too much.

@github-actions github-actions bot added area: server Server related issues (routerlicious) public api change Changes to a public API base: main PRs targeted against main branch labels Nov 11, 2024
@frankmueller-msft frankmueller-msft requested review from Copilot and removed request for Copilot November 12, 2024 18:59

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 109 out of 124 changed files in this pull request and generated no suggestions.

Files not reviewed (15)
  • server/routerlicious/packages/gitresources/tsconfig.json: Language not supported
  • server/routerlicious/packages/kafka-orderer/tsconfig.json: Language not supported
  • server/routerlicious/packages/lambdas-driver/tsconfig.json: Language not supported
  • server/routerlicious/packages/local-server/tsconfig.json: Language not supported
  • server/routerlicious/packages/memory-orderer/tsconfig.json: Language not supported
  • server/routerlicious/packages/protocol-base/tsconfig.json: Language not supported
  • server/routerlicious/packages/routerlicious-base/package.json: Language not supported
  • server/routerlicious/packages/lambdas-driver/src/test/types/validateServerLambdasDriverPrevious.generated.ts: Evaluated as low risk
  • server/routerlicious/packages/routerlicious-base/src/alfred/routes/api/documents.ts: Evaluated as low risk
  • server/routerlicious/packages/routerlicious-base/src/alfred/routes/api/deltas.ts: Evaluated as low risk
  • server/routerlicious/packages/lambdas-driver/src/document-router/lambdaFactory.ts: Evaluated as low risk
  • server/routerlicious/packages/memory-orderer/src/localOrderManager.ts: Evaluated as low risk
  • server/routerlicious/packages/routerlicious-base/src/alfred/routes/api/api.ts: Evaluated as low risk
  • server/routerlicious/packages/memory-orderer/src/reservationManager.ts: Evaluated as low risk
  • server/routerlicious/packages/memory-orderer/src/nodeManager.ts: Evaluated as low risk

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: server Server related issues (routerlicious) base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant