Changelog History
Page 1
-
v1.25.0 Changes
May 24, 2026๐ 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).
-
v1.24.0 Changes
January 19, 2026๐ฅ 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.
- ๐
-
v1.23.3 Changes
September 14, 2025๐ Version Control
๐ The
ahashcrate that Rhai depends on has a breaking change since version0.8.12which bumpsgetrandomto version0.3, braking certainno-stdandwasmbuilds.๐ Version
1.23.3: Use this version when building forno-std๐ Version
1.23.4: This is the main version forstdbuilds.๐ Bug fixes
- ๐ (Fuzzing) Fixed crash when using
..=in arrays, BLOB's, bit-fields and iterators (#1004). - Modules loaded within a
ModuleResolversCollectionnow properly enable access to thescopeetc. - Registered functions for comparison operators with only one operand being a custom type now works properly (thanks
@mkeeter#1003). NativeCallContext::fn_sourcenow correctly returns the source of the function (usuallyNone). The missingNativeCallContext::call_sourceis added to return the source of caller (thanks@FlashSystems#1013).Engine::collect_fn_metadatanow properly includes functions registered into the global namespace (thanks@therealprofand@matthiasbeyer#1017).
โจ Enhancements
- ๐
build.rsno longer writes to the source tree butOUT_DIRinstead (thanks@matthiasbeyer#1018) - ๐
CustomTypederive macro now supports generic types (thanks@ProphetOSpam#999). Therhai_codegencrate dependency is bumped to3.0.0or later. CustomTypederive macro now handlesOptionfields (thanks@agersant#1011).Engine::eval_fn_callis added to make a generic function call.Engine::eval_binary_opis added to quickly compare twoDynamicvalues.- ๐ Better handling for 32-bit architectures and enhanced safety by replacing casts with
try_from(thanks@therealprof#1009). - The new symbol types
$token$,$inner$, and$raw$can now be used in custom syntax definitions (#1023). Engine::register_custom_syntax_without_look_ahead_rawis added to allow the use of$raw$in custom syntax, which returns the script text character-by-character without processing, by-passing the tokenizer. This in turn allows for parsing arbitrary syntax. (#1022)CallFnOptions::in_all_namespacesis added to allow calling functions in all namespaces, instead of only scripted Rhai functions in theAST.
- ๐ (Fuzzing) Fixed crash when using
-
v1.22.0 Changes
May 30, 2025๐ Bug fixes
- ๐ (Fuzzing) An integer-overflow bug from an inclusive range in
get_bitsis fixed (#963). - (Fuzzing) Nested functions marked
privatenow properly cause compilation errors (#993). - Passing function as a function pointer into a function in an imported module now correctly encapsulates the current environment into the generated function pointer (thanks
@dcihlar#976). The same for passing a closure (thanks again,@dcihlar#979). - Revised epsilon-based floating-point comparisons (thanks
@HactarCE#981). - Unneeded optional dependencies are no longer pulled in with features (thanks
@HactarCE#987). Engine::collect_fn_metadatanow properly includes the namespaces of functions in static modules (thanks@therealprofand@elkowar#992).
โจ Enhancements
- ๐ Improve display of function call errors by displaying the caller function's source together with line number info (thanks
@rhizoomeand@HactarCE#988). sourceandpositioninNativeCallContextare nowfn_sourceandcall_position. A new methodcall_sourceis added to return the source (if any) of the caller function (thanks@rhizoomeand@HactarCE#989).- โก๏ธ The
&&,||and??operators are optimized to allow efficient chaining (#994).
- ๐ (Fuzzing) An integer-overflow bug from an inclusive range in
-
v1.21.0 Changes
January 25, 2025๐ Bug fixes
- ๐ Fixed bug in raw strings (thanks
@benatkin944). get_fn_metadata_listfunction is markedvolatile.- ๐
no-stdplussyncshould now build correctly (thanksstargazing-dino947).
๐ New Features
- It is possible to create a function pointer (
FnPtr) which binds to a native Rust function or closure viaFnPtr::from_dnandFnPtr::from_dyn_fn. When called in script, the embedded function will be called (thanks@makspll952).
โจ Enhancements
- The methods
call_fn,call_native_fn,call_fn_rawandcall_native_fn_raware added toEvalContext(thanks@rawhuul954). - A new
internalsfunction,Engine::collect_fn_metadata, is added to collect all functions metadata. This is to facilitate better error reporting for missing functions (thankstherealprof945).
- ๐ Fixed bug in raw strings (thanks
-
v1.20.1 Changes
December 13, 2024 -
v1.20.0 Changes
November 02, 2024๐ Bug fixes
- ๐ (Fuzzing) An integer-overflow bug from an inclusive range in the bits iterator is fixed.
- ๐ (Fuzzing) An integer-underflow bug from an inclusive range is fixed.
- Copy strings if the strings interner is busy instead of panicing (thanks
@irevoire917). - Deserialization of
Scopenow works correctly (thanks@AngelicosPhosphoros918). - ๐ Support for
thumbv6mtarget is fixed (thankschxry919)
๐ New features
- Added support for raw strings with the syntax
##..#" ... "#..##(thanks@cellomath908 910).
โจ Enhancements
-
v1.19.0 Changes
June 30, 2024๐ Bug fixes
- Variable resolver now correctly resolves variables that are captured in a closure.
- ๐
NativeCallContext<'_>(with a lifetime parameter) now parses correctly in the#[export_module]macro. This is to allow forrust_2018_idiomslints (thanks@ltabis864). - ๐ The
syncfeature now works properly inno-stdbuilds (thanks@misssonder874). - More data-race conditions are caught and returned as errors instead of panicking.
- Missing
minandmaxfunctions where both operands are floats orDecimalare added. - ๐ Fixed stack overflow when calling closures recursively (thanks
@MageWeiG880). Engine::call_fnandEngine::call_fn_with_optionsnow correctly use theAST'ssourcefield.- ๐ (Fuzzing) Fixed crash when using
..=in strings. - ๐ (Fuzzing) A recursive stack-overflow bug in
Dynamic::is_hashableis fixed.
๐ New features
- The
break,continue,returnandthrowstatements can now follow the??operator to short-circuit operations where the value is(). - ๐ A new symbol,
$func$, is added to custom syntax to allow parsing of anonymous functions. - The
filter,drainandretainmethods are added to object maps.
-
v1.18.0 Changes
April 12, 2024๐ Starting from this version, we try to put contributors' names on features/enhancements/fixes that they contributed.
๐ We apologize for neglecting to adopt this practice earlier, but late is better than never!
๐ Bug fixes
- The position of an undefined operation call now points to the operator instead of the first operand.
- โก๏ธ The
optimizecommand inrhai-replnow works properly and cycles throughNone->Simple->Full. Engine::call_fn_XXXno longer return errors unnecessarily wrapped inEvalAltResult::ErrorInFunctionCall.- โ
Some tests that panic on 32-bit architecture are fixed (thanks
@alexanderkjall#851). - โก๏ธ The optimizer no longer goes into an infinite loop when optimizing a
trystatement with an empty body.
๐ Deprecated API's
- The plugin macros
export_fn,register_exported_fn!,set_exported_fn!andset_exported_global_fn!are deprecated because they do not add value over existing direct API's.
๐ New features
- Sub-strings can now be selected from full strings by indexing via ranges, e.g.
s[1..4](thanks@zitsen#845). - Doc-comments are now automatically added to function registrations and custom types via the
CustomTypederive macro (thanks@Itabis#847). - New options
Engine::set_max_strings_internedandEngine::max_strings_internedare added to limit the maximum number of strings interned in theEngine's string interner. - A new advanced callback,
Engine::on_invalid_array_index, is added (gated under theinternalsfeature) to handle access to missing properties in object maps. - A new advanced callback,
Engine::on_missing_map_property, is added (gated under theinternalsfeature) to handle out-of-bound index into arrays.
โจ Enhancements
- ๐
parse_jsonis also available without themetadataorserdefeature -- it usesEngine::parse_jsonto parse the JSON text (thanks@Mathieu-Lala#840). FuncRegistration::in_global_namespaceandFuncRegistration::in_internal_namespaceare added to avoid pulling inFnNamespace.- ๐ฆ Array/BLOB/string iterators are defined also within the
BasicIteratorPackagein addition to the regular array/BLOB/string packages. - ๐
LexError::Runtimeis added for use withEngine::on_parse_token. - ๐ Shared values under
syncare now handled more elegantly -- instead of deadlocking and hanging indefinitely, it spins for a number of tries (waiting one second between each), then errors out.
-
v1.17.1 Changes
February 02, 2024๐ This is a bug-fix release that bumps
rhai_codegenversion to2.0.0to satisfy semver rules.