oncall icon indicating copy to clipboard operation
oncall copied to clipboard

Improve type-safety: use autogenerated types across frontend codebase (part 1)

Open brojd opened this issue 2 years ago • 0 comments

Part 1 of using autogenerated types, we should cover here alert groups, integrations and users

Acceptance criteria

  • frontend has additional layer for making HTTP requests
  • every HTTP request goes through this layer (e.g. prevent calling makeRequest directly from components or MobX stores)
  • in this layer every HTTP request and response is typed using types imported from files generated as a part of https://github.com/grafana/oncall/issues/3330
  • any other frontend code make use of generated types instead of custom types (e.g. use enum from generated types instead of manual string etc.)

Outcome

  • better type-safety in code
  • being able to catch type errors during development before they reach prod (shift left)
  • better developer experience thanks to increased number of type declarations and improved intellisense

brojd avatar Nov 13 '23 08:11 brojd