servo/components/shared/embedder/Cargo.toml
Jonathan Schwender d7e560c9c0
resources: Remove baked in resources (#36042)
This allows removing a LazyLock around the resources.
We override the baked in resources unconditionally in servoshell
upon initialization anyway
([desktop](9f93ccd942/ports/servoshell/desktop/cli.rs (L15)),
[android](9f93ccd942/ports/servoshell/egl/android/simpleservo.rs (L49)),
[ohos](9f93ccd942/ports/servoshell/egl/ohos/simpleservo.rs (L43))
), meaning that the baked in resources
are unused in servoshell.

For 3rd-party embedders, we probably also want to the let them know
early that they should initialize the resources, instead of
restricting the panics to production mode.

Rippy is the only resource which was required. Since it is only
253 bytes large, we just bake that resource in as a fallback.

We do want to make using the resources easy from tests, so we add
some logic to keep the baked in resources for tests only and initialize
the resource reader on first access.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-04-17 05:12:44 +00:00

41 lines
1.1 KiB
TOML

[package]
name = "embedder_traits"
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
rust-version.workspace = true
[lib]
name = "embedder_traits"
path = "lib.rs"
[features]
# bakes default resources into the library.
# This feature is mainly intended for testing purposes.
baked-default-resources = []
[dependencies]
base = { workspace = true }
cfg-if = { workspace = true }
cookie = { workspace = true }
crossbeam-channel = { workspace = true }
euclid = { workspace = true }
http = { workspace = true }
hyper_serde = { workspace = true }
ipc-channel = { workspace = true }
keyboard-types = { workspace = true }
log = { workspace = true }
malloc_size_of = { workspace = true }
malloc_size_of_derive = { workspace = true }
num-derive = "0.4"
num-traits = { workspace = true }
pixels = { path = "../../pixels" }
serde = { workspace = true }
servo_url = { path = "../../url" }
strum_macros = { workspace = true }
stylo_traits = { workspace = true }
url = { workspace = true }
webdriver = { workspace = true }
webrender_api = { workspace = true }