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(http): return WebSocketStream from upgradeWebSocket #16732

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

crowlKats
Copy link
Member

Closes #14064

@lucacasonato
Copy link
Member

The WSS accessor needs to be locked behind --unstable.

@crowlKats
Copy link
Member Author

@lucacasonato done

@bartlomieju bartlomieju added this to the 1.29 milestone Nov 24, 2022
* request.
*
* @category Web Sockets */
export interface WebSocketUpgrade {
Copy link
Member

Choose a reason for hiding this comment

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

It seems this is not used anywhere?

Copy link
Member Author

@crowlKats crowlKats Dec 13, 2022

Choose a reason for hiding this comment

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

it overloads the same named interface as in lib.deno.ns.d.ts

@bartlomieju bartlomieju modified the milestones: 1.29, 1.30 Dec 14, 2022
@sgwilym
Copy link
Contributor

sgwilym commented Jan 12, 2023

Would it be possible to test this API against this issue? #17332

In Deno 1.29.2 WebSocketStream also exhibits this problem of dropping messages/chunks when sending from/to a live server, which seems like a bad thing for a streaming API.

# Conflicts:
#	runtime/ops/runtime.rs
# Conflicts:
#	cli/tsc/dts/lib.deno.unstable.d.ts
#	ext/flash/01_http.js
#	ext/http/01_http.js
#	ext/websocket/02_websocketstream.js
@crowlKats crowlKats changed the title feat: return WebSocketStream from upgradeWebSocket feat: return WebSocketStream from upgradeWebSocket Mar 17, 2023
@crowlKats crowlKats changed the title feat: return WebSocketStream from upgradeWebSocket feat(http): return WebSocketStream from upgradeWebSocket Mar 17, 2023
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Discussed offline, documentation should be updated to reflect that one can use either socket or stream.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

@crowlKats looks good, but I'd like to see a test that verified that either socket or stream can be used

@crowlKats
Copy link
Member Author

@bartlomieju there is a test for that already

Copy link
Collaborator

@aapoalas aapoalas left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@aapoalas aapoalas left a comment

Choose a reason for hiding this comment

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

Needs rebase.

crowlKats and others added 4 commits June 21, 2023 14:44
# Conflicts:
#	ext/flash/01_http.js
#	ext/http/01_http.js
#	ext/websocket/02_websocketstream.js
#	runtime/ops/runtime.rs
@dsherret dsherret removed this from the 1.30 milestone Jul 10, 2024
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.

upgradeWebSocket could return a WebSocketStream
6 participants