Releases: mlua-rs/mlua

v0.12.1

Choose a tag to compare

@khvzakkhvzak released this 29 Aug 22:46
v0.12.1
4fd87af

What's Changed

  • Lua 5.5 updated to 5.5.1
  • Luau updated to 0.736
  • Allow #[mlua::userdata_impl] to be used in a different module from #[derive(UserData)] (#726)
  • Fix coroutine stack handling after yielding from hooks (#723)

Full Changelog: v0.12.0...v0.12.1

v0.12.0

Choose a tag to compare

@khvzakkhvzak released this 05 Jul 22:56
v0.12.0
8eddf85

Highlights

More ergonomic UserData building blocks

  • Declaratively implement UserData with #[derive(UserData)] and register methods/fields with the new #[mlua::userdata_impl] attribute macro.
  • UserDataOwned<T> wrapper takes ownership of userdata and implements FromLua
  • UserDataMethods::add_method_once/add_async_method_once
  • __todebugstring metamethod for pretty-printing userdata when debugging
  • MaybeSync trait for userdata under the send feature

Reorganized public API

Types are now grouped into focused modules: chunk, debug, error, function, table, string, state, thread, userdata and luau.

Thread lifecycle callbacks

Hook into coroutine create/resume/yield events across all Lua versions (when using mlua API).

Luau improvements

Latest Luau with extended require-by-string support and JIT options.

Garbage-collector interface refactor

Lua::gc_inc / Lua::gc_gen are replaced by a Lua::gc_set_mode, with GcIncParams/GcGenParams for fine-grained tuning.

What's Changed (since v0.12.0-rc.2)

  • Crate root re-exports are refactored (only essentials are re-exported, the rest is in the new submodules)
  • Added ThreadStatus::Normal and Thread::is_normal (mimic coroutine.status)
  • Added Lua::set_jit_options with support of Luau JIT inliner (Luau)
  • Added Value::as_vector/Value::is_vector (Luau)
  • Added Table::remove
  • serde: tables with the array metatable are always encoded as arrays (incl. detect_mixed_tables option)
  • impl Hash for BorrowedStr/BorrowedBytes
  • Lua::current_thread resolves implicit async threads to their root owner (#706)
  • Bugfixes and improvements

Full Changelog: v0.11.6...v0.12.0

v0.12.0-rc.2

v0.12.0-rc.2Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 06 Jun 15:41
v0.12.0-rc.2
0711c61

The new stable version is almost ready and will be released after some testing

What's Changed

  • Add #[derive(UserData)] and #[userdata_impl] macros
  • Support thread create/resume/yield callbacks for all Lua versions (including Luau)
  • Support to_alias_override/to_alias_fallback in Require trait (Luau)
  • Prevent XRc overflow when dropping RawLua with foreign Lua state
  • Implement Not for StdLib (#699)
  • Fix String::to_pointer return NULL in Lua <5.4

Full Changelog: v0.12.0-rc.1...v0.12.0-rc.2

v0.12.0-rc.1

v0.12.0-rc.1Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 21 Apr 23:13
v0.12.0-rc.1
5f0e06f

What's Changed

  • Switch to Rust 2024 edition
  • Removed Error::ToLuaConversionError variant as it was unused (and not practically useful)
  • New modules to group data types: chunk, debug, error, function, table, string, state, thread, userdata, luau
  • Support __todebugstring metamethod for pretty formatting userdata value (for debugging)
  • New MaybeSync trait that is required for userdata types
  • Removed lifetime from BorrowedStr and BorrowedBytes
  • New Thread methods: is_resumable, is_running, is_finished, is_error
  • Added Thread::state to get raw Lua state pointer
  • Luau TextRequirer is renamed to FsRequirer
  • GC interface refactor: Lua::gc_inc/Lua::gc_gen is replaced with gc_set_mode
  • Added GcIncParams and GcGenParams for GC tuning
  • New UserDataMethods::add_method_once and UserDataMethods::add_async_method_once
  • Initial Luau integer64 type support
  • Changed interface of Function::wrap/wrap_mut/wrap_async to support any Error type
  • Changed AnyUserData::type_name to return LuaString instead
  • Added UserDataOwned<T> wrapper to take ownership of userdata T and implements FromLua

Full Changelog: v0.11.6...v0.12.0-rc.1

v0.11.6

Choose a tag to compare

@khvzakkhvzak released this 27 Jan 20:24
e7fa8d7

What's Changed

  • Lua 5.5 support under the new lua55 feature flag
  • Luau updated to 0.705+
  • Added AnyUserData::is_proxy
  • Added num_params, num_upvalues, is_vararg to FunctionInfo

Full Changelog: v0.11.5...v0.11.6

Lua 5.5 notes

Lua 5.5 support external strings and mlua enable this optimisation for impl IntoLua for String/BString (owned versions to move Drop into Lua).
Also the Lua::create_external_string function allow moving ownership to Lua for any Into<Vec<u8>> types.

v0.11.5

Choose a tag to compare

@khvzakkhvzak released this 23 Nov 18:41
0245d4c

What's Changed

  • Luau updated to 0.701
  • Added Lua::set_memory_category and Lua::heap_dump functions to profile (Luau) memory
  • Added Lua::type_metatable helper to get metatable of a primitive type
  • Added Lua::traceback function to generate stack traces at different levels
  • Added add_method_once /add_async_method_once UserData methods (experimental)
  • Make AnyUserData::type_name public
  • impl IntoLuaMulti for &MultiValue

Full Changelog: v0.11.4...v0.11.5

v0.11.4

Choose a tag to compare

@khvzakkhvzak released this 30 Sep 22:27
247208e

What's Changed

  • Make Value::to_serializable public
  • Added new serde option detect_mixed_tables (to encode mixed array+map tables)
  • Added ObjectLike::get_path helper (for tables and userdata) for easy access of nested data
  • Added (experimental) __namecall optimization for Luau

Full Changelog: v0.11.3...v0.11.4

v0.11.3

Choose a tag to compare

@khvzakkhvzak released this 30 Aug 10:40
13ff0ca

What's Changed

  • Added Lua::yield_with to use as coroutine.yield functional replacement in async functions for any Lua (see doc examples)
  • Do not try to yield at non-yielable points in Luau interrupt (#632)
  • Added Buffer::cursor method (Luau)
  • Added Lua::create_buffer_with_capacity method (Luau)
  • Make Lua reference values cheap to clone in Rust (only increments ref count)
  • Fix panic on large (>67M entries) table creation

Full Changelog: v0.11.2...v0.11.3

v0.11.2

Choose a tag to compare

@khvzakkhvzak released this 10 Aug 09:47
3516f4c

What's Changed

  • Faster stack push for Variadic<T>
  • Fix handling Windows paths with drive letter in Luau require (#623) by @piz-ewing
  • Make Luau registered aliases ascii case-insensitive (#620)
  • Fix deserializing negative zeros -0.0 (#618)

Full Changelog: v0.11.1...v0.11.2

v0.11.1

Choose a tag to compare

@khvzakkhvzak released this 15 Jul 22:23
78331ce

What's Changed

  • Fixed bug exhausting Lua auxiliary stack and leaving it without reserve (#615)
  • Lua::push_c_function now correctly handles OOM for Lua 5.1 and Luau

Full Changelog: v0.11.0...v0.11.1

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Releases: mlua-rs/mlua

v0.12.1

Choose a tag to compare

@khvzakkhvzak released this 29 Aug 22:46
v0.12.1
4fd87af

What's Changed

  • Lua 5.5 updated to 5.5.1
  • Luau updated to 0.736
  • Allow #[mlua::userdata_impl] to be used in a different module from #[derive(UserData)] (#726)
  • Fix coroutine stack handling after yielding from hooks (#723)

Full Changelog: v0.12.0...v0.12.1

v0.12.0

Choose a tag to compare

@khvzakkhvzak released this 05 Jul 22:56
v0.12.0
8eddf85

Highlights

More ergonomic UserData building blocks

  • Declaratively implement UserData with #[derive(UserData)] and register methods/fields with the new #[mlua::userdata_impl] attribute macro.
  • UserDataOwned<T> wrapper takes ownership of userdata and implements FromLua
  • UserDataMethods::add_method_once/add_async_method_once
  • __todebugstring metamethod for pretty-printing userdata when debugging
  • MaybeSync trait for userdata under the send feature

Reorganized public API

Types are now grouped into focused modules: chunk, debug, error, function, table, string, state, thread, userdata and luau.

Thread lifecycle callbacks

Hook into coroutine create/resume/yield events across all Lua versions (when using mlua API).

Luau improvements

Latest Luau with extended require-by-string support and JIT options.

Garbage-collector interface refactor

Lua::gc_inc / Lua::gc_gen are replaced by a Lua::gc_set_mode, with GcIncParams/GcGenParams for fine-grained tuning.

What's Changed (since v0.12.0-rc.2)

  • Crate root re-exports are refactored (only essentials are re-exported, the rest is in the new submodules)
  • Added ThreadStatus::Normal and Thread::is_normal (mimic coroutine.status)
  • Added Lua::set_jit_options with support of Luau JIT inliner (Luau)
  • Added Value::as_vector/Value::is_vector (Luau)
  • Added Table::remove
  • serde: tables with the array metatable are always encoded as arrays (incl. detect_mixed_tables option)
  • impl Hash for BorrowedStr/BorrowedBytes
  • Lua::current_thread resolves implicit async threads to their root owner (#706)
  • Bugfixes and improvements

Full Changelog: v0.11.6...v0.12.0

v0.12.0-rc.2

v0.12.0-rc.2Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 06 Jun 15:41
v0.12.0-rc.2
0711c61

The new stable version is almost ready and will be released after some testing

What's Changed

  • Add #[derive(UserData)] and #[userdata_impl] macros
  • Support thread create/resume/yield callbacks for all Lua versions (including Luau)
  • Support to_alias_override/to_alias_fallback in Require trait (Luau)
  • Prevent XRc overflow when dropping RawLua with foreign Lua state
  • Implement Not for StdLib (#699)
  • Fix String::to_pointer return NULL in Lua <5.4

Full Changelog: v0.12.0-rc.1...v0.12.0-rc.2

v0.12.0-rc.1

v0.12.0-rc.1Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 21 Apr 23:13
v0.12.0-rc.1
5f0e06f

What's Changed

  • Switch to Rust 2024 edition
  • Removed Error::ToLuaConversionError variant as it was unused (and not practically useful)
  • New modules to group data types: chunk, debug, error, function, table, string, state, thread, userdata, luau
  • Support __todebugstring metamethod for pretty formatting userdata value (for debugging)
  • New MaybeSync trait that is required for userdata types
  • Removed lifetime from BorrowedStr and BorrowedBytes
  • New Thread methods: is_resumable, is_running, is_finished, is_error
  • Added Thread::state to get raw Lua state pointer
  • Luau TextRequirer is renamed to FsRequirer
  • GC interface refactor: Lua::gc_inc/Lua::gc_gen is replaced with gc_set_mode
  • Added GcIncParams and GcGenParams for GC tuning
  • New UserDataMethods::add_method_once and UserDataMethods::add_async_method_once
  • Initial Luau integer64 type support
  • Changed interface of Function::wrap/wrap_mut/wrap_async to support any Error type
  • Changed AnyUserData::type_name to return LuaString instead
  • Added UserDataOwned<T> wrapper to take ownership of userdata T and implements FromLua

Full Changelog: v0.11.6...v0.12.0-rc.1

v0.11.6

Choose a tag to compare

@khvzakkhvzak released this 27 Jan 20:24
e7fa8d7

What's Changed

  • Lua 5.5 support under the new lua55 feature flag
  • Luau updated to 0.705+
  • Added AnyUserData::is_proxy
  • Added num_params, num_upvalues, is_vararg to FunctionInfo

Full Changelog: v0.11.5...v0.11.6

Lua 5.5 notes

Lua 5.5 support external strings and mlua enable this optimisation for impl IntoLua for String/BString (owned versions to move Drop into Lua).
Also the Lua::create_external_string function allow moving ownership to Lua for any Into<Vec<u8>> types.

v0.11.5

Choose a tag to compare

@khvzakkhvzak released this 23 Nov 18:41
0245d4c

What's Changed

  • Luau updated to 0.701
  • Added Lua::set_memory_category and Lua::heap_dump functions to profile (Luau) memory
  • Added Lua::type_metatable helper to get metatable of a primitive type
  • Added Lua::traceback function to generate stack traces at different levels
  • Added add_method_once /add_async_method_once UserData methods (experimental)
  • Make AnyUserData::type_name public
  • impl IntoLuaMulti for &MultiValue

Full Changelog: v0.11.4...v0.11.5

v0.11.4

Choose a tag to compare

@khvzakkhvzak released this 30 Sep 22:27
247208e

What's Changed

  • Make Value::to_serializable public
  • Added new serde option detect_mixed_tables (to encode mixed array+map tables)
  • Added ObjectLike::get_path helper (for tables and userdata) for easy access of nested data
  • Added (experimental) __namecall optimization for Luau

Full Changelog: v0.11.3...v0.11.4

v0.11.3

Choose a tag to compare

@khvzakkhvzak released this 30 Aug 10:40
13ff0ca

What's Changed

  • Added Lua::yield_with to use as coroutine.yield functional replacement in async functions for any Lua (see doc examples)
  • Do not try to yield at non-yielable points in Luau interrupt (#632)
  • Added Buffer::cursor method (Luau)
  • Added Lua::create_buffer_with_capacity method (Luau)
  • Make Lua reference values cheap to clone in Rust (only increments ref count)
  • Fix panic on large (>67M entries) table creation

Full Changelog: v0.11.2...v0.11.3

v0.11.2

Choose a tag to compare

@khvzakkhvzak released this 10 Aug 09:47
3516f4c

What's Changed

  • Faster stack push for Variadic<T>
  • Fix handling Windows paths with drive letter in Luau require (#623) by @piz-ewing
  • Make Luau registered aliases ascii case-insensitive (#620)
  • Fix deserializing negative zeros -0.0 (#618)

Full Changelog: v0.11.1...v0.11.2

v0.11.1

Choose a tag to compare

@khvzakkhvzak released this 15 Jul 22:23
78331ce

What's Changed

  • Fixed bug exhausting Lua auxiliary stack and leaving it without reserve (#615)
  • Lua::push_c_function now correctly handles OOM for Lua 5.1 and Luau

Full Changelog: v0.11.0...v0.11.1

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Releases: mlua-rs/mlua

v0.12.1

Choose a tag to compare

@khvzakkhvzak released this 29 Aug 22:46
v0.12.1
4fd87af

What's Changed

  • Lua 5.5 updated to 5.5.1
  • Luau updated to 0.736
  • Allow #[mlua::userdata_impl] to be used in a different module from #[derive(UserData)] (#726)
  • Fix coroutine stack handling after yielding from hooks (#723)

Full Changelog: v0.12.0...v0.12.1

v0.12.0

Choose a tag to compare

@khvzakkhvzak released this 05 Jul 22:56
v0.12.0
8eddf85

Highlights

More ergonomic UserData building blocks

  • Declaratively implement UserData with #[derive(UserData)] and register methods/fields with the new #[mlua::userdata_impl] attribute macro.
  • UserDataOwned<T> wrapper takes ownership of userdata and implements FromLua
  • UserDataMethods::add_method_once/add_async_method_once
  • __todebugstring metamethod for pretty-printing userdata when debugging
  • MaybeSync trait for userdata under the send feature

Reorganized public API

Types are now grouped into focused modules: chunk, debug, error, function, table, string, state, thread, userdata and luau.

Thread lifecycle callbacks

Hook into coroutine create/resume/yield events across all Lua versions (when using mlua API).

Luau improvements

Latest Luau with extended require-by-string support and JIT options.

Garbage-collector interface refactor

Lua::gc_inc / Lua::gc_gen are replaced by a Lua::gc_set_mode, with GcIncParams/GcGenParams for fine-grained tuning.

What's Changed (since v0.12.0-rc.2)

  • Crate root re-exports are refactored (only essentials are re-exported, the rest is in the new submodules)
  • Added ThreadStatus::Normal and Thread::is_normal (mimic coroutine.status)
  • Added Lua::set_jit_options with support of Luau JIT inliner (Luau)
  • Added Value::as_vector/Value::is_vector (Luau)
  • Added Table::remove
  • serde: tables with the array metatable are always encoded as arrays (incl. detect_mixed_tables option)
  • impl Hash for BorrowedStr/BorrowedBytes
  • Lua::current_thread resolves implicit async threads to their root owner (#706)
  • Bugfixes and improvements

Full Changelog: v0.11.6...v0.12.0

v0.12.0-rc.2

v0.12.0-rc.2Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 06 Jun 15:41
v0.12.0-rc.2
0711c61

The new stable version is almost ready and will be released after some testing

What's Changed

  • Add #[derive(UserData)] and #[userdata_impl] macros
  • Support thread create/resume/yield callbacks for all Lua versions (including Luau)
  • Support to_alias_override/to_alias_fallback in Require trait (Luau)
  • Prevent XRc overflow when dropping RawLua with foreign Lua state
  • Implement Not for StdLib (#699)
  • Fix String::to_pointer return NULL in Lua <5.4

Full Changelog: v0.12.0-rc.1...v0.12.0-rc.2

v0.12.0-rc.1

v0.12.0-rc.1Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 21 Apr 23:13
v0.12.0-rc.1
5f0e06f

What's Changed

  • Switch to Rust 2024 edition
  • Removed Error::ToLuaConversionError variant as it was unused (and not practically useful)
  • New modules to group data types: chunk, debug, error, function, table, string, state, thread, userdata, luau
  • Support __todebugstring metamethod for pretty formatting userdata value (for debugging)
  • New MaybeSync trait that is required for userdata types
  • Removed lifetime from BorrowedStr and BorrowedBytes
  • New Thread methods: is_resumable, is_running, is_finished, is_error
  • Added Thread::state to get raw Lua state pointer
  • Luau TextRequirer is renamed to FsRequirer
  • GC interface refactor: Lua::gc_inc/Lua::gc_gen is replaced with gc_set_mode
  • Added GcIncParams and GcGenParams for GC tuning
  • New UserDataMethods::add_method_once and UserDataMethods::add_async_method_once
  • Initial Luau integer64 type support
  • Changed interface of Function::wrap/wrap_mut/wrap_async to support any Error type
  • Changed AnyUserData::type_name to return LuaString instead
  • Added UserDataOwned<T> wrapper to take ownership of userdata T and implements FromLua

Full Changelog: v0.11.6...v0.12.0-rc.1

v0.11.6

Choose a tag to compare

@khvzakkhvzak released this 27 Jan 20:24
e7fa8d7

What's Changed

  • Lua 5.5 support under the new lua55 feature flag
  • Luau updated to 0.705+
  • Added AnyUserData::is_proxy
  • Added num_params, num_upvalues, is_vararg to FunctionInfo

Full Changelog: v0.11.5...v0.11.6

Lua 5.5 notes

Lua 5.5 support external strings and mlua enable this optimisation for impl IntoLua for String/BString (owned versions to move Drop into Lua).
Also the Lua::create_external_string function allow moving ownership to Lua for any Into<Vec<u8>> types.

v0.11.5

Choose a tag to compare

@khvzakkhvzak released this 23 Nov 18:41
0245d4c

What's Changed

  • Luau updated to 0.701
  • Added Lua::set_memory_category and Lua::heap_dump functions to profile (Luau) memory
  • Added Lua::type_metatable helper to get metatable of a primitive type
  • Added Lua::traceback function to generate stack traces at different levels
  • Added add_method_once /add_async_method_once UserData methods (experimental)
  • Make AnyUserData::type_name public
  • impl IntoLuaMulti for &MultiValue

Full Changelog: v0.11.4...v0.11.5

v0.11.4

Choose a tag to compare

@khvzakkhvzak released this 30 Sep 22:27
247208e

What's Changed

  • Make Value::to_serializable public
  • Added new serde option detect_mixed_tables (to encode mixed array+map tables)
  • Added ObjectLike::get_path helper (for tables and userdata) for easy access of nested data
  • Added (experimental) __namecall optimization for Luau

Full Changelog: v0.11.3...v0.11.4

v0.11.3

Choose a tag to compare

@khvzakkhvzak released this 30 Aug 10:40
13ff0ca

What's Changed

  • Added Lua::yield_with to use as coroutine.yield functional replacement in async functions for any Lua (see doc examples)
  • Do not try to yield at non-yielable points in Luau interrupt (#632)
  • Added Buffer::cursor method (Luau)
  • Added Lua::create_buffer_with_capacity method (Luau)
  • Make Lua reference values cheap to clone in Rust (only increments ref count)
  • Fix panic on large (>67M entries) table creation

Full Changelog: v0.11.2...v0.11.3

v0.11.2

Choose a tag to compare

@khvzakkhvzak released this 10 Aug 09:47
3516f4c

What's Changed

  • Faster stack push for Variadic<T>
  • Fix handling Windows paths with drive letter in Luau require (#623) by @piz-ewing
  • Make Luau registered aliases ascii case-insensitive (#620)
  • Fix deserializing negative zeros -0.0 (#618)

Full Changelog: v0.11.1...v0.11.2

v0.11.1

Choose a tag to compare

@khvzakkhvzak released this 15 Jul 22:23
78331ce

What's Changed

  • Fixed bug exhausting Lua auxiliary stack and leaving it without reserve (#615)
  • Lua::push_c_function now correctly handles OOM for Lua 5.1 and Luau

Full Changelog: v0.11.0...v0.11.1

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Releases: mlua-rs/mlua

v0.12.1

Choose a tag to compare

@khvzakkhvzak released this 29 Aug 22:46
v0.12.1
4fd87af

What's Changed

  • Lua 5.5 updated to 5.5.1
  • Luau updated to 0.736
  • Allow #[mlua::userdata_impl] to be used in a different module from #[derive(UserData)] (#726)
  • Fix coroutine stack handling after yielding from hooks (#723)

Full Changelog: v0.12.0...v0.12.1

v0.12.0

Choose a tag to compare

@khvzakkhvzak released this 05 Jul 22:56
v0.12.0
8eddf85

Highlights

More ergonomic UserData building blocks

  • Declaratively implement UserData with #[derive(UserData)] and register methods/fields with the new #[mlua::userdata_impl] attribute macro.
  • UserDataOwned<T> wrapper takes ownership of userdata and implements FromLua
  • UserDataMethods::add_method_once/add_async_method_once
  • __todebugstring metamethod for pretty-printing userdata when debugging
  • MaybeSync trait for userdata under the send feature

Reorganized public API

Types are now grouped into focused modules: chunk, debug, error, function, table, string, state, thread, userdata and luau.

Thread lifecycle callbacks

Hook into coroutine create/resume/yield events across all Lua versions (when using mlua API).

Luau improvements

Latest Luau with extended require-by-string support and JIT options.

Garbage-collector interface refactor

Lua::gc_inc / Lua::gc_gen are replaced by a Lua::gc_set_mode, with GcIncParams/GcGenParams for fine-grained tuning.

What's Changed (since v0.12.0-rc.2)

  • Crate root re-exports are refactored (only essentials are re-exported, the rest is in the new submodules)
  • Added ThreadStatus::Normal and Thread::is_normal (mimic coroutine.status)
  • Added Lua::set_jit_options with support of Luau JIT inliner (Luau)
  • Added Value::as_vector/Value::is_vector (Luau)
  • Added Table::remove
  • serde: tables with the array metatable are always encoded as arrays (incl. detect_mixed_tables option)
  • impl Hash for BorrowedStr/BorrowedBytes
  • Lua::current_thread resolves implicit async threads to their root owner (#706)
  • Bugfixes and improvements

Full Changelog: v0.11.6...v0.12.0

v0.12.0-rc.2

v0.12.0-rc.2Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 06 Jun 15:41
v0.12.0-rc.2
0711c61

The new stable version is almost ready and will be released after some testing

What's Changed

  • Add #[derive(UserData)] and #[userdata_impl] macros
  • Support thread create/resume/yield callbacks for all Lua versions (including Luau)
  • Support to_alias_override/to_alias_fallback in Require trait (Luau)
  • Prevent XRc overflow when dropping RawLua with foreign Lua state
  • Implement Not for StdLib (#699)
  • Fix String::to_pointer return NULL in Lua <5.4

Full Changelog: v0.12.0-rc.1...v0.12.0-rc.2

v0.12.0-rc.1

v0.12.0-rc.1Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 21 Apr 23:13
v0.12.0-rc.1
5f0e06f

What's Changed

  • Switch to Rust 2024 edition
  • Removed Error::ToLuaConversionError variant as it was unused (and not practically useful)
  • New modules to group data types: chunk, debug, error, function, table, string, state, thread, userdata, luau
  • Support __todebugstring metamethod for pretty formatting userdata value (for debugging)
  • New MaybeSync trait that is required for userdata types
  • Removed lifetime from BorrowedStr and BorrowedBytes
  • New Thread methods: is_resumable, is_running, is_finished, is_error
  • Added Thread::state to get raw Lua state pointer
  • Luau TextRequirer is renamed to FsRequirer
  • GC interface refactor: Lua::gc_inc/Lua::gc_gen is replaced with gc_set_mode
  • Added GcIncParams and GcGenParams for GC tuning
  • New UserDataMethods::add_method_once and UserDataMethods::add_async_method_once
  • Initial Luau integer64 type support
  • Changed interface of Function::wrap/wrap_mut/wrap_async to support any Error type
  • Changed AnyUserData::type_name to return LuaString instead
  • Added UserDataOwned<T> wrapper to take ownership of userdata T and implements FromLua

Full Changelog: v0.11.6...v0.12.0-rc.1

v0.11.6

Choose a tag to compare

@khvzakkhvzak released this 27 Jan 20:24
e7fa8d7

What's Changed

  • Lua 5.5 support under the new lua55 feature flag
  • Luau updated to 0.705+
  • Added AnyUserData::is_proxy
  • Added num_params, num_upvalues, is_vararg to FunctionInfo

Full Changelog: v0.11.5...v0.11.6

Lua 5.5 notes

Lua 5.5 support external strings and mlua enable this optimisation for impl IntoLua for String/BString (owned versions to move Drop into Lua).
Also the Lua::create_external_string function allow moving ownership to Lua for any Into<Vec<u8>> types.

v0.11.5

Choose a tag to compare

@khvzakkhvzak released this 23 Nov 18:41
0245d4c

What's Changed

  • Luau updated to 0.701
  • Added Lua::set_memory_category and Lua::heap_dump functions to profile (Luau) memory
  • Added Lua::type_metatable helper to get metatable of a primitive type
  • Added Lua::traceback function to generate stack traces at different levels
  • Added add_method_once /add_async_method_once UserData methods (experimental)
  • Make AnyUserData::type_name public
  • impl IntoLuaMulti for &MultiValue

Full Changelog: v0.11.4...v0.11.5

v0.11.4

Choose a tag to compare

@khvzakkhvzak released this 30 Sep 22:27
247208e

What's Changed

  • Make Value::to_serializable public
  • Added new serde option detect_mixed_tables (to encode mixed array+map tables)
  • Added ObjectLike::get_path helper (for tables and userdata) for easy access of nested data
  • Added (experimental) __namecall optimization for Luau

Full Changelog: v0.11.3...v0.11.4

v0.11.3

Choose a tag to compare

@khvzakkhvzak released this 30 Aug 10:40
13ff0ca

What's Changed

  • Added Lua::yield_with to use as coroutine.yield functional replacement in async functions for any Lua (see doc examples)
  • Do not try to yield at non-yielable points in Luau interrupt (#632)
  • Added Buffer::cursor method (Luau)
  • Added Lua::create_buffer_with_capacity method (Luau)
  • Make Lua reference values cheap to clone in Rust (only increments ref count)
  • Fix panic on large (>67M entries) table creation

Full Changelog: v0.11.2...v0.11.3

v0.11.2

Choose a tag to compare

@khvzakkhvzak released this 10 Aug 09:47
3516f4c

What's Changed

  • Faster stack push for Variadic<T>
  • Fix handling Windows paths with drive letter in Luau require (#623) by @piz-ewing
  • Make Luau registered aliases ascii case-insensitive (#620)
  • Fix deserializing negative zeros -0.0 (#618)

Full Changelog: v0.11.1...v0.11.2

v0.11.1

Choose a tag to compare

@khvzakkhvzak released this 15 Jul 22:23
78331ce

What's Changed

  • Fixed bug exhausting Lua auxiliary stack and leaving it without reserve (#615)
  • Lua::push_c_function now correctly handles OOM for Lua 5.1 and Luau

Full Changelog: v0.11.0...v0.11.1

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Releases: mlua-rs/mlua

v0.12.1

Choose a tag to compare

@khvzakkhvzak released this 29 Aug 22:46
v0.12.1
4fd87af

What's Changed

  • Lua 5.5 updated to 5.5.1
  • Luau updated to 0.736
  • Allow #[mlua::userdata_impl] to be used in a different module from #[derive(UserData)] (#726)
  • Fix coroutine stack handling after yielding from hooks (#723)

Full Changelog: v0.12.0...v0.12.1

v0.12.0

Choose a tag to compare

@khvzakkhvzak released this 05 Jul 22:56
v0.12.0
8eddf85

Highlights

More ergonomic UserData building blocks

  • Declaratively implement UserData with #[derive(UserData)] and register methods/fields with the new #[mlua::userdata_impl] attribute macro.
  • UserDataOwned<T> wrapper takes ownership of userdata and implements FromLua
  • UserDataMethods::add_method_once/add_async_method_once
  • __todebugstring metamethod for pretty-printing userdata when debugging
  • MaybeSync trait for userdata under the send feature

Reorganized public API

Types are now grouped into focused modules: chunk, debug, error, function, table, string, state, thread, userdata and luau.

Thread lifecycle callbacks

Hook into coroutine create/resume/yield events across all Lua versions (when using mlua API).

Luau improvements

Latest Luau with extended require-by-string support and JIT options.

Garbage-collector interface refactor

Lua::gc_inc / Lua::gc_gen are replaced by a Lua::gc_set_mode, with GcIncParams/GcGenParams for fine-grained tuning.

What's Changed (since v0.12.0-rc.2)

  • Crate root re-exports are refactored (only essentials are re-exported, the rest is in the new submodules)
  • Added ThreadStatus::Normal and Thread::is_normal (mimic coroutine.status)
  • Added Lua::set_jit_options with support of Luau JIT inliner (Luau)
  • Added Value::as_vector/Value::is_vector (Luau)
  • Added Table::remove
  • serde: tables with the array metatable are always encoded as arrays (incl. detect_mixed_tables option)
  • impl Hash for BorrowedStr/BorrowedBytes
  • Lua::current_thread resolves implicit async threads to their root owner (#706)
  • Bugfixes and improvements

Full Changelog: v0.11.6...v0.12.0

v0.12.0-rc.2

v0.12.0-rc.2Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 06 Jun 15:41
v0.12.0-rc.2
0711c61

The new stable version is almost ready and will be released after some testing

What's Changed

  • Add #[derive(UserData)] and #[userdata_impl] macros
  • Support thread create/resume/yield callbacks for all Lua versions (including Luau)
  • Support to_alias_override/to_alias_fallback in Require trait (Luau)
  • Prevent XRc overflow when dropping RawLua with foreign Lua state
  • Implement Not for StdLib (#699)
  • Fix String::to_pointer return NULL in Lua <5.4

Full Changelog: v0.12.0-rc.1...v0.12.0-rc.2

v0.12.0-rc.1

v0.12.0-rc.1Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 21 Apr 23:13
v0.12.0-rc.1
5f0e06f

What's Changed

  • Switch to Rust 2024 edition
  • Removed Error::ToLuaConversionError variant as it was unused (and not practically useful)
  • New modules to group data types: chunk, debug, error, function, table, string, state, thread, userdata, luau
  • Support __todebugstring metamethod for pretty formatting userdata value (for debugging)
  • New MaybeSync trait that is required for userdata types
  • Removed lifetime from BorrowedStr and BorrowedBytes
  • New Thread methods: is_resumable, is_running, is_finished, is_error
  • Added Thread::state to get raw Lua state pointer
  • Luau TextRequirer is renamed to FsRequirer
  • GC interface refactor: Lua::gc_inc/Lua::gc_gen is replaced with gc_set_mode
  • Added GcIncParams and GcGenParams for GC tuning
  • New UserDataMethods::add_method_once and UserDataMethods::add_async_method_once
  • Initial Luau integer64 type support
  • Changed interface of Function::wrap/wrap_mut/wrap_async to support any Error type
  • Changed AnyUserData::type_name to return LuaString instead
  • Added UserDataOwned<T> wrapper to take ownership of userdata T and implements FromLua

Full Changelog: v0.11.6...v0.12.0-rc.1

v0.11.6

Choose a tag to compare

@khvzakkhvzak released this 27 Jan 20:24
e7fa8d7

What's Changed

  • Lua 5.5 support under the new lua55 feature flag
  • Luau updated to 0.705+
  • Added AnyUserData::is_proxy
  • Added num_params, num_upvalues, is_vararg to FunctionInfo

Full Changelog: v0.11.5...v0.11.6

Lua 5.5 notes

Lua 5.5 support external strings and mlua enable this optimisation for impl IntoLua for String/BString (owned versions to move Drop into Lua).
Also the Lua::create_external_string function allow moving ownership to Lua for any Into<Vec<u8>> types.

v0.11.5

Choose a tag to compare

@khvzakkhvzak released this 23 Nov 18:41
0245d4c

What's Changed

  • Luau updated to 0.701
  • Added Lua::set_memory_category and Lua::heap_dump functions to profile (Luau) memory
  • Added Lua::type_metatable helper to get metatable of a primitive type
  • Added Lua::traceback function to generate stack traces at different levels
  • Added add_method_once /add_async_method_once UserData methods (experimental)
  • Make AnyUserData::type_name public
  • impl IntoLuaMulti for &MultiValue

Full Changelog: v0.11.4...v0.11.5

v0.11.4

Choose a tag to compare

@khvzakkhvzak released this 30 Sep 22:27
247208e

What's Changed

  • Make Value::to_serializable public
  • Added new serde option detect_mixed_tables (to encode mixed array+map tables)
  • Added ObjectLike::get_path helper (for tables and userdata) for easy access of nested data
  • Added (experimental) __namecall optimization for Luau

Full Changelog: v0.11.3...v0.11.4

v0.11.3

Choose a tag to compare

@khvzakkhvzak released this 30 Aug 10:40
13ff0ca

What's Changed

  • Added Lua::yield_with to use as coroutine.yield functional replacement in async functions for any Lua (see doc examples)
  • Do not try to yield at non-yielable points in Luau interrupt (#632)
  • Added Buffer::cursor method (Luau)
  • Added Lua::create_buffer_with_capacity method (Luau)
  • Make Lua reference values cheap to clone in Rust (only increments ref count)
  • Fix panic on large (>67M entries) table creation

Full Changelog: v0.11.2...v0.11.3

v0.11.2

Choose a tag to compare

@khvzakkhvzak released this 10 Aug 09:47
3516f4c

What's Changed

  • Faster stack push for Variadic<T>
  • Fix handling Windows paths with drive letter in Luau require (#623) by @piz-ewing
  • Make Luau registered aliases ascii case-insensitive (#620)
  • Fix deserializing negative zeros -0.0 (#618)

Full Changelog: v0.11.1...v0.11.2

v0.11.1

Choose a tag to compare

@khvzakkhvzak released this 15 Jul 22:23
78331ce

What's Changed

  • Fixed bug exhausting Lua auxiliary stack and leaving it without reserve (#615)
  • Lua::push_c_function now correctly handles OOM for Lua 5.1 and Luau

Full Changelog: v0.11.0...v0.11.1

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Releases: mlua-rs/mlua

v0.12.1

Choose a tag to compare

@khvzakkhvzak released this 29 Aug 22:46
v0.12.1
4fd87af

What's Changed

  • Lua 5.5 updated to 5.5.1
  • Luau updated to 0.736
  • Allow #[mlua::userdata_impl] to be used in a different module from #[derive(UserData)] (#726)
  • Fix coroutine stack handling after yielding from hooks (#723)

Full Changelog: v0.12.0...v0.12.1

v0.12.0

Choose a tag to compare

@khvzakkhvzak released this 05 Jul 22:56
v0.12.0
8eddf85

Highlights

More ergonomic UserData building blocks

  • Declaratively implement UserData with #[derive(UserData)] and register methods/fields with the new #[mlua::userdata_impl] attribute macro.
  • UserDataOwned<T> wrapper takes ownership of userdata and implements FromLua
  • UserDataMethods::add_method_once/add_async_method_once
  • __todebugstring metamethod for pretty-printing userdata when debugging
  • MaybeSync trait for userdata under the send feature

Reorganized public API

Types are now grouped into focused modules: chunk, debug, error, function, table, string, state, thread, userdata and luau.

Thread lifecycle callbacks

Hook into coroutine create/resume/yield events across all Lua versions (when using mlua API).

Luau improvements

Latest Luau with extended require-by-string support and JIT options.

Garbage-collector interface refactor

Lua::gc_inc / Lua::gc_gen are replaced by a Lua::gc_set_mode, with GcIncParams/GcGenParams for fine-grained tuning.

What's Changed (since v0.12.0-rc.2)

  • Crate root re-exports are refactored (only essentials are re-exported, the rest is in the new submodules)
  • Added ThreadStatus::Normal and Thread::is_normal (mimic coroutine.status)
  • Added Lua::set_jit_options with support of Luau JIT inliner (Luau)
  • Added Value::as_vector/Value::is_vector (Luau)
  • Added Table::remove
  • serde: tables with the array metatable are always encoded as arrays (incl. detect_mixed_tables option)
  • impl Hash for BorrowedStr/BorrowedBytes
  • Lua::current_thread resolves implicit async threads to their root owner (#706)
  • Bugfixes and improvements

Full Changelog: v0.11.6...v0.12.0

v0.12.0-rc.2

v0.12.0-rc.2Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 06 Jun 15:41
v0.12.0-rc.2
0711c61

The new stable version is almost ready and will be released after some testing

What's Changed

  • Add #[derive(UserData)] and #[userdata_impl] macros
  • Support thread create/resume/yield callbacks for all Lua versions (including Luau)
  • Support to_alias_override/to_alias_fallback in Require trait (Luau)
  • Prevent XRc overflow when dropping RawLua with foreign Lua state
  • Implement Not for StdLib (#699)
  • Fix String::to_pointer return NULL in Lua <5.4

Full Changelog: v0.12.0-rc.1...v0.12.0-rc.2

v0.12.0-rc.1

v0.12.0-rc.1Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 21 Apr 23:13
v0.12.0-rc.1
5f0e06f

What's Changed

  • Switch to Rust 2024 edition
  • Removed Error::ToLuaConversionError variant as it was unused (and not practically useful)
  • New modules to group data types: chunk, debug, error, function, table, string, state, thread, userdata, luau
  • Support __todebugstring metamethod for pretty formatting userdata value (for debugging)
  • New MaybeSync trait that is required for userdata types
  • Removed lifetime from BorrowedStr and BorrowedBytes
  • New Thread methods: is_resumable, is_running, is_finished, is_error
  • Added Thread::state to get raw Lua state pointer
  • Luau TextRequirer is renamed to FsRequirer
  • GC interface refactor: Lua::gc_inc/Lua::gc_gen is replaced with gc_set_mode
  • Added GcIncParams and GcGenParams for GC tuning
  • New UserDataMethods::add_method_once and UserDataMethods::add_async_method_once
  • Initial Luau integer64 type support
  • Changed interface of Function::wrap/wrap_mut/wrap_async to support any Error type
  • Changed AnyUserData::type_name to return LuaString instead
  • Added UserDataOwned<T> wrapper to take ownership of userdata T and implements FromLua

Full Changelog: v0.11.6...v0.12.0-rc.1

v0.11.6

Choose a tag to compare

@khvzakkhvzak released this 27 Jan 20:24
e7fa8d7

What's Changed

  • Lua 5.5 support under the new lua55 feature flag
  • Luau updated to 0.705+
  • Added AnyUserData::is_proxy
  • Added num_params, num_upvalues, is_vararg to FunctionInfo

Full Changelog: v0.11.5...v0.11.6

Lua 5.5 notes

Lua 5.5 support external strings and mlua enable this optimisation for impl IntoLua for String/BString (owned versions to move Drop into Lua).
Also the Lua::create_external_string function allow moving ownership to Lua for any Into<Vec<u8>> types.

v0.11.5

Choose a tag to compare

@khvzakkhvzak released this 23 Nov 18:41
0245d4c

What's Changed

  • Luau updated to 0.701
  • Added Lua::set_memory_category and Lua::heap_dump functions to profile (Luau) memory
  • Added Lua::type_metatable helper to get metatable of a primitive type
  • Added Lua::traceback function to generate stack traces at different levels
  • Added add_method_once /add_async_method_once UserData methods (experimental)
  • Make AnyUserData::type_name public
  • impl IntoLuaMulti for &MultiValue

Full Changelog: v0.11.4...v0.11.5

v0.11.4

Choose a tag to compare

@khvzakkhvzak released this 30 Sep 22:27
247208e

What's Changed

  • Make Value::to_serializable public
  • Added new serde option detect_mixed_tables (to encode mixed array+map tables)
  • Added ObjectLike::get_path helper (for tables and userdata) for easy access of nested data
  • Added (experimental) __namecall optimization for Luau

Full Changelog: v0.11.3...v0.11.4

v0.11.3

Choose a tag to compare

@khvzakkhvzak released this 30 Aug 10:40
13ff0ca

What's Changed

  • Added Lua::yield_with to use as coroutine.yield functional replacement in async functions for any Lua (see doc examples)
  • Do not try to yield at non-yielable points in Luau interrupt (#632)
  • Added Buffer::cursor method (Luau)
  • Added Lua::create_buffer_with_capacity method (Luau)
  • Make Lua reference values cheap to clone in Rust (only increments ref count)
  • Fix panic on large (>67M entries) table creation

Full Changelog: v0.11.2...v0.11.3

v0.11.2

Choose a tag to compare

@khvzakkhvzak released this 10 Aug 09:47
3516f4c

What's Changed

  • Faster stack push for Variadic<T>
  • Fix handling Windows paths with drive letter in Luau require (#623) by @piz-ewing
  • Make Luau registered aliases ascii case-insensitive (#620)
  • Fix deserializing negative zeros -0.0 (#618)

Full Changelog: v0.11.1...v0.11.2

v0.11.1

Choose a tag to compare

@khvzakkhvzak released this 15 Jul 22:23
78331ce

What's Changed

  • Fixed bug exhausting Lua auxiliary stack and leaving it without reserve (#615)
  • Lua::push_c_function now correctly handles OOM for Lua 5.1 and Luau

Full Changelog: v0.11.0...v0.11.1

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Releases: mlua-rs/mlua

v0.12.1

Choose a tag to compare

@khvzakkhvzak released this 29 Aug 22:46
v0.12.1
4fd87af

What's Changed

  • Lua 5.5 updated to 5.5.1
  • Luau updated to 0.736
  • Allow #[mlua::userdata_impl] to be used in a different module from #[derive(UserData)] (#726)
  • Fix coroutine stack handling after yielding from hooks (#723)

Full Changelog: v0.12.0...v0.12.1

v0.12.0

Choose a tag to compare

@khvzakkhvzak released this 05 Jul 22:56
v0.12.0
8eddf85

Highlights

More ergonomic UserData building blocks

  • Declaratively implement UserData with #[derive(UserData)] and register methods/fields with the new #[mlua::userdata_impl] attribute macro.
  • UserDataOwned<T> wrapper takes ownership of userdata and implements FromLua
  • UserDataMethods::add_method_once/add_async_method_once
  • __todebugstring metamethod for pretty-printing userdata when debugging
  • MaybeSync trait for userdata under the send feature

Reorganized public API

Types are now grouped into focused modules: chunk, debug, error, function, table, string, state, thread, userdata and luau.

Thread lifecycle callbacks

Hook into coroutine create/resume/yield events across all Lua versions (when using mlua API).

Luau improvements

Latest Luau with extended require-by-string support and JIT options.

Garbage-collector interface refactor

Lua::gc_inc / Lua::gc_gen are replaced by a Lua::gc_set_mode, with GcIncParams/GcGenParams for fine-grained tuning.

What's Changed (since v0.12.0-rc.2)

  • Crate root re-exports are refactored (only essentials are re-exported, the rest is in the new submodules)
  • Added ThreadStatus::Normal and Thread::is_normal (mimic coroutine.status)
  • Added Lua::set_jit_options with support of Luau JIT inliner (Luau)
  • Added Value::as_vector/Value::is_vector (Luau)
  • Added Table::remove
  • serde: tables with the array metatable are always encoded as arrays (incl. detect_mixed_tables option)
  • impl Hash for BorrowedStr/BorrowedBytes
  • Lua::current_thread resolves implicit async threads to their root owner (#706)
  • Bugfixes and improvements

Full Changelog: v0.11.6...v0.12.0

v0.12.0-rc.2

v0.12.0-rc.2Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 06 Jun 15:41
v0.12.0-rc.2
0711c61

The new stable version is almost ready and will be released after some testing

What's Changed

  • Add #[derive(UserData)] and #[userdata_impl] macros
  • Support thread create/resume/yield callbacks for all Lua versions (including Luau)
  • Support to_alias_override/to_alias_fallback in Require trait (Luau)
  • Prevent XRc overflow when dropping RawLua with foreign Lua state
  • Implement Not for StdLib (#699)
  • Fix String::to_pointer return NULL in Lua <5.4

Full Changelog: v0.12.0-rc.1...v0.12.0-rc.2

v0.12.0-rc.1

v0.12.0-rc.1Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 21 Apr 23:13
v0.12.0-rc.1
5f0e06f

What's Changed

  • Switch to Rust 2024 edition
  • Removed Error::ToLuaConversionError variant as it was unused (and not practically useful)
  • New modules to group data types: chunk, debug, error, function, table, string, state, thread, userdata, luau
  • Support __todebugstring metamethod for pretty formatting userdata value (for debugging)
  • New MaybeSync trait that is required for userdata types
  • Removed lifetime from BorrowedStr and BorrowedBytes
  • New Thread methods: is_resumable, is_running, is_finished, is_error
  • Added Thread::state to get raw Lua state pointer
  • Luau TextRequirer is renamed to FsRequirer
  • GC interface refactor: Lua::gc_inc/Lua::gc_gen is replaced with gc_set_mode
  • Added GcIncParams and GcGenParams for GC tuning
  • New UserDataMethods::add_method_once and UserDataMethods::add_async_method_once
  • Initial Luau integer64 type support
  • Changed interface of Function::wrap/wrap_mut/wrap_async to support any Error type
  • Changed AnyUserData::type_name to return LuaString instead
  • Added UserDataOwned<T> wrapper to take ownership of userdata T and implements FromLua

Full Changelog: v0.11.6...v0.12.0-rc.1

v0.11.6

Choose a tag to compare

@khvzakkhvzak released this 27 Jan 20:24
e7fa8d7

What's Changed

  • Lua 5.5 support under the new lua55 feature flag
  • Luau updated to 0.705+
  • Added AnyUserData::is_proxy
  • Added num_params, num_upvalues, is_vararg to FunctionInfo

Full Changelog: v0.11.5...v0.11.6

Lua 5.5 notes

Lua 5.5 support external strings and mlua enable this optimisation for impl IntoLua for String/BString (owned versions to move Drop into Lua).
Also the Lua::create_external_string function allow moving ownership to Lua for any Into<Vec<u8>> types.

v0.11.5

Choose a tag to compare

@khvzakkhvzak released this 23 Nov 18:41
0245d4c

What's Changed

  • Luau updated to 0.701
  • Added Lua::set_memory_category and Lua::heap_dump functions to profile (Luau) memory
  • Added Lua::type_metatable helper to get metatable of a primitive type
  • Added Lua::traceback function to generate stack traces at different levels
  • Added add_method_once /add_async_method_once UserData methods (experimental)
  • Make AnyUserData::type_name public
  • impl IntoLuaMulti for &MultiValue

Full Changelog: v0.11.4...v0.11.5

v0.11.4

Choose a tag to compare

@khvzakkhvzak released this 30 Sep 22:27
247208e

What's Changed

  • Make Value::to_serializable public
  • Added new serde option detect_mixed_tables (to encode mixed array+map tables)
  • Added ObjectLike::get_path helper (for tables and userdata) for easy access of nested data
  • Added (experimental) __namecall optimization for Luau

Full Changelog: v0.11.3...v0.11.4

v0.11.3

Choose a tag to compare

@khvzakkhvzak released this 30 Aug 10:40
13ff0ca

What's Changed

  • Added Lua::yield_with to use as coroutine.yield functional replacement in async functions for any Lua (see doc examples)
  • Do not try to yield at non-yielable points in Luau interrupt (#632)
  • Added Buffer::cursor method (Luau)
  • Added Lua::create_buffer_with_capacity method (Luau)
  • Make Lua reference values cheap to clone in Rust (only increments ref count)
  • Fix panic on large (>67M entries) table creation

Full Changelog: v0.11.2...v0.11.3

v0.11.2

Choose a tag to compare

@khvzakkhvzak released this 10 Aug 09:47
3516f4c

What's Changed

  • Faster stack push for Variadic<T>
  • Fix handling Windows paths with drive letter in Luau require (#623) by @piz-ewing
  • Make Luau registered aliases ascii case-insensitive (#620)
  • Fix deserializing negative zeros -0.0 (#618)

Full Changelog: v0.11.1...v0.11.2

v0.11.1

Choose a tag to compare

@khvzakkhvzak released this 15 Jul 22:23
78331ce

What's Changed

  • Fixed bug exhausting Lua auxiliary stack and leaving it without reserve (#615)
  • Lua::push_c_function now correctly handles OOM for Lua 5.1 and Luau

Full Changelog: v0.11.0...v0.11.1

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Releases: mlua-rs/mlua

v0.12.1

Choose a tag to compare

@khvzakkhvzak released this 29 Aug 22:46
v0.12.1
4fd87af

What's Changed

  • Lua 5.5 updated to 5.5.1
  • Luau updated to 0.736
  • Allow #[mlua::userdata_impl] to be used in a different module from #[derive(UserData)] (#726)
  • Fix coroutine stack handling after yielding from hooks (#723)

Full Changelog: v0.12.0...v0.12.1

v0.12.0

Choose a tag to compare

@khvzakkhvzak released this 05 Jul 22:56
v0.12.0
8eddf85

Highlights

More ergonomic UserData building blocks

  • Declaratively implement UserData with #[derive(UserData)] and register methods/fields with the new #[mlua::userdata_impl] attribute macro.
  • UserDataOwned<T> wrapper takes ownership of userdata and implements FromLua
  • UserDataMethods::add_method_once/add_async_method_once
  • __todebugstring metamethod for pretty-printing userdata when debugging
  • MaybeSync trait for userdata under the send feature

Reorganized public API

Types are now grouped into focused modules: chunk, debug, error, function, table, string, state, thread, userdata and luau.

Thread lifecycle callbacks

Hook into coroutine create/resume/yield events across all Lua versions (when using mlua API).

Luau improvements

Latest Luau with extended require-by-string support and JIT options.

Garbage-collector interface refactor

Lua::gc_inc / Lua::gc_gen are replaced by a Lua::gc_set_mode, with GcIncParams/GcGenParams for fine-grained tuning.

What's Changed (since v0.12.0-rc.2)

  • Crate root re-exports are refactored (only essentials are re-exported, the rest is in the new submodules)
  • Added ThreadStatus::Normal and Thread::is_normal (mimic coroutine.status)
  • Added Lua::set_jit_options with support of Luau JIT inliner (Luau)
  • Added Value::as_vector/Value::is_vector (Luau)
  • Added Table::remove
  • serde: tables with the array metatable are always encoded as arrays (incl. detect_mixed_tables option)
  • impl Hash for BorrowedStr/BorrowedBytes
  • Lua::current_thread resolves implicit async threads to their root owner (#706)
  • Bugfixes and improvements

Full Changelog: v0.11.6...v0.12.0

v0.12.0-rc.2

v0.12.0-rc.2Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 06 Jun 15:41
v0.12.0-rc.2
0711c61

The new stable version is almost ready and will be released after some testing

What's Changed

  • Add #[derive(UserData)] and #[userdata_impl] macros
  • Support thread create/resume/yield callbacks for all Lua versions (including Luau)
  • Support to_alias_override/to_alias_fallback in Require trait (Luau)
  • Prevent XRc overflow when dropping RawLua with foreign Lua state
  • Implement Not for StdLib (#699)
  • Fix String::to_pointer return NULL in Lua <5.4

Full Changelog: v0.12.0-rc.1...v0.12.0-rc.2

v0.12.0-rc.1

v0.12.0-rc.1Pre-release
Pre-release

Choose a tag to compare

@khvzakkhvzak released this 21 Apr 23:13
v0.12.0-rc.1
5f0e06f

What's Changed

  • Switch to Rust 2024 edition
  • Removed Error::ToLuaConversionError variant as it was unused (and not practically useful)
  • New modules to group data types: chunk, debug, error, function, table, string, state, thread, userdata, luau
  • Support __todebugstring metamethod for pretty formatting userdata value (for debugging)
  • New MaybeSync trait that is required for userdata types
  • Removed lifetime from BorrowedStr and BorrowedBytes
  • New Thread methods: is_resumable, is_running, is_finished, is_error
  • Added Thread::state to get raw Lua state pointer
  • Luau TextRequirer is renamed to FsRequirer
  • GC interface refactor: Lua::gc_inc/Lua::gc_gen is replaced with gc_set_mode
  • Added GcIncParams and GcGenParams for GC tuning
  • New UserDataMethods::add_method_once and UserDataMethods::add_async_method_once
  • Initial Luau integer64 type support
  • Changed interface of Function::wrap/wrap_mut/wrap_async to support any Error type
  • Changed AnyUserData::type_name to return LuaString instead
  • Added UserDataOwned<T> wrapper to take ownership of userdata T and implements FromLua

Full Changelog: v0.11.6...v0.12.0-rc.1

v0.11.6

Choose a tag to compare

@khvzakkhvzak released this 27 Jan 20:24
e7fa8d7

What's Changed

  • Lua 5.5 support under the new lua55 feature flag
  • Luau updated to 0.705+
  • Added AnyUserData::is_proxy
  • Added num_params, num_upvalues, is_vararg to FunctionInfo

Full Changelog: v0.11.5...v0.11.6

Lua 5.5 notes

Lua 5.5 support external strings and mlua enable this optimisation for impl IntoLua for String/BString (owned versions to move Drop into Lua).
Also the Lua::create_external_string function allow moving ownership to Lua for any Into<Vec<u8>> types.

v0.11.5

Choose a tag to compare

@khvzakkhvzak released this 23 Nov 18:41
0245d4c

What's Changed

  • Luau updated to 0.701
  • Added Lua::set_memory_category and Lua::heap_dump functions to profile (Luau) memory
  • Added Lua::type_metatable helper to get metatable of a primitive type
  • Added Lua::traceback function to generate stack traces at different levels
  • Added add_method_once /add_async_method_once UserData methods (experimental)
  • Make AnyUserData::type_name public
  • impl IntoLuaMulti for &MultiValue

Full Changelog: v0.11.4...v0.11.5

v0.11.4

Choose a tag to compare

@khvzakkhvzak released this 30 Sep 22:27
247208e

What's Changed

  • Make Value::to_serializable public
  • Added new serde option detect_mixed_tables (to encode mixed array+map tables)
  • Added ObjectLike::get_path helper (for tables and userdata) for easy access of nested data
  • Added (experimental) __namecall optimization for Luau

Full Changelog: v0.11.3...v0.11.4

v0.11.3

Choose a tag to compare

@khvzakkhvzak released this 30 Aug 10:40
13ff0ca

What's Changed

  • Added Lua::yield_with to use as coroutine.yield functional replacement in async functions for any Lua (see doc examples)
  • Do not try to yield at non-yielable points in Luau interrupt (#632)
  • Added Buffer::cursor method (Luau)
  • Added Lua::create_buffer_with_capacity method (Luau)
  • Make Lua reference values cheap to clone in Rust (only increments ref count)
  • Fix panic on large (>67M entries) table creation

Full Changelog: v0.11.2...v0.11.3

v0.11.2

Choose a tag to compare

@khvzakkhvzak released this 10 Aug 09:47
3516f4c

What's Changed

  • Faster stack push for Variadic<T>
  • Fix handling Windows paths with drive letter in Luau require (#623) by @piz-ewing
  • Make Luau registered aliases ascii case-insensitive (#620)
  • Fix deserializing negative zeros -0.0 (#618)

Full Changelog: v0.11.1...v0.11.2

v0.11.1

Choose a tag to compare

@khvzakkhvzak released this 15 Jul 22:23
78331ce

What's Changed

  • Fixed bug exhausting Lua auxiliary stack and leaving it without reserve (#615)
  • Lua::push_c_function now correctly handles OOM for Lua 5.1 and Luau

Full Changelog: v0.11.0...v0.11.1