xilem/xilem_core
Daniel McNab d4d48d80a5
Make the environment and element available in `View::message` (#1220)
See [#xilem > Environment
System](https://xi.zulipchat.com/#narrow/channel/354396-xilem/topic/Environment.20System/with/529496085)
and [#xilem > Giving `message` access to the
Element](https://xi.zulipchat.com/#narrow/channel/354396-xilem/topic/Giving.20.60message.60.20access.20to.20the.20Element/with/529436165)
for motivation.

This is a massive refactor, to significant improve the capabilities of
Xilem.
The main difficulty so far has been sequences, as we need to skip the
right amount of items.
This will either require storing large amounts of item, or restoring the
`count` method on sequences.

Obviously Xilem and Xilem Web are not yet done in this PR.

---------

Co-authored-by: Philipp Mildenberger <philipp@mildenberger.me>
2025-07-29 11:05:10 +00:00
..
examples Make the environment and element available in `View::message` (#1220) 2025-07-29 11:05:10 +00:00
src Make the environment and element available in `View::message` (#1220) 2025-07-29 11:05:10 +00:00
tests Make the environment and element available in `View::message` (#1220) 2025-07-29 11:05:10 +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 Migrate Xilem Core and Masonry to Anymore (#1170) 2025-07-17 07:49:45 +00:00
LICENSE Remove appendix from `LICENSE` files. (#970) 2025-05-09 18:53:13 +00:00
README.md Make the environment and element available in `View::message` (#1220) 2025-07-29 11:05:10 +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 require alloc to be available.

Minimum supported Rust Version (MSRV)

This version of Xilem Core has been verified to compile with Rust 1.88 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.

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

Licensed under the Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0)