Release post: https://sycamore-rs.netlify.app/news/announcing-v0.5.0
Changelog
-
⚡️ Features
- Tweened signals [[@lukechu10], #86]
- Add more easing functions [[@tmpr], #90]
- Document fragments in the
template!
macro.template!
can now accept the following input:template! { p { "First" } p { "Second" } }
[[@lukechu10], #89]template! {} // empty template
- 2-way data binding for certain supported props [[@lukechu10], #93]
- Allow generic component's type parameters to be inferred from context [[@lukechu10], #100]
- Refactored
Template
(renamed fromTemplateResult
) to allow make the template system more flexible. It is now possible to imperatively constructTemplate
s from raw dom nodes,Vec
s, and closures [[@lukechu10], #104] - Sycamore router [[@lukechu10], #118]
- Temporary "fake" hydration [[@lukechu10], #101]
- Router use anchor tags (
<a>
) instead ofLink
components [[@lukechu10], #128] - Reactive scope dependency count utility function [[@lukechu10], #144]
-
🛠 Fixes
- Implement missing operations on
SsrNode
[[@lukechu10], #82, #138] - Remove warning when effects are created outside of a reactive scope [[@JuanMarchetto], #95]
- Do not assume
Signal
is valid for entire duration of the effect and make effect triggers deterministic (outer effects rerun first) [[@lukechu10], #145] - Eagerly evaluate dynamic
Template
s withcreate_memo
[[@lukechu10], #146]
- Implement missing operations on
-
📃 Documentation
- Host documentation on website [[@lukechu10], #83]
- Write documentation [[@lukechu10], #87, #111, #133]
- Fix
CHANGELOG.md
typo [[@Riey], #102] - Style documentation website with TailwindCSS [[@lukechu10], #117]
- Use router for documentation website header [[@lukechu10], #132]
- Extract outline from markdown and new index page [[@lukechu10], #134]
- Move documentation under
/docs/*
path [[@lukechu10], #139]
-
🛠 Internal Fixes and Improvements
- Build website in GitHub Actions [[@lukechu10], #84]
- Run unit tests in Miri to catch memory errors [[@lukechu10], #91]
- Update Trunk to v0.11.0 [[@lukechu10], #96]
- Improve documentation website lighthouse score [[@lukechu10], #97]
- Setup gitpod.io configuration to make it easier to contribute [[@lukechu10], #98]
- Update
wasm-bindgen
to v0.2.74 in.gitpod.Dockerfile
[[@lukechu10], #108] - Update links to git repository to point to
sycamore-rs/sycamore
[[@lukechu10], #110] - Add micro-benchmarks for
map_indexed
andmap_keyed
[[@lukechu10], #115] - Run js-framework-benchmark in GitHub Actions. Pull requests with the
performance
tag will automatically trigger a benchmark run [[@lukechu10], #114] - Fix branch naming to work with continuous benchmark [[@lukechu10], #116]
- Various performance improvements [[@lukechu10], #126]
- Google search console verification file [[@lukechu10], #135]
- Get
NodeId
forDomNode
lazily to improve performance whenHash
is not used [[@lukechu10], #136] - Do not insert unnecessary marker nodes [[@lukechu10], #137]
- Remove unnecessary
Rc<RefCell<_>>
s [[@lukechu10], #141] - Cache
window.document
since it is frequently used to prevent going through JS interop [[@lukechu10], #142]
-
⚠ BREAKING CHANGES
- Abstraction over rendering backend! This introduces the concept of
GenericNode
which is a trait to access the underlying rendering backend. Currently, Sycamore ships withDomNode
andSsrNode
out-of-the-box for rendering the the browser DOM and to a static string respectively. Components should now be generic overG: GenericNode
to be able to render to multiple backends [[@lights0123], #67] - Require using the
#[component(_)]
attribute macro for defining components. This changes the component syntax to:The#[component(MyComponent<G>)] fn my_component() -> Template<G> { todo!() }
#[component(_)]
macro generates astruct
under the hood that implements theComponent
trait for improved type safety. This also means that you no longer need#[allow(non_snake_case)]
in your code! [[@lukechu10], #70, #92] - Rename
Owner
toReactiveScope
[[@lukechu10], #99] - Renamed crate from
maple-core
tosycamore
andmaple-core-macro
tosycamore-macro
. Also renamed all instances of "Maple" to "Sycamore" [[@lukechu10], #109] - Rename
TemplateResult
toTemplate
[[@lukechu10], #112] - Rename
reactive
sub-module torx
[[@lukechu10], #113] - Remove render functions (
render
,render_to
,render_to_string
, etc...) fromprelude
. These functions are generally only called once in a Sycamore app so they do not belong in the prelude [[@lukechu10], #140]
- Abstraction over rendering backend! This introduces the concept of