Skip to content

feat(server): support for server.sockWrite#5211

Merged
chenjiahan merged 1 commit intomainfrom
sock_write_0510
May 10, 2025
Merged

feat(server): support for server.sockWrite#5211
chenjiahan merged 1 commit intomainfrom
sock_write_0510

Conversation

@chenjiahan
Copy link
Member

Summary

Added a sockWrite method to the RsbuildDevServer API, enabling middleware to send messages (e.g., 'static-changed') to the HMR client to trigger actions like page reloads.

This is consistent with the sockWrite function in the setupMiddlewares config, and now developers can call it through the JS API.

const rsbuildServer = await rsbuild.createDevServer();
if (someCondition) {
  rsbuildServer.sockWrite('static-changed');
}

Checklist

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

@netlify
Copy link

netlify bot commented May 10, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 65df630
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/681f4935184a240008313741
😎 Deploy Preview https://deploy-preview-5211--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: 76 (🟢 up 5 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (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 site configuration.

@chenjiahan chenjiahan merged commit d133baa into main May 10, 2025
12 checks passed
@chenjiahan chenjiahan deleted the sock_write_0510 branch May 10, 2025 23:20
@chenjiahan chenjiahan mentioned this pull request May 12, 2025
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.

1 participant