Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocket 0.5 release! #8

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rocket = { version = "0.5.0-rc.1", features = ["json"], optional = true }
rocket = { version = "0.5", features = ["json"], optional = true }
serde = { version = "1", features = ["derive"] }
serde_json = "1.0"
tracing = "0.1"
Expand Down
Empty file.
10 changes: 6 additions & 4 deletions examples/rocket-svelte/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#[macro_use]
extern crate rocket;

use inertia_rs::rocket::{Inertia, VersionFairing};
use inertia_rs::{rocket::VersionFairing, Inertia};
use rocket::fs::FileServer;
use rocket::response::Responder;
use rocket_dyn_templates::Template;
use rocket::fs::FileServer;

#[derive(serde::Serialize)]
struct Hello {
Expand All @@ -17,7 +17,9 @@ fn hello() -> Inertia<Hello> {
// the component to render
"Hello",
// the props to pass our component
Hello { name: "world".into() },
Hello {
name: "world".into(),
},
)
}

Expand All @@ -27,7 +29,7 @@ fn rocket() -> _ {
.mount("/", routes![hello])
.attach(Template::fairing())
.mount("/public", FileServer::from(rocket::fs::relative!("public")))
// Version fairing is configured with current asset version, and a
// Version fairing is configured with current asset version, and a
// closure to generate the html template response
.attach(VersionFairing::new("1", |request, ctx| {
Template::render("app", ctx).respond_to(request)
Expand Down
2 changes: 2 additions & 0 deletions src/rocket.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::type_complexity)]

use super::{Inertia, X_INERTIA, X_INERTIA_LOCATION, X_INERTIA_VERSION};
use rocket::fairing::{Fairing, Info, Kind};
use rocket::http::{self, Method};
Expand Down
Loading