2023-03-21 08:19:22 +08:00
[ package ]
2024-01-05 00:17:13 +08:00
name = "xilem_web"
2023-03-21 08:19:22 +08:00
version = "0.1.0"
2023-07-31 02:14:59 +08:00
description = "HTML DOM frontend for the Xilem Rust UI framework."
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 https://github.com/rust-lang/rust/issues/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>
2024-06-28 16:30:18 +08:00
keywords = [ "xilem" , "html" , "svg" , "dom" , "web" , "ui" ]
2023-07-31 02:14:59 +08:00
categories = [ "gui" , "web-programming" ]
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 23:16:36 +08:00
publish = false # Until it's ready
2023-07-31 02:14:59 +08:00
edition . workspace = true
2024-05-04 04:07:12 +08:00
license . workspace = true
2023-07-31 02:14:59 +08:00
repository . workspace = true
2024-05-04 04:07:12 +08:00
homepage . workspace = true
2024-07-19 22:42:27 +08:00
rust-version . workspace = true
2023-03-21 08:19:22 +08:00
2023-09-12 22:50:50 +08:00
[ package . metadata . docs . rs ]
all-features = true
# rustdoc-scrape-examples tracking issue https://github.com/rust-lang/rust/issues/88791
cargo-args = [ "-Zunstable-options" , "-Zrustdoc-scrape-examples" ]
2024-03-10 00:26:02 +08:00
[ lints ]
workspace = true
2023-03-21 08:19:22 +08:00
[ dependencies ]
2024-08-09 01:51:04 +08:00
futures = "0.3.30"
2024-05-04 04:07:12 +08:00
peniko . workspace = true
2024-05-08 03:38:40 +08:00
wasm-bindgen = "0.2.92"
2024-07-27 00:11:34 +08:00
wasm-bindgen-futures = "0.4.42"
2024-08-09 01:51:04 +08:00
xilem_core = { workspace = true , features = [ "kurbo" ] }
2023-03-21 08:19:22 +08:00
[ dependencies . web-sys ]
2024-05-08 03:38:40 +08:00
version = "0.3.69"
2023-03-21 08:19:22 +08:00
features = [
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 https://github.com/rust-lang/rust/issues/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>
2024-06-28 16:30:18 +08:00
"console" ,
"CssStyleDeclaration" ,
"Document" ,
2024-08-05 17:08:34 +08:00
"DocumentFragment" ,
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 https://github.com/rust-lang/rust/issues/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>
2024-06-28 16:30:18 +08:00
"DomTokenList" ,
"Element" ,
"Event" ,
"AddEventListenerOptions" ,
"HtmlElement" ,
"Node" ,
"NodeList" ,
2024-08-09 16:40:24 +08:00
"ResizeObserver" ,
"ResizeObserverEntry" ,
"DomRectReadOnly" ,
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 https://github.com/rust-lang/rust/issues/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>
2024-06-28 16:30:18 +08:00
"SvgElement" ,
"SvgaElement" ,
"SvgAnimateElement" ,
"SvgAnimateMotionElement" ,
"SvgAnimateTransformElement" ,
"SvgCircleElement" ,
"SvgClipPathElement" ,
"SvgDefsElement" ,
"SvgDescElement" ,
"SvgEllipseElement" ,
"SvgfeBlendElement" ,
"SvgfeColorMatrixElement" ,
"SvgfeComponentTransferElement" ,
"SvgfeCompositeElement" ,
"SvgfeConvolveMatrixElement" ,
"SvgfeDiffuseLightingElement" ,
"SvgfeDisplacementMapElement" ,
"SvgfeDistantLightElement" ,
"SvgfeDropShadowElement" ,
"SvgfeFloodElement" ,
"SvgfeFuncAElement" ,
"SvgfeFuncBElement" ,
"SvgfeFuncGElement" ,
"SvgfeFuncRElement" ,
"SvgfeGaussianBlurElement" ,
"SvgfeImageElement" ,
"SvgfeMergeElement" ,
"SvgfeMergeNodeElement" ,
"SvgfeMorphologyElement" ,
"SvgfeOffsetElement" ,
"SvgfePointLightElement" ,
"SvgfeSpecularLightingElement" ,
"SvgfeSpotLightElement" ,
"SvgfeTileElement" ,
"SvgfeTurbulenceElement" ,
"SvgFilterElement" ,
"SvgForeignObjectElement" ,
"SvggElement" ,
# "SvgHatchElement",
# "SvgHatchpathElement",
"SvgImageElement" ,
"SvgLineElement" ,
"SvgLinearGradientElement" ,
"SvgMarkerElement" ,
"SvgMaskElement" ,
"SvgMetadataElement" ,
"SvgmPathElement" ,
"SvgPathElement" ,
"SvgPatternElement" ,
"SvgPolygonElement" ,
"SvgPolylineElement" ,
"SvgRadialGradientElement" ,
"SvgRectElement" ,
"SvgScriptElement" ,
"SvgSetElement" ,
"SvgStopElement" ,
"SvgStyleElement" ,
"SvgsvgElement" ,
"SvgSwitchElement" ,
"SvgSymbolElement" ,
"SvgTextElement" ,
"SvgTextPathElement" ,
"SvgTitleElement" ,
"SvgtSpanElement" ,
"SvgUseElement" ,
"SvgViewElement" ,
"Text" ,
"Window" ,
"FocusEvent" ,
"HtmlInputElement" ,
"InputEvent" ,
"KeyboardEvent" ,
"MouseEvent" ,
"PointerEvent" ,
"WheelEvent" ,
"HtmlAnchorElement" ,
"HtmlAreaElement" ,
"HtmlAudioElement" ,
"HtmlBrElement" ,
"HtmlButtonElement" ,
"HtmlCanvasElement" ,
"HtmlDataElement" ,
"HtmlDataListElement" ,
"HtmlDetailsElement" ,
"HtmlDialogElement" ,
"HtmlDivElement" ,
"HtmlDListElement" ,
"HtmlEmbedElement" ,
"HtmlFieldSetElement" ,
"HtmlFormElement" ,
"HtmlHeadingElement" ,
"HtmlHrElement" ,
"HtmlIFrameElement" ,
"HtmlImageElement" ,
"HtmlInputElement" ,
"HtmlLabelElement" ,
"HtmlLegendElement" ,
"HtmlLiElement" ,
"HtmlLinkElement" ,
"HtmlMapElement" ,
"HtmlMediaElement" ,
"HtmlMenuElement" ,
"HtmlMeterElement" ,
"HtmlModElement" ,
"HtmlObjectElement" ,
"HtmlOListElement" ,
"HtmlOptGroupElement" ,
"HtmlOptionElement" ,
"HtmlOutputElement" ,
"HtmlParagraphElement" ,
"HtmlPictureElement" ,
"HtmlPreElement" ,
"HtmlProgressElement" ,
"HtmlQuoteElement" ,
"HtmlScriptElement" ,
"HtmlSelectElement" ,
"HtmlSlotElement" ,
"HtmlSourceElement" ,
"HtmlSpanElement" ,
"HtmlTableCaptionElement" ,
"HtmlTableCellElement" ,
"HtmlTableColElement" ,
"HtmlTableElement" ,
"HtmlTableRowElement" ,
"HtmlTableSectionElement" ,
"HtmlTemplateElement" ,
"HtmlTimeElement" ,
"HtmlTextAreaElement" ,
"HtmlTrackElement" ,
"HtmlUListElement" ,
"HtmlVideoElement" ,
2023-03-21 08:19:22 +08:00
]
2024-08-15 23:37:57 +08:00
[ features ]
default = [ "hydration" ]
hydration = [ ]
2024-09-18 02:49:15 +08:00
# This interns some often used strings, such as element tags ("div" etc.), which slightly improves performance when creating elements at the cost of a bigger wasm binary
intern_strings = [ "wasm-bindgen/enable-interning" ]