- Fix: setting values in common html attributes should be enable by default
- remove support for
custom_elementas its functionality is superseeded withstateful_component - remove parent in DomNode as to simplify code
- remove template and use-template feature gate as it is not adding performance enhancements
- rename
safe_htmltoraw_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_componentpatches work on its own dom tree
- make
use-templateanduse-skipdifffail safe if the template and skipdiff is not used in the view - feat: feature gate
with-tracefor determining how much time is spent in section of making stateful component
- more clippy lint fixes
- improvements on the examples
- use
with-lookupfeature by default
- 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 intoEffects<Msg,..>and vice versa- The
mt-domcrate is now part ofcorein thevdommodule. This change is necessary to improve code coherence and simplicity, lesser number of generic types has to be passed arround. - remove
inner_htmlas 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_htmltosymbolas its usage is intended for html entities such as "e;etc. - A
safe_htmlfunction is added and usehtml-parserto parse dynamic html and convert it into a safe dom-tree.
- feat: add selectionchange event and document_event_listener
- feat: Add a new crate html-parser for dynamically parsing html content
- feat: add rgba css function
- 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"
- quoted property name in
- add
Program::clear_mountas alias toclear_append_to_mount, addclear_mount_to_body
- return
Optionfor style property lookup instead of panicking. - Make
style!provides a helpful error when property names used is not found in the lookup.
- improve the Input event
- InputEvent now call on
value()to get the value
- InputEvent now call on
- 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
- 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.
- Fixed with using
- 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
- fix: remove the auto-implementation fo
Container+WebComponentas 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_flagintodomvcfor more pleasant syntax - feat: breaking migrated
jssfrom independentjsscrate 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
- refactor: remove the
use-snippetsfeature, since we are usingjs_sys::Function
- feat: add
as_strmethod for returning the str value of an attribute
- refactor: breaking change the methods which extracts inner values to not panic but instead return
Optionunwrap_text->as_textunwrap_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
dataattribute out of the commons, since it is commonly used in local variables - fix:
web_componentinit method - feat: add a conversion from Task to Effects
- fix: to the new version of sauron, improve code for interactive example
- feat: breaking
Effectsnow wrapsTaskwhich 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
'staticconstraint toXMSGin components - refactor: such that borrows end at line, which open for a more flexible data structure for the
AppContext - refactor: rename
dispatch_multipletopush_msgsinAppContext - refactor: use update_app as function name for updating the app
- refactor: simplify the batching of
pending_cmdscode - inject the css before mounting the App to the dom
- feat: create
AppContextmodule which moves app, current_vdom, pending_msgs, pending_cmds, which pertains to the state to the Application's model
- use the latest published version of mt-dom
- refactor: move
fragmentintomt-dom,so it can be diff there, therefore will still be performant when in used in Application view - fix: breaking expose
delayfunction, in replacement toasync_delay - fix: issue with
fragmentnode andnode_listwhen used in the top-level view of the app - refactor: breaking swap names for
custom_elementandweb_componentsince it is more concise to swap the two
- update to
mt-dom0.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_elementshould include theweb_componentmacro- 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_elementModifier arg - feat: improvement on
ModifierandMeasurementto contain the name as tag - refactor: improvement on the data structure of
ActiveClosure - improve code for attaching
node_closures
- make
initandstylsheetan optional method forApplicationandComponenttrait. - update mt-dom version to 0.56.1
- update to mt-dom
0.56.0, which contains bug fixes when swapping rows with keyed elements - new PatchVariant in
mt-domwhich hasMoveBeforeNodeandMoveAfterNodefor moving existing keyed elements
- allow users to surround braces on closure in html events. ie:
on_click={|_|..}
- update dependencies
- docs: add warnings on the usage of Fragment
- docs: put quote on words that has underscore on it
- refactor: migrate to
rstmlsincesyn-rsxis not maintained anymore- also migrate to
syn2.0.
- also migrate to
- 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_tagin theweb_componentmacro - refactor: restructure the declaration of html and svg tag such that the module is wrapping the declaration instead of inside the macro code
- fix: changes in
mt-dom0.55.0 where the method names are shorter and concise - feat: breaking add a new static method for Application, and Components:
stylesheetwhich returns a static stylesheet, makestyleoptional - feat: linking of
define_custom_elementbehinduse-snippetsmodule - 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_elementfunctionality behindcustom_elementfeature gate - feat: put
regsiter_custom_elementbehind 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
HtmlMenuItemElementsince it is already deprecated - call
update_domafter calling on the programconnected_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::localizefunction, this way, the user don't have to unzip the Msg - fix: remove the use of wee_alloc
- refactor: move some
windowfunctions intoutilmodule - refactor: remove the use
Closure::forgetin adding event listeners, and store the closures into the Program asnode_closures - refactor: put the creating of closure in place rather than calling create_closure_wrap
- use
Closure::newinstead ofClosure::wrapsince 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_nodetodom_nodemodule - refactor: remove unnecessary wrapper
CreatedNode - move
apply_dom_patchtodom_patchmodule, but still underProgramimplementation - append the
active_closuresdirectly to thePrograminstead of storing it inCreatedNode - join styles with blank instead of new_line since the new version of jss has added the necessary lines
- style now returns
Vec<String>to make it ergonomic when dealing with Component that has multiple styles - feature: add a conversion of
Window::on_resizeto , a variant which returns aTask<MSG>, instead ofCmd - breaking change the return type of init in
ApplicationtoVec<Cmd> - feature: add utility function to inject style to document head
- feature: add
Task
- fix: call
dispatch_mount_eventto other patching variants, other than just theAppendvariant
- breaking rename crate
sauron-node-macrointosauron-macro, since it contains some other macro other thannode!ie:#[web_component] - organized the with-dom feature
- remove
Dispatchtrait, and just pass theProgramaround, sinceProgramis the only implementation ofDispatchtrait. - use a more concise method names in
Httpmodule - 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
Widgettrait, which is a simpler version ofComponent. - move
CustomElementtocustom_elementmodule - add
map_externalmethod to Effects - remove unused trait method
attributes_for_mountinCustomElementtrait
- bump up version such that
sauron-node-macrois usingsauron-corev0.54.1 as well.
- 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 asvalue,checked,open,disabledetc - 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_elementfunction, 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
- 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
new
use sauron::prelude::*,
this is neccessary, since a lot of tags and attributes could be comming from html or svg, if you are working with svg elementsuse sauron::{*, html::*, html::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.use sauron::{*, svg::*, svg::attributes::*, html::events::*}
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
- refactor: make visibility private on fields of program that is not needed to be accessible outside of the module
- refactor: use
target_elementinstead oftarget_nodeinDomPatch - refactor: make
DomPatchuse less repeated fields in all variants by making it use struct withPatchVariantas the enum - feat: Program api such as
replace_mountandappend_to_mountis now clearly defined with explcity use of enum forMountActionandMounTarget, rather than just boolean foris_shadoworis_replace. - fix: improve the lifecycle logic of custom elements
- refactor: organize code in updating of dom
- feat: expose
with-rafas feature in sauron, which the dispatch function cal userequestAnimationFramecallback - feat: add support for
touch_eventin events module - feat: export
wasm_bindgen_futuresfrom 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_changesa sync function since it does not need to be async, add feature gates to function calls - refactor: make
pending_cmdas state in the program, which can be handled later on - refactor: create a
request_idle_callback_with_deadlinein dom util, rename some functions, add early return when there is no pending patches, pending msgs - refactor: use
BTreeMapandBTreeSetas alternative toHashMapandHashSetwhich 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
<details>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_innermethod into 2 stages methods: the app updates and the dom updates - feat: add
skip_criteria, an improvement on the skip attribute - refactor: make
batch_msgmethod accepts IntoIterator rathern than vec
- 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
- feat: add utility function
async_delayfor putting delay inside of async functions
- feat: remove the feature
with-request-animation-frameas it is now always used by default
- 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
- Add
key!macro which combineskeyandformat!macro to easily format key attribute value.
- Add
Progam::dispatch_with_delayto dispatch an MSG at a later time.
- bump
mt-domto 0.20.0
- BREAKING make the
Cmd::appendaccept&mut selfand modify it rather then return a Self - Add support for defining custom elements a.k.a web components
- 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:
node!{
<h1>"Header"</h1>
<main>"The content goes here"</main>
}- support setting the attribute value for;
- HtmlLiElement
- HtmlMeterElement
- HtmlMenuItemElement
- HtmlProgressElement
- HtmlParamElement
- HtmlOutputElement
- HtmlDataElement
- fix: a bug, closures for the elements created in InsertBeforeNode and InsertAfterNode variant for Patch is not added to the active closures
- Fix the ordering of inserting nodes when applying patch InsertAfterNode.
- fix assertion in apply_patch for InsertNode variants
- 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
- Use TreePath for finding and traversing nodes.
- bump minor last release was using sauron-core 0.45 for sauron-node-macro
- change in mt-dom TreePath where root node is now at [], while first element in the dom is at [0].
- change in Patch variants InsertNode -> InsertBeforeNode, added InsertAfterNode.
- limit the export for
unitsso as not to conflict with html tags and attributes
- The Leaf node of vdom formerly integerated in mt-dom::Node is now defined in the crate.
Valueandunitsis now fromjsscrate.Valueenum don't have bytes anymore since it is not useful in dom context
- Refactor on apply_patches due to changes in mt-dom (collapsing the Patch struct)
- Correctly set value on HtmlSelectElement and HtmlOptionElement
- Add
unzipandextendmethod toEffects
- Add support for
<select>element in converting to event intoInputEvent. - Add example using
custom-elements.
- Add support for
disabledattribute to be explicitly called on their corresponding DOM html element functions to explicitly set the boolean value.- This allows the users to use
disabled=truewhen using thenode!macro with the intuitive expected result as opposed to the default value in html which only checks for the presence of the attribute.
- This allows the users to use
- Improve the
Render::render_to_stringfunction to skip attributes:open,checked,disabledwhen the value evaluates to false as the mere presence of this attribute alone will make the attribute the same as evaluated to true. We mitigate this counter-intuitive behavior of the browser such that we use the 2 states of the boolean value, wheretruewill make the attribute be in effect, whilefalseskip the attribute and/or render the element attribute in the opposite state. - Improve
Cmdaccumulation in dispatch inner using functional code
- Add support for details/disclosure element and its open attribute
- Add toggle event.
- Add
Dispatch::dispatch_multipleto dispatch multiple MSG at once, which add performance benefit of not having the compute the view in between updates, but only when all of the MSG has been dispatched
- Change
Cmdsuch that it usesFnOnce, which doesn't requireMSGto be aClone.
- Remove
log::traceonwith-measurefeature flag, it is not needed anymore since the details is already passed in the Measurements object
- Call only measurements only when
with-measurefeature flag is enabled. - Use of
IntoIteratorfor attributes and children of the html nodes, which allow the usage of either array or vec for a more cleaner view- Improve readability on examples to array of attributes and children nodes for better readability
- Move effects to be under
dommodule instead of undercomponentmodule - increase the sleep timer to give time for crates to reflect the dep
- Use comment for the
view_ifinstead of a blank span - Improve code for handling TextNodes, hacks to create comment as separator is now removed
- Use thread_local for caching Window, Document and NodeId counter
- Add modifier for Effects
- Make the
on_scrollwork for window as well - Rename Generics PMSG (Parent Msg) to XMSG (External Msg)
- Fix handling of units with multiple value
- Add
Effects::append_localto easily chain local Msg into existing effects. - Remove anything that has to do with
node_idxsincemt-domdon't use it anymore- We are now using
TreePathwhich provides a better way to traverse the DOM tree.
- We are now using
- Include the total number of patches applied on the
Measurements. - Cleanup
Cmdby moving the accessory fields into aModifierstruct - Update to jss 0.4
- breaking Rename
Effects{follow_ups, effects}to a more descriptive nameEffects{local, external} - breaking Remove
Cmd::map_msgandfrom_effectsas their functionality is moved intoEffects. - breaking Rename
Effects::follow_throughtoEffects::localizesince it maps theexternalfields into msg that is compatible with local messages and merge them. - Change the
node_to_findfunction to useBTreeMapso that their arrangement will be ordered/consistent, hence easier to debug - Improve debugging InsertNode where it can NOT find the parent node
- Modify the
stylemethod inApplicationsuch that it returns aStringrather thanVec<String>.Component,ContainerandViewcan now havestylemethod - Add
maybe_attrutility helper function in attributes - Add
Cmd::appendmethod to easily add more cmd to existing cmd
- shorten the
data-vdom-idthat we used as marker in the DOM element - Improve calling on emit, The input don't need to implement Into, so we can call it right away
- Use Callback in Cmd
- Repurpose the old Callback for Listener so it can contain additional fields such as TypeId of the arguments and return type of the Fn it contains, A new generic Callback with only Fn as the content has now a new place in dom::callback::Callback module, this would be used for lightweight operations such as callbacks in the components
- Rename the type alias of Callback<Event,MSG> to Listener
- Rename generics in Callback<EVENT,MSG> to Callback<IN,OUT> for a more generic application
- Wire the Callback into the parent Component Msg
- Remove unused function Cmd::from_msg
- Add method in Cmd to accept Msg and Vec intended to be used for deriving an Application Cmd from Component Msg
- Add implementation to convert Cmd from Effects, rename Cmd::map_effects to Cmd::map_follow_ups
- Add batch_map function to Cmd to simultaneously map Msg list and create a Cmd
- Rename Effects::map_follow_ups to Effects::map_msg and Cmd::map_follow_ups to Cmd::map_msg, we already know that it is mapping the follow_up and the effects is already in the same type as the component that is containing it
- Use effects in window-tab-rows example
- Use effects in custom_widget example
- Move effects out into its own module, Add functions for mapping effects easily
- Add Effects struct to contain follow_up msg and effect Msg intended for the parent component
- Component is just a widget which returns Effects with follow_ups, but no effects
- Improve the
Componentsystem, Add 2 new types ofComponents:Container, andView- Component and Widget are merged using Component as the final name, Component can now return both effects and followups
- map follow_up updates from components inside a component
- breaking Modify and expose
request_animation_frameto execute a rust closure, and create therequest_animation_frame_for_closurewhich acceptswasm_bindgen::Closureused internally inProgram- breaking Remove unused function
execute_in_request_in_animation_frame
- breaking Remove unused function
- Modify
Application::initsuch that program is not included in the arg, to simplfiy and make it cleaner - Remove
node_idxin render, it was for debugging only - Add a way to convert mouse_event into Event
- Remove outdated comment
- Simplify the batching the follow up Msg
- Add utility functions in html attributes which manipulates classes with namespace
- breaking Move out
jssmodule into a new crate and repository, as it has gotten bigger.- This also make sauron stays slim to prevent it from collapsing from its own weight.
- breaking Move
sauron-markdownout to a new repository, as it has gotten bigger. - Move
futuristi-uiout of the examples and into a new repository. - Add
init_with_programfunction inComponentfor allowing components to have a way access to it's own executor.- This is for enabling components have access to the program
- Remove dependency
lazy_staticin favor ofonce_cell - breaking Move
sauron-parseout of the repository to keep sauron being lean to prevent it from collapsing on its own weight. - breaking Rename
ComponenttoApplication, useComponentfor actual components that can use subsequent updates. - Remove internal
stylemacro in favor ofjsscrate - Modify the
Callbacksuch that there is lesser chance that node with different event will be recycled- type_id of input arguments and output arguments of function is stored for future comparison on the diffing algorithm.
- Add a test to show node-recylcing bug
- Move out
futuristic-uiout of the examples, since it is a lot bigger to fit as an example. New repo - breaking
initinApplicationnot uses&mut selfand has access toProgram. This allows the application to update its state upon initialization.
- Improve
sauron-node-macroperformance by resolving the values ofnamespaceandself_closingtags at compile time, rather than at runtime. - Add plugin capability of
sauron-markdownto easily hook user define functions such as code-highlighting. - Modify
Window::scroll_to_topto return it as wrapped inCmdto be used after anupdatecall in aComponent - Add
popstatetoeventsmodule. - Make
sauron::jss!macro to create the css without the use of indents and new lines by default.- This makes it easier to setup test as we don't have to deal with whitespace anymore.
- Added
sauron::jss_pretty!variant to use nice indents and space on the generated css.
- breaking Improve the ergonomic to
Httpapi. It is now easier to receive and deserialize text response. - Add a code fence processor plugin for
sauron-markdown. Developers can hook code to create a custom element out of code blocks in markdown parser. - Rename
Program::new_replace_mounttoProgram::replace_mount.- Rename
Program::new_append_to_mounttoProgram::append_to_mount. Programis not optional anymore when passed to functions in modules such asapply_patches,dom_updaterandcreated_node
- Rename
- Added
safe_htmltoTextnode, this indicated whether to render as text node or asinnerHTMLof its parent element.ammoniacrate is used to sanitize the html text.
- breaking Program agument is not optional anymore in module
apply_patches,dom_updaterandcreated_node. - Improve rustdoc on prominent functions and modules.
- Add measurements function to Component for letting components know how much time is spent in each of major steps in dispatching and updating the DOM.
- Add a field
log_measurementtoCmdwhich tells theProgramwheter to log and call measurements.
- Add a field
- Add performance optimization for
sauron-parsecrate lookup ontag_namespaceandself_closing_tagsby putting it in a once_cell Lazy HashSet - breaking Rename
html_element_sctohtml_element_self_closing. - breaking Remove the use of underscore_ to html/svg tags such as
type_,etc and attributes which are also rust identifier to use the raw r#ident.- This includes
typeforasync.
- This includes
- Modify
apply_patchesto use onlyTreePathwherePatchPathis already removed inmt-dom
- Modify
apply_patchesto make use ofPatchPatchandTreePathfrommt-domto efficiently traverse and find the target element to be patched.
- Move Callback from
mt-domcrate to here, since it is more relevant tosauronthanmt-dom.map_callbackandmap_msgis done usingtraitimplementation tomt-dom'sNode,Element,Attribute, andAttValue. - No longer
lib.rswill be used to generate the readme. Make a separate document for each
- simplify the construction of attribute in node-macro by using
attr - Revamp
Cmdto contain flagshould_update_viewwhich instruct theProgramto skip updating the view.
- Fix svg not appearing in the client when used in node macro syntax
- Expose
sauron-parse::parsermodule insauron::parser
- breaking unify the fail and success decoder into just text_reponse_decoder, it receives the status code together with the text body and header
- breaking overhaul on the
Httpapi to allow users to manipulate response headers, and assign callback functions to errored request. - fix too aggressive assertion in
apply_patcheschecking for matching tags. - implement
set_location_hashtoBrowserapi. - breaking dissolve
Browserapi functionalities intoWindowapi. - Fix behavior of checkboxes, it must be explicitly set_checked to false when checked attribute is removed
- implement
on_mountevent where virtual node (sauron::Node) can listen to when the element is materialized into an actual dom element. TheMountEventthat is passed on the argument function contains thetarget_nodewhich is the equivalent created DOM node. - restructure the interactive examples
- improve implementation of markdown-parser
- Use
<p>to wrap multiple top-level elements instead of<div>in sauron-markdown. - use the semantic equivalent html tag, such as
<em>and<strong>, instead of just<span>with aclassattribute
- Use
- fix parsing of self-closing tag for in
sauron-parsecrate. - Add special handling of
on_enterevent, input elements can now useon_enterevent to listen to when the user presses theEnterkey
- minor: put behind a feature-flag some trace/debugging code.
- put behind a feature flag functionalities which deals with
node_idx_lookup
- Add
on_copyandon_pasteevent. - modify
execute_in_request_animation_frameto return the handle ( can be used for cancelling the execution ) - Add special attributes
focus,skipandreplace- If an element has a
focus(true)attribute, it will always have a focus on each update. - If an element has a
skip(true)attribute, it will skip diffing of that node and assume no changes - If an element has a
replace(true)attribute, it will return aReplaceNodepatch replacing the matching old node skipping the diffing. This will be useful, for parts in the view code where it always changes at every update, for diffing would just become an uncessary overhead.
- If an element has a
- Fix
apply_text_patchto include RemoveNode
- Added improvements on
node!macro, now allowing you to use the exact attribute names for rust keywords. before:now:node!( <main> <label for_="input1">Input:</label> <input id="input1" type_="text" /> </main> )
node!( <main> <label for="input1">Input:</label> <input id="input1" type="text" /> </main> )
- 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-nodeidxfeature is enabled - Reexport
serde_jsonin order forjssmacro be able to use reexportedserde_jsonfrom 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
- Fix the
renderfunction 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-markdownfeature fromsauronwhich exclude thesauron-parsecrate to minimize binary size - expose
empty_attrinhtml::attributes- this allows you to add a conditional attribute in building the view.
Example:
img(vec![ src("img/image.jpg"), if let Some(img_title) = self.img_title { title(img_title.to_string()) } else { empty_attr() } ], vec![] )
- this allows you to add a conditional attribute in building the view.
Example:
- add
jssmodule and utility functions which utilizes json to preprocess css styles.jss_nsallows you to add style to your components while prefixing the classnames with a namespace to prevent clashing with classes from other components. Check out thefuturistic-uiexample for complete usage.
- (breaking) Improved
style!macro by using json as the syntax - Added
jss!macro which parsesjsonand convert them tocss - Invocation the
initmethod ofComponentwill be done after theComponenthas been mounted into the DOM. - Unified base code of
append_to_mountandreplace_mountinDomUpdater - Added
map_msgfunction for mappingDomUpdaterto a differentMSG - Fix all the example project's start scripts and
index.htmlload script to get rid of errors from webkit based browser- Modified scripts to use
--target weband import module to fix problems in safari
- Modified scripts to use
- Get rid of test_fixtures and move it to the test directory
- use
span(vec![],vec![])instead oftext("")inview_if(bool,..)when the flag evaluates to false - Add support for
transitionendandanimationendevent - Add initial support for
styleinComponent - Remove the deprecated svg tag macro that should have been removed together with the html tag macro
- refactor
Cmdto not use theCallback.- remove the need for
MSGandPhantomDatain Cmd.
- remove the need for
- change the
no_request_animation_framefeature flag towith-request-animation-frameto be additive and is enabled by default - change the
measurefeature flag towith-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_markdowninsauron. can be used assauron::markdown - dom internal: Remove only the event listener which match the event_name from the ActiveClosure
- 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
- merge attributes of the same name first, before applying the attributes to the DOM element
- 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
- adjust sauron for changes in mt-dom where there are multiple values in one attribute
- change syntax of attribute events which uses
_after theonie:on_clickinstead ofonclick - Make a special case for style than just a plain attribute
- Use
mt-domcrate as replacement to sauron_vdom.mt-domis a very generic virtual-dom crate which doesn't put too much constraints on the types of the member fields
- Change
to_pretty_stringtorenderwith focus on writing to the common buffer.- This is a performance improvement
- Add a function
Node.textto return the string of the text element - Add a function
Node.eldest_child_textto return the string of the only child of this element - Add a function
Node.get_childrento return children of a node - Add a utility function
mousemoveandreleasefor MouseEvent - Remove the call to
stop_propagationin the add_event_listener processor, since this is handled by the event_mapper.
- 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
markdownmodule into a high-level crate (sauron-md)- Detach
to_syntaxmodule into a high-level crate (sauron-syntax) - Create
sauron-parsecrate whichsauron-mdandsauron-syntaxdepends on.
- Detach
- Add functionality for inner_html which optimizes the performance of client side apps
- Add a functionality to hook url hashchange event in the browser
- move Cmd and Dispatch from sauron_vdom to sauron
- Simplify the use Dispatch without the need for Rc
- Export
sauron_vdom::diff::diff_with_key - Add function
take_callbackto consume attribute and get the callback
- Only expose html::events in prelude when 'with-dom' feature is enabled
- 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 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 strsuch asStringor strongly typedenums. - 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
- 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
- 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
- expose
onclick_with,onclick_stop_propagation,onclick_prevent_default,onclick_prevent_allwhich allows developers control on the behavior of the event of a DOM element.
- 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
- bumped up to see logo in docs.rs
-
Add macro based syntax to provide a cleaner syntax in writing the view:
fn view(&self) -> Node<Msg> { 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)), ], ) }
fn view(&self) -> Node<Msg> { 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_updaterandcreated_nodeout 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::tagsandsvg::tags -
Remove the html_array syntax
-
Fix unused warning errors when no feature is enabled
-
Use the proper logging by using
logandconsole_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:
Fto 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
- attributes helper functions such as (styles, classes, etc) should not require MSG to be Clone.
- Add underscores on html tags and attribtues(
type,for,async,loop) that are also special keywords in rust. Now, you can usetype_("text")as an alternative tor#type("text") - rename as_element -> as_element_mut, children -> add_children
- Add
dumb_patchfor patching the dom without involving the callbacks. - Expose to
html::tagmodule for the uncommon html tags which conflicts with common html attributes such asstyle,title.
- implemented removing the associated closures of elements that has been removed from the DOM including the removed element descendants.
- 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_arraymodule. This however has performance penalty
- The original array based syntax is still preserved by using the
- events and attributes are now unified in one field:
attrs mapfunction mapping Msg from in between component is nowmap_msgto avoid confusion with the rust std common maps suchIterator.map- add units utility functions
- Remove requirement for Msg to have any Clone,Debug,PartialEq
- Add initial implementation for markdown handling
- Add history function get history object
- events now prevents defaults and stop propagation
- 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
initfunction 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<Self,Msg> in update method
- 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:
Now:
onclick(|event: Event| { if let Event::MouseEvent(mouse) = event{ sauron::log!("clicked at ({},{})", mouse.x(), mouse.y()) }else{ panic!("This should not happen") } })
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.
- Use &'static str type for Node's attribute name, event name and namespace.
- Add helper function
styleswhich allows users to write style properties easily. - Add helper function
styles_flagwhich 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<Event,MSG>as the value of node.events. - Add
mapfunctionality which lets user embed subcomponents view into the parent component by mapping the callbacks with a wrapped MSG variant from the parent.
- 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 usedstyleattributes. - Separate the uncommon attributes such as
span,labelwhich conflicts with the commonly usedspanandlabelhtml tags. - Use snake_case for non-ident tags and attributes.