Skip to content

refactor: rename connection to socket for clarity#5850

Merged
chenjiahan merged 2 commits intomainfrom
rename_socket_0815
Aug 15, 2025
Merged

refactor: rename connection to socket for clarity#5850
chenjiahan merged 2 commits intomainfrom
rename_socket_0815

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

The variable 'connection' was renamed to 'socket' to better reflect its purpose and improve code readability. This change affects both server and client WebSocket implementations.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings August 15, 2025 05:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors WebSocket-related code by renaming the variable 'connection' to 'socket' throughout both server and client implementations to improve code clarity and better reflect the variable's purpose.

  • Renamed 'connection' parameter to 'socket' in server-side WebSocket handling methods
  • Updated all references from 'connection' to 'socket' in client-side WebSocket code
  • Improved readyState comparison by using named constant instead of magic number

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/core/src/server/socketServer.ts Renamed connection parameter to socket in onConnect and send methods, eliminated intermediate variable assignment
packages/core/src/client/hmr.ts Renamed global connection variable to socket and updated all references throughout WebSocket event handlers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@netlify
Copy link
Copy Markdown

netlify bot commented Aug 15, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit e1c4c44
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/689ec5f2bb8f620007a46b46
😎 Deploy Preview https://deploy-preview-5850--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 80 (🟢 up 9 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@chenjiahan chenjiahan merged commit da438c6 into main Aug 15, 2025
12 checks passed
@chenjiahan chenjiahan deleted the rename_socket_0815 branch August 15, 2025 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants