Unpoly in Rust
What is Unpoly?
Unpoly is an unobtrusive Javascript framework for applications that render on the server. It allows your views to do things that are not normally possible in HTML, such as having links update only fragments of a page, or opening links in modal dialogs.
Unpoly can give your server-side application a fast and flexible frontend that feel like a single-page application (SPA). It also preserves the resilience and simplicity of the server-side programming model.
So with Unpoly you hardly have to write any Javascript for the frontend; your site is almost completely written is server-side delivered/generated html and css. No need to write code in both the frontend and backend for getting the data, validating forms, etc.
How does Unpoly-rs helps?
Unpoly works with regular html files. If the backend serve html files, static or dynamic, you're good to go. However, when the backends implements the Unpoly Server Protocol, the responses can be exactly suited to match the requests.
Typical usages
use IntoResponse;
use extract;
use Deserialize;
use json;
/// Omitting content that isn't targeted
/// https://unpoly.com/optimizing-responses#omitting-content-that-isnt-targeted
/// Rendering different content for overlays
/// https://unpoly.com/optimizing-responses#rendering-different-content-for-overlays
/// Rendering different content for unpoly requests
/// https://unpoly.com/optimizing-responses#rendering-different-content-for-unpoly-requests
/// Rendering content that depends on layer context
/// https://unpoly.com/optimizing-responses#rendering-content-that-depends-on-layer-context
/// Set the title of the page via a fragment update
/// Send events to the frontend
/// Expire cache
/// Validating a form
/// https://unpoly.com/up-validate