Skip to content

refactor(instant): Make instant an optional dependency#70

Open
amnn wants to merge 1 commit intoihrwein:masterfrom
amnn:amnn/fix-instant
Open

refactor(instant): Make instant an optional dependency#70
amnn wants to merge 1 commit intoihrwein:masterfrom
amnn:amnn/fix-instant

Conversation

@amnn
Copy link

@amnn amnn commented Nov 11, 2024

The instant crate is used by backoff to support the Instant type when compiling to WASM, but it is currently unmaintained. This PR makes the dependency optional, so that clients that do not need this feature can avoid taking the dependency.

The feature is enabled by default so this change should not be breaking, but it allows downstream packages to disable default features if they don't need to take the dependency.

A separate PR is required to change the dependency to something like web-time that is currently maintained.

Test plan

Ran tests with and without the feature enabled:

cargo nextest run
cargo nextest run --no-default-features
cargo nextest run --no-default-features --features wasm-bindgen
cargo nextest run --features wasm-bindgen

The `instant` crate is used by `backoff` to support the `Instant` type
when compiling to WASM, but it is currently unmaintained. This PR makes
the dependency optional, so that clients that do not need this feature
can avoid taking the dependency.

The feature is enabled by default so this change should not be breaking,
but it allows downstream packages to disable default features if they
don't need to take the dependency.

A separate PR is required to change the dependency to something like
`web-time` that is currently maintained.

## Test plan

Ran tests with and without the feature enabled:

```
cargo nextest run
cargo nextest run --no-default-features
cargo nextest run --no-default-features --features wasm-bindgen
cargo nextest run --features wasm-bindgen
```
@ggriffiniii
Copy link

I was just starting to work on a change to also remove instant due to it no longer being maintained. Please consider merging this PR so we can remove the instant dependency. Alternatively if you would prefer a migration to web-time instead I would be happy to send a PR that does that.

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.

2 participants