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(ws): Make WebSocket adapter more changeable #3531

Merged
merged 9 commits into from
Oct 25, 2024

Conversation

nakasyou
Copy link
Contributor

Closes #3468. And also related to #3005 and #3466.

In the PR, I added defineWebSocketHelper function and WSContext class.
We can change WebSocket helper interface easier than before merge this.

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

Copy link

codecov bot commented Oct 19, 2024

Codecov Report

Attention: Patch coverage is 95.37037% with 5 lines in your changes missing coverage. Please review.

Project coverage is 94.74%. Comparing base (f8664b0) to head (a7717df).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/adapter/cloudflare-workers/websocket.ts 87.80% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3531      +/-   ##
==========================================
+ Coverage   94.30%   94.74%   +0.44%     
==========================================
  Files         157      157              
  Lines        9488     9522      +34     
  Branches     2773     2801      +28     
==========================================
+ Hits         8948     9022      +74     
+ Misses        540      500      -40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nakasyou
Copy link
Contributor Author

Hi @yusukebe, what do you think about this? I think it helps #3466.

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

LGTM!

@yusukebe
Copy link
Member

Hi @nakasyou

Awesome! This is a good feature and refactors things, and the code is clean. I'll merge this now and include it into a patch release since this change does not introduce a new feature for the WebSocket feature for Bun/Deno/Workers adapters, which is facing the users. Thank you so much!

@yusukebe yusukebe merged commit 234b083 into honojs:main Oct 25, 2024
16 checks passed
@nakasyou nakasyou deleted the feat/define-ws-helper branch October 25, 2024 12:04
TinsFox pushed a commit to TinsFox/hono that referenced this pull request Oct 28, 2024
* feat(ws): Make WebSocket adapter more changeable

* lint

* format code

* test: add tests

* format code

* lint:fix

* format code

* test: add more tests
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.

Make WebSocket adapter more changeable
3 participants