This commit adds subtree memoization to Dioxus.
Subtree memoization is basically a compile-time step that drastically
reduces the amount of work the diffing engine needs to do at runtime by
extracting non-changing nodes out into a static "template." Templates
are then understood by the various renderers in the ecosystem as a
faster way of rendering the same items.
For example, in the web, templates are simply a set of DOM Nodes created
once and then cloned later. This is the same pattern frameworks like Lithtml
and SolidJS use to achieve near-perfect performance.
Subtree memoization adds an additional level of complexity to Dioxus. The RSX
macro needs to be much smarter to identify changing/nonchanging nodes and
generate a mapping between the Template and its runtime counterparts.
This commit represents a working starter point for this work, adding support
for templates for the web, desktop, liveview, ssr, and native-core renderers.
In the future we will try to shrink code generation, generally improve
performance, and simplify our implementation.
* feat: use synchronous router design
* feat: function to get router out of dom
* chore: restructure workspace to use renderers as packages, not features
* Move getting started to Guide
* Clean up summary and getting started
* Shorten intro by moving stuff to individual platform docs
* Make intro even shorter, summarize features
* Further cleanup; move development-related docs to separate section
* Make `guide` a crate. Turn code samples into examples so that we can check if they compile
* Rewrite "Describing the UI":
* Focus on RSX syntax (interactivity covered in later chapters); make sure samples are tested; concise language
* Move some "special attribute" samples to the `examples` directory
* Simplify introduction to components
* Simplify introduction to component props
* Document Prop features; add code samples
* Simplify component children docs
* Interactivity: better introduction to events
* Hooks: better introduction
* Remove outdated doc
* Introducs use_ref
* Simplify User Input chapter
* Document event handler props
* Meme editor example
* Meme editor walkthrough
* Add dark mode example
* Guide for context; dark mode example
* Guide: custom hooks
* Guide: conditional rendering
* Guide: rendering lists
* Guide: rendering lists + keys
* Move remaining infor from Reference to guide
* Delete reference book