Go to file
Luke a7bec19acf
Refactor view! by extracting parsing logic from codegen into a new crate (#649)
* Add sycamore-view-parser crate

* Add sycamore_macro::view2 which uses sycamore-view-parser

* Fix parser bug

* Remove old macro implementation

* Fix a few more parser bugs

* Fix final codegen bugs

* Satisfy clippy

* Update UI tests and fix some diagnostics

* Remove node! macro

* Improve span for children and dangerously_set_inner_html cannot both be set error message

* Add extra UI test case for parse error

* Remove unnecessary derive

* Add UI test for `bind` directive
2023-12-03 00:01:10 +00:00
.github Run everything through prettier (#635) 2023-10-08 07:43:15 +00:00
docs Fix typos left from previous reactive system in router docs (#647) 2023-11-26 20:32:24 +00:00
examples Re-export `wasm-bindgen`, `js-sys`, and event types from `web-sys` (#642) 2023-10-20 15:49:58 +00:00
packages Refactor view! by extracting parsing logic from codegen into a new crate (#649) 2023-12-03 00:01:10 +00:00
website Fix typos left from previous reactive system in router docs (#647) 2023-11-26 20:32:24 +00:00
.gitignore Make SsrNode attribute order stable (#323) 2021-12-16 21:51:54 -08:00
.gitpod.Dockerfile Update gitpod Dockerfile 2022-10-17 18:58:54 +00:00
.gitpod.yml Fix .gitpod.yml syntax error 2021-10-08 05:56:43 +00:00
CHANGELOG.md Run everything through prettier (#635) 2023-10-08 07:43:15 +00:00
CODE_OF_CONDUCT.md Run everything through prettier (#635) 2023-10-08 07:43:15 +00:00
CONTRIBUTING.md Add a CONTRIBUTING.md and remove old contributing docs (#636) 2023-10-11 08:14:46 +01:00
Cargo.toml Refactor view! by extracting parsing logic from codegen into a new crate (#649) 2023-12-03 00:01:10 +00:00
LICENSE chore: update license for 2022 (#328) 2022-01-04 19:12:32 -08:00
README.md Run everything through prettier (#635) 2023-10-08 07:43:15 +00:00
netlify.toml Add _headers file 2021-11-26 14:04:04 -08:00
rustfmt.toml Extract `sycamore` crate into multiple crates (#416) 2022-05-16 17:43:54 -07:00

README.md

Sycamore

Crates.io docs.rs GitHub contributors Discord

Sycamore is a reactive library for creating web apps in Rust and WebAssembly.

#[component]
fn Hello<G: Html>() -> View<G> {
    view! {
        p { "Hello World!" }
    }
}
  • Lightning Speed: Sycamore harnesses the full power of Rust via WebAssembly, giving you full control over performance.
  • Ergonomic and Intuitive: Write code that feels natural. Everything is built on reactive primitives without a cumbersome virtual DOM.
  • No JavaScript: Had enough of JavaScript? So have we. Create apps using Sycamore without touching a single line of JS.

Documentation

Sycamore is extensively documented:

Still have questions? Don't hesitate to stop by our friendly Discord server.

Examples

Sycamore has many examples for your reference in the examples/ directory. Be sure to check them out!

Viewing on sycamore-rs.netlify.app

All the examples are hosted under sycamore-rs.netlify.app/examples/<example_name> with <example_name> being the name of the example you want to view. For instance, the todomvc example is hosted on sycamore-rs.netlify.app/examples/todomvc.

Building Locally

All the examples can also be built locally using Trunk. For instance, the following command builds and serves the todomvc example:

cd examples/todomvc
trunk serve

Now open up localhost:8080 in your browser to see "Hello World!".

Perseus

Perseus is a fullstack framework built with Sycamore. Think NextJS or SvelteKit but with no JavaScript. Everything from backend to frontend is built with pure Rust!

Alternatives?

Don't think Sycamore is for you? Thankfully, there are plenty of alternatives!

  • SolidJS: A declarative, efficient and flexible JavaScript library for building user interfaces
    Solid is a JavaScript library which greatly inspired Sycamore. Many concepts such as fine-grained reactivity and components as factory functions were borrowed from Solid. If you don't mind working with JavaScript (or TypeScript), go check it out!
  • Yew: Rust / Wasm framework for building client web apps
    Yew was also a big inspiration for Sycamore. Yew employs a VDOM and has a MVU (Elm) architecture. If you think that's for you, take a look!
  • MoonZoon: Rust Fullstack Framework
    MoonZoon also champions the no VDOM paradigm and uses dominator as its underlying DOM layer. MoonZoon is a fullstack framework making it easier to combine frontend and backend code with minimal boilerplate.

Contributing

Sycamore would not have been possible without the wonderful contributions from the community. Thank you!

Special thanks to @nate-sys for designing the Sycamore logo!