Rhai v1.25.0 Release Notes
Release Date: 2026-05-24 // 14 days ago-
🐛 Bug fixes
Engine::compact_scriptnow properly compacts scripts with custom syntax that uses$raw$(thanks@yuvalrakavy#1079).- The string methods
split,split_revand their variants are now markedpureso they can be called onconststrings (thanks@theJC#1082). - The array method
index_ofnow falls back to value comparison for string argument when no script function of that name is registered (thanks@yinho999#1086). - The
walkAPI now correctly visits the arguments toMethodCallandswitchstatements (thanks@isSerge#1092#1093)
🆕 New features
- A new advanced callback,
Engine::on_missing_function, is added (gated under theinternalsfeature) to override default handling when a called function or method is not found (thanks@yuvalrakavy#1067). - ⏪ A new method,
EvalContext::new_frame, is added to created an isolated frame guard that automatically restores field values uponDrop(thanks@yuvalrakavyfor the idea#1085). - 👍
\${...}is supported in multi-line literal strings to escape interpolation, yielding literally${...}for the string (thanks@yinho999#1089).
✨ Enhancements
- Procedural macros such as
#[export_module]and#[derive(CustomType)]no longer require importing standard Rhai types (thanks@timokoesters#1071). FnPtr::call_fn_as_methodandFnPtr::call_as_method_within_contextare added (when not underno_object) to accept athispointer for calling the function pointer as a method call (thanks@yunfengzhfor the request#1080).NativeCallContext::call_methodandNativeCallContext::call_native_methodare added (when not underno_object) to accept athispointer for method calls (thanks@yunfengzhfor the idea#1080).
Previous changes from v1.24.0
-
💥 This new release has a breaking change because of the upgrade to the
getrandomcrate to version 0.3.👍 As a result,
stdwebsupport has been dropped. It is anticipated that this change would not have significant impact on normal usage.💥 Breaking Changes
- 🚚
stdwebsupport is removed. The feature flagstdwebis also removed. Usewasm-bindgeninstead. - 🌐
web-timeis used for WASM targets instead ofinstant, which is no longer maintained #1063.
🐛 Bug fixes
- 🛠 (Fuzzing) Fixed panic when using
sorton an array with a comparer function that does not implement a total order #1058.
✨ Enhancements
- ⚡️ The optimizer now optimizes constant object map property accesses (thanks
@phsym#1050). - Optimization is added to turn
if cond1 { if cond2 { ... } }intoif cond1 && cond2 { ... }. - The method
sortfor arrays is also aliased tosort_by. - The methods
sort_desc,order,order_byandorder_descare added to arrays. - 👻 An exception is now thrown when attempting to use
sorton an array containing unsupported element types.
🆕 New features
AST::new_from_moduleis added to create anASTfrom a sharedModule.
- 🚚