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

Type out Socket.io in frontend #664

Open
Dammshine opened this issue Jun 24, 2024 · 0 comments
Open

Type out Socket.io in frontend #664

Dammshine opened this issue Jun 24, 2024 · 0 comments
Assignees

Comments

@Dammshine
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The socket.io library used in DevelopmentMode is not being typed out, and violate single responsibility principle require us to refactor every socket related business logic out of that component.

Describe the solution you'd like
We want to have a clear typed definition for the socket in our frontend code, includes

  • For sending out any request, it to have an API defined in our clientSockcet.ts class to do that
  • For receiving any request, I want every ServerToClient request to be a generic object that contains shared type property allow it to further deduce the type, and handle accordingly.
  • We want to lift up all the state in DevelopmentMode to state management tool
  • We want to create a common directory and put type definition for frontend/backend side by side

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

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

When branches are created from issues, their pull requests are automatically linked.

2 participants