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

Implement WebSocket API #7051

Merged
merged 56 commits into from
Sep 5, 2020
Merged

Implement WebSocket API #7051

merged 56 commits into from
Sep 5, 2020

Conversation

crowlKats
Copy link
Member

Closes #3539.

Currently most tests dont work. Not sure how to run the websocket server simulatenously. some borrowmuterrors in some places and possible case of missing RID in eventloop when closing.

@crowlKats
Copy link
Member Author

Currently all tests related to connecting will fail because there are leaking async ops

Cargo.lock Outdated Show resolved Hide resolved
cli/ops/websocket.rs Outdated Show resolved Hide resolved
cli/rt/27_websocket.js Outdated Show resolved Hide resolved
cli/ops/websocket.rs Outdated Show resolved Hide resolved
cli/ops/websocket.rs Outdated Show resolved Hide resolved
@crowlKats
Copy link
Member Author

crowlKats commented Aug 17, 2020

Problem right now is leaking resources (expected) & leaking async ops.
About the leaking resources: we should implement https://html.spec.whatwg.org/multipage/web-sockets.html#make-disappear, but not sure where that would go.
About the leaking async ops, i have no clue what is going on there...
mostly fixed

@lucacasonato lucacasonato added cli related to cli/ dir feat new feature (which has been agreed to/accepted) web related to Web APIs labels Aug 31, 2020
interface CloseEvent extends Event {
/**
* Returns the WebSocket connection close code provided by the server.
*/
Copy link
Member

@ry ry Sep 1, 2020

Choose a reason for hiding this comment

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

nit: These could probably be made into single line doc comments

nevermind - I think these were copied directly from dom.d.ts

Copy link
Member Author

Choose a reason for hiding this comment

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

yea they were

cli/ops/websocket.rs Outdated Show resolved Hide resolved
this.origin = eventInitDict?.origin ?? "";
this.lastEventId = eventInitDict?.lastEventId ?? "";
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to move the MessageEvent in a separate PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

i could if you want, but i dont see all that much point to it

promise.resolve();
};
await promise;
});
Copy link
Member

Choose a reason for hiding this comment

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

Very nice - thanks @lucacasonato for ridding us of openssl

@ry
Copy link
Member

ry commented Sep 4, 2020

Is this patch ready to land?

# Conflicts:
#	cli/Cargo.toml
#	cli/build.rs
@crowlKats
Copy link
Member Author

@ry yes

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM - huge contribution @crowlKats - many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli related to cli/ dir feat new feature (which has been agreed to/accepted) web related to Web APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement WebSocket client
5 participants