cargo leptos 0.9.0-beta
v0.9.0-beta

14 hours ago

This is a beta release from the leptos_0.9 branch, to give people an opportunity to start playing around.

I have not yet written up a full changelog but you can find the PR at #4522

Notable changes:

  • lazy feature: Lazy-loading/code-splitting is now gated behind a lazy flag on the leptos crate. This saves binary size for anyone who's not using lazy-loading; if you are, just enable the feature.
  • serde_qs 1.0: we've migrated to the 1.0 series of releases for our default server-function input encoding (form URL data). This should reduce the requirement for #[server(default)] and similar workarounds for empty collections.
  • on:toggle is now typed as a ToggleEvent rather than plain Event
  • Function-call syntax for signal reads is now supported on stable (i.e., let (foo, set_foo) = signal(42); set_foo(13); foo() should work on both stable and nightly)
  • Some of the trait implementations around signals have changed. Specifically, signals no longer implement the Fn() traits directly on nightly; instead, on both stable and nightly, they deref to a dyn Fn(). This means that you can call signals as functions on either nightly or stable. If you had props that took impl Fn() -> T previously (and could receive a signal or a closure on nightly), you can now take impl SignalOrFn<Output = T>. This is probably the biggest change in 0.9, so let me know if you encounter any issues.
  • A wide variety of semver-breaking changes that probably won't affect user code.

Many of the changes in this release are intended to smooth out various APIs and don't seem to cause significant breakage, but please let me know if they do. This is not intended to require meaningful migration; if you find that it's causing you to need to make significant changes to your code, please share some examples and we'll see if we can minimize the breakage.

