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

Add gloo-net crate #191

Merged
merged 37 commits into from
Feb 16, 2022
Merged

Add gloo-net crate #191

merged 37 commits into from
Feb 16, 2022

Conversation

ranile
Copy link
Collaborator

@ranile ranile commented Feb 15, 2022

This PR adds a new crate, gloo-net, which has been missing for quite a while. This is done by merging my crate, reqwasm into gloo as gloo-net.

Unlike the last crate introduced in #180, I was able to keep the git history intact. I learnt that it was possible only recently. I apologize to all the contributors who had their history lost as part of merge done in #180

Fixes #4
Fixes #49
Closes #113
Supersedes #188

Allows following to move forward:

ranile and others added 30 commits January 14, 2021 21:29
* redo websockets

* docs + tests

* remove gloo-console

* fix CI

* Add getters for the underlying WebSocket fields

* better API

* better API part 2 electric boogaloo
* Update to Rust 2021 and use JsError from gloo-utils

* use new toolchain
When the WebSocket is used with frameworks, passed down as props, it might be `drop`ed automatically, which closes the WebSocket connection. Initially `Clone` was added so sender and receiver can be in different `spawn_local`s but it turns out that `StreamExt::split` solves that problem very well.

See #13 for more information about the issue
)

* feat: feature gate json support

* feat: feature gate weboscket api

* ci: check websocket and json features seperately in CI, check no default features

* feat: feature gate the http API

* refactor: use futures-core and futures-sink instead of depending on whole of futures

* ci: test http feature seperately in CI

* fix: only compile error conversion funcs if either APIs are enabled

* fix: add futures to dev-deps for tests, fix doc test
* Change edition from 2021 to 2018

* Fix missing import due to edition 2021 prelude
We no longer need a multi-producer-multi-consumer channel. There's only one consumer as of ranile/reqwasm@445e9a5
The websocket specification guarantees that messages are received in the
same order they are sent. The implementation in this library can violate
this guarantee because messages are parsed in a spawn_local block before
being sent over the channel. When multiple messages are received before
the next executor tick the scheduling order of the futures is
unspecified.
We fix this by performing all operations synchronously. The only part
where async is needed is the conversion of Blob to ArrayBuffer which we
obsolete by setting the websocket to always receive binary data as
ArrayBuffer.
…oo-reqwasm

This merge is done to move reqwasm crate to gloo. This puts reqwasm
under the gloo umbrella.

See #188 (comment)
for need of this merge.
@ranile ranile force-pushed the gloo-reqwasm branch 2 times, most recently from 64453ba to 1832554 Compare February 15, 2022 14:21
@ranile ranile mentioned this pull request Feb 15, 2022
@ranile ranile merged commit 65fcda7 into master Feb 16, 2022
ranile added a commit to ranile/reqwasm that referenced this pull request Mar 11, 2022
See the updated README for future plans.

All the code from reqwasm was was moved to gloo as part of rustwasm/gloo#191. Move to gloo-net should be a drop-in replacement for reqwasm users
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.

A new Websocket type and crate. utility crate: fetch and making HTTP requests
6 participants