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 justuse app::MyComponent;
instead ofapp::{MyComponent, MyComponentProps};
#[slot]
syntax to define typed component children.- Typed events in
window_event_listener
- Optional event listeners with
HtmlElement::optional_event
- Adds
style:
syntax in theview
macro to set individual styles, much likeclass:
sets individual classes - Simplify work with resources by adding a
Resource::update
method to reactively update current value. expect_context::<T>(cx)
shorthand foruse_context::<T>(cx).unwrap()
Server
- 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 byserde_qs
) - Support for rendering a
<Route/>
in response to additional HTTP methods/verbs, e.g., the classic PHP/multi-page-app style in which aPOST
request can be sent to a page and it will render a response. (Seemethods
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 theview
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 toString
by the renderer; usingCow<'static, str>
now allows&'static str
to be rendered without the additional allocation, at the cost of requiring the conversion of&str
toString
to be more explicit.)window_event_listener
now takes a typed event (likeev::keypress
). Usewindow_event_listener_untyped
for the old behavior.- When deriving
Params
to use typed router search/params, theFromStr
error for any type needs to beSend + Sync
so they areErrorBoundary
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.
What's Changed
-
Fix server functions default macro on stable by @Demonthos in #784
-
docs: add runtime "strict mode" checks that warn if you’re non-reactively accessing a value by @gbj in #786
-
fix: warnings about untracked signal access in
<Router/>
by @gbj in #790 -
Remove unused fs dependency from leptos_config by @valeth in #787
-
fix:
untrack
should disable warnings about untracked reads by @gbj in #791 -
Fix server functions with non-copy server contexts by @Demonthos in #785
-
fix: unused warning on cx in server functions by @markcatley in #794
-
docs: warn if you are using
leptos_meta
without features by @gbj in #797 -
fix: warning in Cargo.toml by @markcatley in #800
-
feat: Add ability to include options to event listeners by @Ofenhed in #799
-
fix: fixes #802 as a temporary measure without resorting to #803 yet by @gbj in #804
-
fix: prevent router panic on root-level
<Redirect/>
during route list generation by @gbj in #801 -
Reduce size of RuntimeId when slotmap is not used by @novacrazy in #805
-
fix: unused warning in reactive signal diagnostics by @markcatley in #807
-
Add the ability for server fns to be submitted via GET requests by @benwis in #789
-
chore: fix unused variable warning in property now that it's not memoized by @gbj in #810
-
Optimize Runtime::mark_dirty by @novacrazy in #808
-
Optimize memory usage of update methods by @novacrazy in #809
-
fix: correctly escape HTML special characters in text nodes during SSR by @gbj in #812
-
fix: correctly pass server fn errors to client by @gbj in #822
-
fix: server functions with
url
as argument name (closes issue #823) by @gbj in #825 -
chore: deny warnings on github actions by @markcatley in #814
-
feat: make
__Props
imports unnecessary (closes #746) by @gbj in #828 -
Various optimizations, size reductions and stability improvements by @novacrazy in #831
-
Fix leaked memo nodes by @novacrazy in #841
-
[Fix] Correct broken
MaybeSignal
link by @hoangph271 in #840 -
feat:
rustls
feature forreqwest
and any other relevant dependencies by @gbj in #842 -
fix: don't entity-encode HTML special characters inside
<script>
or<style>
(closes #837) by @gbj in #846 -
feat: allow multiple HTTP request methods/verbs by @gbj in #695
-
[WIP] Trigger prototype by @novacrazy in #838
-
fix static text nodes with curly braces in SSR by @gbj in #849
-
docs: emit error when trying to combine global class and dynamic class in a bugged way by @gbj in #850
-
fix: Strip
&
from the end of params queries by @mondeja in #854 -
Fix the counter without macros test by @agilarity in #863
-
feat: add ability to set
node_ref
and pass additional attributes to<Form/>
and friends by @gbj in #853 -
Fixed typo in life cycle docs by @Stackingttv in #869
-
examples: fix error handling in fetch example by @gbj in #870
-
feat: add the ability to specify animations on route transitions by @gbj in #736
-
[fix] updated nix flakes lock files on session auth axum examples by @mustafasegf in #872
-
docs: Add per-project toolchain override readme by @kamilogorek in #876
-
feat: add non-animation base classes to
<AnimatedOutlet/>
and<AnimatedRoutes/>
by @gbj in #877 -
Use override key, if available, for server function calling by @snapbug in #878
-
feat: add
expect_context
function by @markcatley in #864 -
fix: rendering error in SSR InOrder/Async Mode by @hjin-me in #879
-
Split counter without macros web test by @agilarity in #884
-
fix: dispose of scope when server fns return error by @gbj in #888
-
perf: tiny optimization on primitive child values by @gbj in #887
-
chore(readme): add link to Matrix bridge by @filipdutescu in #894
-
Fixes #890 that was using OnceLock, which is nightly only, by adding the once_cell crate as a dependency. by @OvermindDL1 in #891
-
This should solve ParamsMap / LinearMap serde serialization and deserialization #892 by @dgsantana in #895
-
fix: erroneous non-reactive access warning in undelegated events by @gbj in #900
-
perf: improve router performance on server by calculating route branches once by @gbj in #898
-
Added get_untracked for node_ref. by @dgsantana in #902
-
Use cargo make to run tests for examples by @agilarity in #904
-
Add a window event listener with a callback that receives an event that has been cast to its non-generic type. by @loganbnielsen in #910
-
docs: compile error on mutually-exclusive features by @gbj in #911
-
fix: issue with ordering of
class
attribute andclass=("fancy-name-200", true)
(closes #907) by @gbj in #914 -
change: add
window_event_listener_untyped
and deprecatewindow_event_listener
pending 0.3.0 by @gbj in #913 -
feat: add slots by @yuuma03 in #909
-
docs: fixed a minor typo in async readme by @escwxyz in #921
-
docs: removed extra unused code blocks in form.md by @escwxyz in #923
-
docs: fixed typo in interlude_styling.md by @escwxyz in #924
-
fix: features related compile error by @agilarity in #919
-
fix: allow nested slots by @yuuma03 in #928
-
docs: add some content on server-side rendering by @gbj in #930
-
chore: specify dependency version for cached by @rodrigc in #929
-
Remove need for LEPTOS_OUTPUT_NAME env var after compilation by @benwis in #899
-
Added (potentially broken) timer example by @bluenote10 in #925
-
Link to actual type instead of Into trait for component properties by @ModProg in #932
-
feat: add allow missing_docs to
children
field by @ModProg in #934 -
Adds the GetCbor and GetJson to server macro documentation. by @dgsantana in #938
-
Fix ServerFnError::Serialization error string by @mtsr in #939
-
examples: better practice for view types in todos by @gbj in #940
-
fix: generics on
impl From slot to Vec<slot>
by @yuuma03 in #946 -
Test business logic for counter_without_macros by @agilarity in #927
-
impl
IntoView
for component props by @jquesada2016 in #948 -
Add From for RequestParts into Parts for Axum and add an option to ge… by @benwis in #931
-
fix:
<ErrorBoundary/>
toggling between states (closes issue #820) by @gbj in #957 -
fix: escapes in doc comments on component properties by @ModProg in #958
-
Add wasm web test and common tasks by @agilarity in #954
-
docs: note need for
serde
dependency for server functions (closes #947) by @gbj in #962 -
fix: use a HashMap on Branches::initialize by @yuuma03 in #966
-
-
Replace
serde_urlencoded
withserde_html_form
to support cross-input vec serverfn by @snapbug in #973 -
change/fix: require
FromStr
errors onParams
to beSend + Sync
so they areErrorBoundary
compatible by @gbj in #974 -
Fix the lint issues in the counter example by @agilarity in #971
-
feat: add builder syntax for optional event listener by @gbj in #969
-
Fix lint issues in counter_isomorphic example by @agilarity in #980
-
fix: suppress warning loading local resource without
<Suspense/>
in hydrate mode (closes #979) by @gbj in #984 -
feat: allow structs in server function arguments by @gbj in #987
-
docs: switch from compile errors to runtime warnings for incompatible feature flags by @gbj in #990
-
docs: error when component ends with
view! { ... };
(closes #985) by @gbj in #993 -
fix: lint issues in
counters
example by @agilarity in #986 -
fix: lint issues in
erros_axum
example by @agilarity in #988 -
fix: lint issues in
fetch
example by @agilarity in #989 -
fix: lint issues in
hackernews
example by @agilarity in #991 -
fix: lint issues in
hackernews_axum
example by @agilarity in #992 -
fix: lint issues in
login_with_token_csr_only
example by @agilarity in #995 -
fix: lint issues in
router
example by @agilarity in #996 -
fix: lint issues in
session_auth_axum
example by @agilarity in #997 -
fix: lint issues in
todo_app_sqlite
example by @agilarity in #998 -
fix: lint issues in
todo_app_sqlite_axum
example by @agilarity in #999 -
fix: lint issues in
todo_app_sqlite_viz
example by @agilarity in #1000 -
fix: lint issues in
todomvc
example by @agilarity in #1001 -
[docs] Reduce firmness of overlapping signal warning by @dglsparsons in #1004
-
docs: document that
<ActionForm/>
only works with form-encoded server functions by @gbj in #1005 -
fix: properly dispose of
<Suspense/>
scopes (closes #834) by @gbj in #1006 -
test: lint examples with --all-features by @agilarity in #1008
-
book: close iframe tag on global state management page by @Wadu436 in #1013
-
docs: add examples for manual server integration by @ChristopherPerry6060 in #1015
-
Clean up examples after verification by @agilarity in #1019
-
build tailwind CSS with trunk by @agilarity in #1016
-
[fix] indentation erros in examples by @hoangph271 in #1017
-
fix: corrects error-deserialization behavior of
ActionForm
(closes #1024) by @gbj in #1025 -
fix: flicking
<Transition/>
in release mode (closes #960) by @gbj in #1030 -
change: remove APIs that had been marked deprecated by @gbj in #1037
-
examples: fix trunk config to run tailwind at the right time by @flosse in #1040
-
Migrate axum integration to use
with_state
overlayer(Extension
by @snapbug in #1032
New Contributors
- @valeth made their first contribution in #787
- @markcatley made their first contribution in #794
- @Ofenhed made their first contribution in #799
- @novacrazy made their first contribution in #805
- @bram209 made their first contribution in #817
- @akarras made their first contribution in #815
- @hoangph271 made their first contribution in #840
- @chroth7 made their first contribution in #860
- @agilarity made their first contribution in #863
- @Stackingttv made their first contribution in #869
- @mustafasegf made their first contribution in #872
- @kamilogorek made their first contribution in #876
- @hjin-me made their first contribution in #879
- @filipdutescu made their first contribution in #894
- @OvermindDL1 made their first contribution in #891
- @dgsantana made their first contribution in #895
- @loganbnielsen made their first contribution in #910
- @yuuma03 made their first contribution in #909
- @escwxyz made their first contribution in #921
- @rodrigc made their first contribution in #929
- @bluenote10 made their first contribution in #925
- @mtsr made their first contribution in #939
- @fattenap made their first contribution in #964
- @Wadu436 made their first contribution in #1010
- @FrankReh made their first contribution in #1011
- @ChristopherPerry6060 made their first contribution in #1015
- @sjud made their first contribution in #1036
Full Changelog: v0.2.5...v0.3.0