Closed lukechu10 closed 10 months ago
Attention: 37 lines
in your changes are missing coverage. Please review.
Comparison is base (
16acf8e
) 61.12% compared to head (93e15ed
) 61.06%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR adds the
sycamore-view-parser
crate which contains all the parsing logic for theview!
~andnode!
~ macros.This new
sycamore-view-parser
crate is completely backend-agnostic and contains no knowledge of HTML and SVG tags whatsoever. In fact, it does not even distinguish between elements and components.The macros
view!
~andnode!
~ are now implemented using this new crate and are HTML/SVG specific for codegen.For creating custom backends, it will be expected to provide a proc-macro crate which uses
sycamore-view-parser
and which produces the appropriate codegen for the backend with the same familiar sycamore DSL syntax.Finally, this also unifies the syntax for elements and components since no distinction is made between the two during parsing.
Update: The
node!
macro has also been removed by this PR. There has never really been an use-case fornode!
and it can simply be replaced byView::as_node
.