# Changelog ## 0.61.8 - Fix: setting values in common html attributes should be enable by default ## 0.61.7 - remove support for `custom_element` as its functionality is superseeded with `stateful_component` - remove parent in DomNode as to simplify code ## 0.61.6 - remove template and use-template feature gate as it is not adding performance enhancements ## 0.61.5 - rename `safe_html` to `raw_html` - decode html entities before parsing and converting into node - optimize dispatching of mount event only to element that has attached event listener to on_mount - make `stateful_component` patches work on its own dom tree ## 0.61.4 - make `use-template` and `use-skipdiff` fail safe if the template and skipdiff is not used in the view - feat: feature gate `with-trace` for determining how much time is spent in section of making stateful component ## 0.61.3 - more clippy lint fixes - improvements on the examples ## 0.61.2 - use `with-lookup` feature by default ## 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` can now be mapped into `Effects` 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 ` ` `"e;` 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 ## 0.60.6 - feat: Add a new crate html-parser for dynamically parsing html content ## 0.60.5 - feat: add rgba css function ## 0.60.4 - fix: check only for non-matching property when the property name is not quoted. - quoted property name in `style!` macro will be an escape hatch for few cases such as the use of prefixes, ie: "-webkit, -ms, -moz" - add `Program::clear_mount` as alias to `clear_append_to_mount`, add `clear_mount_to_body` ## 0.60.3 - return `Option` for style property lookup instead of panicking. - Make `style!` provides a helpful error when property names used is not found in the lookup. ## 0.60.2 - improve the Input event - InputEvent now call on `value()` to get the value - update to mt-dom 0.59.1 to force crate user to use this version, since it has a fix of critical bug - feat: allow annotation to style properties - add test for annotated styles ## 0.60.1 - feat: add lazy_view_if function to lazily evaluate the node function only when the flag is true - fix: web_component, use Program clone for attribute_change - fix: Program has to be wrap with ManuallyDrop so as not to drop it at the start function - feat: **breaking** all references to Program is now Weak and will go out of scope, and so an AppLoader is needed - Fixed with using `ManuallyDrop`. - fix: test, use update_dom_with_vdom instead of just setting the current vdom using set_current_dom function - fix: remove set_current_dom function which has a different functionality with app_context.set_current_dom - use mutable methods in app_context - docs: add a Note on why the function update_dom_with_vdom is not unified into update_dom - refactor: use mutable function when applicable - fix: progressive rendering example - refactor: make dispatching messages and updating dom mutable - feat: include strong_count and weak_count to the measurements - add a test-case for issue#75 ## 0.60.0 - fix: remove the auto-implementation fo `Container+WebComponent` as it conflicts with other usage - feat: add utility method to the component to create a consistent namespace class names and selector for building view and css nicely - remove the style attribute function, since it conflicts with the name of the style! macro which is more useful than the removed one - fix: comparison of Value for string variants to compare stringly types - feat: make use of `classes_flag` in `todomvc` for more pleasant syntax - feat: **breaking** migrated `jss` from independent `jss` crate back to sauron - feat: improvement on the ergonomics of writing web_components - feat: improvement on registration of web component, as this eliminates the need to attaching component to the Window object ## 0.59.2 - refactor: remove the `use-snippets` feature, since we are using `js_sys::Function` ## 0.59.1 - feat: add `as_str` method for returning the str value of an attribute ## 0.59.0 - refactor: **breaking** change the methods which extracts inner values to not panic but instead return `Option` - `unwrap_text` -> `as_text` - `unwrap_safe_html` -> `as_safe_html` - refactor: remove the use of unnecessary map_callback, since it can be done using map_msg since Fn pointer can just be clone - refactor: use the clear_children function - patching a document fragment other than in root node should not happen - refactor: convert the shell scripts to justfile - refactor: use raf for doing patches, use ric for anything else - feat: add a request_idle_callback to make ric work in safari - feat: expose a reference to the underlying field in Program's app_context - fix: move `data` attribute out of the commons, since it is commonly used in local variables - fix: `web_component` init method - feat: add a conversion from Task to Effects - fix: to the new version of sauron, improve code for interactive example - feat: **breaking** `Effects` now wraps `Task` which could now accept ready MSG or an Future MSG - **breaking** change Component signature which returns Effects on the init function - **breaking** change Application signature which returns Cmd on the init function, to match that of the Component - fix clippy, no need to collect iterators - fix: add `'static` constraint to `XMSG` in components - refactor: such that borrows end at line, which open for a more flexible data structure for the `AppContext` - refactor: rename `dispatch_multiple` to `push_msgs` in `AppContext` - refactor: use update_app as function name for updating the app - refactor: simplify the batching of `pending_cmds` code - inject the css before mounting the App to the dom - feat: create `AppContext` module which moves app, current_vdom, pending_msgs, pending_cmds, which pertains to the state to the Application's model ## 0.58.0 - use the latest published version of mt-dom - refactor: move `fragment` into `mt-dom,` so it can be diff there, therefore will still be performant when in used in Application view - fix: **breaking** expose `delay` function, in replacement to `async_delay` - fix: issue with `fragment` node and `node_list` when used in the top-level view of the app - refactor: **breaking** swap names for `custom_element` and `web_component` since it is more concise to swap the two ## 0.57.5 - update to `mt-dom` `0.57.0` - feat: add method as_text to NodeTrait for extracting optional str from a leaf text node - remove too many logging in `define_custom_element` - `custom_element` should include the `web_component` macro - don't lock third-party dependencies to latest version, otherwise, it will disallow other dependent crate to use older version of the mentioned third-party dep causing failure to select version of dependencies - chore: remove unnecessary logging - fix: `custom_element` Modifier arg - feat: improvement on `Modifier` and `Measurement` to contain the name as tag - refactor: improvement on the data structure of `ActiveClosure` - improve code for attaching `node_closures` ## 0.57.4 - make `init` and `stylsheet` an optional method for `Application` and `Component` trait. - update mt-dom version to 0.56.1 ## 0.57.3 - update to mt-dom `0.56.0`, which contains bug fixes when swapping rows with keyed elements - new PatchVariant in `mt-dom` which has `MoveBeforeNode` and `MoveAfterNode` for moving existing keyed elements ## 0.57.2 - allow users to surround braces on closure in html events. ie: `on_click={|_|..}` ## 0.57.1 - update dependencies ## 0.57.0 - docs: add warnings on the usage of Fragment - docs: put quote on words that has underscore on it - refactor: migrate to `rstml` since `syn-rsx` is not maintained anymore - also migrate to `syn` `2.0`. - feat: **breaking** change the data type for the old_value and new_value in the attribute_changed function, since everything is a string in the attribute value - feat: include the `custom_tag` in the `web_component` macro - refactor: restructure the declaration of html and svg tag such that the module is wrapping the declaration instead of inside the macro code ## 0.56.0 - fix: changes in `mt-dom` 0.55.0 where the method names are shorter and concise - feat: **breaking** add a new static method for Application, and Components: `stylesheet` which returns a static stylesheet, make `style` optional - feat: linking of `define_custom_element` behind `use-snippets` module - feat: add an alternative way of making registration of custom element work in sauron using wasm_bindgen and it's limitations - feat: put the `custom_element` functionality behind `custom_element` feature gate - feat: put `regsiter_custom_element` behind a feature gate - refactor: simplify the resize task to not use Rc and RefCell - restructure exports and prelude - fix: refine and sanitize the export of modules in sauron - refactor: improve and unify `add_event_listener` - fix: remove use of `HtmlMenuItemElement` since it is already deprecated - call `update_dom` after calling on the program `connected_callback` - refactor: improve the function signature for `attribute_changed` - refactor: **breaking** use snake_case for svg tags and attributes to fit rust conventions - fix: use a different generic type to the external in `Effect::localize` function, this way, the user don't have to unzip the Msg - fix: remove the use of wee_alloc - refactor: move some `window` functions into `util` module - refactor: remove the use `Closure::forget` in adding event listeners, and store the closures into the Program as `node_closures` - refactor: put the creating of closure in place rather than calling create_closure_wrap - use `Closure::new` instead of `Closure::wrap` since they have the same effect, only thinner and less complex - refactor: modularize rif,raf,and timeout into their corresponding modules, now returns the Handle which contains the closure - refactor: rename active_closures to node_closures since it is only storing the closures used in node elements - rename `created_node` to `dom_node` module - refactor: remove unnecessary wrapper `CreatedNode` - move `apply_dom_patch` to `dom_patch` module, but still under `Program` implementation - append the `active_closures` directly to the `Program` instead of storing it in `CreatedNode` - join styles with blank instead of new_line since the new version of jss has added the necessary lines - style now returns `Vec` to make it ergonomic when dealing with Component that has multiple styles - feature: add a conversion of `Window::on_resize` to , a variant which returns a `Task`, instead of `Cmd` - **breaking** change the return type of init in `Application` to `Vec` - feature: add utility function to inject style to document head - feature: add `Task` ## 0.55.1 - fix: call `dispatch_mount_event` to other patching variants, other than just the `Append` variant ## 0.55.0 - **breaking** rename crate `sauron-node-macro` into `sauron-macro`, since it contains some other macro other than `node!` ie: `#[web_component]` - organized the with-dom feature - remove `Dispatch` trait, and just pass the `Program` around, since `Program` is the only implementation of `Dispatch` trait. - use a more concise method names in `Http` module - refactor: put allow(unused) directive to some feature gated function - remove focused_node, to slim down and simplify the framework code - remove on_enter event since it can easily be done in the user application - feature: add a new attribute macro: #[web_component] to easily derive a WebComponent - add getting InputEvent from HtmlElement which is used in CustomElement - add `Widget` trait, which is a simpler version of `Component`. - move `CustomElement` to `custom_element` module - add `map_external` method to Effects - remove unused trait method `attributes_for_mount` in `CustomElement` trait ## 0.54.1 - bump up version such that `sauron-node-macro` is using `sauron-core` v0.54.1 as well. ## 0.54.0 - fix: make clippy happy, use bump up version of mt-dom - fix to suit changes in mt-dom where replacement uses multiple nodes, fix tests - add composed to InputEvent, modify the custom_element example to demonstrate input event - call on `set_attribute`, in order to trigger attribute_change value for special attributes such as `value`, `checked`, `open`, `disabled` etc - fix: put debug logging behind feature patches - add improvement to MountEvent dispatching it as a native web event - refine the appending of child nodes and combine them into a function that calls the dispatch_mount event together upon appending - simplify the `register_custom_element` function, to just accept the 2 args instead of 3. - add custom_tag function to CustomElement trait - This includes the custom-tag and the CustomElement wrapper, and removes the never changing HTML as base class - add improvements on custom_elements, auto-registering when used in function call to form a widget, attributes should also be a function inside the module - move the register function as a static member of the WidgetCustomElement - add more util functions for asynchronous execution - use edition 2021 for the example projects ## 0.53.0 - **breaking**: fix glob imports conflict, remove prelude. - the html tags and attributes should be explicity imported as well - this is necessary since rust version 1.70 don't allow importing names that conflicts other names in the same glob, in the case of html and svg attributes, there are conflicting names such as: title, slot, data, style old ```rust use sauron::prelude::*, ``` new ```rust use sauron::{*, html::*, html::attributes::*, html::events::*} ``` this is neccessary, since a lot of tags and attributes could be comming from html or svg, if you are working with svg elements ```rust use sauron::{*, svg::*, svg::attributes::*, html::events::*} ``` if you are using both html and svg in the same module, you can glob imports the html, and explcitly specify the svg attribtues. ```rust use sauron::{*, html::*, html::attributes::*, html::events::*, svg::attributes::{xmlns, cx, cy, r, points, d}} ``` - fix: put the logging of dispatch time in measure and debug feature flag - feat: enable scroll related objects from web_sys - feat: convert on_focus and on_blur to use FocusEvent - refactor: make the request_animation_callback, request_idle_callback and async_delay more readable by unifying the code that was scattered into small little functions - feat: make the cache_elements readonly, not using refcell as there is no need to add the other elements - feat: add caching of created element for faster creation using clone_node - feat: add with-interning feature to make transfering faster from rust to js - cargo fmt using stable features with default values ## 0.52.0 - refactor: make visibility private on fields of program that is not needed to be accessible outside of the module - refactor: use `target_element` instead of `target_node` in `DomPatch` - refactor: make `DomPatch` use less repeated fields in all variants by making it use struct with `PatchVariant` as the enum - feat: Program api such as `replace_mount` and `append_to_mount` is now clearly defined with explcity use of enum for `MountAction` and `MounTarget`, rather than just boolean for `is_shadow` or `is_replace`. - fix: improve the lifecycle logic of custom elements - refactor: organize code in updating of dom - feat: expose `with-raf` as feature in sauron, which the dispatch function cal use `requestAnimationFrame` callback - feat: add support for `touch_event` in events module - feat: export `wasm_bindgen_futures` from sauron - fix: add optional deadline to applying of msgs and patches functions - fix: add code for ensuring the state of the Program is correct - refactor: make `dispatch_dom_changes` a sync function since it does not need to be async, add feature gates to function calls - refactor: make `pending_cmd` as state in the program, which can be handled later on - refactor: create a `request_idle_callback_with_deadline` in dom util, rename some functions, add early return when there is no pending patches, pending msgs - refactor: use `BTreeMap` and `BTreeSet` as alternative to `HashMap` and `HashSet` which seems to work faster than the later - fix: remove the Already borrowed error when setting the root_node, refactor the DomPatch apply method into the Program - refactor: make conversion of attribute value from various types idiomatic - feat: expose the `with-ric` (requestIdleCallback) feature in sauron - refactor: merge DomUpdater into Program to simplify and unify all the central logic of the APP lifecycle in one place - refactor: remove apply_patches and distribute the functions into CreatedNode and DomUpdater - fix: polish the open attribute and the toggle event used in `
` element - feat: improvement to the processing of `pending_patches`, remove the throttling feature - feat: add DomPatch as an intermediate Patch with no lifetime reference for processing the patches in a controlled way to minimize sluggishness of the app - refactor: mutate the active_closures in place rather than re-assigning it. - fix: remove commented out examples - feat: split the `dispatch_inner` method into 2 stages methods: the app updates and the dom updates - feat: add `skip_criteria`, an improvement on the skip attribute - refactor: make `batch_msg` method accepts IntoIterator rathern than vec ## 0.51.0 - breaking: remove the use of sauron-component-macro - fix: use mt-dom 0.21.0 - feat: add a function to check whether a tag is a custom-element, add append_child to Container trait - feat: improve the implementation for macro for implementing components - fix: remove #[wasm_bindgen] anotation for register, since it will conflict with other functions for wasm - feat: expose jss_ns_pretty - feat: add node_list - feature: add Cmd::async function to create cmd from Future types - refactor: more simplification to Http module by using async/await with JsFutures from wasm-bindgen-futures - refactor: use wasm-bindgen-future, async and await instead of Closures ## 0.50.6 - feat: add utility function `async_delay` for putting delay inside of async functions ## 0.50.5 - feat: remove the feature `with-request-animation-frame` as it is now always used by default ## 0.50.4 - fix: the passed root_node must point to the original root_node, as there is a possibility that the top level node will be replaced with a new top-level view node - refactor: reuse the call to other function in creating request animation call ## 0.50.3 - Add `key!` macro which combines `key` and `format!` macro to easily format key attribute value. ## 0.50.2 - Add `Progam::dispatch_with_delay` to dispatch an MSG at a later time. ## 0.50.1 - bump `mt-dom` to 0.20.0 ## 0.50.0 - **BREAKING** make the `Cmd::append` accept `&mut self` and modify it rather then return a Self - Add support for defining custom elements a.k.a web components - [DateTime widget example](https://github.com/ivanceras/sauron/tree/master/examples/custom-element) - Add support for creating fragment in a node The `node!` macro can now be used to return a view which uses multiple top level tags. Example: ```rust node!{

"Header"

"The content goes here"
} ``` ## 0.49.3 - support setting the attribute value for; - HtmlLiElement - HtmlMeterElement - HtmlMenuItemElement - HtmlProgressElement - HtmlParamElement - HtmlOutputElement - HtmlDataElement ## 0.49.2 - fix: a bug, closures for the elements created in InsertBeforeNode and InsertAfterNode variant for Patch is not added to the active closures ## 0.49.1 - Fix the ordering of inserting nodes when applying patch InsertAfterNode. ## 0.49.0 - fix assertion in apply_patch for InsertNode variants ## 0.48.0 - Remove the branch for patching the variant of Patch ReplaceLeaf since it is superseeded by ReplaceNode variant. - Fix all the test including the wasm test this time ## 0.47.0 - Use TreePath for finding and traversing nodes. ## 0.46.1 - bump minor last release was using sauron-core 0.45 for sauron-node-macro ## 0.46.0 - change in mt-dom TreePath where root node is now at [], while first element in the dom is at [0]. ## 0.45.2 - change in Patch variants InsertNode -> InsertBeforeNode, added InsertAfterNode. ## 0.45.1 - limit the export for `units` so as not to conflict with html tags and attributes ## 0.45.0 - The Leaf node of vdom formerly integerated in mt-dom::Node is now defined in the crate. - `Value` and `units` is now from `jss` crate. - `Value` enum don't have bytes anymore since it is not useful in dom context ## 0.44.0 - Refactor on apply_patches due to changes in mt-dom (collapsing the Patch struct) ## 0.43.11 - Correctly set value on HtmlSelectElement and HtmlOptionElement ## 0.43.10 - Add `unzip` and `extend` method to `Effects` ## 0.43.9 - Add support for ` ) ``` now: ```rust node!(
) ``` - simplify the algorithmn for `find_node_recursive` - Fix server side rendering of self closing tags html, such as `input`, `br`, `hr` - unify attribute manipulation in render and in dom_updater, the common code is in html::attributes module - Add node_idx attribute in render if `with-nodeidx` feature is enabled - Reexport `serde_json` in order for `jss` macro be able to use reexported `serde_json` from sauron crate - fix example: remove the use of workaround on attributes that are keywords in rust - Add `#[allow(unused_braces)]` inside node macro to prevent the compiler from making expressions in braces in html as unncessary ## 0.31.2 - Fix the `render` function where attributes of the same name not merged. - use the exported Style struct from html::attributes, to avoid namespace collision with 'style' attribute - Add Minimal SSR example - expose a `lite-markdown` feature from `sauron` which exclude the `sauron-parse` crate to minimize binary size - expose `empty_attr` in `html::attributes` - this allows you to add a conditional attribute in building the view. Example: ```rust img(vec![ src("img/image.jpg"), if let Some(img_title) = self.img_title { title(img_title.to_string()) } else { empty_attr() } ], vec![] ) ``` - add `jss` module and utility functions which utilizes json to preprocess css styles. - `jss_ns` allows you to add style to your components while prefixing the classnames with a namespace to prevent clashing with classes from other components. Check out the `futuristic-ui` [example](https://github.com/ivanceras/sauron/tree/master/examples/futuristic-ui/) for complete usage. ## 0.31.0 - (**breaking**) Improved `style!` macro by using json as the syntax - Added `jss!` macro which parses `json` and convert them to `css` - Invocation the `init` method of `Component` will be done after the `Component` has been mounted into the DOM. - Unified base code of `append_to_mount` and `replace_mount` in `DomUpdater` - Added `map_msg` function for mapping `DomUpdater` to a different `MSG` - Fix all the example project's start scripts and `index.html` load script to get rid of errors from webkit based browser - Modified scripts to use `--target web` and import module to fix problems in safari - Get rid of test_fixtures and move it to the test directory - use `span(vec![],vec![])` instead of `text("")` in `view_if(bool,..)` when the flag evaluates to false - Add support for `transitionend` and `animationend` event - Add initial support for `style` in `Component` - Remove the deprecated svg tag macro that should have been removed together with the html tag macro ## 0.30.0 - refactor `Cmd` to not use the `Callback`. - remove the need for `MSG` and `PhantomData` in Cmd. - change the `no_request_animation_frame`feature flag to `with-request-animation-frame` to be additive and is enabled by default - change the `measure` feature flag to `with-measure`. - Introduce a `node!` macro syntax which allows users to write view code which resembles html syntax. - Restructure the project to have the code code of sauron in a crate `sauron-core`. This paves a way to introduce modules which depends on the core functionality of sauron and then will be re-exported as part of the sauron package. Example: `sauron-markdown` - Reexport `sauron_markdown` in `sauron`. can be used as `sauron::markdown` - dom internal: Remove only the event listener which match the event_name from the ActiveClosure ## 0.29.0 - Fix the todomvc with a new rewrite and storage support - Update the todomvc app using keyed elements - Fix set_checked when setting attributes for checkboxes, radio buttons - Implement code for InsertChildren patches since Patch is changed in `mt-dom` - Use the keyed-elements diffing in mt-dom, this will ensure that the elements with the callback will be matched with the same callback - TruncateChildren is replaced with RemoveChildren in mt-dom, this provide a more flexible patches - Add an example of server-side rendering using warp ## 0.28.2 - merge attributes of the same name first, before applying the attributes to the DOM element ## 0.28.1 - Adjusted for changes in mt-dom with performance improvements - remove merge_attribute functionality in Element. - MSG doesn't need to be clone, just use get_attributes instead of merge_attributes - A lot of performance improvement due to changes in mt-dom crate ## 0.28.0 - adjust sauron for changes in mt-dom where there are multiple values in one attribute ## 0.27.0 - change syntax of attribute events which uses `_` after the `on` ie: `on_click` instead of `onclick` - Make a special case for style than just a plain attribute - Use `mt-dom` crate as replacement to sauron_vdom. `mt-dom` is a very generic virtual-dom crate which doesn't put too much constraints on the types of the member fields ## 0.26.0 - Change `to_pretty_string` to `render` with focus on writing to the common buffer. - This is a performance improvement ## 0.25.0 - Add a function `Node.text` to return the string of the text element - Add a function `Node.eldest_child_text` to return the string of the only child of this element - Add a function `Node.get_children` to return children of a node - Add a utility function `mousemove` and `release` for MouseEvent - Remove the call to `stop_propagation` in the add_event_listener processor, since this is handled by the event_mapper. ## 0.24.0 - **Breaking** Add the tag in patches, to give clue to backend on how to handle special tags - This is used in gtk, since widgets in gtk doesn't follow a proper tree nesting as with html - **Breaking** Detach `markdown` module into a high-level crate (sauron-md) - Detach `to_syntax` module into a high-level crate (sauron-syntax) - Create `sauron-parse` crate which `sauron-md` and `sauron-syntax` depends on. - Add functionality for inner_html which optimizes the performance of client side apps - Add a functionality to hook url hashchange event in the browser ## 0.23.0 - move Cmd and Dispatch from sauron_vdom to sauron - Simplify the use Dispatch without the need for Rc ## 0.22.2 - Export `sauron_vdom::diff::diff_with_key` - Add function `take_callback` to consume attribute and get the callback ## 0.22.1 - Only expose html::events in prelude when 'with-dom' feature is enabled ## 0.22.0 - Make use of prelude to simpilfy imports in sauron - Add feature to parse html and convert it into sauron view syntax code. - Add link to [html2sauron](https://ivanceras.github.io/html2sauron/) tool in the docs - Refactor Attribute key to use generic type, Attribute key was previously using `&'static str`, It got changed to a generic type, which allows us to create attribute with key other than `&'static str` such as `String` or strongly typed `enums`. - Simplify the indent utility function - Improve the svg_clock example to make the subsecond update to the subsecond by ticking at every 20ms - Add cargo deny configuration ## 0.21.1 - Add a help function classes which joins an array of string into a space class - Use criterion in benchmarks - Add data-viewer as an example ## 0.21.0 - add Window as a global object to let components easily attached events to the window - add style! macro for a nicer html style attribute syntax - **Breaking Change** remove tag style from the macro export, as it conflicts with the style attribute macro, which is more common - include mousemove in the supported event type - implement creating an attribute that has namespace, such as xlink:href in embededd svg image - fix error in svg_graph example ## 0.20.3 - expose `onclick_with`, `onclick_stop_propagation`, `onclick_prevent_default`, `onclick_prevent_all` which allows developers control on the behavior of the event of a DOM element. ## 0.20.2 - Enable doubleclick event - improve and modularize shell scripts - Fix errors in the todomvc benchmark - Explicitly set the value of element by calling the set_value function since just setting the attribute value is not enough - Enable calling to event.prevent_default() to allow both oninput and keypress event play nicely together, as used in the todomvc example - Add svg_graph example ## 0.20.1 - bumped up to see logo in docs.rs ## 0.20.0 - Add macro based syntax to provide a cleaner syntax in writing the view: ## Old syntax: ```rust fn view(&self) -> Node { div( vec![class("some-class"), id("some-id"), attr("data-id", 1)], vec![ input( vec![ class("client"), r#type("button"), value("Click me!"), onclick(|_| { trace!("Button is clicked"); Msg::Click }), ], vec![], ), text(format!("Clicked: {}", self.click_count)), ], ) } ``` ## New syntax: ```rust fn view(&self) -> Node { div!( [class("some-class"), id("some-id"), attr("data-id", 1)], [ input!( [ class("client"), type_("button"), value("Click me!"), onclick(|_| { trace!("Button is clicked"); Msg::Click }), ], [], ), text!("Clicked: {}", self.click_count), ], ) } ``` - Move DomEvent in dom module - nicer name for `dumb_patch` -> `apply_dumb_patch` - Refactor `dom_updater` and `created_node` out of the dom module - Add macro syntax, which provides a cleaner code by eliminating the `vec![]` syntax on the components view functions - Enable github actions - Reorganize dom specific module to get rid of multiple cfg feature code in the library - Reorganize `html::tags` and `svg::tags` - Remove the html_array syntax - Fix unused warning errors when no feature is enabled - Use the proper logging by using `log` and `console_log crate` - Completely remove the with-serde feature - Add feature gate 'with-dom' for browser specific functionality, such that sauron can be efficiently used for server-side rendering - Constraint the generic Type: `F` to be 'static in Callback, instead of the return generic type - Fix attributes helper functions: (`styles`, `styles_flag`, `classes`, `classes_flag`, `attrs_flag`) should not require MSG to be clone ## 0.11.1 - attributes helper functions such as (styles, classes, etc) should not require MSG to be Clone. ## 0.11.0 - Add underscores on html tags and attribtues(`type`,`for`, `async`, `loop`) that are also special keywords in rust. Now, you can use `type_("text")` as an alternative to `r#type("text")` - rename as_element -> as_element_mut, children -> add_children - Add `dumb_patch` for patching the dom without involving the callbacks. - Expose to `html::tag` module for the uncommon html tags which conflicts with common html attributes such as `style`, `title`. ## 0.10.1 - implemented removing the associated closures of elements that has been removed from the DOM including the removed element descendants. ## 0.10.0 - performance improvement on node tree building - using vec![] as the argumemts for attributes and children, this changes the syntax a lot - The original array based syntax is still preserved by using the `html_array` module. This however has performance penalty - events and attributes are now unified in one field: `attrs` - `map` function mapping Msg from in between component is now `map_msg` to avoid confusion with the rust std common maps such `Iterator.map` - add units utility functions - Remove requirement for Msg to have any Clone,Debug,PartialEq ## 0.7.1 - Add initial implementation for markdown handling - Add history function get history object - events now prevents defaults and stop propagation ## 0.7.0 - Added an initial implementation for Http for fetching data which returns a Cmd - Added Examples usage of Http fetch - Added Browser for listening to browser resize event which returns a Cmd - Added Cmd module for abstracting calls such as Http requests - Added an optional `init` function in Component which allows apps execute Cmd Task such as fetching data at the start of the app - Change the update method in Component to return Cmd in update method ## 0.6.0 - Refactor sauron_vdom::Event to cater general usecase for mouse, keyboard and input event - Events such as onclick, onkeypress, and oninput are now supplied with: MouseEvent, KeyEvent, and InputEvent accordingly, therefore no additional matching/unwrapping code is neccessary on the users code. Before: ```rust onclick(|event: Event| { if let Event::MouseEvent(mouse) = event{ sauron::log!("clicked at ({},{})", mouse.x(), mouse.y()) }else{ panic!("This should not happen") } }) ``` Now: ```rust onclick(|mouse: MouseEvent| { sauron::log!("clicked at ({},{})", mouse.x(), mouse.y()) }) ``` - Move to svg_extra the following tags and attributes: style, width, height, id, font_size, font_family, since these conflicts with the commonly used tags and attributes in html. Attributes that are defined in html attributes could also be used in svg attributes. What's not possible is using tags declared in html module in svg elements, since svg elements needs to be created with svg namespace in the DOM. ## 0.5.0 - Use &'static str type for Node's attribute name, event name and namespace. - Add helper function `styles` which allows users to write style properties easily. - Add helper function `styles_flag` which allows users to write even more granular style properties. - Elements attributes are now appended to the existing attributes ones, this is needed when there is multiple calls assigning on the same attributes on the same element - Put back `Callback` as the value of node.events. - Add `map` functionality which lets user embed subcomponents view into the parent component by mapping the callbacks with a wrapped MSG variant from the parent. ## 0.4.0 - Added the complete list of svg/html attributes. - Separate the uncommon html tags into html_extract module. These includes `style`, which conflicts with the commonly used `style` attributes. - Separate the uncommon attributes such as `span`, `label` which conflicts with the commonly used `span` and `label` html tags. - Use snake_case for non-ident tags and attributes.