September 12, 2021

Announcing Sycamore v0.6.0!

Faster and faster with plenty of fixes and features…

Hello everybody! Sycamore is a library for building isomorphic web applications in Rust and WebAssembly.

I’m happy to announce that we’ve just released v0.6.0. This release contains plenty of fixes, shiny new features, and QOL improvements.

(BTW, we just reached 300+ stars on GitHub! Thanks everybody! 🎉)

What’s New?

Perseus

Perseus (by community member @arctic-hen7) is a new web framework for building websites with Rust. Think NextJS or SvelteKit but with no JavaScript.

Perseus supports, among other things:

  • static generation (serving only static resources)
  • server-side rendering (serving dynamic resources)
  • revalidation after time and/or with custom logic (updating rendered pages)
  • incremental regeneration (build on demand)
  • open build matrix (use any rendering strategy with anything else, mostly)
  • CLI harness that lets you build apps with ease and confidence
  • full i18n support out-of-the-box with Fluent

And also, it’s built on top of Sycamore. Go check it out!

Higher-order components

Components can now be generic over other components! This allows interesting patterns, similar to higher-order components in React.

#[component(EnhancedComponent<G>)]
fn enhanced_component<C: Component<G, Props = i32>>() -> Template<G> {
    template! {
        div(class="enhanced-container") {
            C(42)
        }
    }
}

It will be interesting to see how this feature can be used in practice.

Boolean attributes

Previously, using boolean attributes could be quiet annoying. Oftentimes, you needed two separate code branches with almost identical code.

// Before
template! {
    (if *my_signal.get() {
        template! {
            button(disabled="") { ... }
        }
    } else {
        template! {
            button() { ... }
        }
    })
}
// After
template! {
    button(disabled=*my_signal.get()) { ... }
}

Ah… so much nicer!

Separate sycamore-reactive crate

The reactive primitives that power sycamore have been extracted into a new crate: sycamore-reactive. This allows using these powerful sycamore primitives outside of the main sycamore crate.

Performance improvements

A lot of performance improvements have been made to Sycamore.

js-framework-benchmark screenshot

Sycamore is now faster than most major JavaScript frameworks!

Conclusion

A big thank you to all the contributors who made this release possible!

For more detailed changes, check out the changelog.

If you are interested in contributing to Sycamore, check out the issues labeled with good first issue on our GitHub repository. Don’t hesitate to join our Discord server too! See you there.

Thanks!