-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite xilem_web to support new xilem_core (#403)
This ports xilem_web to the new xilem_core. There's also a lot of cleanup internally: * Get rid of all of the complex macros to support DOM interfaces, and instead use associated type bounds on the `View::Element`. * Introduce an extendable modifier based system, which should also work on top of memoization (`Arc`, `Memoize`) and `OneOf` views with an intersection of the modifiable properties. * This modifier based system gets rid of the hacky way to propagate attributes to elements, and takes inspiration by masonrys `WidgetMut` type to apply changes. * Currently that means `Attributes`, `Classes` and `Styles` to reflect what xilem_web previously offered. Downsides (currently, needs some investigation): ~~Due to more internal type complexity via associated types this suffers from rust-lang/rust#105900. The new trait solver should hopefully mitigate some of that, but it seems currently it completely stalls in the todomvc example (not in other examples).~~ ~~The deep, possibly completely static composition via associated type-bounds of the view and element tree unfortunately can take some time to compile, this gets (already) obvious in the todomvc example. The other examples don't seem to suffer that bad yet from that issue, probably because they're quite simple.~~ ~~I really hope we can mitigate this mostly, because I think this is the idiomatic (and more correct) way to implement what the previous API has offered.~~ One idea is to add a `Box<dyn AnyViewSequence>`, as every element takes a "type-erased" `ViewSequence` as parameter, so this may solve most of the issues (at the slight cost of dynamic dispatch/allocations). Edit: idea was mostly successful, see comment right below. I think it also closes #274 It's a draft, as there's a lot of changes in xilem_core that should be upstreamed (and cleaned up) via separate PRs and I would like to (mostly) fix the slow-compile time issue. --------- Co-authored-by: Daniel McNab <36049421+DJMcNab@users.noreply.github.com>
- Loading branch information
Showing
45 changed files
with
5,709 additions
and
4,210 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.