v0.2.0
#578
gbj
announced in
Announcements
`v0.2.0`
#578
Replies: 1 comment
-
WHOA!! So excited |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
v0.2.0
v0.2.0
is an incremental change over0.1.x
. There are a few small things that have been breaking changes over the last two months, one big new feature, and a lot of small improvements and changes.Async Rendering and In-Order Streaming
The biggest new feature of
0.2.0
that requires explanation is support forasync
rendering and in-order streaming, which you can activate via the newssr
prop on a<Route/>
. (See thessr_modes
andssr_modes_axum
examples.)With this new feature, Leptos now supports four different ways to render HTML that contains
async
data loaded under<Suspense/>
. You can opt in to one or the other on a per-route basis.fallback
for anySuspense
. Load data on the client, replacingfallback
once they're loaded.fallback
for anySuspense
. Load data on the server, streaming it down to the client as it resolves, and streaming down HTML forSuspense
nodes.async
, with a very fast shell and resources that begin loading on the server.<head>
)Suspense
. At that point, wait for all its data to load, then render it, then the rest of the tree.Suspense
. Cannot begin hydration until the entire page has loaded, so earlier piecesof the page will not be interactive until the suspended chunks have loaded.
async
: Load all resources on the server. Wait until all data are loaded, and render HTML in one sweep.<head>
). Faster complete load than synchronous because async resources begin loading on server.The mode defaults to out-of-order streaming. For a path that includes multiple nested routes, the most
restrictive mode will be used: i.e., if even a single nested route asks for
async
rendering, the whole initialrequest will be rendered
async
. (async
is the most restrictive requirement, followed by in-order, out-of-order, and synchronous.)Because you have the ability to opt into these different modes on a per-route basis, you can choose the rendering strategy that is best for you—not only for your app in general, but for any given page.
Other Features and Improvements
<Html/>
and<Body/>
components inleptos_meta
that let you change things like<html>
lang
anddir
, and add aclass
to the<body>
on:
event listeners on<Component/>
nodes, e.g.,<MyFancyButton on:click=.../>
without needing to create anon_click
prop<Redirect/>
component in the router that works during client-side navigation or server-side renderingChildren
,AttributeValue
, and other type aliases to make it easier to accept a variety of types in your componentsBreaking Changes Since
0.1.3
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.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()
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.<For/>
componentview
argument now takes aScope
as its first argument, i.e., a change fromview=move |counter| { ... }
toview=move |cx, counter| { ... }
<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.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.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
Complete CHANGELOG
Children
type alias by @gbj in AddChildren
type alias #403view
macro fast-path SSR by @gbj in Fix boolean attributes inview
macro fast-path SSR #408<Html/>
and<Body/>
components inleptos_meta
by @gbj in Add<Html/>
and<Body/>
components inleptos_meta
#407<option>
and<use>
in SSRview
macro by @gbj in fix: correct types for top-level<option>
and<use>
in SSRview
macro #416axum_errors
example by @gbj in Fix some small issues inaxum_errors
example #424RouteDefinition
public by @gbj in MakeRouteDefinition
public #430inner_html
attribute by @gbj in docs: Documentinner_html
attribute #429check
instead ofbuild
(for CI) & add missing examples by @gbj in chore: switch examples tocheck
instead ofbuild
(for CI) & add missing examples #437<Show/>
by @gbj in fix: correct behavior of<Show/>
#436<Outlet/>
by @gbj in fix: successfully pass context to nested routes via<Outlet/>
#447on:
event listeners on<Component/>
nodes by @gbj in feature: allowon:
event listeners on<Component/>
nodes #448leptos_router
hydration issues by @gbj in fix:leptos_router
hydration issues #450<Outlet />
#452) by @gbj in fix: stack overflow in with nested outlet (closes #452) #453leptos_config
description by @odiseo0 in fix: typo inleptos_config
description #455Children
types to macro docs by @gbj in docs: add newChildren
types to macro docs #454close
event ondialog
tag does not work #457 by @Threated in Fix #457 #460fallback
in<Show/>
(closes Potential case for optional fallback in <Show> view macro tag #406) by @gbj in docs: add note about optionalfallback
in<Show/>
(closes #406) #463<Redirect/>
component (closes Add<Redirect />
component #412) by @gbj in feature: add isomorphic<Redirect/>
component (closes #412) #466node_ref
in SSR by @gbj in fix: fixnode_ref
in SSR #471cargo doc
in projects using#[server]
by @gbj in fix:cargo doc
in projects using#[server]
#476<ErrorBoundary/>
by @gbj in fix: adding/removing errors from<ErrorBoundary/>
#478"openssl"
feature from Actix examples by @gbj in remove unnecessary"openssl"
feature from Actix examples #480axum_errors
example by @gbj in fix: errors on 404 page inaxum_errors
example #485inner_html
in SSR by @gbj in fix: correct behavior forinner_html
in SSR #487#[derive(Params)]
by @gbj in fix: typed route params with#[derive(Params)]
#488debug_warn
behavior in reactive crate and removelog
dependency by @gbj in fix: fixdebug_warn
behavior in reactive crate and removelog
dependency #491Scope
to view function in<For/>
to avoid memory "leak" by @gbj in change: addScope
to view function in<For/>
to avoid memory "leak" #492index.html
by @gbj in examples: remove unusedindex.html
#497rustfmt
by @jquesada2016 in workspacerustfmt
#483<For/>
intodomvc
example by @gbj in fix:<For/>
intodomvc
example #504leptos_dom
and add Wasm build to CI for regressions by @gbj in fix: import inleptos_dom
and add Wasm build to CI for regressions #510.unwrap()
fromredirect
in Actix integration by @gbj in remove.unwrap()
fromredirect
in Actix integration #5140.2.0-alpha
by @gbj in version:0.2.0-alpha
#515Unit
in empty views (closes Empty views no longer work #518) by @gbj in fix: correct namespace forUnit
in empty views (closes #518) #520web-sys
event types to make it easier to type handlers by @gbj in Reexportweb-sys
event types to make it easier to type handlers #521Errors
and implementIntoIter
by @gbj in change: tweak API ofErrors
and implementIntoIter
#522view
macro with new exports by @gbj in fix: top-level SVG inview
macro with new exports #525template
macro by @gbj in feature: reintroduce limited template-node cloning w/template
macro #526<Suspense/>
(closes Hydration Mismatch within ActionForm with InnerComponents #527) by @gbj in fix: hydration IDs for elements following<Suspense/>
(closes #527) #531async
rendering by @gbj in feature: in-order streaming andasync
rendering #496v0.2.0-alpha2
by @gbj inv0.2.0-alpha2
#539leptos_reactive
in release mode by @gbj in fix: buildingleptos_reactive
in release mode #540<Suspense/>
by @gbj in fix: more work on hydration IDs with<Suspense/>
#545Scope
intoResource::read()
andResource::with()
by @gbj in change: passScope
intoResource::read()
andResource::with()
#542v0.2.0-beta
by @gbj inv0.2.0-beta
#557<ButtonC on:click/>
syntax by @gbj in docs: add example of<ButtonC on:click/>
syntax #558create_resource
,<Suspense/>
, and<Transition/>
by @gbj in docs: addcreate_resource
,<Suspense/>
, and<Transition/>
#559<Suspense/>
fragments by @gbj in fix: issue with local resources blocking<Suspense/>
fragments #561transition
fallback (closesTransition
doesn't show fallback while pending #562) by @gbj in fix:transition
fallback (closes #562) #563<details>
toggle event does not bubble (issue on:toggle of<details> does not work #565) by @gbj in fix:<details>
toggle event does not bubble (issue #565) #566panic
hygiene by @remkop22 in Macropanic
hygiene #568<Transition/>
withlocal_resource
(closesTransition
doesn't show fallback while pending #562) by @gbj in fix:<Transition/>
withlocal_resource
(closes #562) #574New Contributors
leptos_config
description #455panic
hygiene #568Full Changelog: v0.1.3...v0.2.0
This discussion was created from the release `v0.2.0`.
Beta Was this translation helpful? Give feedback.
All reactions