v0.3.0 is another incremental-ish release with a bunch of new features, many on the server end but including a bunch of general-purpose improvements. It includes several things that are breaking changes in the semantic-versioning sense, but you may find that not much breaks in your actual app. (For example, no code in any of the the three starter templates needed to change.)
New Features and Small Fixes
General
No longer necessary to import __Props types for components; you can just use app::MyComponent; instead of app::{MyComponent, MyComponentProps};
#[slot] syntax to define typed component children.
Support for server functions that use GET requests (with either URL or CBOR encoding), for easier caching.
extract helper to directly use Actix extractors in a server function.
Allow more complex data like structs and Vec<_> as server function arguments (anything that can be de/serialized by serde_qs)
Support for rendering a <Route/> in response to additional HTTP methods/verbs, e.g., the classic PHP/multi-page-app style in which a POST request can be sent to a page and it will render a response. (See methods prop.)
Support for SsrMode::PartiallyBlocked which works like out-of-order streaming but replaces the HTML for any “blocked” fragments on the server. Improves UX when JS is disabled.
Developer Experience and Ergonomics
Top-to-bottom integration with the tracing crate
Adding some "real-time docs" via several runtime warnings and compile-time errors to prevent common bugs (for example, using leptos_meta with no features enabled or accidentally ending the view a component returns with a semicolon, meaning it renders nothing)
Performance
Improve performance of Axum integration by spawning requests into a local threadpool.
Improve performance of router on the server side by caching branch generation.
Performance improvements in the reactive system and renderer, and closing a memory leak in <Suspense/>/<Transition/>.
And as always...
Lots of bug fixes! Full changelog below.
Breaking Changes
&'a str can no longer be directly rendered as a view: add .to_string() to effected variables. (Previously, all &str were converted to String by the renderer; using Cow<'static, str> now allows &'static str to be rendered without the additional allocation, at the cost of requiring the conversion of &str to String to be more explicit.)
window_event_listener now takes a typed event (like ev::keypress). Use window_event_listener_untyped for the old behavior.
When deriving Params to use typed router search/params, the FromStr error for any type needs to be Send + Sync so they are ErrorBoundary compatible
Generics in create_slice have changed to allow different input types for getter/setter; only relevant if (for some reason?) you were specifying them manually.
Exact interfaces for a few public-but-rarely-needed functions in the server integrations have changed.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps leptos_router from 0.2.5 to 0.3.0.
Release notes
Sourced from leptos_router's releases.
... (truncated)
Commits
059c1bf
cargo fmtadd13fd
change: migrate Axum integration to usewith_state
overlayer(Extension)
...904c2e8
v0.3.0
a5c3be5
docs: tweak new slice docs9f5139d
examples: fix trunk config to run tailwind at the right time (#1040)bae3053
change: updatecreate_slice
to allow different types on getter and setter (...40c1556
change: remove APIs that had been marked deprecated (#1037)0db4f58
fix: avoid extra{
escaping (closes #1035) (#1038)12ebc95
fix: flickering\<Transition/>
in release mode (closes #960) (#1030)d7b9190
feat:SsrMode::PartiallyBlocked
(#1026)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)