Skip to content
Snippets Groups Projects

JetBrains: Increase type-safety of JS -> Java bridge

Merged Administrator requested to merge ps/jetbrains-type-safety into main

Created by: philipp-spiess

I saw some unsafe typings and wanted to fix it. Going forward we should probably also encode the expected return type to avoid casting it.

This PR:

  • Changes the Action type to be an enum instead of a loosely typed object.
  • Changes the mock to use an exhaustive switch so that we get a type error when we add a new action that is not implemented (as opposed to a runtime error)

Test plan

  • TS build works
  • Here's an example of the exhaustive switch statement failing: exhaustive test

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Merged by avatar (Apr 30, 2025 12:26pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading