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

Migrate to Edition 2021 #360

Merged
merged 6 commits into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ on:

jobs:
native_tests:
strategy:
fail-fast: false
matrix:
rust-version: [1.64, stable, nightly]
name: Native Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
toolchain: ${{ matrix.rust-version }}

- uses: actions/cache@v3
with:
Expand All @@ -30,13 +34,17 @@ jobs:
run: cargo test --workspace --exclude gloo-net

browser_tests:
strategy:
fail-fast: false
matrix:
rust-version: [1.64, stable, nightly]
name: Browser Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
toolchain: ${{ matrix.rust-version }}
target: wasm32-unknown-unknown

- name: Install wasm-pack
Expand Down Expand Up @@ -73,13 +81,17 @@ jobs:
done

node_tests:
strategy:
fail-fast: false
matrix:
rust-version: [1.64, stable, nightly]
name: Node Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
toolchain: ${{ matrix.rust-version }}
target: wasm32-unknown-unknown

- name: Install wasm-pack
Expand Down Expand Up @@ -115,11 +127,12 @@ jobs:
matrix:
# example: [ markdown, prime ]
example: [ markdown ]
rust-version: [1.64, stable, nightly]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
toolchain: ${{ matrix.rust-version }}
target: wasm32-unknown-unknown

- name: Install wasm-pack
Expand Down Expand Up @@ -156,6 +169,10 @@ jobs:


test-net:
strategy:
fail-fast: false
matrix:
rust-version: [1.64, stable, nightly]
name: Test gloo-net
runs-on: ubuntu-latest
services:
Expand Down Expand Up @@ -200,7 +217,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
toolchain: ${{ matrix.rust-version }}
target: wasm32-unknown-unknown

- name: Run native tests
Expand Down
53 changes: 41 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## `console`

### Next Version

- Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360)

### Version "0.2.3"

- Release new gloo versions
Expand All @@ -21,19 +25,24 @@

### Version "0.1.0"

- Add an `dbg!` equivalent to `gloo-console` (#158)
- Add an `dbg!` equivalent to `gloo-console` (#158)
- Fix dir, dirxml macros in gloo-console (#154)
- Finishing touches


## `dialogs`

### Version "0.1.0"
### Next Version

- Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360)

### Version "0.1.0"

## `events`

### Next Version

- Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360)

### Version "0.1.1"

- Add implementation for rfc-1 (files)
Expand Down Expand Up @@ -67,9 +76,12 @@
- Renaming A parameter to S
- Fixing all the issues with gloo-events


## `file`

### Next Version

- Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360)

### Version "0.2.2"

- [rfc] Implement an ObjectUrl wrapper (#231)
Expand All @@ -90,12 +102,15 @@
- Adding README for gloo-file
- Fixing Cargo.toml for gloo-file


## `history`

### Next Version

- Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360)

### Version 0.1.4

