Skip to content

Commit f2d38a0

Browse files
committed
gloo-specific patches
1 parent 752e5b6 commit f2d38a0

File tree

6 files changed

+84
-164
lines changed

6 files changed

+84
-164
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 145 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,59 @@ jobs:
6363
- name: Run tests
6464
run: |
6565
for x in $(ls crates); do
66+
# gloo-net is tested separately
67+
if [[ "$example" == "gloo-net" ]]; then
68+
continue
69+
fi
6670
wasm-pack test --headless --firefox --chrome crates/$x --all-features
6771
wasm-pack test --headless --firefox --chrome crates/$x --no-default-features
6872
done
73+
74+
test-net:
75+
name: Test gloo-net
76+
runs-on: ubuntu-latest
77+
services:
78+
httpbin:
79+
image: kennethreitz/httpbin@sha256:599fe5e5073102dbb0ee3dbb65f049dab44fa9fc251f6835c9990f8fb196a72b
80+
ports:
81+
- 8080:80
82+
echo_server:
83+
image: jmalloc/echo-server@sha256:c461e7e54d947a8777413aaf9c624b4ad1f1bac5d8272475da859ae82c1abd7d
84+
ports:
85+
- 8081:8080
86+
87+
steps:
88+
- uses: actions/checkout@v2
89+
- uses: actions-rs/toolchain@v1
90+
with:
91+
toolchain: stable
92+
profile: minimal
93+
components: clippy
94+
target: wasm32-unknown-unknown
95+
96+
- name: Install wasm-pack
97+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
98+
99+
- uses: actions/cache@v2
100+
with:
101+
path: |
102+
~/.cargo/registry
103+
~/.cargo/git
104+
target
105+
key: cargo-${{ runner.os }}-test-${{ hashFiles('**/Cargo.toml') }}
106+
restore-keys: |
107+
cargo-${{ runner.os }}-test-
108+
cargo-${{ runner.os }}-
109+
- name: Run browser tests
110+
env:
111+
HTTPBIN_URL: "http://localhost:8080"
112+
ECHO_SERVER_URL: "ws://localhost:8081"
113+
run: wasm-pack test --chrome --firefox --headless
114+
115+
- name: Run browser tests
116+
env:
117+
HTTPBIN_URL: "http://localhost:8080"
118+
ECHO_SERVER_URL: "ws://localhost:8081"
119+
uses: actions-rs/cargo@v1
120+
with:
121+
command: test

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ members = [
4141
"crates/utils",
4242
"crates/history",
4343
"crates/worker",
44+
"crates/net",
4445
]

crates/net/Cargo.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
[package]
2-
name = "reqwasm"
3-
version = "0.4.1"
4-
authors = ["Hamza <[email protected]>"]
2+
name = "gloo-net"
3+
version = "0.1.0"
4+
authors = ["Rust and WebAssembly Working Group", "Muhammad Hamza <[email protected]>"]
55
edition = "2018"
66
license = "MIT OR Apache-2.0"
77
repository = "https://github.com/hamza1311/reqwasm"
88
description = "HTTP requests library for WASM Apps"
99
readme = "README.md"
1010
keywords = ["requests", "http", "wasm", "websockets"]
1111
categories = ["wasm", "web-programming::http-client", "api-bindings"]
12-
exclude = [
13-
".idea",
14-
]
1512

1613
[package.metadata.docs.rs]
1714
all-features = true
@@ -20,7 +17,7 @@ all-features = true
2017
wasm-bindgen = "0.2"
2118
web-sys = "0.3"
2219
js-sys = "0.3"
23-
gloo-utils = "0.1.0"
20+
gloo-utils = { version = "0.1", path = "../utils" }
2421

2522
wasm-bindgen-futures = "0.4"
2623
futures-core = { version = "0.3", optional = true }

crates/net/README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1-
# Reqwasm
1+
<div align="center">
22

3-
[![crates.io](https://img.shields.io/crates/v/reqwasm.svg?style=flat)](https://crates.io/crates/reqwasm)
4-
[![docs.rs](https://img.shields.io/docsrs/reqwasm)](https://docs.rs/reqwasm/)
5-
![licence](https://img.shields.io/crates/l/reqwasm)
3+
<h1><code>gloo-net</code></h1>
4+
5+
<p>
6+
<a href="https://crates.io/crates/gloo-net"><img src="https://img.shields.io/crates/v/gloo-net.svg?style=flat-square" alt="Crates.io version" /></a>
7+
<a href="https://crates.io/crates/gloo-net"><img src="https://img.shields.io/crates/d/gloo-net.svg?style=flat-square" alt="Download" /></a>
8+
<a href="https://docs.rs/gloo-net"><img src="https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square" alt="docs.rs docs" /></a>
9+
</p>
10+
11+
<h3>
12+
<a href="https://docs.rs/gloo-net">API Docs</a>
13+
<span> | </span>
14+
<a href="https://github.com/rustwasm/gloo/blob/master/CONTRIBUTING.md">Contributing</a>
15+
<span> | </span>
16+
<a href="https://discordapp.com/channels/442252698964721669/443151097398296587">Chat</a>
17+
</h3>
18+
19+
<sub>Built with 🦀🕸 by <a href="https://rustwasm.github.io/">The Rust and WebAssembly Working Group</a></sub>
20+
</div>
621

722
HTTP requests library for WASM Apps. It provides idiomatic Rust bindings for the `web_sys` `fetch` and `WebSocket` API
823

@@ -40,6 +55,3 @@ spawn_local(async move {
4055
console_log!("WebSocket Closed")
4156
})
4257
```
43-
## Contributions
44-
45-
Your PRs and Issues are welcome. Note that all the contribution submitted by you, shall be licensed as MIT or APACHE 2.0 at your choice, without any additional terms or conditions.

website/src/pages/__index.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ as [API documentation](https://docs.rs/gloo/).
99
2. [`dialog`](https://crates.io/crates/gloo-dialog)
1010
3. [`event`](https://crates.io/crates/gloo-event)
1111
4. [`file`](https://crates.io/crates/gloo-file)
12-
4. [`history`](https://crates.io/crates/gloo-history)
13-
5. [`storage`](https://crates.io/crates/gloo-storage)
14-
6. [`timer`](https://crates.io/crates/gloo-timer)
15-
6. [`utils`](https://crates.io/crates/gloo-utils)
16-
6. [`worker`](https://crates.io/crates/gloo-worker)
12+
5. [`history`](https://crates.io/crates/gloo-history)
13+
6. [`net`](https://crates.io/crates/gloo-net)
14+
7. [`render`](https://crates.io/crates/gloo-render)
15+
8. [`storage`](https://crates.io/crates/gloo-storage)
16+
9. [`timer`](https://crates.io/crates/gloo-timer)
17+
10. [`utils`](https://crates.io/crates/gloo-utils)
18+
11. [`worker`](https://crates.io/crates/gloo-worker)
1719

1820
## Using Gloo
1921

0 commit comments

Comments
 (0)