Skip to content

Commit

Permalink
Merge pull request #39 from azriel91/maintenance/update-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
azriel91 authored Dec 14, 2024
2 parents 0802729 + d007fcb commit 892f844
Show file tree
Hide file tree
Showing 18 changed files with 376 additions and 697 deletions.
8 changes: 7 additions & 1 deletion .cargo/audit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ ignore = [
# `proc-macro-error` is Unmaintained.
#
# Transitive dependency of `syn_derive`.
# Pending https://github.com/Kyuuhachi/syn_derive/issues/4.
# Pending <https://github.com/rs-tml/rstml/issues/56>.
"RUSTSEC-2024-0370",

# `derivative` is unmaintained.
#
# Transitive dependency of `log4rs`.
# Pending <https://github.com/estk/log4rs/issues/391>.
"RUSTSEC-2024-0388",
]
46 changes: 23 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ default = [
rt = ["dep:dot_ix_rt"]
web_components = ["dep:dot_ix_web_components"]

flex_diag = ["dot_ix_web_components?/flex_diag"]
ssr = ["dot_ix_web_components?/ssr"]
server_side_graphviz = ["dot_ix_web_components?/server_side_graphviz"]

Expand Down Expand Up @@ -62,36 +61,37 @@ dot_ix_static_check_macros = { version = "0.8.1", path = "crate/static_check_mac
dot_ix_web_components = { version = "0.8.1", path = "crate/web_components" }

# external crates
axum = "0.7.6"
axum = "0.7.9"
cfg-if = "1"
console_error_panic_hook = "0.1"
console_log = "1"
cfg-if = "1"
gloo-net = "0.6.0"
indexmap = "2.5.0"
indexmap = "2.7.0"
indoc = "2.0.5"
js-sys = "0.3.70"
web-sys = "0.3.70"
leptos = { version = "0.6" }
leptos_axum = "0.6"
leptos_meta = { version = "0.6" }
leptos_router = { version = "0.6" }
leptos-use = "0.13.5"
js-sys = "0.3.76"
web-sys = "0.3.76"
leptos = { version = "0.7.0" }
leptos_axum = "0.7.0"
leptos_meta = { version = "0.7.0" }
leptos_router = { version = "0.7.0" }
leptos_router_macro = { version = "0.7.0" }
leptos-use = { git = "https://github.com/Synphonyte/leptos-use.git" }
log = "0.4"
log4rs = { version = "1.3.0", default-features = false }
monaco = "0.4.0"
serde = "1.0.210"
tempfile = "3.12.0"
tokio = "1.40.0"
tower = "0.5.1"
wasm-bindgen = "0.2.93"
monaco = "0.5.0"
serde = "1.0.216"
tempfile = "3.14.0"
tokio = "1.42.0"
tower = "0.5.2"
wasm-bindgen = "0.2.99"
tailwind-css = "0.13.0"
thiserror = "1.0.64"
tracing = "0.1.40"
http = "1.1.0"
proc-macro2 = "1.0.86"
thiserror = "2.0.7"
tracing = "0.1.41"
http = "1.2.0"
proc-macro2 = "1.0.92"
quote = "1.0.37"
reqwest = "0.12.7"
syn = "2.0.77"
reqwest = "0.12.9"
syn = "2.0.90"
serde_yaml = "0.9.34"

[workspace.lints.rust]
Expand Down
2 changes: 1 addition & 1 deletion crate/rt/src/info_graph_dot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl InfoGraphDot<'_> {
}
}

