Don't store the name in the element view, but use a zero-sized type.
Note, this breaks the untyped case. That will probably need a separate view, or alternatively the tag doesn't have to be zero-sized (so there is a variant that stores a String), the name func could take a &self parameter, and it could return the internal string.
Note, also uses the stringify function to reduce the duplication in the macros. That's a separate, orthogonal change.
I'm doing all the work in a single commit so it's easier to rebase.
Below is a list of the individual changes I did
- Squash prev commits
- Remove top-level action handler (use Adapt instead).
- Type events in the same way as elements (could also do attributes the
same)
- Allow users to avoid compiling the typed html/attributes/events
- Use more specific types for mouse events from web_sys
- change "click" from PointerEvent to MouseEvent (PointerEvent caused a
panic on `dyn_into().unwrap()`)
Handle cases where the length of the Vec changes.
Also fine-tunes the handling of tree structure changes, setting just the tree structure change flag rather than all (and fixing a hygiene problem in the macro).
Add additional arguments to the macros which instantiate view, allowing them optionally to be Send.
The main widget tree is Send because we're pushing the ability to run app logic in multiple threads. A web deployment would not be Send, because many primitives needed for web integration (including closures) are !Send.