Skip to content

Commit abe016e

Browse files
authored
Bump version 0.14.0 (#1155)
* Bump version 0.14.0
1 parent f72a6bd commit abe016e

File tree

5 files changed

+93
-5
lines changed

5 files changed

+93
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ license = "Apache-2.0"
99

1010
[package]
1111
name = "loco-rs"
12-
version = "0.13.2"
12+
version = "0.14.0"
1313
description = "The one-person framework for Rust"
1414
homepage = "https://loco.rs/"
1515
documentation = "https://docs.rs/loco-rs"
@@ -49,7 +49,7 @@ bg_sqlt = ["dep:sqlx", "dep:ulid"]
4949
integration_test = []
5050

5151
[dependencies]
52-
loco-gen = { version = "0.13.2", path = "./loco-gen" }
52+
loco-gen = { version = "0.14.0", path = "./loco-gen" }
5353
backtrace_printer = { version = "1.3.0" }
5454

5555
# cli

docs-site/content/docs/extras/upgrades.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,91 @@ These are the major ones:
3333
* [SeaORM](https://www.sea-ql.org/SeaORM), [CHANGELOG](https://github.com/SeaQL/sea-orm/blob/master/CHANGELOG.md)
3434
* [Axum](https://github.com/tokio-rs/axum), [CHANGELOG](https://github.com/tokio-rs/axum/blob/main/axum/CHANGELOG.md)
3535

36+
37+
## Upgrade from 0.13.x to 0.14.x
38+
39+
### Upgrading from Axum 0.7 to 0.8
40+
41+
PR: [#1130](https://github.com/loco-rs/loco/pull/1130)
42+
The upgrade to Axum 0.8 introduces a breaking change. For more details, refer to the [announcement](https://tokio.rs/blog/2025-01-01-announcing-axum-0-8-0).
43+
#### Steps to Upgrade
44+
* In your `Cargo.toml`, update the Axum version from `0.7.5` to `0.8.1`.
45+
* Replace use `axum::async_trait`; with use `async_trait::async_trait;`. For more information, see [here](https://tokio.rs/blog/2025-01-01-announcing-axum-0-8-0#async_trait-removal).
46+
* The URL parameter syntax has changed. Refer to [this section](https://tokio.rs/blog/2025-01-01-announcing-axum-0-8-0#path-parameter-syntax-changes) for the updated syntax. The new path parameter format is:
47+
The path parameter syntax has changed from `/:single` and `/*many` to `/{single}` and `/{*many}`.
48+
49+
50+
### Extending the `boot` Function Hook
51+
PR: [#1143](https://github.com/loco-rs/loco/pull/1143)
52+
53+
The `boot` hook function now accepts an additional Config parameter. The function signature has changed from:
54+
55+
From
56+
```rust
57+
async fn boot(mode: StartMode, environment: &Environment) -> Result<BootResult> {
58+
create_app::<Self, Migrator>(mode, environment).await
59+
}
60+
```
61+
To:
62+
```rust
63+
async fn boot(mode: StartMode, environment: &Environment, config: Config) -> Result<BootResult> {
64+
create_app::<Self, Migrator>(mode, environment, config).await
65+
}
66+
```
67+
Make sure to import the `Config` type as needed.
68+
69+
### Upgrade validator crate
70+
PR: [#993](https://github.com/loco-rs/loco/pull/993)
71+
72+
Update the `validator` crate version in your `Cargo.toml`:
73+
74+
From
75+
```
76+
validator = { version = "0.18" }
77+
```
78+
To
79+
```
80+
validator = { version = "0.19" }
81+
```
82+
83+
### Extend truncate and seed hooks
84+
PR: [#1158](https://github.com/loco-rs/loco/pull/1158)
85+
86+
The `truncate` and `seed` functions now receive `AppContext` instead of `DatabaseConnection` as their argument.
87+
88+
From
89+
```rust
90+
async fn truncate(db: &DatabaseConnection) -> Result<()> {}
91+
async fn seed(db: &DatabaseConnection, base: &Path) -> Result<()> {}
92+
```
93+
To
94+
```rust
95+
async fn truncate(ctx: &AppContext) -> Result<()> {}
96+
async fn seed(_ctx: &AppContext, base: &Path) -> Result<()> {}
97+
```
98+
99+
Impact on Testing:
100+
101+
Testing code involving the seed function must also be updated accordingly.
102+
103+
from:
104+
```rust
105+
async fn load_page() {
106+
request::<App, _, _>(|request, ctx| async move {
107+
seed::<App>(&ctx.db).await.unwrap();
108+
...
109+
})
110+
.await;
111+
}
112+
```
113+
114+
to
115+
```rust
116+
async fn load_page() {
117+
request::<App, _, _>(|request, ctx| async move {
118+
seed::<App>(&ctx).await.unwrap();
119+
...
120+
})
121+
.await;
122+
}
123+
```

loco-gen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "loco-gen"
3-
version = "0.13.2"
3+
version = "0.14.0"
44
description = "Loco generators"
55
license.workspace = true
66
edition.workspace = true

loco-new/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "loco"
5-
version = "0.13.3"
5+
version = "0.14.0"
66
edition = "2021"
77
description = "Loco new app generator"
88
license = "Apache-2.0"

loco-new/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub mod wizard;
99
pub type Result<T> = std::result::Result<T, Error>;
1010

1111
/// Matching minimal Loco version.
12-
pub const LOCO_VERSION: &str = "0.13.2";
12+
pub const LOCO_VERSION: &str = "0.14.0";
1313

1414
#[derive(thiserror::Error, Debug)]
1515
pub enum Error {

0 commit comments

Comments
 (0)