What's Changed

  • fix: disable lazy hydration when not using lazy-loading to avoid binary-size cost by @gbj in #4438
  • Support ToggleEvent for on:toggle. by @azriel91 in #4362
  • Remove _with_handle suffix from functions by @mondeja in #4388
  • Remove redundant render_app_async_stream_with_context method by @alexisfontaine in #4309
  • Make ScopedFuture internals private by @zakstucke in #4274
  • change: migrate to serde_qs 1.0 (see #4014) by @gbj in #4237
  • fix!: Enable setting content type for server fn middleware errors by @spencewenski in #4249
  • Signal API tweaks by @gbj in #4523
  • feat: Allow customizing the status code of server fn error responses by @spencewenski in #4536
  • Adding feature for easy conversion from Params to ParamsMap by @cerdelen in #4553
  • Show unification by @maccesch in #4466
  • Update main and fix existing merge conflict in branch leptos_0.9 by @metatoaster in #4591
  • Full change to #4528 by @metatoaster in #4535
  • Merge main into leptos_0.9 by @metatoaster in #4624
  • fix: .into_reactive_value conversion for signal-function types on nightly (closes #4608) by @gbj in #4617
  • Don't force next axum state to be (). by @metatoaster in #4653
  • change: adopt deref-based fn call syntax on both stable and nightly by @gbj in #4654
  • Allow server_fn_macro to specify a default client type by @darakreqo in #4594
  • Remove IntoIterator bound from KeyedSubfield by @tysen in #4605
  • Tweaks to Suspense behavior by @gbj in #4691
  • fix(server_fn): make FormatType::into_encoded_string lossy instead of panicking by @sabify in #4719
  • fix(server_fn): avoid panic on malformed Content-Type in multipart codec by @sabify in #4718
  • fix: preserve sync chunk order in out-of-order SSR template by @tysen in #4716
  • fix(server_fn): use StreamingText::CONTENT_TYPE for StreamingText codec by @sabify in #4721
  • leptos_0.9: rust edition 2024 and upgrade deps by @sabify in #4717
  • fix(server_fn): use correct redirect header in reqwest client by @sabify in #4722
  • fix(server_fn): apply back-pressure in websocket forwarding loop by @sabify in #4725
  • fix(server_fn): browser and reqwest client prepend server_url for form_data and streaming requests by @sabify in #4720
  • fix(server_fn): avoid panic on invalid path bytes in error_response by @sabify in #4724
  • fix(server_fn_macro): quality of life fixes by @sabify in #4726
  • Fix HTML-injection (XSS) sinks in tachys and leptos_macro by @sabify in #4730
  • fix(CI): do not fail fast by @sabify in #4740
  • Fix several bugs in reactive_graph by @sabify in #4734
  • fix(CI): use official actions for toolchain and binary installs, #4740 follow up by @sabify in #4742
  • fix(CI): drop wretry wrapper from action steps by @sabify in #4743
  • Remove unused unstable FromWasmAbi bound by @ealmloff in #4741
  • Fix five bugs in the router by @sabify in #4731
  • Quality of life fixes for router_macro by @sabify in #4732
  • Quality of life fixes for leptos_macro by @sabify in #4738
  • Fix some oco_ref performance bugs by @sabify in #4744
  • Fix HTML injection (XSS) and other bugs in hydration_context by @sabify in #4747
  • Harden Leptos server integrations (axum): panics, info leaks, path traversal & resource leaks by @sabify in #4739
  • Fix several leptos_server correctness bugs by @sabify in #4753
  • Fix correctness bugs in any_error by @sabify in #4756
  • Fix any_spawner correctness bugs by @sabify in #4757
  • fix: ensure that nested cleanups happen in right order (closes #4758) by @gbj in #4762
  • fix+perf: server Url::origin() returns the real request origin by @sabify in #4760
  • perf(leptos_axum): cut per-render allocations in the SSR hot path by @sabify in #4761
  • Reintroduce auto live reload protocol option by @veigaribo in #4265
  • Performance optimizations for leptos by @sabify in #4763
  • Harden leptos actix server integrations by @sabify in #4755
  • perf(any_spawner): outline non-generic spawn dispatch tail by @sabify in #4766
  • fix(tachys): stop wrapping inert SVG children in a spurious by @sabify in #4767
  • fix(ci): include running wasm_bindgen tests in server_fn by @sabify in #4770
  • fix: defer owner drop in OwnedView (closes #4769) by @gbj in #4771
  • Fix bugs in reactive_stores and reactive_stores_macro by @sabify in #4735
  • feat(router): allow permanent redirects (301) by @Baptistemontan in #4775
  • Performance optimization for server_fn by @sabify in #4765
  • 0.9: fix MaybeProp fn deref by @gbj in #4779
  • Fix leptos_dom correctness bugs by @sabify in #4754
  • Performance optimization for tachys by @sabify in #4764
  • perf(router): optimize hot-path route matching by @sabify in #4778
  • feat(nonce): add Nonce::from_value for externally-supplied CSP nonces by @anagrius in #4786
  • feat(macro): collapse reactive child closure monomorphizations on --cfg erase_components by @skyf0l in #4711
  • docs(axum): remove unused LeptosOptions import from render_app_to_stream_with_context example by @SAY-5 in #4714
  • perf(hydration_context): optimize streaming and async SSR resource handling by @sabify in #4776
  • fix(tachys): pass FROM_SERVER=false in AnyAttribute::hydrate_from_template by @Noethix55555 in #4792
  • fix(router): propagate error instead of unwrapping in anchor click handler by @Noethix55555 in #4789
  • fix: notify when structure changes during keyed patch (closes #4806) by @gbj in #4807
  • feat: Add the #[prop(marker)] option by @Baptistemontan in #4774
  • feat(leptos_macro): Adding a lazy_preload macro by @edmondj in #4729
  • Performance optimizations for the server integrations by @sabify in #4782
  • fix(router): reject over-long static segment instead of partial-matching by @Noethix55555 in #4790
  • fix(server_fn): don't panic in set_server_url if already set by @Noethix55555 in #4795
  • fix(reactive_stores): untrack parent in AtIndex::writer to avoid spurious notifications by @Noethix55555 in #4794
  • fix(leptos_server): print serialization errors when tracing is disabled by @sabify in #4805
  • fix(router): return early in Form submit handler instead of panic by @Noethix55555 in #4798
  • chore(deps): bump actions/checkout from 6 to 7 by @dependabot[bot] in #4808
  • chore: clean up some leptos_macro docs by @gbj in #4811
  • fix: respect Axum/Actix built-in body size limits by @gbj in #4813
  • Escaping fixes backported from 0.9 by @gbj in #4812
  • perf(throw_error): cheaper error construction and hook installation by @sabify in #4777
  • Revert "chore: don't rely on unstable wasm bindgen apis (#4741)" by @gbj in #4816
  • Revert "fix(tachys): escape <textarea> children to prevent XSS" by @gbj in #4819
  • chore(deps): bump actions/cache from 5 to 6 by @dependabot[bot] in #4822
  • fix: handle <For/> keys correctly in non-async HTML rendering (see #4780, #4833) by @gbj in #4834
  • fix: notify error boundaries in LocalResource-only Suspense (closes #4826) by @gbj in #4827
  • feat(leptos): always expose use_nonce() (simplified version of #4825) by @Ofenhed in #4828
  • fix(tachys): decouple child escaping from hydration for raw-text elements by @sabify in #4821
  • fix(leptos_macro): localize view! diagnostics and recover incomplete component tags by @sabify in #4803

New Contributors

Full Changelog: v0.9.0-alpha...v0.9.0-beta

Don't miss a new leptos release

NewReleases is sending notifications on new releases.