This is outdated documentation for Sycamore.
For up-to-date documentation, see the latest version (v0.8).
Project architecture
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
/packages/sycamore/src/rx.rs.
- All the reactivity primitives are defined in
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.
-
Template
Templateis a wrapper type around aGenericNodethat is produced by thetemplate!macro. ATemplatecan be rendered using the utilities insycamore::utils::render.
template!
-
The template macro is defined in
/packages/sycamore-macro/src/lib.rs. -
trybuildis used for testing proc-macros.
-
Fragment diffing
Template 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.