xilem/xilem_web
Daniel McNab 86d9592a3e
Move `xilem` onto a new `xilem_core`, which uses a generic View trait (#310)
This:
1) Renames the current/old `xilem_core` to `xilem_web_core` and moves it
to the `xilem_web/xilem_web_core` folder
2) Creates a new `xilem_core`, which does not use (non-tuple) macros and
instead contains a `View` trait which is generic over the `Context` type
3) Ports `xilem` to this `xilem_core`, but with some functionality
missing (namely a few of the extra views; I expect these to
straightforward to port)
4) Ports the `mason` and `mason_android` examples to this new `xilem`,
with less functionality.

This continues ideas first explored in #235 

The advantages of this new View trait are:
1) Improved support for ad-hoc views, such as views with additional
attributes.
This will be very useful for layout algorithms, and will also enable
native *good* multi-window (and potentially menus?)
2) A lack of macros, to better enable using go-to-definition and other
IDE features on the traits

Possible disadvantages:
1) There are a few more traits to enable the flexibility
2) It can be less clear what `Self::Element::Mut` is in the `rebuild`
function, because of how the resolution works
3) When implementing `View`, you need to specify the context (i.e.
`impl<State, Action> View<State, Action, [new] ViewCtx> for
Button<State, Action>`.

---------

Co-authored-by: Philipp Mildenberger <philipp@mildenberger.me>
2024-06-06 15:16:36 +00:00
..
src Move `xilem` onto a new `xilem_core`, which uses a generic View trait (#310) 2024-06-06 15:16:36 +00:00
web_examples fix invalid HTML in examples (#304) 2024-05-12 06:03:24 +00:00
xilem_web_core Move `xilem` onto a new `xilem_core`, which uses a generic View trait (#310) 2024-06-06 15:16:36 +00:00
.gitignore Move crates to the repository root (#302) 2024-05-11 21:59:03 +00:00
Cargo.toml Move `xilem` onto a new `xilem_core`, which uses a generic View trait (#310) 2024-06-06 15:16:36 +00:00
LICENSE Move crates to the repository root (#302) 2024-05-11 21:59:03 +00:00
README.md Move `xilem` onto a new `xilem_core`, which uses a generic View trait (#310) 2024-06-06 15:16:36 +00:00

README.md

xilem_web prototype

This is an early prototype of a potential implementation of the Xilem architecture using DOM elements as Xilem elements (unfortunately the two concepts have the same name). This uses xilem_web_core under the hood, which is a legacy version of xilem_core.

The easiest way to run it is to use Trunk. Run trunk serve, then navigate the browser to the link provided (usually http://localhost:8080).