You are browsing as a guest. Sign up (or log in) to start making projects!

1h 28m 13s logged

Optimized chatting rooms

  • Optimized the Socket.io broadcast events and listeners a lot by using the library’s rooms feature so users viewing different channels will listen to different events
  • Every time you click and view a new channel, you automatically “leave” the original channel room so you no longer receive messages from it (because you’re not viewing the channel despite still being in the channel). You also “join” the new channel and receive its messages because you’re viewing it
  • This took a frustratingly long time to implement and debug because I have to track the currently viewed channel on the frontend and communicate with the backend reliably
  • Added backend revalidation to make the UX of creating new channels smoother
  • The channel you’re currently viewing is now highlighted on the left sidebar of the chat layout
  • Updated types
  • Updated navigation
  • Updated styling
  • Because this is mostly a refactor with minimal feature changes, I’ll just put a screenshot of chatting in a channel
0
7

Comments 0

No comments yet. Be the first!