xilem/xilem_core
Daniel McNab 7be4dd2a2f
Xilem example for http cats API, requiring `worker`s and `image` component (#571)
This example is inspired by:
https://troz.net/post/2024/swiftui-mac-2024/

Current status:
- Lists status code
- Can select status code
- Downloads image from status code
- Shows image from status code

This adds two new features to Xilem:
- The worker view, which is the obvious extension to `task` for multiple
operations
- The `image` view, which just uses Masonry `Image`.

It also fixes a the Masonry Image view's layout to use the already
extant but unused method.
2024-09-03 19:02:07 +00:00
..
examples Use `ViewMarker` trait instead of the generic `Marker` to allow `impl ViewSequence` as return type (#472) 2024-08-05 10:53:19 +00:00
src Xilem example for http cats API, requiring `worker`s and `image` component (#571) 2024-09-03 19:02:07 +00:00
tests Don't use doc comments for VSCode markers. (#543) 2024-08-25 08:00:17 +00:00
.gitignore Move `xilem` onto a new `xilem_core`, which uses a generic View trait (#310) 2024-06-06 15:16:36 +00:00
Cargo.toml Correctly set `rust-version` in all `Cargo.toml`s (#438) 2024-07-19 14:42:27 +00:00
LICENSE Move crates to the repository root (#302) 2024-05-11 21:59:03 +00:00
README.md Rename mentions of Zulip Stream to Channel (#470) 2024-07-31 12:49:54 +00:00

README.md

Xilem Core

Reactivity primitives for Rust

Latest published version. Documentation build status. Apache 2.0 license.

Linebender Zulip chat. GitHub Actions CI status. Dependency staleness status.

Xilem Core provides primitives which are used by Xilem (a cross-platform GUI toolkit) and Xilem Web (a web frontend framework). If you are using Xilem, its documentation will probably be more helpful for you.

Xilem apps will interact with some of the functions from this crate, in particular memoize. Xilem apps which use custom widgets (and therefore must implement custom views), will implement the View trait.

If you wish to implement the Xilem pattern in a different domain (such as for a terminal user interface), this crate can be used to do so. Though, while Xilem Core should be able to support all kinds of domains, the crate prioritizes the ergonomics for users of Xilem.

Hot reloading

Xilem Core does not currently include infrastructure to enable hot reloading, but this is planned. The current proposal would split the application into two processes:

  • The app process, which contains the app state and create the views, which would be extremely lightweight and can be recompiled and restarted quickly.
  • The display process, which contains the widgets and would be long-lived, updating to match the new state of the view tree provided by the app process.

Quickstart

no_std support

Xilem Core supports running with #![no_std], but does use alloc to be available.

It is plausible that this reactivity pattern could be used without allocation being required, but that is not provided by this package. If you wish to use Xilem Core in environments where an allocator is not available, feel free to bring this up on Zulip.

Minimum supported Rust Version (MSRV)

This version of Xilem Core has been verified to compile with Rust 1.79 and later.

Future versions of Xilem Core might increase the Rust version requirement. It will not be treated as a breaking change and as such can even happen with small patch releases.

Click here if compiling fails.

As time has passed, some of Xilem Core's dependencies could have released versions with a higher Rust requirement. If you encounter a compilation issue due to a dependency and don't want to upgrade your Rust toolchain, then you could downgrade the dependency.

# Use the problematic dependency's name and version
cargo update -p package_name --precise 0.1.1

Community

Discussion of Xilem Core development happens in the Linebender Zulip, specifically the #xilem channel. All public content can be read without logging in.

Contributions are welcome by pull request. The Rust code of conduct applies.

License