impl<'graph> Themeable for InfoGraphDot<'graph> {
impl Themeable for InfoGraphDot<'_> {
fn node_ids(&self) -> impl Iterator<Item = &NodeId>
where
Self: Sized,
Expand Down
6 changes: 0 additions & 6 deletions crate/web_components/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ web-sys = { workspace = true, features = ["Document", "Element", "HtmlElement",

[features]
default = []
flex_diag = [
"dep:dot_ix_rt",
"dot_ix_rt?/info_graph_html",

"dep:serde",
]
ssr = [
"dep:leptos_axum",
"dep:tempfile",
Expand Down
74 changes: 45 additions & 29 deletions crate/web_components/src/dot_svg.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
use leptos::{component, view, IntoView, Signal, SignalGet};
use leptos::{
component,
prelude::{ClassAttribute, ElementChild, Get, Signal},
view, IntoView,
};

#[cfg(not(feature = "server_side_graphviz"))]
use leptos::prelude::{Effect, NodeRef};

use dot_ix_model::{common::DotSrcAndStyles, info_graph::InfoGraph};

#[cfg(feature = "server_side_graphviz")]
use leptos::{server, server_fn::error::NoCustomError, ServerFnError, Suspense};
use leptos::{
prelude::{InnerHtmlAttribute, Resource, ServerFnError},
server,
server_fn::error::NoCustomError,
suspense::Suspense,
};

#[cfg(any(
all(feature = "ssr", feature = "server_side_graphviz"),
target_arch = "wasm32"
))]
use dot_ix_model::common::{dot_src_and_styles::GraphvizImage, Images};

#[cfg(not(feature = "server_side_graphviz"))]
use leptos::prelude::{GlobalAttributes, GlobalOnAttributes, NodeRefAttribute};

#[cfg(not(feature = "server_side_graphviz"))]
use leptos::html::Div;
#[cfg(not(feature = "server_side_graphviz"))]
Expand All @@ -35,7 +50,6 @@ pub async fn dot_svg(
info_graph: InfoGraph,
dot_src_and_styles: DotSrcAndStyles,
) -> Result<(String, String), ServerFnError<NoCustomError>> {
use dot_ix_model::info_graph;
use std::process::Stdio;
use tokio::io::{AsyncReadExt, AsyncWriteExt};

Expand Down Expand Up @@ -236,10 +250,10 @@ async fn dot_svg_styles(dot_src: &str) -> Result<String, ServerFnError<NoCustomE
pub fn DotSvg(
info_graph: Signal<InfoGraph>,
dot_src_and_styles: Signal<Option<DotSrcAndStyles>>,
#[prop(default = Signal::from(|| false))] diagram_only: Signal<bool>,
#[prop(default = Signal::from(false))] diagram_only: Signal<bool>,
) -> impl IntoView {
let _diagram_only = diagram_only;
let dot_svg_and_error_resource = leptos::create_resource(
let dot_svg_and_error_resource = Resource::new(
move || dot_src_and_styles.get(),
move |dot_src_and_styles| async move {
if let Some(dot_src_and_styles) = dot_src_and_styles {
Expand All @@ -264,27 +278,29 @@ pub fn DotSvg(
>
{ move || {
dot_svg_and_error_resource.get()
.map(|(dot_svg, error_text)| view! {
<div>
<div inner_html=dot_svg />

<div class={
let error_text_empty = error_text.is_empty();
move || {
if error_text_empty {
"hidden"
} else {
"
border
border-amber-300
bg-gradient-to-b from-amber-100 to-amber-200
rounded
"
.map(|(dot_svg, error_text)| {
let error_text_empty = error_text.is_empty();
view! {
<div>
<div inner_html=dot_svg />

<div class={
move || {
if error_text_empty {
"hidden"
} else {
"
border
border-amber-300
bg-gradient-to-b from-amber-100 to-amber-200
rounded
"
}
}
}
}
>{error_text}</div>
</div>
>{error_text}</div>
</div>
}
})
}}
</Suspense>
Expand Down Expand Up @@ -327,12 +343,12 @@ pub fn DotSvg(
pub fn DotSvg(
info_graph: Signal<InfoGraph>,
dot_src_and_styles: Signal<Option<DotSrcAndStyles>>,
#[prop(default = Signal::from(|| false))] diagram_only: Signal<bool>,
#[prop(default = Signal::from(false))] diagram_only: Signal<bool>,
) -> impl IntoView {
// DOM elements for the graph and error
let svg_div_ref = leptos::create_node_ref::<Div>();
let svg_div_ref = NodeRef::<Div>::new();

let (error_text, set_error_text) = leptos::create_signal(None::<String>);
let (error_text, set_error_text) = leptos::prelude::signal(None::<String>);

#[cfg(not(target_arch = "wasm32"))]
{
Expand All @@ -341,12 +357,12 @@ pub fn DotSvg(
let _set_error_text = set_error_text;
}

leptos::create_effect(move |_| {
Effect::new(move |_| {
#[cfg(not(target_arch = "wasm32"))]
let _svg_div_ref = svg_div_ref;

#[cfg(target_arch = "wasm32")]
use leptos::SignalSet;
use leptos::prelude::Set;
#[cfg(target_arch = "wasm32")]
if let Some(dot_src_and_styles) = dot_src_and_styles.get() {
if !dot_src_and_styles.dot_src.is_empty() {
Expand Down
10 changes: 8 additions & 2 deletions crate/web_components/src/error_template.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
use cfg_if::cfg_if;
use http::status::StatusCode;
use leptos::*;
use leptos::{
component,
control_flow::For,
error::Errors,
prelude::{ElementChild, GetUntracked, RwSignal},
view, IntoView,
};
use thiserror::Error;

#[cfg(feature = "ssr")]
Expand Down Expand Up @@ -49,7 +55,7 @@ pub fn ErrorTemplate(
// Only the response code for the first error is actually sent from the server
// this may be customized by the specific application
cfg_if! { if #[cfg(feature="ssr")] {
let response = use_context::<ResponseOptions>();
let response = leptos::context::use_context::<ResponseOptions>();
if let Some(response) = response {
response.set_status(errors[0].status_code());
}
Expand Down
Loading

0 comments on commit 892f844

Please sign in to comment.