- Use thread_local!'s lazy initialization instead of RefCell<Option<_>> (#358)
- Use `thread_local!`'s lazy initialization instead of `RefCell<Option<_>>` (#358)
- Fix required feature set of serde dependency (#357)

### Version "0.1.3"
Expand Down Expand Up @@ -124,9 +139,12 @@
- Memory-based History (#178)
- Hash-based History type & Unified Location. (#177)


## `net`

### Next Version

- Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360)

### Version "0.3.1"

- export RequestBuilder and ResponseBuilder as public
Expand Down Expand Up @@ -186,15 +204,20 @@
- add `json()` impl to `Request` (#204)
- Improve the Fetch API (#188)


## `render`

### Version "0.1.0"
### Next Version

- Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360)

### Version "0.1.0"

## `storage`

### Next Version

- Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360)

### Version "0.2.1"

- fix: Break dependency cycle by not using serde-serialize (#239)
Expand All @@ -208,9 +231,12 @@

- Utility crate for common `web_sys`/`js_sys` features (#155)


## `timers`

### Next Version

- Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360)

### Version "0.2.5"

- fix: `clearTimeout` illegal invocation with bundler (#187) (#283)
Expand Down Expand Up @@ -275,9 +301,12 @@
- Split up callback and future/stream APIs.
- timers: Fix author line in Cargo.toml


## `utils`

### Next Version

- Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360)

### Version "0.1.6"

- Update json.rs fix typo (#338)
Expand Down Expand Up @@ -312,11 +341,11 @@

- utils: Add body() and document_element() getters (#161)


## `worker`

### Next Version

- Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360)
- Add Worker Loader (#349)

### Version 0.3.0
Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Rust and WebAssembly Working Group"]
description = "A modular toolkit for Rust and WebAssembly"
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
name = "gloo"
readme = "README.md"
Expand All @@ -10,6 +10,7 @@ repository = "https://github.com/rustwasm/gloo"
homepage = "https://gloo-rs.web.app/"
documentation = "https://docs.rs/gloo/"
categories = ["api-bindings", "wasm"]
rust-version = "1.64"

[dependencies]
gloo-timers = { version = "0.2", path = "crates/timers", optional = true }
Expand Down Expand Up @@ -44,7 +45,7 @@ futures = [
"worker",
"gloo-timers/futures",
"gloo-file/futures",
"gloo-worker/futures"
"gloo-worker/futures",
]
timers = ["gloo-timers"]
events = ["gloo-events"]
Expand Down
8 changes: 3 additions & 5 deletions crates/console/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ name = "gloo-console"
description = "Convenience crate for working with browser's console"
version = "0.2.3"
authors = ["Rust and WebAssembly Working Group"]
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/rustwasm/gloo/tree/master/crates/console"
homepage = "https://github.com/rustwasm/gloo"
documentation = "https://docs.rs/gloo-console/"
categories = ["api-bindings", "development-tools::profiling", "wasm"]
rust-version = "1.64"

[dependencies]
wasm-bindgen = "0.2"
Expand All @@ -18,10 +19,7 @@ serde = { version = "1", features = ["derive"] }
gloo-utils = { version = "0.1", path = "../utils", features = ["serde"] }
[dependencies.web-sys]
version = "0.3"
features = [
"console",
"Document"
]
features = ["console", "Document"]

[dev-dependencies]
wasm-bindgen-test = "0.3.4"
Expand Down
7 changes: 3 additions & 4 deletions crates/dialogs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ name = "gloo-dialogs"
description = "Convenience crate for working with dialogs in browser"
version = "0.1.1"
authors = ["Rust and WebAssembly Working Group"]
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/rustwasm/gloo/tree/master/crates/dialogs"
homepage = "https://github.com/rustwasm/gloo"
categories = ["api-bindings", "asynchronous", "wasm"]
rust-version = "1.64"

[dependencies]
wasm-bindgen = "0.2"

[dependencies.web-sys]
version = "0.3"
features = [
"Window"
]
features = ["Window"]
9 changes: 3 additions & 6 deletions crates/events/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@ name = "gloo-events"
description = "Convenience crate for working with DOM event listeners"
version = "0.1.2"
authors = ["Rust and WebAssembly Working Group"]
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/rustwasm/gloo/tree/master/crates/events"
homepage = "https://github.com/rustwasm/gloo"
categories = ["api-bindings", "asynchronous", "web-programming", "wasm"]
rust-version = "1.64"

[dependencies]
wasm-bindgen = "0.2"

[dependencies.web-sys]
version = "0.3.31"
features = [
"Event",
"EventTarget",
"AddEventListenerOptions",
]
features = ["Event", "EventTarget", "AddEventListenerOptions"]

[dev-dependencies]
js-sys = "0.3.31"
Expand Down
10 changes: 2 additions & 8 deletions crates/events/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ use web_sys::{AddEventListenerOptions, Event, EventTarget};
/// EventListenerPhase::Bubble
/// # ;
/// ```
#[derive(Debug, Clone, Copy)]
#[derive(Default, Debug, Clone, Copy)]
pub enum EventListenerPhase {
#[default]
#[allow(missing_docs)]
Bubble,

Expand All @@ -47,13 +48,6 @@ impl EventListenerPhase {
}
}

impl Default for EventListenerPhase {
#[inline]
fn default() -> Self {
EventListenerPhase::Bubble
}
}

/// Specifies options for [`EventListener::new_with_options`](struct.EventListener.html#method.new_with_options) and
/// [`EventListener::once_with_options`](struct.EventListener.html#method.once_with_options).
///
Expand Down
3 changes: 2 additions & 1 deletion crates/file/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ name = "gloo-file"
description = "Convenience crate for working with JavaScript files and blobs"
version = "0.2.3"
authors = ["Rust and WebAssembly Working Group"]
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/rustwasm/gloo/tree/master/crates/file"
homepage = "https://github.com/rustwasm/gloo"
categories = ["api-bindings", "asynchronous", "wasm"]
rust-version = "1.64"

[package.metadata.docs.rs]
features = ["futures"]
Expand Down
Loading