78 Commits

Author SHA1 Message Date
033355dad4
Added all current html tags to dynatos_html::html.
Tags in `dynatos_html::html` now use `createElementNS` with the html namespace.
2024-02-16 12:53:31 +00:00
da19e1c801
Improved dynatos_html::html::decl_elements macro. 2024-02-16 12:41:05 +00:00
8b504329a4
Added dynatos_reactive::Derived. 2024-02-16 12:31:48 +00:00
6612e831c9
Added Input event to dynatos_util::EventTargetAddListener. 2024-02-15 22:21:37 +00:00
6cfe0a1ec0
Improved some backtrace locations for panics in dynatos-context. 2024-02-15 21:35:13 +00:00
a49c8f45f0
Added dynatos::dyn_element. 2024-02-15 20:47:10 +00:00
fdce90882b
Added warnings when adding an existing child to a node when using NodeWithChildren. 2024-02-15 20:45:09 +00:00
d052afe309
The effect stack now only stores WeakEffect.
This is to avoid cloning effects as much, so that we can debug reactivity issues.
It doesn't help with correctness, since effects should always be pushed and popped within a small scope, so no lifetime issues exist.
2024-02-06 18:35:55 +00:00
a5822b96e1
ObjectAttachEffect now de-duplicates the effects, to avoid blow up. 2024-02-06 15:05:25 +00:00
1e85e99aa0
Added Effect::inner_ptr. 2024-02-06 15:04:45 +00:00
07f249b1aa
Effect now implements {PartialEq, Eq, Hash}. 2024-02-06 15:01:42 +00:00
58b235f55f
Added dynatos_util::hash_of 2024-02-06 15:01:18 +00:00
445fd1c89a
Renamed NodeAttachEffect to ObjectAttachEffect.
Made `ObjectAttachEffect` work on all types such that `AsRef<Object>`.
2024-02-06 13:35:30 +00:00
554b4f6429
Added fmt::Debug impl for WeakEffect. 2024-02-06 13:34:59 +00:00
7c2ad3d2da
All effects attached by dynatos are bundled in the same array variable. 2024-02-06 13:33:56 +00:00
f32ec1d4ec
Improved dyn child handling of duplicate nodes.
Previously it panicked, due to it's invariants being messed with.
However, now, it simply refuses to insert a duplicate node.

If someone else messes with the invariants by removing the existing node, we also recover.
2024-02-06 09:51:54 +00:00
9ab1115f78
Replaced ObjectDefineProperty with ObjectSet. 2024-02-06 09:15:50 +00:00
e3c520afb0
Refactored all wasm_bindgen effect types in dynatos. 2024-02-06 08:34:48 +00:00
e9c4c9ad8b
Added Effect::try_new. 2024-02-06 08:32:51 +00:00
785d782ea9
Added TryOrReturn helper. 2024-02-06 08:30:25 +00:00
3adb2c67aa
Added wrapper for WeakRef. 2024-02-06 08:04:52 +00:00
c563754171
Fixed that .dyn_child would lose the position if the closure returned None. 2024-02-06 07:44:24 +00:00
f319161336
Fixed possible bug with NodeDynChild. 2024-02-05 22:41:53 +00:00
4f63e55653
Added initial support for Signal<impl ?Sized>. 2024-02-05 22:36:08 +00:00
c19c2ecddc
Reduced size of Signal.
With the previous commit, it doubled, since it had to store 2 `Rc`s, but now it stores just one.
2024-02-05 19:55:55 +00:00
bee58c76a2
Added new reactivity primitive Trigger.
`Signal<T>` now uses `T` underneath.
2024-02-05 19:52:25 +00:00
d5c96a117f
dynatos::*Dyn* extension traits now do less work if the reactive effect has no dependencies. 2024-02-04 18:02:06 +00:00
24a54dba40
Added ElementDynAttr::[with_]dyn_attr_if. 2024-02-04 15:37:49 +00:00
749cc7b42f
Added NodeWithChildren::with_child. 2024-02-04 15:34:35 +00:00
2bf93dc495
Added ElementDynAttr::[with_]dyn_attr_value. 2024-02-04 15:15:47 +00:00
54eb8d6a9d
Fixed issue with having multiple reactive children. 2024-02-04 15:10:31 +00:00
0083e62fa7
NodeDynChild now accepts a missing child. 2024-02-04 15:03:17 +00:00
db46fdf8e7
Added *_cloned wrappers to dynatos-context. 2024-02-04 15:02:55 +00:00
2f6b9e9d09
dynatos_reactive::{Signal, Effect} now implement fmt::Debug. 2024-02-04 15:02:42 +00:00
02051163c8
Fixed ElementDynAttr using wrong property name. 2024-02-04 15:02:11 +00:00
d9d9366080
Added dynatos_html::ElementWithClass. 2024-02-04 14:01:12 +00:00
e972ae461f
Added dynatos::ElementDynAttr. 2024-02-04 13:33:58 +00:00
1ae80ad1e4
Added impls for Children of tuple sizes between 0 and 10, inclusive. 2024-02-04 13:26:23 +00:00
90e12df0cf
Renamed ElementWithTextContent to NodeWithTextContent.
Renamed `ElementWithChildren` to `NodeWithChildren`.
Made the previous and `ElementWithAttr` all generic on their implemented type.
2024-02-04 13:19:18 +00:00
94a4fe3f65
Renamed ElementDynChild to NodeDynChild.
Also made it generic over the types.
2024-02-04 13:15:27 +00:00
bc8f562a42
Renamed ElementDynText to NodeDynText.
Also made it generic over the type.
2024-02-04 13:13:17 +00:00
e3dc70b725
Most web_sys fallible calls now panic on failure. 2024-02-04 12:37:36 +00:00
7c7db72348
ElementWithChildren::with_children now panics on errors by default. 2024-02-04 12:33:26 +00:00
faa8460191
ElementWithAttr::with_attr now panics on errors by default. 2024-02-04 12:29:43 +00:00
65f62e51e0
SignalSet and SignalReplace now take the value type as an argument. 2024-02-04 12:26:11 +00:00
50a99c0ac2
Location now implements the signal traits. 2024-02-04 12:00:53 +00:00
fcf29943c2
Added SignalReplace. 2024-02-04 11:51:24 +00:00
fb10a1d3de
Fixed Location not changing when the user went forwards or backwards. 2024-02-04 11:46:09 +00:00
bd7b841deb
Moved and renamed ElementEventListener to dynatos_util::EventTargetAddListener. 2024-02-04 11:35:57 +00:00
88856c4836
Added dynatos_reactive::WithDefault. 2024-02-04 11:29:39 +00:00