Skip to content

docs: clarify step 7 server delivery code snippets#540

Open
vipin8797 wants to merge 1 commit into
socketio:mainfrom
vipin8797:fix/step7-server-delivery-code-clarity
Open

docs: clarify step 7 server delivery code snippets#540
vipin8797 wants to merge 1 commit into
socketio:mainfrom
vipin8797:fix/step7-server-delivery-code-clarity

Conversation

@vipin8797

Copy link
Copy Markdown

What this PR does / why we need it

This PR resolves an issue with the "Step #7 Server delivery" tutorial where the final code snippet was presented as a single combined block without differentiating between CommonJS and ES Modules.

Users using CommonJS encountered a SyntaxError: Unexpected reserved word due to the top-level await because the implicit async function main() wrapper wasn't shown in the snippet. Additionally, the async keyword was added silently without any highlighting, causing confusion.

Changes Made:

  • Split the final combined code block into <Tabs> with cjs and mjs variants, matching the style established in previous tutorial steps.
  • Properly added // highlight-next-line immediately before the io.on('connection', async (socket) and socket.on('chat message', async (msg) lines so students are aware of the newly introduced async keywords.

Fixes #512

Splits the final combined code block into distinct CommonJS and ES Modules tabs for better clarity. Highlights the newly added �sync keyword for io.on and socket.on. Fixes socketio#512.
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

@vipin8797 is attempting to deploy a commit to the SocketIO Team on Vercel.

A member of the Team first needs to authorize it.

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.

Step #7 Server delivery has multiple issues

1 participant