Cot.rs

Cot.rs

@cot.rs

The Rust web framework for lazy developers

28 followers5 following29 posts

Foreign key fields now let you control referential integrity policies directly from the model definition. Previously, Cot always generated RESTRICT for both policies. Now you can choose any standard option giving you full control over what happens when a referenced row is updated or deleted.

ProjectConfig now has a catch-all extra field that captures any configuration keys Cot doesn’t recognise. This is the idiomatic way to add project-specific settings to the standard config TOML files without fighting the parser.

Forms are central to almost every web app, and in v0.7 we’ve made Cot’s form system more expressive. All the major field types: String, Password, Email, Url, number, and float fields, now expose a much larger set of HTML attributes that you can configure through field options

View full thread

While we like to focus on the user and developer experiences, it's nice to get performance benefits whenever feasible, and so in v0.6, we've replaced SHA-2 with BLAKE3 for both static file hashing and session authentication hashes 🚀

View full thread

While we're at the ORM topic, a small, yet useful fix is that now you can use raw Rust identifiers in model and field names. You can now name your fields, models, and tables however you want!

We've overhauled the cot-site repository and moved the framework guide directly into the main cot repository. This change ensures that code and documentation updates happen at the same time. We have other documentation improvements in mind for next releases!

View full thread

By decoupling the core from the rest of the framework, we've achieved a cleaner codebase and slightly faster build times. This is just the beginning; our long-term goal is to extract the ORM into its own crate as well, making it available for use in projects outside of the Cot framework. Stay tuned!

One of the long-awaited change in the ORM was the custom migrations. With Cot v0.6, you can now generate a migration template that executes arbitrary Rust code! Do you want to change format of your blog posts titles in the database? Now you can!

The most significant architectural shift in this release is the extraction of our core logic into a dedicated crate: cot-core. This new foundation handles the essentials—HTTP request handling, error management, extractors, and other fundamental building blocks.

Cot v0.4 is out! This Rust web framework update brings significant improvements to error handling, forms, and session management. We've been working on this for four months and are quite pleased with how it turned out 🎉

View full thread

The new `FromRequestParts` derive macro cuts down on repetitive code. Instead of listing `Urls`, `StaticFiles`, and `RouteName` in every handler signature, you can bundle them into one struct. Small quality of life improvement that really adds up.

Cot v0.4 is out! This Rust web framework update brings significant improvements to error handling, forms, and session management. We've been working on this for four months and are quite pleased with how it turned out 🎉

View full thread

Forms are much more capable now. File uploads work out of the box just by using a pre-defined special type! Full chrono support means date and time pickers actually work properly, and you can configure HTML attributes programmatically with restrictions like "images only".

Session stores are now pluggable, so you can switch between backends without touching your code. Use in-memory for development, Redis for production, or the new database-backed store, which is now the default since it's good enough until you need Redis performance.

Cot v0.4 is out! This Rust web framework update brings significant improvements to error handling, forms, and session management. We've been working on this for four months and are quite pleased with how it turned out 🎉

Error handling got a complete redesign. Before, you mostly got 404s and 500s; now you get proper HTTP status codes for different error types. The new system uses a single error handler instead of separate ones, and we managed to shrink error structs from 110+ bytes down to just 8 bytes.

View full thread

The static file framework has been improved to support content hashing. This is a big win for production performance, as it allows you to use aggressive caching strategies without worrying about cache invalidation.

One of the biggest features is the automatic OpenAPI specification generation! It allows you to generate a specification for your API endpoints automatically, making it almost zero effort to generate Swagger UI for your RESTful endpoints that will always be kept in sync with the source code.

Another neat thing is the addition of the `IntoResponse` trait. This trait allows you to convert any type into a response, making it easier to return different types of responses from your request handlers.

You are up to date.