Skip to content
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
1,007 changes: 567 additions & 440 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
axum = { version = "0.7", features = ["macros"] }
axum = { version = "0.8", features = ["macros"] }
mrml = { version = "5.0.0", path = "../../packages/mrml-core", features = [
"async",
"http-loader-async-reqwest",
Expand Down
6 changes: 3 additions & 3 deletions packages/mrml-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ serde_json = { version = "1.0", optional = true }
htmlparser = { workspace = true, optional = true }
indexmap = { version = "2.6", default-features = false }
rustc-hash = { version = "2.0", default-features = false }
thiserror = { version = "1.0", optional = true }
thiserror = { version = "2.0", optional = true }

# http-loader feature related
reqwest = { version = "0.12", default-features = false, features = [
"rustls-tls",
], optional = true }
ureq = { version = "2.10", optional = true }
ureq = { version = "3.0", optional = true }
url = { version = "2.5", optional = true }

# macros
itertools = { version = "0.13" }
itertools = { version = "0.14" }
enum_dispatch = { version = "0.3", optional = true }
enum-as-inner = { version = "0.6", optional = true }

Expand Down
4 changes: 1 addition & 3 deletions packages/mrml-core/lib/css-compare/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ repository = "https://github.com/jdrouet/mrml"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
lightningcss = { version = "1.0.0-alpha.59", features = [
"grid",
], default-features = false }
lightningcss = { version = "1.0.0-alpha.66", default-features = false }

[dev-dependencies]
similar-asserts = { workspace = true }
6 changes: 4 additions & 2 deletions packages/mrml-core/lib/css-compare/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ pub enum Error<'a> {

fn font_family_as_key(item: &FontFamily<'_>) -> String {
match item {
FontFamily::FamilyName(inner) => inner.to_string(),
FontFamily::FamilyName(inner) => inner
.to_css_string(PrinterOptions::default())
.unwrap_or_default(),
FontFamily::Generic(inner) => inner.as_str().to_string(),
}
}
Expand Down Expand Up @@ -366,7 +368,7 @@ mod tests {
width: 50% !important;
max-width: 50%;
}

.mj-column-per-33-333332 {
width: 33.333332% !important;
max-width: 33.333332%;
Expand Down
2 changes: 1 addition & 1 deletion packages/mrml-core/lib/html-compare/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = "https://github.com/jdrouet/mrml"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
colored = "2.0"
colored = "3.0"
css-compare = { path = "../css-compare", version = "0.1" }
similar-asserts = { workspace = true }
htmlparser = { workspace = true }
28 changes: 13 additions & 15 deletions packages/mrml-core/src/prelude/parser/http_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,19 @@ impl HttpFetcher for UreqFetcher {
headers: &HashMap<String, String>,
) -> Result<String, IncludeLoaderError> {
let req = ureq::get(url);
let req = headers
.iter()
.fold(req, |r, (key, value)| r.set(key.as_str(), value.as_str()));
req.call()
.map_err(|err| {
IncludeLoaderError::new(url, ErrorKind::NotFound)
.with_message("unable to fetch template")
.with_cause(Arc::new(err))
})?
.into_string()
.map_err(|err| {
IncludeLoaderError::new(url, ErrorKind::InvalidData)
.with_message("unable to convert remote template as string")
.with_cause(Arc::new(err))
})
let req = headers.iter().fold(req, |r, (key, value)| {
r.header(key.as_str(), value.as_str())
});
let mut res = req.call().map_err(|err| {
IncludeLoaderError::new(url, ErrorKind::NotFound)
.with_message("unable to fetch template")
.with_cause(Arc::new(err))
})?;
res.body_mut().read_to_string().map_err(|err| {
IncludeLoaderError::new(url, ErrorKind::InvalidData)
.with_message("unable to convert remote template as string")
.with_cause(Arc::new(err))
})
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/mrml-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ mrml = { version = "5.0.0", path = "../mrml-core", features = [
"http-loader-ureq",
"local-loader",
] }
pyo3 = { version = "0.23", features = ["extension-module"] }
pyo3 = { version = "0.24", features = ["extension-module"] }
2 changes: 1 addition & 1 deletion packages/mrml-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ serde = { version = "1.0", features = ["derive"] }
serde-wasm-bindgen = { version = "0.6" }

# to generate typescript binding
tsify = { version = "0.4" }
tsify = { version = "0.5" }

wasm-bindgen = { version = "0.2" }
wasm-bindgen-futures = { version = "0.4", optional = true }
Expand Down
6 changes: 0 additions & 6 deletions packages/mrml-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,6 @@ impl ToHtmlResult {
}
}

impl From<ToHtmlResult> for JsValue {
fn from(value: ToHtmlResult) -> Self {
serde_wasm_bindgen::to_value(&value).unwrap()
}
}

#[cfg(test)]
mod tests {
#![allow(dead_code)]
Expand Down
Loading