Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: experimental websocket support #158

Merged
merged 5 commits into from
Jan 29, 2024
Merged

feat: experimental websocket support #158

merged 5 commits into from
Jan 29, 2024

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jan 29, 2024

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR adds experimental WebSocket support.

The new ws option can be enabled via options or CLI. When set via options and is a function, will be used as normal Node.js upgrade handler.

When is an object, listhen will use crossws API to listen on the hooks.

When is true (set by CLI), listhen dev server will support WebSocket with HMR (using a hooks proxy)

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

codecov bot commented Jan 29, 2024

Codecov Report

Attention: 118 lines in your changes are missing coverage. Please review.

Comparison is base (ebef2d1) 52.19% compared to head (7766a3f) 49.42%.

Files Patch % Lines
playground/index.ts 0.00% 54 Missing ⚠️
src/server/dev.ts 4.34% 44 Missing ⚠️
src/listen.ts 23.52% 13 Missing ⚠️
src/cli.ts 0.00% 5 Missing ⚠️
src/server/watcher.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #158      +/-   ##
==========================================
- Coverage   52.19%   49.42%   -2.78%     
==========================================
  Files          17       17              
  Lines        1686     1819     +133     
  Branches      145      147       +2     
==========================================
+ Hits          880      899      +19     
- Misses        801      915     +114     
  Partials        5        5              

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@pi0 pi0 merged commit 207e882 into main Jan 29, 2024
2 of 4 checks passed
@pi0 pi0 deleted the feat/ws branch January 29, 2024 03:55
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.

None yet

1 participant