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 aScope
as their first argument, i.e.,resource.read()
is nowresource.read(cx)
. This is necessary for correct<Suspense/>
behavior.- The
Errors
type has been modified to hide its internals and exposeIntoIter
directly. 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/>
componentview
argument now takes aScope
as its first argument, i.e., a change fromview=move |counter| { ... }
toview=move |cx, counter| { ... }
- The
<ErrorBoundary/>
componentfallback
argument now takes aFn(Scope, RwSignal<Errors>) -> impl IntoView
instead ofFn(Scope, Option<RwSignal<Errors>>) -> impl IntoView
NodeRef
now 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-leptos
and the server integrations whether you're usingcargo-leptos
or not. Thesite_address
field 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-sys
so 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_meta
that let you change things like<html>
lang
anddir
, and add aclass
to the<body>
- Restoring
on:
event listeners on<Component/>
nodes, e.g.,<MyFancyButton on:click=.../>
without needing to create anon_click
prop - 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
Unit
in empty views (closes #518) by @gbj in #520 - Reexport
web-sys
event 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
Errors
and implementIntoIter
by @gbj in #522 - fix: top-level SVG in
view
macro with new exports by @gbj in #525 - feature: reintroduce limited template-node cloning w/
template
macro by @gbj in #526 - fix: hydration IDs for elements following
<Suspense/>
(closes #527) by @gbj in #531 - feature: in-order streaming and
async
rendering by @gbj in #496 - fix compile of leptos dom by @seanaye in #535
- Signal traits by @jquesada2016 in #490
v0.2.0-alpha2
by @gbj in #539- fix: building
leptos_reactive
in 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
Scope
intoResource::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