1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00
Files
egui/crates/egui_demo_app/Cargo.toml
Nathan Adams 87021d3fbd egui_extras: Make serde an optional feature (#4641)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until you have self-reviewed it and run
`./scripts/check.sh`.
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

All the other crates in egui have serde as an optional dependency -
which is great! But sadly egui_extras unconditionally includes it, which
adds a bunch of code to stuff that may not care for it. This PR gates
serde support behind a new `serde` feature.

This is a breaking change; if that's undesirable then we can add it as a
default feature instead, though that wouldn't match any of the other
crates.
2024-06-18 22:27:48 +02:00

83 lines
2.4 KiB
TOML

[package]
name = "egui_demo_app"
version.workspace = true
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
license.workspace = true
edition.workspace = true
rust-version.workspace = true
publish = false
default-run = "egui_demo_app"
[lints]
workspace = true
[package.metadata.docs.rs]
all-features = true
[lib]
crate-type = ["cdylib", "rlib"]
[features]
default = ["glow", "persistence"]
# image_viewer adds about 0.9 MB of WASM
web_app = ["http", "persistence"]
http = ["ehttp", "image", "poll-promise", "egui_extras/image"]
image_viewer = ["image", "egui_extras/all_loaders", "rfd"]
persistence = ["eframe/persistence", "egui/persistence", "serde", "egui_extras/serde"]
puffin = ["eframe/puffin", "dep:puffin", "dep:puffin_http"]
serde = ["dep:serde", "egui_demo_lib/serde", "egui/serde"]
syntect = ["egui_demo_lib/syntect"]
glow = ["eframe/glow"]
wgpu = ["eframe/wgpu", "bytemuck", "dep:wgpu"]
wayland = ["eframe/wayland"]
x11 = ["eframe/x11"]
[dependencies]
chrono = { version = "0.4", default-features = false, features = [
"js-sys",
"wasmbind",
] }
eframe = { workspace = true, default-features = false, features = [
"web_screen_reader",
] }
egui = { workspace = true, features = ["callstack", "default", "log"] }
egui_demo_lib = { workspace = true, features = ["default", "chrono"] }
egui_extras = { workspace = true, features = ["default", "image"] }
log.workspace = true
# Optional dependencies:
bytemuck = { workspace = true, optional = true }
puffin = { workspace = true, optional = true }
puffin_http = { workspace = true, optional = true }
# Enable both WebGL & WebGPU when targeting the web (these features have no effect when not targeting wasm32)
wgpu = { workspace = true, features = ["webgpu", "webgl"], optional = true }
# feature "http":
ehttp = { version = "0.5", optional = true }
image = { workspace = true, optional = true, features = ["jpeg", "png"] }
poll-promise = { version = "0.3", optional = true, default-features = false }
# feature "persistence":
serde = { workspace = true, optional = true }
# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
env_logger = { version = "0.10", default-features = false, features = [
"auto-color",
"humantime",
] }
rfd = { version = "0.13", optional = true }
# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "=0.2.92"
wasm-bindgen-futures.workspace = true
web-sys.workspace = true