Releases: leptos-rs/leptos
v0.6.11
The primary purpose of this release is that it includes a fix for an unfortunate memory leak when using leptos_router
on the server.
Also included are
- the ability to spread both attributes and event handlers onto an element (see the new
spread
example for the full set of possibilities) - implementing
IntoView
directly forRc<str>
- massive improvements to the spans for error reporting in the
view
macro - migrating all our examples to use the stable features/syntax by default, to reduce confusion for new users
It's important to me to say that all three of the new features above were implemented by community members. This release brings us to over 250 total contributors over time, not to mention everyone who's done work on docs, templates, or libraries that exist outside this repo. Thank you to everyone who's been involved in this project so far.
What's Changed
- stable todomvc example by @mahmoud-eltahawy in #2489
- fix(ci): false leptos changes detected by @agilarity in #2491
- ci(examples/error-boundary): use stable syntax by @agilarity in #2496
- ex: counter_url_query; to stable by @solweo in #2499
- stable examples change by @sjud in #2497
- stable todo_app_sqlite_axum example by @mahmoud-eltahawy in #2493
- Implement IntoView for Rc by @ydirson in #2462
- Allow spreading of both attributes and event handlers by @lpotthast in #2432
- chore(ci): move example CI over to stable by @gbj in #2502
- move channels to stable by @mahmoud-eltahawy in #2501
- chore(ci): run all examples under stable and fix remaining linting issue by @gbj in #2503
- Fix error reporting in view macro by @Ar4ys in #2289
- fix: invalid
Location
header when usingleptos_actix::redirect()
without JS/WASM (closes #2506) by @gbj in #2507 - chore(ci): remove nightly feature on
counter_isomorphic
by @gbj in #2510 - Simplify stable syntax in examples by @gbj in #2511
- fix: stable Router IDs (closes #2514) by @gbj in #2515
New Contributors
- @mahmoud-eltahawy made their first contribution in #2489
- @solweo made their first contribution in #2499
- @ydirson made their first contribution in #2462
- @Ar4ys made their first contribution in #2289
Full Changelog: v0.6.10...v0.6.11
v0.6.10
Mostly a patch release with a number of bugfixes, as well as some nice quality-of-life improvements:
- allowing
#[prop(attrs)]
on slots - add support for
on:
to dynamic children of components (i.e., when you do<MyComponent on:.../>
, the event listener is now applied correctly to more of the children of<MyComponent/>
)
What's Changed
- remove printlns that run many times by @ChristopherBiscardi in #2402
- feat: allow #[prop(attrs)] on slots by @Upbolt in #2396
- fix: re-throw errors in delegated event listeners by @Giovanni-Tably in #2382
- fix: prevent setting the same event listener twice by @Giovanni-Tably in #2383
- chore: Disallow prints to stdout by @mondeja in #2404
- chore: update to gloo-net 0.5 (closes #2411) by @gbj in #2416
- fix some comments by @battmdpkq in #2413
- fix(ci): leptos examples fail with bindgen schema error by @agilarity in #2428
- chore: update attribute-derive by @ModProg in #2438
- build(examples): clean more output by @agilarity in #2420
- For the session_auth_axum example, move the passhash into a separate non-serializable struct. by @rcythr in #2446
- chore(ci): upgrade actions to node 20 by @agilarity in #2444
- register server_fn first to allow for wildcard Route path by @sify21 in #2435
- chore: examples/tailwind_axum bumped tailwindcss to 3.4.2. by @martinfrances107 in #2443
- Added missing link for #[server] macro by @ratulb in #2437
- fix(ci): trunk command not found by @agilarity in #2453
- Chore(ci) bumping tj-actions/changed-files to version 43. by @martinfrances107 in #2454
- Bumped base64 to 0.22. by @martinfrances107 in #2457
- test(ci): check semver by @agilarity in #2450
- Persist parent span context within resource fetchers by @boyswan in #2456
- Minor: Ran cargo clippy --fix by @martinfrances107 in #2461
- Fix: Small fix for location hash/fragment by @BToersche in #2464
- Allow CDN_PKG_PATH at runtime. by @zakstucke in #2466
- Remove panic for axum ResponseOptions by @jollygreenlaser in #2468
- Fix: Environment variables do not overwrite Config.toml options by @GrumiumXD in #2433
- ci: disable semver checks by @agilarity in #2471
- Add repository field to server_fn_macro by @paolobarbolini in #2474
- chore: bump nightly version in examples by @gbj in #2479
- fix: correctly handle empty
view! {}
in hot-reloading code (closes #2421) by @gbj in #2478 - View::on support for CoreComponent::{DynChild, Each} by @zakstucke in #2422
- fix: handle directives properly in SSR mode (closes #2448) by @gbj in #2477
- chore(ci): run semver checks on push by @agilarity in #2483
New Contributors
- @ChristopherBiscardi made their first contribution in #2402
- @Upbolt made their first contribution in #2396
- @Giovanni-Tably made their first contribution in #2382
- @battmdpkq made their first contribution in #2413
- @rcythr made their first contribution in #2446
- @sify21 made their first contribution in #2435
- @ratulb made their first contribution in #2437
- @boyswan made their first contribution in #2456
- @BToersche made their first contribution in #2464
- @zakstucke made their first contribution in #2466
- @GrumiumXD made their first contribution in #2433
- @paolobarbolini made their first contribution in #2474
Full Changelog: v0.6.9...v0.6.10
v0.6.9
Mostly this release exists to fix imports in Cargo, as well as a few minor bug fixes
What's Changed
- Minor: examples/todomvc - Rename Todos::new() as Todos::default(). by @martinfrances107 in #2390
- Add MessagePack codec by @johnbchron in #2371
New Contributors
- @johnbchron made their first contribution in #2371
Full Changelog: v0.6.8...v0.6.9
v0.6.8
Mostly this release is to disable file hashing by default, and streamline it's use. It can now be enabled by setting hash-files=true
in your Cargo.toml or setting the LEPTOS_HASH_FILES=true
env var when running cargo-leptos. If you're using Docker or moving the bin to a new folder, you need to copy the (by default) hash.txt
file from target/{release_profile_name}
to the same folder as your binary, and make sure the env var or cargo.toml option is enabled. Also some minor bug fixes
What's Changed
- Specify path to wasm bindgen in island macro by @Baptistemontan in #2387
- add note on how to get leptos_axum::ResponseOptions by @sjud in #2380
- fix(ci): "needless borrow" error and example never exiting by @paul-hansen in #2392
- fix: ignore this Axum integration as with other doctests for now by @gbj in #2395
- Unnecessary trait bound
PartialEq
removed fromcreate_owning_memo
by @zroug in #2394 - fix: correctly reset hydration status in islands mode Suspense (closes #2332) by @gbj in #2393
- Rename env var and tweak hashing to align with cargo leptos by @benwis in #2398
New Contributors
Full Changelog: v0.6.7...v0.6.8
0.6.7
Hello everyone! Some lovely changes in here. My favorite is the addition of version hashes to css,js, and wasm files to automatically invalidate browser caching issues. Be sure to update to the latest version of cargo leptos(v0.2.8) to test out this feature. As always, big thanks to our returning contributors and welcome to the new folks!
What's Changed
- feat: Add owning memos to allow memos that re-use the previous value by @pheki in #2139
- feat: add
impl_from
argument to#[server]
proc_macro by @videobitva in #2335 - Make it so that cancelled timeouts don't leak by @rjmac in #2331
- Update suspense_component.rs documentation to use .get() instead of .β¦ by @sjud in #2346
- add comment specifying edgecase of server function prefixes by @sjud in #2345
- feat(leptos-axum): propagate trace context to server functions by @janu-cambrelen in #2340
- finish doc sentence by @sjud in #2348
- Fix Broken Doc links and Deprecate
FromUtf8Error
inoco.rs
by @zoomiti in #2318 - ci(examples): build hackernews_js_fetch with deno by @agilarity in #2344
- chore(ci): fix failing CI by removing deprecation note by @gbj in #2362
- Trailing slashes (#2154) take 2 by @skirsdeda in #2217
- feat: add method to RouteContext (#1808) by @zoomiti in #2315
- Replace Resrouce::read() in doc examples with Resource::get() by @sjud in #2372
- fix: do not strip query in redirect hook when using client-side navigation by @haslersn in #2376
- added hashes generated from cargo-leptos by @maccesch in #2373
- Add MSRV by @paul-hansen in #2360
New Contributors
- @pheki made their first contribution in #2139
- @videobitva made their first contribution in #2335
- @rjmac made their first contribution in #2331
- @janu-cambrelen made their first contribution in #2340
- @skirsdeda made their first contribution in #2217
Full Changelog: v0.6.6...v0.6.7
v0.6.6
Fixed some issues with examples, integrated a server macro for Spin, and improved a number of typos. Thanks to all that participated!
For general 0.6 release notes, see here.
What's Changed
- Update rkyv example button text to accurately reflect what it does by @Innominus in #2250
- example/counter_isomorphic Removed console warning. by @martinfrances107 in #2244
- Chore: Minor, ran
cargo fmt
by @martinfrances107 in #2254 - examples/hackernews: Add a "Suspense" wrapper. by @martinfrances107 in #2253
- fix: error rather than panicking if unable to send response in Axum integration by @gbj in #2241
- docs: fix broken link in leptos_router by @nootr in #2256
- Adding a Beginner's Tip to HtmlElement by @sjud in #2218
- Percent Decode Url Parameters by @zoomiti in #2251
- feat(axum): provide state to server fn context by @chrisp60 in #2257
- Fix typo in actix integrations docs by @SleeplessOne1917 in #2258
- docs: typos in examples by @ngutech21 in #2260
- fix: guarantee execution order of effects (closes #2261) by @gbj in #2262
- fix: make directive
.into()
calls consistent by @blorbb in #2249 - chore: fix typo by @saikatdas0790 in #2267
- Create an axum-no-default feature for server_fn and sets leptos_axum to rely on it instead. by @sjud in #2270
- fix: add key/value pair from submit button when parsing form event by @haslersn in #2268
- fix(ci): address clippy issue by @agilarity in #2278
- fix(test-report) should show all cargo-make leptos configuration by @agilarity in #2282
- Fix remaining CI issues by @gbj in #2285
- docs: give a warning when you try to
.dispatch()
an action immediately (closes #2225) by @gbj in #2286 - fix(ci): empty directory vector error by @agilarity in #2288
- fix(examples): align crate name and output name (closes #2206) by @gbj in #2291
- pub export server is either from leptos_macro or leptos_spin_macro depending on if spin feature is enabled. by @sjud in #2280
- ci(examples): configure leptos examples to build with cargo-leptos when possible by @agilarity in #2294
- session_auth_axum compiles and works again by @drebbe-intrepid in #2310
- I have been looking the "github actions" build warnings. by @martinfrances107 in #2303
- fix(meta): provide meta context missing in example by @EstebanBorai in #2311
- Error type detection only worked without type path by @maccesch in #2298
- feat: use cdn url for static assets (#2281) by @zoomiti in #2283
- Bumping config to 0.14. by @martinfrances107 in #2302
- fix: Transition in hydrate mode that isn't initially created (closes #2279) by @gbj in #2314
- docs(examples): update docs by @agilarity in #2313
- docs: log error on failing to convert form to ServerFn type, in addition to setting action value by @gbj in #2319
- chore(ci): reduce set of tested features to prevent running out of disk space in
server_fn
by @gbj in #2320 - examples: fix CSS file name in
tailwind_axum
by @gbj in #2324 - fix: handle cross-origin redirects in server function redirect hook by @haslersn in #2329
- Fixed href path in tailwind_csr example by @itsDrac in #2328
New Contributors
- @Innominus made their first contribution in #2250
- @nootr made their first contribution in #2256
- @zoomiti made their first contribution in #2251
- @ngutech21 made their first contribution in #2260
- @haslersn made their first contribution in #2268
- @drebbe-intrepid made their first contribution in #2310
- @EstebanBorai made their first contribution in #2311
- @itsDrac made their first contribution in #2328
Full Changelog: v0.6.5...v0.6.6
0.6.5
0.6.4
This fixes a few bugs that have popped up since 0.6.3. For general 0.6 migration notes, see here.
What's Changed
- chore: define
edtion = "2021"
inrustfmt.toml
by @chrisp60 in #2235 - fix: correctly track source in
create_local_resource
(closes #2237) by @gbj in #2238 - example: file upload with streaming progress bar by @gbj in #2242
- fix: serialization error during SSR on ServerFnError by @gbj in #2240
Full Changelog: v0.6.3...v0.6.4
0.6.3
This is release for our new server functions rewrite and Axum 0.7 support.
This should be a relatively feature-rich release, with limited breaking changes.
Migration
Actix
- You can remove any explicit
.handle_server_fns()
call in yourmain.rs
, as server functions are now handled in.leptos_routes()
- The current
extract
function has been removed, and replaced with a newextract
that has the same API as the currentextractor
. I think this API is strictly better, but please share feedback if you disagree.
Axum
- This release supports Axum 0.7, so you'll need to migrate from Axum 0.6. The easiest way to do this is probably to consult the diff on one of the examples. (Note that along with Axum 0.7, you'll need to update to
http
1.0 andtower_http
0.5.) - You can remove any explicit
.handle_server_fns()
call in yourmain.rs
, as server functions are now handled in.leptos_routes()
- The current
extract
function has been removed, and replaced with a newextract
that has the same API as the currentextractor
. I think this API is strictly better, but please share feedback if you disagree. RequestParts
has been removed, ashttp::request::Parts
now implementsClone
: anyuse_context::<RequestParts>()
should be updated to useParts
directly instead.
ServerFnError::new()
The addition of custom error types means that constructing ServerFnError
inside server functions can cause type inference errors:
let oops = Err(ServerFnError::ServerError("No server state".to_string()));
return oops; // this is fine
oops? // this is not: cannot infer type of the type parameter `E` declared on the enum `ServerFnError`
As a result, we've added a helper ServerFnError::new
which simply constructs a ServerFnError::<NoCustomError>::ServerError
:
let oops = Err(ServerFnError::new("No server state"));
return oops; // this is fine
oops? // this is also fine now
This has the benefit of being more concise than the earlier pattern in any case.
Features
A rewritten server function system that is backwards-compatible, but reduces binary size and increases flexibility, specifically by allowing
- automatic setup of server fn handlers with
.leptos_routes()
from the integrations - a variety of additional built-in encodings (rkyv, multipart forms/file uploads) in addition to the current set (GET URL, POST URL, CBOR, Rkyv) (#1868, #1989)
- support for streaming responses from server functions (#1284)
- ability to create custom user encodings for input and output by deriving
IntoReq
,FromReq
,IntoRes
, and/orFromRes
traits - ability to mix and match encodings easily: This server function should be a JSON POST request and a ByteStream response, this one should be GET URL request and an rkyv response, etc.; any combination of the encodings above is supported
- custom error types (#1657)
- a
#[middleware]
macro to add per-server-function middleware from the Tower or Actix ecosystems (#1461)
Note: The additional included encodings (serde_lite
, rkyv
, multipart form data) are all enabled by additive features on the server_fn
crate. If you want to use them you can just add that crate as a dependency and enable the required features.
Example: You can find a comprehensive example of these new features in the new server_fns_axum
example.
Full Changelog: v0.5.7...0.6.3
0.6.2
This is release for our new server functions rewrite and Axum 0.7 support.
This should be a relatively feature-rich release, with limited breaking changes.
Migration
Actix
- You can remove any explicit
.handle_server_fns()
call in yourmain.rs
, as server functions are now handled in.leptos_routes()
- The current
extract
function has been removed, and replaced with a newextract
that has the same API as the currentextractor
. I think this API is strictly better, but please share feedback if you disagree.
Axum
- This release supports Axum 0.7, so you'll need to migrate from Axum 0.6. The easiest way to do this is probably to consult the diff on one of the examples. (Note that along with Axum 0.7, you'll need to update to
http
1.0 andtower_http
0.5.) - You can remove any explicit
.handle_server_fns()
call in yourmain.rs
, as server functions are now handled in.leptos_routes()
- The current
extract
function has been removed, and replaced with a newextract
that has the same API as the currentextractor
. I think this API is strictly better, but please share feedback if you disagree. RequestParts
has been removed, ashttp::request::Parts
now implementsClone
: anyuse_context::<RequestParts>()
should be updated to useParts
directly instead.
ServerFnError::new()
The addition of custom error types means that constructing ServerFnError
inside server functions can cause type inference errors:
let oops = Err(ServerFnError::ServerError("No server state".to_string()));
return oops; // this is fine
oops? // this is not: cannot infer type of the type parameter `E` declared on the enum `ServerFnError`
As a result, we've added a helper ServerFnError::new
which simply constructs a ServerFnError::<NoCustomError>::ServerError
:
let oops = Err(ServerFnError::new("No server state"));
return oops; // this is fine
oops? // this is also fine now
This has the benefit of being more concise than the earlier pattern in any case.
Features
A rewritten server function system that is backwards-compatible, but reduces binary size and increases flexibility, specifically by allowing
- automatic setup of server fn handlers with
.leptos_routes()
from the integrations - a variety of additional built-in encodings (rkyv, multipart forms/file uploads) in addition to the current set (GET URL, POST URL, CBOR, Rkyv) (#1868, #1989)
- support for streaming responses from server functions (#1284)
- ability to create custom user encodings for input and output by deriving
IntoReq
,FromReq
,IntoRes
, and/orFromRes
traits - ability to mix and match encodings easily: This server function should be a JSON POST request and a ByteStream response, this one should be GET URL request and an rkyv response, etc.; any combination of the encodings above is supported
- custom error types (#1657)
- a
#[middleware]
macro to add per-server-function middleware from the Tower or Actix ecosystems (#1461)
Note: The additional included encodings (serde_lite
, rkyv
, multipart form data) are all enabled by additive features on the server_fn
crate. If you want to use them you can just add that crate as a dependency and enable the required features.
Example: You can find a comprehensive example of these new features in the new server_fns_axum
example.
Full Changelog: v0.5.7...0.6.2