Skip to content

Commit 90d05cc

Browse files
authored
Merge pull request #81 from ealmloff/0.7
Bump dioxus version
2 parents 5a79ae3 + 8c868ac commit 90d05cc

File tree

16 files changed

+94
-55
lines changed

16 files changed

+94
-55
lines changed

.github/workflows/rust.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
paths:
88
- packages/**
99
- examples/**
10-
10+
1111
pull_request:
1212
types: [opened, synchronize, reopened, ready_for_review]
1313
branches:
@@ -22,22 +22,22 @@ env:
2222
jobs:
2323
# Rust fmt
2424
fmt:
25-
if: github.event.pull_request.draft == false
26-
name: Rustfmt
27-
runs-on: ubuntu-latest
28-
steps:
29-
- uses: dtolnay/rust-toolchain@stable
30-
- uses: Swatinem/rust-cache@v2
31-
- run: rustup component add rustfmt
32-
- uses: actions/checkout@v3
33-
- run: cargo fmt --all -- --check
25+
if: github.event.pull_request.draft == false
26+
name: Rustfmt
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: dtolnay/rust-toolchain@1.90.0
30+
- uses: Swatinem/rust-cache@v2
31+
- run: rustup component add rustfmt
32+
- uses: actions/checkout@v3
33+
- run: cargo fmt --all -- --check
3434
# Clippy
3535
clippy:
3636
if: github.event.pull_request.draft == false
3737
name: Clippy
3838
runs-on: windows-latest
3939
steps:
40-
- uses: dtolnay/rust-toolchain@stable
40+
- uses: dtolnay/rust-toolchain@1.90.0
4141
- uses: Swatinem/rust-cache@v2
4242
- run: rustup target add wasm32-unknown-unknown
4343
- run: rustup component add clippy

.github/workflows/testing.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
paths:
99
- packages/**
1010
- examples/**
11-
11+
1212
pull_request:
1313
types: [opened, synchronize, reopened, ready_for_review]
1414
branches:
@@ -26,17 +26,19 @@ jobs:
2626
name: WASM
2727
runs-on: ubuntu-latest
2828
steps:
29+
- uses: dtolnay/[email protected]
2930
- uses: actions/checkout@v3
3031
- run: rustup target add wasm32-unknown-unknown
3132
- uses: Swatinem/rust-cache@v2
3233
- run: cargo build --all-targets --workspace --exclude *-example --verbose --target wasm32-unknown-unknown --all-features
3334
# need to run tests here
34-
35+
3536
desktop:
3637
if: github.event.pull_request.draft == false
3738
name: Desktop
3839
runs-on: windows-latest
3940
steps:
41+
- uses: dtolnay/[email protected]
4042
- uses: actions/checkout@v3
4143
- uses: Swatinem/rust-cache@v2
4244
- run: cargo build --all-targets --workspace --verbose --all-features

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ package.repository = "https://github.com/DioxusLabs/sdk/"
1616

1717
[workspace.dependencies]
1818
# Workspace
19-
dioxus-sdk = { path = "packages/sdk", version = "0.7.0-alpha.1" }
20-
dioxus-time = { path = "packages/time", version = "0.1.0-alpha.1" }
21-
dioxus_storage = { path = "packages/storage", version = "0.1.0-alpha.1" }
22-
dioxus-geolocation = { path = "packages/geolocation", version = "0.1.0-alpha.1" }
23-
dioxus-notification = { path = "packages/notification", version = "0.1.0-alpha.1" }
24-
dioxus-sync = { path = "packages/sync", version = "0.1.0-alpha.1" }
25-
dioxus-util = { path = "packages/util", version = "0.1.0-alpha.1" }
26-
dioxus-window = { path = "packages/window", version = "0.1.0-alpha.1" }
19+
dioxus-sdk = { path = "packages/sdk", version = "0.7.0" }
20+
dioxus-time = { path = "packages/time", version = "0.7.0" }
21+
dioxus_storage = { path = "packages/storage", version = "0.7.0" }
22+
dioxus-geolocation = { path = "packages/geolocation", version = "0.7.0" }
23+
dioxus-notification = { path = "packages/notification", version = "0.7.0" }
24+
dioxus-sync = { path = "packages/sync", version = "0.7.0" }
25+
dioxus-util = { path = "packages/util", version = "0.7.0" }
26+
dioxus-window = { path = "packages/window", version = "0.7.0" }
2727

2828
# Dioxus
2929
dioxus = "0.7.0"

packages/geolocation/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dioxus-geolocation"
3-
version = "0.1.0-alpha.1"
3+
version = "0.7.0"
44

55
description = "Geolocation utilities and hooks for Dioxus."
66
readme = "./README.md"

packages/geolocation/src/core.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ pub enum Error {
9292
AccessDenied,
9393
Poisoned,
9494
DeviceError(String),
95+
Unsupported,
9596
}
9697

9798
impl std::error::Error for Error {}
@@ -104,6 +105,7 @@ impl fmt::Display for Error {
104105
}
105106
Error::Poisoned => write!(f, "the internal read/write lock has been poisioned"),
106107
Error::DeviceError(e) => write!(f, "a device error has occurred: {}", e),
108+
Error::Unsupported => write!(f, "the current platform is not supported"),
107109
}
108110
}
109111
}

packages/geolocation/src/lib.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
//! Interact with location services.
1+
#![allow(clippy::collapsible_if)]
22

3-
cfg_if::cfg_if! {
4-
if #[cfg(any(windows, target_family = "wasm"))] {
5-
pub mod core;
6-
pub mod platform;
7-
pub mod use_geolocation;
8-
pub use self::core::*;
9-
pub use self::use_geolocation::*;
10-
}
3+
//! Interact with location services.
114
12-
else {
13-
compile_error!("the `geolocation` feature is only available on wasm and windows targets");
14-
}
15-
}
5+
pub mod core;
6+
pub mod platform;
7+
pub mod use_geolocation;
8+
pub use self::core::*;
9+
pub use self::use_geolocation::*;
Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,46 @@
1-
cfg_if::cfg_if! {
2-
if #[cfg(windows)] {
3-
mod windows;
4-
pub use self::windows::*;
5-
} else if #[cfg(target_family = "wasm")] {
6-
mod wasm;
7-
pub use self::wasm::*;
1+
#[cfg(windows)]
2+
mod windows;
3+
#[cfg(windows)]
4+
pub use self::windows::*;
5+
6+
#[cfg(target_family = "wasm")]
7+
mod wasm;
8+
#[cfg(target_family = "wasm")]
9+
pub use self::wasm::*;
10+
11+
#[cfg(not(any(target_family = "wasm", windows)))]
12+
mod unsupported {
13+
use std::sync::Arc;
14+
15+
use crate::{Error, Event, Geocoordinates};
16+
17+
pub struct Geolocator {}
18+
19+
impl Geolocator {
20+
/// Create a new Geolocator for the device.
21+
pub fn new() -> Result<Self, Error> {
22+
Err(Error::Unsupported)
23+
}
24+
}
25+
26+
pub async fn get_coordinates(_geolocator: &Geolocator) -> Result<Geocoordinates, Error> {
27+
Err(Error::Unsupported)
28+
}
29+
30+
pub fn set_power_mode(
31+
_geolocator: &mut Geolocator,
32+
_power_mode: crate::PowerMode,
33+
) -> Result<(), Error> {
34+
Err(Error::Unsupported)
35+
}
36+
37+
pub fn listen(
38+
_geolocator: &Geolocator,
39+
_callback: Arc<dyn Fn(Event) + Send + Sync>,
40+
) -> Result<(), Error> {
41+
Err(Error::Unsupported)
842
}
943
}
44+
45+
#[cfg(not(any(target_family = "wasm", windows)))]
46+
pub use self::unsupported::*;

packages/notification/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dioxus-notification"
3-
version = "0.1.0-alpha.1"
3+
version = "0.7.0"
44

55
description = "Send notifications from your Dioxus apps."
66
readme = "./README.md"

packages/sdk/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dioxus-sdk"
3-
version = "0.7.0-alpha.1"
3+
version = "0.7.0"
44

55
description = "A platform agnostic library for supercharging your productivity with Dioxus."
66
readme = "../../README.md"
@@ -32,4 +32,4 @@ util = ["dep:dioxus-util"]
3232
window = ["dep:dioxus-window"]
3333

3434
[package.metadata.docs.rs]
35-
all-features = true
35+
all-features = true

packages/storage/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dioxus_storage"
3-
version = "0.1.0-alpha.1"
3+
version = "0.7.0"
44

55
description = "Local and persistent storage utilities for Dioxus."
66
readme = "./README.md"

0 commit comments

Comments
 (0)