v0.5.0-alpha #1437
Closed
gbj
announced in
Announcements
v0.5.0-alpha
#1437
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This long-awaited release significantly changes how the reactive system works. This should solve several correctness issues/rough edges that related to the manual use of
cx
/Scope
and could create memory leaks. (See #918 for details)It also has the fairly large DX change (improvement?) of removing the need to pass
cx
orScope
variables around at all.Migration is fairly easy. 95% of apps will migrate completely by making the following string replacements:
cx: Scope,
=> (empty string)cx: Scope
=> (empty string)cx,
=> (empty string)(cx)
=>()
|cx|
=>||
Scope,
=> (empty string)Scope
=> (empty string) as needed|_, _|
that become|_|
or|_|
that become||
, particularly for thefallback
props on<Show/>
and<ErrorBoundary/>
Basically, there is no longer a
Scope
type, and anything that used to take it can simply be deleted.For the 5%: if you were doing tricky things like storing a
Scope
somewhere in a struct or variable and then reusing it, you should be able to achieve the same result by storingOwner::current()
somewhere and then later using it inwith_owner(owner, move || { /* ... */ })
.There are no other big conceptual or API changes in this update: essentially all the same reactive, templating, and component concepts should still apply, just without
cx
.Expected to Not Work
leptosfmt
andcargo leptos --hot-reload
, which assume that theview!
needs acx,
, will probably not work as intended and will need to be updated.Any other ecosystem libraries that depend on Leptos 0.4 won't work, of course.
Help Wanted
This needs pretty extensive testing with real apps. It passes our test suite and the examples seem to work fine, but I'm sure there are bugs out there. Help find them! I've created a discussion linked to these release notes that you can use for feedback or to help track down bugs.
This discussion was created from the release v0.5.0-alpha.
Beta Was this translation helpful? Give feedback.
All reactions