Skip to content

Commit

Permalink
prepare for 0.61.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanceras committed Apr 3, 2024
1 parent aa75dca commit 1798a00
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 8 deletions.
14 changes: 14 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.61.0
- add template system, skip_diff
- web_sys::Node is now wrapped with DomNode, the event listeners
is now managed from its containing DomNode, instead of from the Program.
when a DomNode is removed and goes out of scope, so does its associated event closures are dropped
- `Cmd<Msg>` can now be mapped into `Effects<Msg,..>` and vice versa
- The `mt-dom` crate is now part of `core` in the `vdom` module. This change is necessary
to improve code coherence and simplicity, lesser number of generic types has to be passed arround.
- remove `inner_html` as a function to set html via html attributes.
- This cause breakage in tracking the DOMTree as new nodes could be inserted dynamically without the runtime knowing it.
- Rename `safe_html` to `symbol` as its usage is intended for html entities such as `&nbsp;` `&quote;` etc.
- A `safe_html` function is added and use `html-parser` to parse dynamic html and convert it into a safe dom-tree.


## 0.60.7
- feat: add selectionchange event and document_event_listener

Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ impl App {
}
}

impl Application<Msg> for App {
impl Application for App {

type MSG = Msg;

fn view(&self) -> Node<Msg> {
node! {
<main>
Expand All @@ -82,7 +85,7 @@ impl Application<Msg> for App {
}
}

fn update(&mut self, msg: Msg) -> Cmd<Self, Msg> {
fn update(&mut self, msg: Msg) -> Cmd<Msg> {
match msg {
Msg::Increment => self.count += 1,
Msg::Decrement => self.count -= 1,
Expand Down Expand Up @@ -147,7 +150,7 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
sauron = "0.60.0"
sauron = "0.61.0"
```

#### Prerequisite:
Expand Down
2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sauron-core"
version = "0.60.7"
version = "0.61.0"
authors = [ "Jovansonlee Cesar <[email protected]>" ]
license = "MIT"
description = "An html library for building client side webapps"
Expand Down
4 changes: 2 additions & 2 deletions crates/html-parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sauron-html-parser"
version = "0.60.7"
version = "0.61.0"
edition = "2021"
authors = [ "Jovansonlee Cesar <[email protected]>" ]
license = "MIT"
Expand All @@ -12,6 +12,6 @@ keywords = ["html", "parser", "web"]

[dependencies]
rphtml = "0.5.9"
sauron-core = { version = "0.60", path = "../core", default-features = false, features = ["with-lookup"] }
sauron-core = { version = "0.61", path = "../core", default-features = false, features = ["with-lookup"] }
log = "0.4"
thiserror = "1.0.48"
4 changes: 2 additions & 2 deletions crates/macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sauron-macro"
version = "0.60.7"
version = "0.61.0"
authors = ["John-John Tedro <[email protected]>", "Jovansonlee Cesar <[email protected]>"]
license = "MIT"
description = "An html library for building client side webapps"
Expand All @@ -16,7 +16,7 @@ rstml = { version = "0.11" }
quote = { version = "1"}
proc-macro2 = { version = "1" }
once_cell = "1.8"
sauron-core = {version = "0.60", path = "../core", features = ["with-lookup"] }
sauron-core = {version = "0.61", path = "../core", features = ["with-lookup"] }
phf = { version = "0.11.2", features = ["macros"] }

[dev-dependencies]
Expand Down
25 changes: 25 additions & 0 deletions docs/migration_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Migration guide from 0.60.0 to 0.61.0

- `MSG` is now an associated type to `Application`
- `Cmd<Self>` should now be just `Cmd<Msg>`

old:
```rust
impl Application<Msg> for App{

fn update(&mut self, msg: Msg) -> Cmd<Self> {
...
}
}
```
new:
```rust
impl Application for App {
type MSG = Msg;

fn update(&mut self, msg: Msg) -> Cmd<Msg>{
...
}
}
```

0 comments on commit 1798a00

Please sign in to comment.