You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like Route Handlers, create a file (something like event.js, message.js or socket.js) like route.js and page.js. This is then injected into the socket's on(message) handler.
Vercel deployment support. Currently, to create a websocket endpoint, we need to create an external server which won't get deployed on Vercel and breaks other optimisations.
Non-Goals
It does not aim to address custom implementation of websocket. Meaning, if we choose to implement the feature with Socket.io, then the user does not have control over changing this implementation.
Background
I feel this is a necessary feature because:
There are many blogs about creating a websocket endpoint. But these implementations are crude and not standardised.
Ease of implementing realtime data transfer needs like a chat application.
With the current method of implementation, one needs to create a separate server.
These implementations have few drawbacks like:
Bad DX
Loss of optimisation that Next JS provides.
Unable to deploy application on Vercel.
Proposal
This feature can be implemented by:
Adding WS feature into the native node JS server and exposing it in Dev and Production builds.
Compiling and bundling the WS message code into the native Node JS server.
I'm not really sure if anything else needs to be changed on Vercel but I would love to work on this and see where it takes us
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Goals
Non-Goals
Background
I feel this is a necessary feature because:
With the current method of implementation, one needs to create a separate server.
These implementations have few drawbacks like:
Proposal
This feature can be implemented by:
I'm not really sure if anything else needs to be changed on Vercel but I would love to work on this and see where it takes us
Beta Was this translation helpful? Give feedback.
All reactions