diff --git a/Cargo.toml b/Cargo.toml index f75f084..33e281d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "monaco" -version = "0.6.0" +version = "0.7.0" authors = ["Simon Berger "] edition = "2018" description = "Rust WASM bindings for the Monaco Editor" @@ -28,7 +28,7 @@ yew-components = ["api", "yew"] js-sys = "0.3" paste = "1.0" wasm-bindgen = "0.2" -yew = { version = "0.22", features = ["csr"], optional = true } +yew = { version = "0.23", features = ["csr"], optional = true } [dependencies.web-sys] version = "0.3" diff --git a/examples/yew/Cargo.toml b/examples/yew/Cargo.toml index f3a25be..fb3fc3d 100644 --- a/examples/yew/Cargo.toml +++ b/examples/yew/Cargo.toml @@ -7,4 +7,4 @@ edition = "2018" [dependencies] monaco = { path = "../..", features = ["yew-components"] } wasm-bindgen = "0.2" -yew = { version = "0.22", features = ["csr"] } +yew = { version = "0.23", features = ["csr"] } diff --git a/examples/yew/src/main.rs b/examples/yew/src/main.rs index 57f4ab7..cc7c2f2 100644 --- a/examples/yew/src/main.rs +++ b/examples/yew/src/main.rs @@ -1,6 +1,5 @@ use monaco::{api::CodeEditorOptions, sys::editor::BuiltinTheme, yew::CodeEditor}; -use std::rc::Rc; -use yew::{html, Component, Context, Html}; +use yew::prelude::*; const CONTENT: &str = include_str!("main.rs"); @@ -12,27 +11,12 @@ fn get_options() -> CodeEditorOptions { .with_automatic_layout(true) } -struct App { - options: Rc, -} -impl Component for App { - type Message = (); - type Properties = (); - - fn create(_context: &Context) -> Self { - Self { - options: Rc::new(get_options()), - } - } - - fn changed(&mut self, _context: &Context, _old_props: &Self::Properties) -> bool { - false - } +#[component] +fn App() -> Html { + let options = get_options().to_sys_options(); - fn view(&self, _context: &Context) -> Html { - html! { - - } + html! { + } } diff --git a/examples/yew_events_external/Cargo.toml b/examples/yew_events_external/Cargo.toml index 367203f..1b4b66b 100644 --- a/examples/yew_events_external/Cargo.toml +++ b/examples/yew_events_external/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] monaco = { path = "../..", features = ["yew-components"] } wasm-bindgen = "0.2" -yew = { version = "0.22", features = ["csr"] } +yew = { version = "0.23", features = ["csr"] } # Used for the randomess, not needed usually. getrandom = { version = "0.2", features = ["js"] } diff --git a/examples/yew_events_keymapping/Cargo.toml b/examples/yew_events_keymapping/Cargo.toml index a94ea40..c2be9e5 100644 --- a/examples/yew_events_keymapping/Cargo.toml +++ b/examples/yew_events_keymapping/Cargo.toml @@ -7,4 +7,4 @@ edition = "2018" [dependencies] monaco = { path = "../..", features = ["yew-components"] } wasm-bindgen = "0.2" -yew = { version = "0.22", features = ["csr"] } \ No newline at end of file +yew = { version = "0.23", features = ["csr"] } \ No newline at end of file diff --git a/examples/yew_model_decorations/Cargo.toml b/examples/yew_model_decorations/Cargo.toml index 887729c..a3c1b9c 100644 --- a/examples/yew_model_decorations/Cargo.toml +++ b/examples/yew_model_decorations/Cargo.toml @@ -8,4 +8,4 @@ edition = "2018" monaco = { path = "../..", features = ["yew-components"] } wasm-bindgen = "0.2" js-sys = "0.3" -yew = { version = "0.22", features = ["csr"] } +yew = { version = "0.23", features = ["csr"] }