Project architecture
TODO: Update this page as this is fairly outdated.
All non proc-macro related code is in /packages/sycamore. Proc-macro related code is in
/packages/sycamore-macro.
Directory structure
Reactivity
- All the reactivity primitives are defined in live in the
sycamore-reactivecrate.
- All the reactivity primitives are defined in live in the
GenericNode
-
GenericNodeis a trait that serves as an abstraction for different rendering backends. Most commonly used types areDomNodefor rendering in the browser to DOM nodes andSsrNodefor rendering on the server to static HTML. -
The
sycamore::utils::rendermodule contains backend agnostic utilities for rendering nodes.
-
View
Viewis a wrapper type around aGenericNodethat is produced by theview!macro. AViewcan be rendered using the utilities insycamore::utils::render.
view!
-
The view macro is defined in
/packages/sycamore-macro/src/lib.rs. -
trybuildis used for testing proc-macros.
-
Fragment diffing
View fragments are diffed in the sycamore::utils::render::reconcile_fragments(_)
method.
The diffing done by Keyed and Indexed is independent of the diffing done when rendering
fragments. Learn more about this in Iteration.