Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchantey committed Jan 17, 2025
1 parent e8f8960 commit afeadba
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 43 deletions.
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,9 @@ sweet_rsx = { workspace = true, optional = true }
sweet_rsx_macros = { workspace = true, optional = true }
sweet_server = { workspace = true, optional = true }


[examples]
counter = { required_features = ["server"] }
render_counter = { required_features = ["server"] }
# [examples]
# counter = { required_features = ["server"] }
# render_counter = { required_features = ["server"] }

[dev-dependencies]
forky.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/sweet_render/src/sweet_loader/live_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl LiveBlock {
block.node_id
))
})?;
let el = el.dyn_into::<HtmlElement>().unwrap();
let _el = el.dyn_into::<HtmlElement>().unwrap();
// let parts = Self::parse_parts(&el)?;
todo!();
// Ok(Self { el, parts })
Expand Down
34 changes: 0 additions & 34 deletions crates/sweet_render/src/sweet_loader/sweet_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,6 @@ pub struct SweetLoader {
pub postion_visitor: RsxTreePositionVisitor,
}

impl RsxTreeVisitorOwned<RustParts> for SweetLoader {
fn visit_node(
&mut self,
mut node: Node<RustParts>,
) -> ParseResult<Option<Vec<Node<RustParts>>>> {
self.postion_visitor.visit_node(&node)?;
let children = node.take_children();
match &node {
Node::Doctype => {}
Node::Comment(_) => {}
Node::Element(element) => todo!(),
Node::Text(_) => {}
Node::TextBlock(text_block) => {
// self.visit_text_block(blocks, recv);
}
Node::Component(_, vec) => todo!(),
}
self.postion_visitor.leave_node(&node)?;
Ok(children)
}

fn leave_node(&mut self) -> ParseResult<()> { Ok(()) }

fn visit_children(
&mut self,
children: Vec<Node<RustParts>>,
) -> ParseResult<Vec<Node<RustParts>>> {
Ok(children)
}

fn leave_children(&mut self) -> ParseResult<()> { Ok(()) }
}


impl SweetLoader {
pub fn load(self, rsx: impl Rsx) -> ParseResult<()> {
console_error_panic_hook::set_once();
Expand Down
9 changes: 5 additions & 4 deletions crates/sweet_site/src/collections/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ title: Sweet

---

A web framework building on the best ideas from astro, quik and more, all entirely in a rust ecosystem.
Sweet is a rust metaframework that minimizes rust recompilations by extracting serializable content.

## Core concept
Find your rust dev flow with sweet.

Sweet *preprocesses* `rsx` macros, allowing for all kinds of sweet features.
## Find your flow with:

- 🔥 **Smokin hot reload** sweet splits html from rust and only triggers recompilation on code changes, html diffs are instant.
- 🔥 **Smokin hot reload** instant html reloads
- 🌊 **Stay Hydrated** sweet collects pre-hydration events and plays them back in order, no missed events!.
- **Scoped CSS** with component `<style/>` tags
- 🌐 **No signal, no problem** sweet provides reactivity primitives and easily integrates other frameworks astro-style.
- 🦀 **Rusty to the core** components are described as *regular structs and traits*.
- 🧪 **A full ecosystem** sweet has a built-in component library and testing framework, as well as integrations with axum, leptos and bevy.
Expand Down

0 comments on commit afeadba

Please sign in to comment.