- Added:
loco version
for getting an operable version string containing logical crate version and git SHA if available:0.3.0 (<git sha>)
To migrate to this behavior from earlier versions, it requires adding the following to your app.rs
app hooks:
fn app_version() -> String {
format!(
"{} ({})",
env!("CARGO_PKG_VERSION"),
option_env!("BUILD_SHA")
.or(option_env!("GITHUB_SHA"))
.unwrap_or("dev")
)
}
Reminder: loco --version
will give you the current Loco framework which your app was built against and loco version
gives you your app version.
- Added:
loco generate migration
for adding ad-hoc migrations - Added: added support in model generator for many-to-many link table generation via
loco generate model --link
- Docs: added Migration section, added relations documentation 1:M, M:M
- Adding .devcontainer to starter projects loco-rs#170
- Braking changes: Adding
Hooks::boot
application. Migration steps:// Load boot::{create_app, BootResult, StartMode} from loco_rs lib // Load migration: use migration::Migrator; Only when using DB // Adding boot hook with the following code impl Hooks for App { ... async fn boot(mode: StartMode, environment: &str) -> Result<BootResult> { // With DB: create_app::<Self, Migrator>(mode, environment).await // Without DB: create_app::<Self>(mode, environment).await } ... }
- Added pretty backtraces loco-rs#41
- adding tests for note requests loco-rs#156
- Define the min rust version the loco can run loco-rs#164
- Added
cargo loco doctor
cli command for validate and diagnose configurations. loco-rs#145 - Added ability to specify
settings:
in config files, which are available in context - Adding compilation mode in the banner. loco-rs#127
- Support shuttle deployment generator. loco-rs#124
- Adding a static asset middleware which allows to serve static folder/data. Enable this section in config. loco-rs#134
static: enable: true # ensure that both the folder.path and fallback file path are existence. must_exist: true folder: uri: "/assets" path: "frontend/dist" fallback: "frontend/dist/index.html"
- fix:
loco generate request
test template. loco-rs#133 - Improve docker deployment generator. loco-rs#131
- refactor: local settings are now
<env>.local.yaml
and available for all environments, for example you can add a localtest.local.yaml
anddevelopment.local.yaml
- refactor: removed
config-rs
and now doing config loading by ourselves. - fix: email template rendering will not escape URLs
- Config with variables: It is now possible to use tera templates in config YAML files
Example of pulling a port from environment:
server:
port: {{ get_env(name="NODE_PORT", default=3000) }}
It is possible to use any tera
templating constructs such as loops, conditionals, etc. inside YAML configuration files.
-
Mailer: expose
stub
in non-test -
Hooks::before_run
with a default blank implementation. You can now code some custom loading of resources or other things before the app runs -
an LLM inference example, text generation in Rust, using an API (
examples/inference
) -
Loco starters version & create release script loco-rs#110
-
Configure Cors middleware loco-rs#114
-
Hooks::after_routes
Invoke this function after the Loco routers have been constructed. This function enables you to configure custom Axum logics, such as layers, that are compatible with Axum. loco-rs#114 -
Adding docker deployment generator loco-rs#119
DOCS:
- Remove duplicated docs in auth section
- FAQ docs: loco-rs#116
ENHANCEMENTS:
- Remove unused libs: loco-rs#106
- turn off default features in tokio loco-rs#118
NEW FEATURES
format:html
loco-rs#74- Create a stateless HTML starter loco-rs#100
- Added worker generator + adding a way to test workers loco-rs#92
ENHANCEMENTS:
- CI: allows cargo cli run on fork prs loco-rs#96