Release post: https://sycamore-rs.netlify.app/news/announcing-v0.7.0
-
⚡️ Features
- Implement
TryFromSegments
forT: Route
. This allows the creation of nested routers. See the docs for more information about usage. - Make parenthesis optional in
cloned!
macro. The following syntax is now accepted, in addition to the old syntax:// Before cloned!((my, variables, to, clone) => move || { ... }) // After cloned!(my, variables, to, clone => move || { ... })
- Builder API. Check out the
hello-builder
example for more usage details. - Make
wasm-bindgen-interning
a feature. This feature is enabled by default but can be opted-out which would disablewasm-bindgen/enable-interning
. Opting-out can lead to a slight decrease in binary size at the cost of performance. - Introduce
render_get_scope
function. This allows accessing (and disposing of) theReactiveScope
created by the render function. - Hydration support. To enable hydration, replace calls to
render
andrender_to
withhydrate
andhydrate_to
. - Add
#[track_caller]
touse_context
. This makes it much easier to debug the"context not found for type"
error. - Better debugging utilities for inspecting the
ReactiveScope
hierarchy.
- Implement
-
🛠 Fixes
- Prevent data binding from panicking when not in browser.
- Extend
ReactiveScope
into scopes that are siblings. - Fix
Lerp
implementation for integers. - Fix context API not working through
Indexed
andKeyed
. - Update TodoMVC example to use context API.
- Remove
autocomplete
from the list of boolean attributes for codegen. - Fix parenthesizing of expressions in
view!
macro interpolation syntax. - Fix context API when effects are re-executed.
- Allow constant generics to be used with
#[component]
macro.
-
📃 Documentation
-
Internal
-
🚨 BREAKING CHANGES
- Refactor
GenericNode
and introduceHtml
trait. AddIS_BROWSER
constant toHtml
.. For projects that target HTML, it is recommended to use theHtml
trait instead ofGenericNode
. This will ensure that it cannot be used on rendering backends that are not for HTML. To check if code is executing on the browser, access theHtml::IS_BROWSER
constant on the generic rendering backend. This also slightly changes theGenericNode
interface which is why it is a breaking change but would most likely not influence you. - Make
GenericNode
generic over the event type. The event type is now an associated type to allow rendering backends to use another type fromweb_sys::Event
. - Rename
Template
toView
andtemplate!
toview!
. For most cases, a simple search-and-replace will suffice, replacing all instances ofTemplate
toView
and all instances oftemplate!
toview!
. - Rename
StateHandle
toReadSignal
. The old name was somewhat confusing and did not reflect thatStateHandle
was just a read-only signal.
- Refactor