Skip to content

refactor(server): introduce message handler registry#6

Open
SyedaAnshrahGillani wants to merge 3 commits into
kirodotdev:mainfrom
SyedaAnshrahGillani:fix/vue-router-dependency
Open

refactor(server): introduce message handler registry#6
SyedaAnshrahGillani wants to merge 3 commits into
kirodotdev:mainfrom
SyedaAnshrahGillani:fix/vue-router-dependency

Conversation

@SyedaAnshrahGillani

Copy link
Copy Markdown

Description:

This pull request refactors the WebSocket message handling on the server to improve modularity and
maintainability.

The previous implementation used a large switch statement in server.ts to handle incoming messages.
This has been replaced with a message handler registry (handlerRegistry.ts) that maps message types to
their corresponding handler functions. This change simplifies the main server.ts file and makes it
easier to add, remove, or modify message handlers in the future.

Changes:

  • server/server.ts: Refactored the message handler to use the new message handler registry.
  • server/handlerRegistry.ts: Added a new file to define the message handler registry.
  • server/handlers/use-skill.ts: Updated the function signature to match the new handler registry.

This refactoring improves the overall code quality of the server and sets a better foundation for
future development.

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.

1 participant