Cargo Features

Zaplib has no features set by default.

[dependencies]
zaplib = { version = "0.0.3", features = ["disable-fonts", "tls", "cef", "cef-dev-tools", "cef-debug", "cef-server", "cef-bundle"] }
disable-fonts
tls

TLS (for HTTPS) doesn't currently work with cross-compilation, so we allow disabling it.

Enables tls of ureq

cef cef-bundle? cef-dev-tools? cef-server? = zaplib_cef

Ship a Chromium browser using CEF in the native app.

Affects cx::CallRustInSameThreadSyncFn, cx::CxDesktopVsWasmCommon.call_js, cx::CxDesktopVsWasmCommon.on_call_rust_in_same_thread_sync, window::Window.create_cef_url

cef-dev-tools = cef

Show the Chrome DevTools on startup. TODO(JP): should we move this to a keyboard shortcut or so at some point?

cef-debug

Use the CEF debug build, and extra verbose logging.

Enables debug of zaplib_cef

cef-server cef-bundle? = cef

Serve web files from the application bundle

Affects window::Window.get_resource_url_callback

cef-bundle = cef, cef-server

Used when building the app bundle

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

zaplib_cef cef? cef-debug?