`v0.2.0-beta`
Pre-release
Pre-release
v0.2.0-beta
This release is a preview, and also serves to generate new docs on docs.rs, as the current ones are getting slightly out of sync with our main branch here.
Changes from 0.2.0-alpha to 0.2.0-beta
Resource::read()andResource::with()now take aScopeas their first argument, i.e.,resource.read()is nowresource.read(cx). This is necessary for correct<Suspense/>behavior.- The
Errorstype has been modified to hide its internals and exposeIntoIterdirectly. In 99% of cases this just means replacing references likeerrors.get().0.into_iter()witherrors.get().into_iter() - Most of the methods on various signal types have been moved into traits instead. This should not cause any actual changes to the way you use them, and if you are accustomed to
use leptos::*you probably won't notice the difference; if you are manually importing types you will need to import the signal traits as well.
Included below are the notes for 0.2.0-alpha, so you can see changes since 0.1.3 as well.
Breaking Changes since 0.1.3
- The
<For/>componentviewargument now takes aScopeas its first argument, i.e., a change fromview=move |counter| { ... }toview=move |cx, counter| { ... } - The
<ErrorBoundary/>componentfallbackargument now takes aFn(Scope, RwSignal<Errors>) -> impl IntoViewinstead ofFn(Scope, Option<RwSignal<Errors>>) -> impl IntoView NodeRefnow takesNodeRef<T>instead ofNodeRef<HtmlElement<T>>. We're also deprecatingNodeRef::new(cx)in favor ofcreate_node_ref(cx)to follow the same pattern as everything else in the framework.- We've finally achieved full consistency between
cargo-leptosand the server integrations whether you're usingcargo-leptosor not. Thesite_addressfield is now namedsite_addr; the compiler should actually prompt you correctly for this one. - The current Leptos global namespace is polluted with a huge number of types and reexports, making it harder to find things in docs and adding compile-time overhead. If you're used to
use leptos::*you may need to manually import a few additional types. We're also no longer reexportingwasm-bindgen,web-sys, andjs-sysso you may need to add them as dependencies to yourCargo.toml - APIs to modify status code and headers in HTTP responses are now synchronous, making them easier to set in components
Other Improvements
- New
<Html/>and<Body/>components inleptos_metathat let you change things like<html>langanddir, and add aclassto the<body> - Restoring
on:event listeners on<Component/>nodes, e.g.,<MyFancyButton on:click=.../>without needing to create anon_clickprop - Adding a
<Redirect/>component in the router that works during client-side navigation or server-side rendering Children,AttributeValue, and other type aliases to make it easier to accept a variety of types in your components- Experimentation with new docs using CodeSandboxes and an expanding set of tutorials
- So, so, so, so many bugfixes, typos, docs improvements, and small changes by many, many, many members of the community. Thanks to you all!
What's Changed
- leptos_dom erros.rs remove() does not need to be generic. by @martinfrances107 in #516
- fix: correct namespace for
Unitin empty views (closes #518) by @gbj in #520 - Reexport
web-sysevent types to make it easier to type handlers by @gbj in #521 - Identify CSS to reload from the href by @akesson in #524
- change: tweak API of
Errorsand implementIntoIterby @gbj in #522 - fix: top-level SVG in
viewmacro with new exports by @gbj in #525 - feature: reintroduce limited template-node cloning w/
templatemacro by @gbj in #526 - fix: hydration IDs for elements following
<Suspense/>(closes #527) by @gbj in #531 - feature: in-order streaming and
asyncrendering by @gbj in #496 - fix compile of leptos dom by @seanaye in #535
- Signal traits by @jquesada2016 in #490
v0.2.0-alpha2by @gbj in #539- fix: building
leptos_reactivein release mode by @gbj in #540 - 533 by @jquesada2016 in #538
- fix(examples): hackernews_axum styles href by @ApplY3D in #536
- revert PR #538 by @gbj in #544
- fix: more work on hydration IDs with
<Suspense/>by @gbj in #545 - change: pass
ScopeintoResource::read()andResource::with()by @gbj in #542 - document typo by @chrislearn in #553
- Fix typo in hydration.rs by @eltociear in #552
- Fix issue with redirects in server fns creating multiple Location headers by @benwis in #550
New Contributors
- @seanaye made their first contribution in #535
- @ApplY3D made their first contribution in #536
- @chrislearn made their first contribution in #553
- @eltociear made their first contribution in #552
Full Changelog: v0.2.0-alpha...v0.2.0-beta