Skip to content

Releases: mlua-rs/mlua

v0.10.5

24 May 12:39
31efd0c
Compare
Choose a tag to compare

What's Changed

  • mlua-sys is back to v0.6.x (Luau 0.663)
  • Reverted: Trigger abort when Luau userdata destructors are panic (requires new mlua-sys)
  • Reverted: Added large (52bit) integers support for Luau (breaking change)

Full Changelog: v0.10.4...v0.10.5

v0.11.0-beta.1

07 May 11:55
9b45663
Compare
Choose a tag to compare
v0.11.0-beta.1 Pre-release
Pre-release

What's Changed

  • New require-by-string for Luau (with Require trait and async support)
  • Added Thread::resume_error support for Luau
  • 52 bit integers support for Luau (this is a breaking change)
  • New features for Luau compiler (constants, disabled builtins, known members)
  • AsyncThread<A, R> changed to AsyncThread<R> (A pushed to stack immediately)
  • Lifetime 'a moved from AsChunk<'a> to AsChunk::source
  • Lua::scope pass &Scope instead of &mut Scope to closure
  • Added global hooks support (Lua 5.1+)
  • Added per-thread hooks support (Lua 5.1+)
  • Lua::init_from_ptr renamed to Lua::get_or_init_from_ptr and returns &Lua
  • Lua:load_from_function is deprecated (this is register_module now)
  • Added Lua::register_module and Lua::preload_module

Full Changelog: v0.10.4...v0.11.0-beta.1

v0.10.4

05 May 15:07
4ff677f
Compare
Choose a tag to compare

What's Changed

yanked because of breaking semver (large integers for Luau changed type from i32 to i64)

  • Luau updated to 0.672
  • New serde option encode_empty_tables_as_array to serialize empty tables as array
  • Added WeakLua and Lua::weak() to create weak references to Lua state
  • Trigger abort when Luau userdata destructors are panicing (Luau GC does not support it)
  • Added AnyUserData::type_id() method to get the type id of the userdata
  • Added Chunk::name(), Chunk::environment() and Chunk::mode() functions
  • Support borrowing underlying wrapped types for UserDataRef and UserDataRefMut (under userdata-wrappers feature)
  • Added large (52bit) integers support for Luau
  • Enable serde for bstr if serialize feature flag is enabled
  • Recursive warnings (Lua 5.4) are no longer allowed
  • Implemented IntoLua/FromLua for BorrowedString and BorrowedBytes
  • Implemented IntoLua/FromLua for char
  • Enable Thread::reset() for all Lua versions (limited support for 5.1-5.3)
  • Bugfixes and improvements

Full Changelog: v0.10.3...v0.10.4

v0.10.2

01 Dec 13:52
6f6cda0
Compare
Choose a tag to compare

