100 KiB
Changelog
✨ yew 0.22.0 (2025-12-08)
Changelog
🚨 Breaking changes
- MSRV raised to 1.84.0. [@Siyuan Yan, #3900]
- Allow setting JsValue as properties. [@Elina, #3458]
- Remove deprecated
class=(...)syntax. [@Tim Kurdov, #3497] - Remove ToHtml trait. [@Elina, #3453]
- Make
<textarea>a void element (no children allowed anymore). [@Tim Kurdov, #3465]
⚡️ Features
- Add for-loops to
html!macro. [@Tim Kurdov, #3498] - Rename
#[function_component]to#[component]. [@Tim Kurdov, #3885] - Add
serdefeature to yew. [@Tim Kurdov, #3880] - Add
use_refhook. [@Alex Parrill, #3548] - Better ImplicitClone ergonomics. Fewer ampersands and stars needed in the
html!macro. [@Cecile Tonglet, #3508, #3431] [@Siyuan Yan, #3892] - Preserve camelCase for known SVG elements. [@Siyuan Yan, #3875]
- Add
inertto the boolean attributes list. [@Tomoaki Kawada, #3678] - Namespace support for
VRaw. [@Finn Bear, #3640] to_callbackmethods and From impls to convert reducer dispatchers and state setters to callbacks. [@Tim Kurdov, #3519]- Allows converting
ChildrenRenderer<VNode>andVChildto VList. [@Muhammad Hamza, #3444] - Add
CallbackRefthat takes ref in argument instead of value. [@Cecile Tonglet, #3419] - Allow import of layout_test into 3rd party crates. [@rollo-b2c2, #3463]
- Add WASI support for server-side rendering. [@langyo, #3534]
- Make
UseFutureHandleClone. [@Adam Steinberg, #3529] - Allow
Selfin prop fields. [@Tim Kurdov, #3569] - Allow boolean in
html!. [@Tim Kurdov, #3441]
🛠 Fixes
- Fix panic when hydrating components with unstable render order. [@WorldSEnder, #3914]
- Fix hydration panic on camelCased elements. [@Siyuan Yan, #3876]
- Fix autocompletion in html macro for rust-analyzer. [@Moritz Hedtke, #3829]
- Fix empty lists hydration failure when they were placed next to suspensions and other components. [@WorldSEnder, #3630]
- Silenced non-normalised element name warnings for SVG elements. [@Tim Kurdov, #3769]
- Fixed inconsistent clone() requirement when passing Classes to HTML elements vs. components. [@Siddhant Shekhar, #3931]
- Fix svg animation always starting immediately. [@Siyuan Yan, #3892]
- Better diagnostics for byte literals in
html!. [@Tim Kurdov, #3441] - Concise diagnostics for missing props. [@Siyuan Yan, #3873]
- Use the namespace when xmlns attributes are specified. [@JasonCG, #3629]
- Fix generic type missing erros in hooks. [@Michael Meyer, #3633]
- Better duplicate key diagnostics. [@WorldSEnder, #3785]
- Fix autocompletion in html macro for rust-analyzer. [@Moritz Hedtke, #3829]
#[hook]:clippy::multiple_bound_locationslint no longer triggered. [@Tim Kurdov, #3803]
⚙️ Improvements
- Avoid unnecessary scheduling. [@WorldSEnder, #3935]
- Remove the dependency on
boolinator. [@Tim Kurdov, #3420] - Avoid string copy for Key: From implementation. [@flumm, #3858]
- Switch to tokise from tokio [@Elina, #3776]
- use_future_with: simplify code a bit by using read-only use_memo rather than use_state. [@Léo Gaspard, #3610]
📝 Documentation
- website: modernise the Yew usage in the tutorial. [@Tim Kurdov, #3882]
- website: make tutorial testable. [@Tim Kurdov, #3879]
- fix the docs of use_prepared_state. [@Tim Kurdov, #3881]
- Update tutorial placeholder image generator. [@Nashwan Azhari, #3830]
- Refactor(NavbarItem): improve readability and maintainability. [@Brilliantkid, #3763]
- Fix website search. [@Muhammad Hamza, #3522]
- Addition and improvements to example crates. [@Oliver Bilbie, #3587] [@Astariul, #3631] [@Yann Dirson, #3570] [@Cecile Tonglet, #3505] [@Kaede Hoshikawa, #3436]
- Wording and typo fixes. [@Waldir Pimenta, #3754] [@Jupp56, #3429] [@Flavio Moreira, #3418] [@ronanM, #3413] [@Waldir Pimenta, #3754] [@Damien Lachaume, #3790] [@Edwin Amsler, #3788] [@Tushar GH, #3585] [@zhengwu, #3574] [@Raahim Fareed, #3539] [@gcmutator, #3628] [@Raphael Martin Schindler, #3605] [@Jonathan Picques, #3448] [@Ikko Eltociear Ashimine, #3432] [@Daniel Sousa, #3425]
✨ yew-router 0.19.0 (2025-12-08)
Changelog
⚡️ Features
- Introduce
FromQueryandIntoQuerytraits. [@Robert Schütte, #3565] - Dynamic basename support. [@Finn Bear, #3725]
🚨 Breaking changes
- MSRV raised to 1.84.0. [@Siyuan Yan, #3900]
✨ yew-agent 0.4.0 (2025-12-08)
Changelog
🛠 Fixes
- Fix calls of the disconnected method of on every render. [@Shihpin Tseng, #3435]
⚡️ Features
- Support module type web worker. [@Luca Cappelletti, #3859]
🚨 Breaking changes
- MSRV raised to 1.84.0. [@Siyuan Yan, #3900]
✨ yew 0.21.0 (2023-09-23)
Changelog
🛠 Fixes
- Fix rust-analyzer non_camel_case_types warning. [[@Sean Bruton](https://github.com/Sean Bruton), #3388]
- Fix incorrect text escaping during SSR. [[@Tim Kurdov](https://github.com/Tim Kurdov), #3381]
- Fix top-level reconciliation in portals. [@WorldSEnder, #3020]
- Fix clippy::let_unit_value lint in propless components. [@WorldSEnder, #2970]
⚡️ Features
- Updated the docs of
set_event_bubbling. [[@Tim Kurdov](https://github.com/Tim Kurdov), #3391] - feat: support arrays for Classes/classes!(). [@Pouriya, #3393]
- Mark VNode as #[must_use]. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #3387]
- Add
IntoPropValueimplementation to convert fromCows toAttrValue. [[@Tim Kurdov](https://github.com/Tim Kurdov), #3346] - Remove compatibility code before 1.64. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #3379]
- Keep checked attribute for elements without special handling. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #3373]
- feat: implement hydration for vraw. [[@Dillen Meijboom](https://github.com/Dillen Meijboom), #3245]
- Add webkitdirectory to the boolean attributes list. [[@Julius Lungys](https://github.com/Julius Lungys), #3214]
- Incremental performance improvements to element creation. [[@Greg Johnston](https://github.com/Greg Johnston), #3169]
- Make VList's children Rc'ed. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #3050]
- Update dependencies. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #3171]
- Pass string types to Html props. [[@Cecile Tonglet](https://github.com/Cecile Tonglet), #2872]
- Implement an internal DomSlot for positioning instead of NodeRef. [@WorldSEnder, #3048]
- Prefer pop_first if it is available. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #3084]
- Add method map() on Children to wrap easily. [[@Cecile Tonglet](https://github.com/Cecile Tonglet), #3039]
- Reentrant event listeners. [@WorldSEnder, #3037]
- Add impl IntoIterator on &Classes. [[@Cecile Tonglet](https://github.com/Cecile Tonglet), #3038]
- Assert there are no circular references. [@WorldSEnder, #3025]
🚨 Breaking changes
- Remove special handling of struct fields of type
Optioninderive(Properties). [[@Tim Kurdov](https://github.com/Tim Kurdov), #3398] - Agent v2. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2773]
- Update signature of use_prepared_state/use_transitive_state. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #3376]
- Make signature of use_future_with consistent. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #3372]
- Allow any type to be used as Children (take 2). [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #3289]
- Enable PartialEq for all virtual dom types. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #3206]
- Pass hook dependencies as the first function argument. [[@Arniu Tseng](https://github.com/Arniu Tseng), #2861]
- Make Classes cheap to clone. [[@Cecile Tonglet](https://github.com/Cecile Tonglet), #3021]
✨ yew-router 0.18.0 (2023-09-xx)
Changelog
⚡️ Features
- Update dependencies. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #3171]
- Only handle "normal" clicks on s. [[@Kai Salmon](https://github.com/Kai Salmon), #3056]
🚨 Breaking changes
- Encode Path Parameters in
yew-router. [[@Jedd Dryden](https://github.com/Jedd Dryden), #3187] - Pass hook dependencies as the first function argument. [[@Arniu Tseng](https://github.com/Arniu Tseng), #2861]
✨ yew-agent 0.3.0 (2023-09-xx)
Changelog
🚨 Breaking changes
- Agent v2. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2773]
✨ yew 0.20.0 (2022-11-xx)
Changelog
-
🛠 Fixes
- Fix onsubmit event type in docs. [@Allan, #2926]
- Fix issues with tuples in closing tag. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2886]
- Fix checked property being reset. [@WorldSEnder, #2907]
- Fix VList Stream in SSR. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2801]
- Fixed
NodeRefnot being implicitly cloned with components. [@wdcocq, #2775] - Attributes: Fix apply_diff_index_maps. [[@Dietmar Maurer](https://github.com/Dietmar Maurer), #2653]
- Fix bubbling of events originating in shadow dom. [@WorldSEnder, #2627]
- Fix some Hook edge cases. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2592]
- Fix issue with node refs and hydration. [@WorldSEnder, #2597]
- Fix macro hygiene issues. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2585]
- Fix casing of dynamic tags. [@WorldSEnder, #2578]
- Automatically convert closure to callback for component properties. [[@Finn Bear](https://github.com/Finn Bear), #2554]
- Fix a problem with NodeRefs and VTags, ref. [@WorldSEnder, #2279]
- Fix defaulted type parameter.. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2284]
- Use Ref::filter_map if rustc is later than 1.63. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2904]
- Evaluate props in the order they're defined. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2887]
- Context: Avoid storing a copy of children. [[@Dietmar Maurer](https://github.com/Dietmar Maurer), #2885]
- Various improvements to Classes, oriented around reducing allocations. [[@Nathan West](https://github.com/Nathan West), #2870]
- Resume Suspension upon unmount. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2874]
- Make fn update() re-render the component by default. [[@Cecile Tonglet](https://github.com/Cecile Tonglet), #2786]
- Do not detach child elements if parent element is about to be detached. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2420]
- remove some unsafes by using atomics. [@WorldSEnder, #2186]
use_prepared_state&use_transitive_state. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2650]- Silence some warnings from derive(Properties). [@WorldSEnder, #2266]
- onsubmit should be a SubmitEvent. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2816]
-
⚡️ Features
- Add VNode::from_html_unchecked. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2842]
- Make Yew lints opt-in. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2882]
- Allow skipping a callback when reforming. [[@Jens Reimann](https://github.com/Jens Reimann), #2864]
- Polled SSR Stream. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2824]
- Add send_stream method for Scope. [@laizy, #2619]
- Allow functions returning unit in
use_effect. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2849] - Configurable Runtime. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2772]
- Pinned Channels. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2811]
- Bind to properties instead of attributes by default. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2819]
- Convert nightly from a feature flag to a compiler flag. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2827]
- Reduce SSR Buffers in VList. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2826]
- Allow keywords after dash in element and attribute names. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2820]
- Replace custom logging by tracing. [@WorldSEnder, #2814]
- Implement sleep and interval for Yew Platform. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2784]
- Remove component NodeRef. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2783]
- Prepared States dependency should be Reference Counted. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2769]
- Document features automatically.. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2780]
- Streamed SSR Response. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2697]
- Nightly features. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2743]
- Allow VNode props to be converted to Children.. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2749]
- Redo derive(Properties), take 2. [@WorldSEnder, #2729]
Callback::reform()should returnCallback<T, OUT>. [@orzogc, #2719]- Span hygiene and editor UX. [@WorldSEnder, #2702]
- Block props update during hydration. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2665]
- Point to
callback_futureincallbackdocs. [@Shadlock0133, #2674] - Change access to VList children to a wrapper. [@WorldSEnder, #2673]
- Partially undo #2673, different approach for the DerefMut impl of VList. [@WorldSEnder, #2692]
- Rework a bunch of cfg(feature) flags to be more principled. [@WorldSEnder, #2666]
- Delay Hydration second render until all assistive nodes have been removed. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2629]
- Allow to consume deps in use_callback. [[@Jet Li](https://github.com/Jet Li), #2617]
- Add
use_futurehook to make consuming futures as suspense easier. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2609] - Add the ability to use non-literal string as attribute names. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2593]
- Introduce a dedicated use_force_update hook. [@WorldSEnder, #2586]
- Impl ImplicitClone for Rc where T: Sized. [@Nano, #2594]
- SSR Hydration. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2552]
- Add use_callback hook. [[@Jet Li](https://github.com/Jet Li), #2566]
- Introduce additional information in SSR artifact to facilitate Hydration. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2540]
- Scoped event handlers. [@WorldSEnder, #2510]
- An ever Increasing Component ID. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2537]
- Prevents Fallback UI from becoming suspended. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2532]
#[cfg(feature = "render")]andyew::Renderer. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2498]- Introduce explicit internal datastructures modeling dom state. [@WorldSEnder, #2330]
- Improve AnyScope API. [[@Aaron Erhardt](https://github.com/Aaron Erhardt), #2445]
- Automatic Message Batching. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2421]
- Add Other variant to the ListenerKind. [[@Alexander Mescheryakov](https://github.com/Alexander Mescheryakov), #2417]
- Function Components & Hooks V2. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2401]
- Add ContextHandle in yew::prelude. [[@Anuvrat Singh](https://github.com/Anuvrat Singh), #2372]
- Separate scheduler rendered call from create and render. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2374]
- Update to edition 2021. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2354]
- Server-side Rendering (without hydration). [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2335]
- Make BaseComponent Sealed.. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2359]
- Remove start_app_as_body.. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2346]
- Bump minimal supported rust version (MSRV) to 1.56. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2334]
- Suspense Support. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2212]
- make layout testing code public. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2310]
- Refactor and simplify
Callback. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2301] - Add pending event listener on the VTag. [[@Alexander Mescheryakov](https://github.com/Alexander Mescheryakov), #2300]
- constify VList::new. [[@Alexander Mescheryakov](https://github.com/Alexander Mescheryakov), #2293]
- Allow
function_componentcreation based on function name. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2292] - Implement IntoPropValue for Rc. [[@Zachary Stewart](https://github.com/Zachary Stewart), #2285]
- Raw field names in property structs. [@WorldSEnder, #2273]
✨ yew-router 0.17.0 (2022-11-xx)
Changelog
-
🛠 Fixes
- Fix basename handling in router. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2297]
-
⚡️ Features
- Simple
NodeRefpassing to<Link>for yew-router. [[@Athan Clark](https://github.com/Athan Clark), #2877] - Make Switch to accept a closure as render function directly. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2659]
#[cfg(feature = "render")]andyew::Renderer. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2498]- Includes query parameters in rendered Link component. [[@Yuki Kodama](https://github.com/Yuki Kodama), #2464]
- Update to edition 2021. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2354]
- Support named wildcards when deriving Routable.. [[@Jonathan Bailey](https://github.com/Jonathan Bailey), #2345]
- Add HashRouter, basename and use gloo-history. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2239]
- Simple
✨ yew-agent 0.2.0 (2022-11-xx)
Changelog
-
⚡️ Features
- add
use_bridgedocs. [[@Shrey Sudhir](https://github.com/Shrey Sudhir), #2722] - Update to edition 2021. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2354]
- Move yew-agent to gloo. [[@Muhammad Hamza](https://github.com/Muhammad Hamza), #2326]
- Implement PrivateAgent. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2318]
- Remove context & job agent. [[@Kaede Hoshikawa](https://github.com/Kaede Hoshikawa), #2295]
- add
✨ yew 0.19.0 (2021-11-26)
Changelog
-
🛠 Fixes
- Attempt to fix recursion on display. [@mibes, #2149]
- Fix default passive option. [@mc1098, #2111]
- Fix trybuild. [@mc1098, #2103]
- Fix event handler during capture phase. [@mc1098, #2062]
- Fix
VTagreuse to reset ancestorNodeRef. [@mc1098, #2030] - Fix IntoEventCallback over IntoPropValue. [@mc1098, #2025]
- Remove underscore prefix on fn parameters. [@mc1098, #2010]
- Fix rust-analyzer #[derive(Properties)] warnings. [@KarlitosVII, #2007]
- Fix clippy lints from 1.54.0. [@Xavientois, #1976]
- Fix scheduler main queue delay (#1953). [@intendednull, #1954]
- Fix case warning on derived properties. [@nitnelave, #1929]
- yew-macro: fix inability to set the autoplay attribute. [@bakape, #1866]
- Fix duplicate
with propserror messages.. [@teymour-aldridge, #1730] - Remove extra braces in html_nested macro. [@Madoshakalaka, #2169]
- Remove unused punct field from props. [@Xavientois, #1969]
-
⚡️ Features
- Check event bubbling cancellation at each step of propagation. [@rjmac, #2191]
- Add possibility to cancel bubbling. [@voidpumpkin, #2172]
- Add the ability to add child nodes conditionally in
html!. [@cecton, #1609] - Add basic lints to the HTML macro.. [@teymour-aldridge, #1748]
- Refactor use ref hooks. [@mc1098, #2093]
- Implementation of portals. [@WorldSEnder, #2147]
- Allow Classes properties to be created from string literals. [@jplatte, #2141]
- Use functions from
gloo_utilsinstead of re-implementing them. [@hamza1311, #2124] - Reliable
use_reducerdispatch anduse_statesetter. [@futursolo, #2126] - Add custom type for attribute values. [@hamza1311, #1994]
- Remove trailing semicolon in macro used in expression position. [@vrmiguel, #2127]
- Add set_if_neq for UseStateHandle. [@voidpumpkin, #2109]
- Add safe first_node fn. [@mc1098, #2094]
- impl PartialEq for
UseStateHandleandUseReducerHandle. [@hamza1311, #2092] - Remove
web_sysre-export. [@mc1098, #2084] - Use into_prop_value to convert str prop to Option. [@Xavientois, #2080]
- Component lifecycle scheduler optimizations. [@bakape, #2065]
- Update dependencies. [@mc1098, #2064]
- Add support for missing boolean attributes. [@mc1098, #2051]
- Add fully qualified primitives in proc macro. [@mc1098, #2037]
- Remove 'static lifetime from hook init function. [@mc1098, #2039]
- Add "struct update" syntax to pass props to component (
..propsinstead ofwith props). [@Xavientois, #2024] - Add
no_implicit_preludeto proc macro tests. [@mc1098, #2033] - Dev/listener multiplexer. [@bakape, #1542]
- Remove ShouldRender type alias. [@mc1098, #2011]
- Components v2 (2). [@hamza1311, #1961]
- Remove InputData & ChangeData. [@mc1098, #2000]
- Support const generics in
#[derive(Properties)]. [@maciejhirsz, #1978] - Add shorthand syntax for props. [@Xavientois, #1970]
- Static attribute lists. [@bakape, #1962]
- yew/vlist: optimize diffing and patching. [@bakape, #1555]
- Add requirement for braces around most props. [@Xavientois, #1939]
- Optimize VTag construction, memory footprint and patching. [@bakape, #1947]
- Refactor and cleanup codebase. [@hamza1311, #1842]
- Helper to build changelog. [@cecton, #1845]
- Implicit optional attributes. [@siku2, #1637]
- yew: reduce scheduler call indirection. [@bakape, #1903]
- Change match statement to if. [@Xavientois, #1884]
- Optimize vtag construction. [@bakape, #1867]
- Apply Clippy lints.. [@teymour-aldridge, #1863]
- Change the app struct to be a real handle to an Yew app instance and make it possible to destroy a running app. [@nicklaswj, #1825]
- Bring context to standard components. [@Diggsey, #1835]
- Upgraded Hook API (2). [@hamza1311, #1780]
- Store hook state in a mutable scoped-TLS. [@Diggsey, #1831]
- Remove unnecessary allocation from
AnyScope. [@Diggsey, #1830] - Added missing licenses to Cargo.toml files and updated to use SPDX syntax. [@jbg, #1822]
- Update Rust version for macro tests to 1.51 & enable const generics tests. [@hamza1311, #1801]
- Allow the use of Rust keywords for element names. [@siku2, #1772]
- Refactor html tag peeking. [@lukechu10, #1738]
- Generic functional components. [@lukechu10, #1756]
- Add support for the unit struct in Properties derive. [@Xavientois, #1752]
- Rip out stdweb. [@philip-peterson, #1697]
✨ yew-router 0.16.0 (2021-11-26)
Changelog
-
🛠 Fixes
- Fix Some Router Behaviour. [@futursolo, #2107]
- Fix multiple field enum tokens. [@mc1098, #1988]
- Fix clippy lints from 1.54.0. [@Xavientois, #1976]
- Fix router. [@hamza1311, #1856]
- update nom 6.1.2 and fix compile errors.. [@higumachan, #1806]
-
⚡️ Features
- Add missing router docs: Redirect, Nested Router, and Path Segament capturing. [@Madoshakalaka, #2192]
- use base url for href of links. [@WorldSEnder, #2177]
- Use functions from
gloo_utilsinstead of re-implementing them. [@hamza1311, #2124] - Update Yew Router as per #2113. [@futursolo, #2118]
- Update dependencies. [@mc1098, #2064]
- Add "replace route" call as a companion to "push route". [@rjmac, #2023]
- Add shorthand syntax for props. [@Xavientois, #1970]
- Add requirement for braces around most props. [@Xavientois, #1939]
- Clean-up and optimize router a little bit. [@hamza1311, #1869]
- Apply Clippy lints.. [@teymour-aldridge, #1863]
- Rewrite router. [@hamza1311, #1791]
- Added missing licenses to Cargo.toml files and updated to use SPDX syntax. [@jbg, #1822]
- Update Rust version for macro tests to 1.51 & enable const generics tests. [@hamza1311, #1801]
- Add support for the unit struct in Properties derive. [@Xavientois, #1752]
✨ yew-agent 0.1.0 (2021-11-26)
Changelog
-
🛠 Fixes
- Fix unmaintained anymap dependency. [@mc1098, #2071]
- Fix clippy lints from 1.54.0. [@Xavientois, #1976]
- Fix crash in link to destroyed agents. [@kristoff3r, #1827]
-
⚡️ Features
- allow web worker resource to be relative. [@astraw, #2086]
use_bridgehook for agents. [@futursolo, #2125]- Use functions from
gloo_utilsinstead of re-implementing them. [@hamza1311, #2124] - yew-agent: add missing web-sys features. [@astraw, #2085]
- Update dependencies. [@mc1098, #2064]
- Drop Private worker handler when bridge is dropped. [@FrancisMurillo, #1944]
✨ yew 0.18.0 (2021-05-15)
Changelog
-
🛠 Fixes
-
⚡️ Features
- Implicit optional attributes. [@siku2, #1637]
- Added callback_future_once in yewtil.(#1712). [@fraillt, #1696]
- Added relevant examples section to the docs. [@oOBoomberOo, #1695]
- Added missing KeyboardService re-export. [@SOF3, #1694]
- Rename internal Agent structs to match Component. [@jstarry, #1688]
- Add discussion link to issue selector. [@jstarry, #1674]
- Update link to Material Design Components. [@TapioT, #1662]
- Extract Classes to a separate macro. [@cecton, #1601]
- Improve the "keyed_list" example. [@titaneric, #1650]
- Add documentation for component children. [@K4rakara, #1616]
- Add a macro for building properties outside of html!. [@siku2, #1599]
✨ yew-router 0.15.0 (2021-05-15)
-
⚡️ Features
- None
-
🛠 Fixes
- None
-
🚨 Breaking changes
RouterButtonnow prevents default events per default @TheNeikos
✨ yew 0.17.4 (2020-10-18)
Changelog
-
🛠 Fixes
✨ yew 0.17.3 (2020-08-16)
Changelog
-
⚡️ Features
- Added
promptfunction toDialogService. [@teymour-aldridge, #1350] - Implement
From<&[T]>whereT: AsRef<str>forClasses. [@alexschrod, #1448] - Added
batch_callback_oncetoComponentLink. [@ctron, #1463]
- Added
-
🛠 Fixes
✨ yew 0.17.2 (2020-07-04)
Changelog
-
⚡️ Features
Keynow implementsDeref<Target = str>. [@faulesocke, #1370]
-
🛠 Fixes
✨ yew 0.17.1 (2020-07-01)
Changelog
-
🛠 Fixes
✨ yew-router 0.14.0 (2020-06-30)
-
⚡️ Features
- None
-
🛠 Fixes
- None
-
🚨 Breaking changes
- The
unit_statemodule has been removed. - Bump
yewversion to0.17.
- The
✨ yew 0.17.0 (2020-06-29)
Changelog
-
⚡️ Features
-
Allow agents to send input messages to themselves. [@mkawalec, #1278]
-
Rendering performance has been improved by ~20%. [@jstarry, #1296, #1309]
-
html!: Elements can be specified with dynamic tag names. [@siku2, #1266]In order to specify a dynamic tag name, wrap an expression with
@{..}:let tag_name = "input"; html! { <@{tag_name} value="Hello" /> } -
HTML button element
typecan now be specified ("submit","reset", or"button"). [@captain-yossarian, #1033] -
All global event listeners can be used as listeners (
onerror,onloadend, and many more). [@siku2, #1244] -
PartialEqis now implemented forVChildwhen properties also implementPartialEq. [[@kellpossible], #1242] -
Agent callbacks now accept
Into<Message>to improve ergonomics. [@totorigolo, #1215] -
Agents can now send messages to themselves. [@totorigolo, #1215]
-
-
🛠 Fixes
-
Bincode dependency version has been loosened
1.2.1->1. [@jstarry, #1349] -
Keyed list ordering algorithm has been fixed. [@totorigolo and @jstarry, #1231]
-
html!:keyandrefare no longer ignored for components with no properties. [@jstarry, #1338] -
html!: List rendering behavior is consistent no matter which syntax is chosen. [@siku2, #1275]html! { for node_list }is now equivalent tohtml! { node_list }whennode_listis aVec<VNode>. -
KeyboardServiceevents can now have default behavior prevented. [[@ghpu], #1286] -
Yew will check the current DOM
inputvalue before comparing with the desired value. [[@ShadoySV], #1268] -
html!: Void elements (<br/>,<input />) are no longer allowed to have children. [@kaoet, #1217] -
Local agents no longer require
InputandOutputto implementSerializable. [@mkawalec, #1195]
-
-
🚨 Breaking changes
-
Renders are now done lazily and will not be executed until all updates have been processed. [@jstarry, #1309]
-
ConsoleService,DialogService,IntervalService,RenderService,TimeoutService, andWebSocketServicemethods are now static. [@teymour-aldridge, #1313] -
html!:Childrenno longer implementsRenderable. [@siku2, #1275]Replace instances of
self.props.children.render()withself.props.children.clone(). -
Yew no longer stops propagation of events by default. [@jstarry, #1256]
Event propagation is usually stopped when you have event listeners attached to nested elements and do not want the event to bubble up from where it was first captured. If your app has this behavior, you can stop propagation by calling
stop_propagation()on the desired event. -
The
onsubmitlistener now usesFocusEventinsteadEventwhen usingweb-sys. [@siku2, #1244] -
The
onmousewheelandontouchenterlisteners have been removed. [@siku2, #1244] -
The
ondoubleclicklistener is now namedondblclick. [@siku2, #1244] -
FetchServicemethods are now static. [@teymour-aldridge, #1235]Instead of
FetchService::new().fetch(..)you should now useFetchService::fetch(..) -
The
send_message_batchmethod has been removed fromAgentLink. [@totorigolo, #1215] -
Minimum supported rust version has been bumped from
1.40.0to1.42.0. [@mkawalec, #1195] -
Every agent
Reachtype is now generic. [@mkawalec, #1195]In order to fix your app, simply append
<Self>to the reach:Reach = Context->Reach = Context<Self> -
Removed
Globalagent because it was never implemented. [@jstarry, #1202] -
Reduced visibility of internal agent types that were not intended to be public. [@jstarry, #1202]
-
✨ yew 0.16.2 (2020-05-14)
Changelog
✨ yew 0.16.1 (2020-05-14)
Changelog
-
🛠 Fixes
✨ yew-router 0.13.0 (2020-05-12)
-
🚨 Breaking changes
- Bump
yewversion to0.16.
- Bump
✨ yew 0.16 (2020-05-09)
Changelog
-
⚡️ Features
-
Added optional
id,class, andplaceholderproperties to theSelectcomponent. [@Stigjb, #1187] -
Re-export
web-sysfrom Yew. This allows projects to useweb-syswithout adding it to theirCargo.toml. [@D4nte, #1176] -
Added support for
Optionwrapped class names. [@liquidblock, #1085]The following code is now supported:
let color: &Option<String> = &self.color; html! { <div class=("btn", color)></div> } -
Added
get_parentandget_componentmethods toComponentLinkto allow access to parent component state. [@jstarry, #1151]
-
-
🛠 Fixes
- Fixed bug that caused html class attributes to be set to an empty string. [@liquidblock, #1085]
- Fixed
Privateworker lifecycle event sending. [@joaquindk, #1146]
-
🚨 Breaking changes
✨ yew-router 0.12.1 (2020-04-26)
-
🛠 Fixes
- Fix infinite rerender bug in 'Router' component. (Thanks @dancespiele)
✨ yew 0.15 (2020-04-25)
Attention!
yew now uses web-sys by default. If your project uses web-sys, you can now drop the "web_sys" feature from your yew dependency.
Don't worry stdweb users, we have created a new alias crate for y'all called yew-stdweb. In order to use it, update your Cargo.toml yew dependency to the following:
yew = { version = "0.15", package = "yew-stdweb" }
Dev Survey Results
Thank you to everyone that took the time to fill out the Yew Dev Survey! 🙇♂️
Results have been posted here: https://github.com/yewstack/yew/wiki/Dev-Survey-%5BSpring-2020%5D
New Chatroom
We moved from Gitter to Discord! Join us: https://discord.gg/VQck8X4
Changelog
-
⚡️ Features
-
🛠 Fixes
- Split class names on whitespace when passed within
tupleorVec. [@bryanjswift, #1084]
- Split class names on whitespace when passed within
-
🚨 Breaking changes
- The
componentsmodule has been moved outyewand intoyew-components. [@jstarry, #1132] - Replaced
mountedcomponent lifecycle method withrenderedwhich is called after each render. [@jstarry, #1072] - Components must now implement the
changemethod (forgetting this was a very common issue). [@jstarry, #1071] - Yew now builds with
web-sysby default. [@jstarry, #1092]
- The
✨ yew-router 0.12.0 (2020-04-25)
-
🚨 Breaking changes
- Bump
yewversion to0.15.
- Bump
-
Extraneous
- Remove
guideexample.
- Remove
✨ yew 0.14.3 (2020-04-04)
-
🛠 Fixes
- Remove
html!component validation to allow generic components. [@mankinskin, #1065] - Improve
Debugformatting forVTagandVText. [@dancespiele, #1059] - Implement
DefaultforCallback. [@TheNeikos, #1043]
- Remove
✨ yew 0.14.2 (2020-03-23)
-
🛠 Fixes
✨ yew 0.14.1 (2020-03-14)
-
🛠 Fixes
Connectedmessage was only called for first bridge creation. [@nicklaswj, #1029]
✨ yew 0.14 (2020-03-14)
Happy 🥧 (PI) Day! This release brings a number of bug fixes for web-sys apps and ergonomic improvements to the API. Huge thanks to the community for diving into the migration from stdweb to web-sys so quickly and uncovering these issues!
Changelog
-
⚡️ Features
- Implemented
CloneforWebSocketStatus. [@kellytk, #1023] - Improved ergonomics for message APIs by accepting
Into<Msg>. [@captain-yossarian, #999] html!improved compiler messages and flexible syntax forwith props. [@captain-yossarian, #960]
- Implemented
-
🛠 Fixes
- Fixed panic in
stdwebResizeServiceevent handling. [@nicklaswj, #1014] - Removed build check for OS compatibility. [@jstarry, #1019]
- Fixed interval and timer usage in
web-sysworkers by updatinggloo. [@jstarry, #1018] - Send
Connectedmessage for Public agents. [@TheNeikos, #1007] - Fixed
web-sysPublic / Private agent initialization. [@jstarry, #1006] - Fixed websocket 'text' message handling for
web-sysagents. [@jstarry, #1005]
- Fixed panic in
-
🚨 Breaking changes
FetchError::FetchFailedenum variant now wraps aStringto hold the failure reason. [@jstarry, #1025]- Message APIs now accept
Into<Msg>, so callingmsg.into()will cause compile errors. [@captain-yossarian, #999]
✨ yew-router 0.11.0 (2020-03-14)
-
🛠 Fixes
✨ yew 0.13.2 (2020-03-05)
✨ yew 0.13.1 (2020-03-04)
✨ yew-router 0.10.0 (2020-03-02)
- Bumped version of Yew from v0.12.0 to v0.13.0
- This brings support for web_sys, which necessitates specifying either "web_sys" or "std_web" as a feature. (Thanks @tarkah)
✨ yew 0.13 (2020-03-01)
web-sys support has arrived! @daxpedda spear-headed the effort and courageously integrated web-sys while maintaining support for stdweb through no small amount of cfg macro usage. We chose to continue support for apps built with stdweb because the dev experience is still quite a bit better (Unfortunately cargo-web is incompatible with web-sys). However, the Yew team recognizes that the future of cargo-web of stdweb are uncertain. For this reason, we recommend devs start making the switch over to web-sys and wasm-bindgen. We will likely invest in improving the dev experience with these tools so that switching over is eventually a no-brainer. Please reach out with ideas and feedback for this migration through Github issues and in our Gitter chatroom!
After upgrading to v0.13, devs will now have to opt in to either stdweb or web-sys by using either the "web_sys" or "std_web" on the yew crate in their Cargo.toml.
# Choose `stdweb`
yew = { version = "0.13", features = ["std_web"] }
# Choose `web-sys`
yew = { version = "0.13", features = ["web_sys"] }
Lastly, take note that API docs on https://docs.rs/yew will be using the "web_sys" feature. For "std_web" docs, please visit https://docs.rs/yew-stdweb.
Changelog
-
⚡️ Features
-
Added support for building apps with
web-sys. [@daxpedda, #961] -
Properties 2.0 [@AlephAlpha, #975]
Component properties are now assumed to be required unless otherwise annotated with a default value. Check out the proposal issue #928 for more details!
-
-
🛠 Fixes
- Fixed
Componentchildren re-rendering bug. [@jstarry, #980] - Fixed panic when interacting with agents after receiving an agent message. [@jstarry, #981]
- Fixed panic when a component with a root
VRefnode is detached. [@jstarry, #983] - Fixed annoying warning when a component with a root
VTagnode is detached. [@jstarry, #983]
- Fixed
-
🚨 Breaking changes
- Changed
Propertiesmacro behavior. Check out the proposal issue #928 for more details! [@AlephAlpha, #975] - Cleaned up exported apis and doc visibility. [@jstarry, #977]
ReaderServicemethods now return aResultinstead of panicking. [@daxpedda, #868]FetchServicemethods now return aResultinstead of panicking. [@daxpedda, #867]StorageServicemethods now return aResultinstead of panicking. [@daxpedda, #827]
- Changed
✨ yew-router 0.9.0 (2020-02-25)
-
⚡️ Features
- Improved error handling in macro. [233] @jplatte
-
🛠 Fixes
✨ yew 0.12 (2020-02-16)
-
⚡️ Features
- Improved ergonomics for
html! { for .. }. [@jstarry, #875] - Added
#[props(default = "fn_path")]for specifying a default property value. [@AlephAlpha, #881] - Exposed the macros for creating format types. [@ctm, #883]
- Added support for binary-only and text-only formats in
WebSocketService. [@ctm, #851] - Implemented
PartialEqforChildrenRendererto allowchildrencomparison. [@jstarry, #916] - Reduced restrictions on
ComponentLinkmethods to improveFuturesupport. [@jplatte, #931] - Added
referrer,referrer_policyandintegritytoFetchOptions. [@leo-lb, #931]
- Improved ergonomics for
-
🛠 Fixes
-
🚨 Breaking changes
✨ yew-router 0.8.1 (2020-01-10)
-
🛠 Fixes
- Fixed a dependency issue with
wasm-bindgenthat would cause builds to fail when building for thewasm32-unknown-unknowntarget.
- Fixed a dependency issue with
✨ yew-router 0.8.0 (2020-01-09)
-
⚡️ Features
- Use a default type parameter of
()to specify state-related type parameters instead of the old macro-based solution. [157] - Remove need for
JsSerializablebound on the state parameter used for storing extra data in the history API.[185] - RouterLink and RouterButton now support having children Html. This deprecates the
textprop. [192] - Fragment routing is now easily implementable by using an adapter because parser rules for the routing syntax were relaxed. [195] [211]
- Support using this library only with the Switch derive, allowing it to run in non-web contexts. [199]
- Use a default type parameter of
-
🚨 Breaking changes
- If you were using
default-features = false, you will have to now specifyfeatures = ["service"]to get the same behavior as before. [199] RouterAnchorandRouterButtonnow have props that take aroute: SW where SW: Switchprop instead of alink: Stringand they now have a mandatory type parameter that specifies thisSW. [207]Route's state field now holds aTinstead of anOption<T>. [205]- Using default type parameters to specify the state typ instead of the macro that generated a module (
unit_state) means that any imports from that module should now be replaced with the path that the type normally has in the project. [157]
- If you were using
-
Inconsequential
- Change state related type parameters from
TtoSTATE. [208]
- Change state related type parameters from
✨ yew 0.11 (2020-01-06)
This release aims to lay the groundwork for Yew component libraries and clean up the API for the ever elusive 1.0 release.
Transition Guide
This release comes with a lot of breaking changes. We understand it's a hassle to update projects but the Yew team felt it was necessary to rip a few bandaids off now as we approach a 1.0 release in the (hopefully) near future. To ease the transition, here's a guide which outlines the main refactoring you will need to do for your project. (Note: all of the changes are reflected in the many example projects if you would like a proper reference example)
1. Callback syntax
This is the main painful breaking change. It applies to both element listeners as well as Component callback properties. A good rule of thumb is that your components will now have to retain a ComponentLink to create callbacks on demand or initialize callbacks in your component's create() method.
Before:
struct MyComponent;
enum Msg {
Click,
}
impl Component for MyComponent {
type Message = Msg;
type Properties = ();
fn create(_: Self::Properties, _: ComponentLink<Self>) -> Self {
MyComponent
}
fn update(&mut self, msg: Self::Message) -> ShouldRender {
match msg {
Msg::Click => true,
}
}
fn view(&self) -> Html<Self> {
// BEFORE: Callbacks were created implicitly from this closure syntax
html! {
<button onclick=|_| Msg::Click>{ "Click me!" }</button>
}
}
}
After:
struct MyComponent {
link: ComponentLink<Self>,
}
enum Msg {
Click,
}
impl Component for MyComponent {
type Message = Msg;
type Properties = ();
fn create(_: Self::Properties, link: ComponentLink<Self>) -> Self {
MyComponent { link }
}
fn update(&mut self, msg: Self::Message) -> ShouldRender {
match msg {
Msg::Click => true,
}
}
fn view(&self) -> Html {
// AFTER: Callbacks need to be explicitly created now
let onclick = self.link.callback(|_| Msg::Click);
html! {
<button onclick=onclick>{ "Click me!" }</button>
}
}
}
If a closure has a parameter you will now need to specify the parameter's type. A tip for finding the appropriate type is to search Yew's repo for the HTML attribute the closure is assigned to.
For example, onkeydown of <button>:
let onkeydown = self.link.callback(|e: KeyDownEvent| {
// ...
});
and
html! {
<button onkeydown=onkeydown type="button">
{ "button" }
</button>
}
2. Method Renames
It should be safe to do a project-wide find/replace for the following:
send_self(->send_message(send_back(->callback(response(->respond(AgentUpdate->AgentLifecycleEvent
These renames will probably require some more care:
fn handle(->fn handle_input((for Agent trait implementations)
3. Drop Generic Types for Html<Self> -> Html
🎉 We are pretty excited about this change! The generic type parameter was confusing and restrictive and is now a thing of the past!
Before:
impl Component for MyComponent {
// ...
fn view(&self) -> Html<Self> {
html! { /* ... */ }
}
}
After:
impl Component for MyComponent {
// ...
fn view(&self) -> Html {
html! { /* ... */ }
}
}
4. Properties must implement Clone
In yew v0.8 we removed the requirement that component properties implement Clone
and in this release we are adding the requirement again. This change is needed
to improve the ergonomics of nested components. The only time properties will be
cloned is when a wrapper component re-renders nested children components.
-
⚡️ Features
- Added
html_nested!macro to support nested iterable children access. [@trivigy, #843] - Added
bincodeto the list of supported formats. [@serzhiio, #806] - Added a
noop()convenience method toCallbackwhich creates a no-op callback. [@mdtusz, #793] - The
html!macro now accepts aCallbackfor element listeners. [@jstarry, #777]
struct MyComponent { onclick: Callback<ClickEvent>, } enum Msg { Click, } impl Component for MyComponent { type Message = Msg; type Properties = (); fn create(_: Self::Properties, link: ComponentLink<Self>) -> Self { MyComponent { onclick: link.callback(|_| Msg::Click), } } fn update(&mut self, msg: Self::Message) -> ShouldRender { match msg { Msg::Click => true, } } fn view(&self) -> Html { html! { <button onclick=&self.onclick>{ "Click me!" }</button> } } }- Add
send_message_batchmethod toComponentLink. [@hgzimmerman, #748] - Allow compilation to
wasitarget withoutwasm_bindgen. [@dunnock, #746] AgentLinknow implementsClonewhich enablesFutureusage without explicit Yew framework support. [@izissise, #802]ComponentLinknow implementsClonewhich enablesFutureusage without explicit Yew framework support. [@hgzimmerman, #749]
use wasm_bindgen::JsValue; use wasm_bindgen_futures::future_to_promise; // future must implement `Future<Output = Component::Message> + 'static` let link = self.link.clone(); let js_future = async move { link.send_message(future.await); Ok(JsValue::NULL) }; future_to_promise(js_future); - Added
-
🛠 Fixes
- Fixed handling of boolean tag attributes. [@mrh0057, #840]
- Improved nested component ergonomics. [@jstarry, #780]
fn view(&self) -> Html { html! { <Wrapper> // This is now valid. (before #780, this would cause a lifetime // compile error because children nodes were moved into a closure) <Nested on_click=&self.nested_on_click /> </Wrapper> } }- Creating a
CallbackwithComponentLinkis no longer restricted to mutable references, improving ergonomics. [@jstarry, #780] - The
Callbackreformmethod no longer consumes self making it easier to "reverse map" aCallback. [@jstarry, #779]
pub struct ListHeader { props: Props, } #[derive(Properties, Clone)] pub struct Props { #[props(required)] pub on_hover: Callback<Hovered>, #[props(required)] pub text: String, } impl Component for ListHeader { type Message = (); type Properties = Props; fn create(props: Self::Properties, _: ComponentLink<Self>) -> Self { ListHeader { props } } fn update(&mut self, _: Self::Message) -> ShouldRender { false } fn view(&self) -> Html { let onmouseover = self.props.on_hover.reform(|_| Hovered::Header); html! { <div class="list-header" onmouseover=onmouseover> { &self.props.text } </div> } } }- Reduced allocations in the
Classesto_stringmethod. [@hgzimmerman, #772] - Empty string class names are now filtered out to prevent panics. [@jstarry, #770]
-
🚨 Breaking changes
- Components with generic args now need to be closed with the full type path. (e.g.
html! { <Wrapper<String>></Wrapper<String>>}) [@jstarry, #837] - Changed
VTaglistener type fromBox<dyn Listener>toRc<dyn Listener>. [@jstarry, #786] Propertiesneed to implementCloneagain in order to improve nested component ergonomics. [@jstarry, #786]- Removed
send_futuremethod fromComponentLinksince it is no longer necessary for using Futures with Yew. [@hgzimmerman, #799] - Removed generic type parameter from
Htmland all virtual node types:VNode,VComp,VTag,VList,VText, etc. [@jstarry, #783] - Removed support for macro magic closure syntax for element listeners. (See transition guide for how to pass a
Callbackexplicitly instead). [@jstarry, #782] - Renamed
Agentmethods and event type for clarity.handle->handle_input,AgentUpdate->AgentLifecycleEvent,response->respond. [@philip-peterson, #751] - The
ComponentLinksend_backmethod has been renamed tocallbackfor clarity. [@jstarry, #780] - The
ComponentLinksend_selfandsend_self_batchmethods have been renamed tosend_messageandsend_message_batchfor clarity. [@jstarry, #780] - The
Agentsend_backmethod has been renamed tocallbackfor clarity. [@jstarry, #780] - The
VTagchildrenvalue type has changed fromVec<VNode>toVList. [@jstarry, #754]
- Components with generic args now need to be closed with the full type path. (e.g.
✨ yew 0.10 (2019-11-11)
-
⚡️ Features
Futuresupport 🎉 AComponentcan update following the completion of aFuture. Check out this example to see how it works. This approach was borrowed from a fork of Yew calledplastercreated by @carlosdp. [@hgzimmerman, #717]- Added the
agentandservicesfeatures so that this functionality can be disabled (useful if you are switching to usingFutures). [@hgzimmerman, #684] - Add
refkeyword for allowing aComponentto have a direct reference to its rendered elements. For example, you can now easily focus an<input>element after mounting. [@jstarry, #715]
use stdweb::web::html_element::InputElement; use stdweb::web::IHtmlElement; use yew::prelude::*; pub struct Input { node_ref: NodeRef, } impl Component for Input { type Message = (); type Properties = (); fn create(_: Self::Properties, _: ComponentLink<Self>) -> Self { Input { node_ref: NodeRef::default(), } } fn mounted(&mut self) -> ShouldRender { if let Some(input) = self.node_ref.try_into::<InputElement>() { input.focus(); } false } fn update(&mut self, _: Self::Message) -> ShouldRender { false } fn view(&self) -> Html<Self> { html! { <input ref=self.node_ref.clone() type="text" /> } } }- Make
Agentrelated typespublicto allow other crates to create custom agents. [@dunnock, #721] Component::changewill now returnfalsefor components that haveComponent::Properties == (). [@kellytk, #690]]- Updated
wasm-bindgendependency to0.2.54. Please update yourwasm-bindgen-clitool by runningcargo install --force --version 0.2.54 -- wasm-bindgen-cli. [@jstarry, #730], [@ctaggart, #681]
-
🛠 Fixes
- Fixed the mount order of components. The root component will be mounted after all descendants have been mounted. [@jstarry, #725]
- All public items now implement
Debug. [@hgzimmerman, #673]
-
🚨 Breaking changes
-
Minimum rustc version has been bumped to
1.39.0forFuturesupport. [@jstarry, #730] -
Componentnow has a requiredviewmethod and automatically implements theRenderabletrait. Theviewmethod in theRenderabletrait has been renamed torender. [@jstarry, #563]Before:
impl Component for MyComponent { type Message = Msg; type Properties = (); fn create(_: Self::Properties, _: ComponentLink<Self>) -> Self { MyComponent {} } fn update(&mut self, msg: Self::Message) -> ShouldRender { true } } impl Renderable<MyComponent> for MyComponent { fn view(&self) -> Html<Self> { html! { "hello" } } }After:
impl Component for MyComponent { type Message = Msg; type Properties = (); fn create(_: Self::Properties, _: ComponentLink<Self>) -> Self { MyComponent {} } fn update(&mut self, msg: Self::Message) -> ShouldRender { true } fn view(&self) -> Html<Self> { html! { "hello" } } } -
Removed the
Transferabletrait since it did no more than extend the serdeSerializeandDeserializetraits. [@hgzimmerman, #319]Before:
impl Transferable for Input {} #[derive(Serialize, Deserialize)] pub enum Input { Connect, }After:
#[derive(Serialize, Deserialize)] pub enum Input { Connect, } -
WebSocketService::connectwill now return aResultin order to stop panicking on malformed urls. [@lizhaoxian, #727] -
VTagnow is boxed withinVNodeto shrink the size of its enum representation. [@hgzimmerman, #675]
-
✨ yew-router 0.7.0 (2019-11-11)
-
⚡️ Features
-
🛠 Fixes
-
🚨 Breaking changes
- Upgrade to Yew 0.10.0
- Switch components now need to implement
Clonein order to be used with theRouter[171]
✨ yew-router 0.6.1 (2019-11-01)
-
⚡️ Features
- Bring back
{},{*}, and{<number>}capture syntax for tuple structs/enum variants. If your variant or struct doesn't have named fields, you don't need to supply names in the matcher string [116] - Allow ! special character in more places.
- Greatly improve the quality of matcher string parsing errors. [171]
- Add
impl<SW: Switch, T> From<SW> for Route<T>. Now Routes can be created from Switches easily. - Allow escaping {, }, and ! special characters by using
{{,}}, and!!respectively. - Provide a correct error message when attempting to derive
Switchfor a Unit struct/variant with a capture group.
- Bring back
✨ yew-router 0.6.0 (2019-10-24)
-
⚡️ Features
Switchtrait and Proc Macro enables extracting data from route strings.Routercomponent added.RouterLinkandRouterButtonhelper components added.
-
🚨 Breaking changes
- Nearly everything. Most items were renamed.
- Upgrade to Yew 0.9.0
✨ yew 0.9.2 (2019-10-12)
-
🛠 Fixes
- Fix
yew-macrodependency version
- Fix
✨ yew 0.9.1 (2019-10-12)
Happy Canadian Thanksgiving! 🦃
-
⚡️ Features
- Implemented
Defaulttrait forVNodeso thatunwrap_or_defaultcan be called onOption<Html<Self>>. [@hgzimmerman, #672] - Implemented
PartialEqtrait forClassesso that is more ergonomic to useClassestype in component props. [@hgzimmerman, #680] - Updated
wasm-bindgendependency to0.2.50. Please update yourwasm-bindgen-clitool by runningcargo install --force --version 0.2.50 -- wasm-bindgen-cli. [@jstarry, #695]
- Implemented
-
🛠 Fixes
- Fixed issue where text nodes were sometimes rendered out of order. [@jstarry, #697]
- Fixed regression introduced in 0.9.0 that prevented tag attributes from updating properly. [@jstarry, #698]
- Fixed emscripten builds by pinning the version for the
ryudownstream dependency. [@jstarry, #703] - Updated
stdwebto0.4.20which fixed emscripten builds and unblocked updatingwasm-bindgento0.2.50. [@ctaggart, @jstarry, #683, #694] - Cleaned up build warnings for missing
dynkeywords. [[@benreyn], #687]
✨ yew 0.9 (2019-09-27)
-
⚡️ Features
-
New
KeyboardServicefor setting up key listeners on browsers which support the feature. [@hgzimmerman, #647] -
ComponentLinkcan now create aCallbackwith more than oneMessage. TheMessage's will be batched together so that theComponentwill not be re-rendered more than necessary. [@stkevintan, #660] -
Message's toPublicAgent's will now be queued if theAgenthasn't finished setting up yet. [@serzhiio, #596] -
Agent's can now be connected to without aCallback. Instead of creating a bridge to the agent, create a dispatcher like so:MyAgent::dispatcher(). [@hgzimmerman, #639] -
Component's can now accept children in thehtml!macro. [@jstarry, #589]// app.rs html! { <MyList name="Grocery List"> <MyListItem text="Apples" /> </MyList> }// my_list.rs use yew::prelude::*; pub struct MyList(Props); #[derive(Properties)] pub struct Props { #[props(required)] pub name: String, pub children: Children<MyListItem>, } impl Renderable<MyList> for MyList { fn view(&self) -> Html<Self> { html! {{ self.props.children.iter().collect::<Html<Self>>() }} } } -
Iterators can now be rendered in thehtml!macro without using theforkeyword. [@hgzimmerman, #622]Before:
html! {{ for self.props.items.iter().map(renderItem) }}After:
html! {{ self.props.items.iter().map(renderItem).collect::<Html<Self>>() }} -
Closures are now able to be transformed into optional
Callbackproperties. [@Wodann, #612] -
Improved CSS class ergonomics with new
Classestype. [@DenisKolodin, #585], [@hgzimmerman, #626] -
Touch events are now supported
<div ontouchstart=|_| Msg::TouchStart>[@boydjohnson, #584], [@jstarry, #656] -
The
Componenttrait now has anmountedmethod which can be implemented to react to when your components have been mounted to the DOM. [@hgzimmerman, #583] -
Additional Fetch options
mode,cache, andredirectare now supported [@davidkna, #579] -
The derive props macro now supports Properties with lifetimes [@jstarry, #580]
-
New
ResizeServicefor registering forwindowsize updates [@hgzimmerman, #577]
-
-
🛠 Fixes
- Fixed JS typo in RenderService. This was causing animation frames to not be dropped correctly. [@jstarry, #658]
- Fixed
VNodeorphaning bug when destroyingVTagelements. This caused someComponents to not be properly destroyed when they should have been. [@hgzimmerman, #651] - Fix mishandling of Properties
whereclause in derive_props macro [@astraw, #640]
-
🚨 Breaking changes
None
✨ yew 0.8 (2019-08-10)
Props! Props! Props!
This release introduces a more developer friendly way to handle your Component props. Use the new #[derive(Properties)] macro to beef up your props! Property values can now be annotated as #[props(required)] which will enforce that props are present at compile time. This means that your props struct no longer needs to implement Default, so time to clean up all of those prop values you wrapped in Option to have a default value.
-
⚡️ Features
html!- Self-closing html tags can now be used:<div class="marker" />[@totorigolo, #523]html!- SVG name-spaced tags are now supported! [@jstarry, #550]- Properties can now be required at compile time [@jstarry, #553]
- App components can now be mounted with properties [@jstarry, #567]
- Apps can now be mounted as the
<body>tag [@jstarry, @kellytk, #540] - Content editable elements can now trigger
oninputevents [@tiziano88, #549]
-
🛠 Fixes
html!- Class name order is now preserved which unlocks the use of Semantic UI [@charvp, #424]html!- Dashed tag names and properties are supported [@jstarry, #512, #550]html!- All rust keywords can be used as tag attributes [@jstarry, #550]html!- SupportCallbackclosure with explicit return type [@totorigolo, #564]html!- Fixed edge case where>token would break parser [@totorigolo, #565]- Performance improvement to the diff engine [@totorigolo, #539]
Propertiesno longer need to implement thePartialEq,Clone, orDefaulttraits [@jstarry, #553]Componentwill not panic if thechangemethod is unimplemented [@jstarry, #554]
-
🚨 Breaking changes
-
The
Component::Propertiesassociated type must implement the newPropertiestrait [@jstarry, #553]The new
Propertiestrait is what powers the ability to check required props are present at compile time. Use the derive props macro to implement automatically.use yew::Properties; #[derive(Properties)] pub struct Props { #[props(required)] pub value: MyStruct, } -
Callbackprops no longer transform intoOptiontypes [@jstarry, #553]html! { <Button on_click=Msg::Click /> }before:
#[derive(PartialEq, Clone, Default)] pub struct Props { on_click: Option<Callback<()>>, }after: note the
#[props(required)]attribute#[derive(PartialEq, Properties)] pub struct Props { #[props(required)] on_click: Callback<()>, }
-
✨ yew 0.7 (2019-07-19)
Commas? We don't need no stinkin' commas!
This release brings a new and improved html! macro for writing JSX-like syntax. Commas and colons are no longer necessary now that the macro is written as a procedural macro.
-
⚡️ Features
html!{}is now valid syntax and can be used to render nothing [@jstarry, #500]- Apps can now be built without
cargo-webusingwasm-bindgen[@jstarry, #497] Callbacknow implementsDebug[@DenisKolodin, #485]- New utility method for getting the
hostof the current page [@DenisKolodin, #509]
-
🛠 Fixes
html!- Commas are no longer necessary for splitting up attributes [@jstarry, #500]html!- Colons are no longer necessary for denoting aComponenttag [@jstarry, #500]- Textarea value can be now be set:
<textarea value="content">[@DenisKolodin, #476] - changed
StorageService::restoreto take an immutable receiver [@dermetfan, #480] - Fixed a component rendering bug [@jstarry, #502]
✨ yew 0.6 (2019-02-20)
-
⚡️ Features
- Added
start_appconvenience method for initializing the app and mounting it to the body [@DenisKolodin, #462] - Added handling of files of
inputelement. There is now aChangeData::Filesvariant for theonchangehandler [@DenisKolodin, #464] - Added
ReaderServiceto read data fromFileinstances. [@DenisKolodin, #464, #468]
- Added
-
🛠 Fixes
- It was impossible to set
valueattribute for any tag instead ofoption, because it used inner value ofVTagto keep the value forinputelement. Nowvalueattribute works foroptions,progresstags, etc.
- It was impossible to set
-
🔮 Examples
- New example
file_uploadthat prints sizes of uploaded files [@DenisKolodin, #464]
- New example
✨ yew 0.5 (2019-02-01)
🎶 Secret Agent Man 🎶
This release introduces the concept of an Agent. Agents are separate activities which you could run in the same thread or in a separate thread. There are three types of agents Context, Job, Public described below. To connect to an agent use the Worker::bridge method and pass a link of component's environment to it.
-
⚡️ Features
- Introduced the concept of an
Agentwhich can run processes in other contexts:Contextagent spawns once per threadJobagent spawns for every bridgePublicagent spawns an agent in a separate thread (it uses Web Workers API under the hood).
- Allow setting the whole properties struct of a component with
<Component: with props /> ComponentLinknow has asend_selfmethod which allows components to update themselves [@DenisKolodin, #365]- All services are re-exported within the
yew::servicesmodule. html!macro supports multiple classes in a single string:<a class="button is-primary",>.- Added
FetchOptionsto allow settingCredentialsoffetchrequest. FetchServiceaborts requests usingAbortController.- Added
SubmitEventwithonsubmitrule.
- Introduced the concept of an
-
🛠 Fixes
- Bug with emscripten target
RuntimeError: index out of boundsfixed with a new scheduler [@DenisKolodin, #272]
- Bug with emscripten target
-
🚨 Breaking changes
send_backmethod requires a mutable reference toself. This was added to prevent creating callbacks inviewimplementations. [@DenisKolodin, #367]Contextrequirement removed. It's no longer necessary to useComponent<CTX>type parameter. Instead, a link to the environment is provided with theComponent::createcall. [@DenisKolodin, #272]