What's Changed

  • Switch proc-macro-error to proc-macro-error2 by @evie-calico in #493
  • Do not allow Lua to run GC finalizers on ref thread (#491)
  • Fix chunks loading in Luau when memory limit is enforced (#488)
  • Added String::wrap method to wrap arbitrary AsRef<[u8]> into impl IntoLua
  • Better FreeBSD/OpenBSD support (thanks to cos)
  • Delay "any" userdata metatable creation until first instance is created (#482)
  • Reduce amount of generated code for UserData (less generics)

Full Changelog: v0.10.1...v0.10.2

v0.10.1

09 Nov 21:52
c926327
Compare
Choose a tag to compare

What's Changed

  • Minimal Luau updated to 0.650
  • Added Luau native vector library support (this can change behavior if you use vector function!)
  • Added Lua String::display method
  • Improved pretty-printing for Lua tables (#478)
  • Added Scope::create_any_userdata to create Lua objects from any non-'static Rust types
  • Added AnyUserData::destroy method
  • New userdata-wrappers feature to impl UserData for Rc<T>/Arc<T>/Rc<RefCell<T>>/Arc<Mutex<T>> (similar to v0.9)
  • UserDataRef in send mode now uses shared lock if T: Sync (and exclusive lock otherwise)
  • Added Scope::add_destructor to attach custom destructors
  • Added Lua::try_app_data_ref and Lua::try_app_data_mut methods
  • Added From<Vec> and Into<Vec> support to MultiValue and Variadic types
  • Bug fixes and improvements (#477 #479)

New Contributors

v0.10.0

25 Oct 20:26
4f56575
Compare
Choose a tag to compare

What's Changed

For full changelog see changes in v0.10.0-beta.1, v0.10.0-beta.2 and v0.10.0-rc.1 versions.

Most notable changes since v0.9:

  • No more 'lua lifetime
  • Send + Sync with send feature flag
  • Lua::exec_raw helper to execute low-level Lua C API code
  • LuaNativeFn/LuaNativeFnMut/LuaNativeAsyncFn traits for using in Function::wrap
  • Setting metatable for Lua builtin types (number/string/function/etc)

v0.10.0-rc.1

08 Oct 22:46
0453029
Compare
Choose a tag to compare
v0.10.0-rc.1 Pre-release
Pre-release

What's Changed

  • Lua::scope is back
  • Support yielding from hooks for Lua 5.3+
  • Support setting metatable for Lua builtin types (number/string/function/etc)
  • Added LuaNativeFn/LuaNativeFnMut/LuaNativeAsyncFn traits for using in Function::wrap
  • Added Error::chain method to return iterator over nested errors
  • Added Lua::exec_raw helper to execute low-level Lua C API code
  • Added Either<L, R> enum to combine two types into a single one
  • Added a new Buffer type for Luau
  • Added Value::is_error and Value::as_error helpers
  • Added Value::Other variant to represent unknown Lua types (eg LuaJIT CDATA)
  • Added (optional) anyhow feature to implement IntoLua for anyhow::Error
  • Added IntoLua/FromLua for OsString/OsStr and PathBuf/Path by @psentee in #459

v0.10.0-beta.2

07 Sep 23:23
7c2e9b5
Compare
Choose a tag to compare
v0.10.0-beta.2 Pre-release
Pre-release

Notes

mlua is getting close to v0.10 stable release. Send+Sync works well and hopefully all unsoundness are fixed.

Few (planned) features left:

  • Scope support
  • Getting/setting metatable for primitives
  • Support yielding in hooks for Lua 5.3+ (similar to yielding in Luau interrupt callback)
  • Access to raw Lua state (lock protected but unsafe)
  • Either<A, B> enum that implements FromLua
  • LuaNativeFn trait to wrap Rust functions with non-tuple args (will be used in Function::wrap*)
  • More code coverage
  • (possibly) IntoLua derive macro

What's Changed

  • Updated ThreadStatus enum to include Running and Finished variants.
  • Error::CoroutineInactive renamed to Error::CoroutineUnresumable.
  • IntoLua/IntoLuaMulti now uses impl trait syntax for args (shorten from a.get::<_, T> to a.get::<T>).
  • Removed undocumented Lua::into_static/from_static methods.
  • Futures now require Send bound if send feature is enabled.
  • Dropped lifetime from UserDataMethods and UserDataFields traits.
  • Compiler::compile() now returns Result (Luau).
  • Removed Clone requirement from UserDataFields::add_field().
  • TableExt and AnyUserDataExt traits were combined into ObjectLike trait.
  • Disabled send feature in module mode (since we don't have exclusive access to Lua).
  • Chunk::set_environment() takes Table instead of IntoLua type.
  • Reduced the compile time contribution of next_key_seed and next_value_seed.
  • Reduced the compile time contribution of serde_userdata.
  • Performance improvements.

New Contributors

Full Changelog: v0.10.0-beta.1...v0.10.0-beta.2

v0.10.0-beta.1

31 Jul 13:25
5acf9d7
Compare
Choose a tag to compare
v0.10.0-beta.1 Pre-release
Pre-release

What's Changed

  • Dropped 'lua lifetime (subtypes now store a weak reference to Lua)
  • Removed (experimental) owned types
  • Make Lua types truly Send and Sync (when enabling send feature flag)
  • Removed UserData impl for Rc/Arc types ("any" userdata functions can be used instead)
  • Lua::replace_registry_value takes &mut RegistryKey
  • Lua::scope temporary disabled (will be re-added in the next release)

v0.9.7

05 Apr 12:59
806bd20
Compare
Choose a tag to compare

What's Changed

  • Implemented IntoLua for RegistryKey
  • Mark __idiv metamethod as available for Luau
  • Added Function::deep_clone() method (Luau)
  • Added SerializeOptions::detect_serde_json_arbitrary_precision option
  • Added Lua::create_buffer() method (Luau)
  • Support serializing buffer type as a byte slice (Luau)
  • Perf: Implemented push_into_stack/from_stack for Option<T>
  • Added Lua::create_ser_any_userdata() method

New Contributors

Full Changelog: v0.9.6...v0.9.7