Commit Graph

  • f36aaa5ce1 Add loadstring function to Luau Closes #578 Alex Orlenko 2025-05-15 11:07:44 +01:00
  • df38878278 Update __mlua_index/__mlua_newindex chunk names Alex Orlenko 2025-05-15 11:03:30 +01:00
  • c5c1fe3b85 Fix tests Alex Orlenko 2025-05-13 23:45:46 +01:00
  • 0cc4b15f6b Generate doc for lua_module macro using doc cfg instead of docsrs Alex Orlenko 2025-05-13 21:56:11 +01:00
  • f16aca687d Terminate underlying Rust future when AsyncThread is dropped. Before this change, Lua GC was responsible to collect and destroy the future if AsyncThread dropped in yielded state. Now we will propagate "drop" event immediately so Lua GC need to only free the memory. Alex Orlenko 2025-05-09 12:48:40 +01:00
  • 9b45663afd v0.11.0-beta.1 v0.11.0-beta.1 Alex Orlenko 2025-05-06 23:21:46 +01:00
  • c0c802262e Add must_use to AsyncCallFuture Alex Orlenko 2025-05-06 22:48:48 +01:00
  • dda344bfc6 Rename _typos.toml to typos.toml Alex Orlenko 2025-05-06 22:42:19 +01:00
  • 93adfa42d1 Update doc comments Alex Orlenko 2025-05-06 22:36:23 +01:00
  • 5dc6c3214b Prepare for 2024 edition Alex Orlenko 2025-05-06 21:28:21 +01:00
  • da08f7210f Revert disabling "module" feature flag for Luau in mlua-sys Dynamic linking should still be okay Alex Orlenko 2025-05-06 15:48:52 +01:00
  • 8b7a85076a mlua-sys: Prepare to 2024 edition Alex Orlenko 2025-05-06 15:45:48 +01:00
  • a4ff68a120 v0.10.4 Alex Orlenko 2025-05-05 15:43:00 +01:00
  • 5454cfa5ed mlua-sys: v0.7.0 Alex Orlenko 2025-05-05 13:25:38 +01:00
  • f9d9dc74a7 Update CHANGELOG Alex Orlenko 2025-05-05 13:16:26 +01:00
  • 298d48f708 Update error message for UserDataRef Alex Orlenko 2025-05-06 10:24:53 +01:00
  • 4ff677f5fc v0.10.4 v0.10.4 Alex Orlenko 2025-05-05 15:43:00 +01:00
  • 5b920321dd mlua-sys: v0.7.0 Alex Orlenko 2025-05-05 13:25:38 +01:00
  • 6bb99783e9 Update CHANGELOG Alex Orlenko 2025-05-05 13:16:26 +01:00
  • 547f82acc1 Bump TARGET_MLUA_LUAU_ABI_VERSION Alex Orlenko 2025-05-05 12:13:50 +01:00
  • 9ea98e3f1e Sync mlua-sys with the main branch Alex Orlenko 2025-05-05 12:02:13 +01:00
  • 0ad03bee98 Update README Alex Orlenko 2025-04-06 17:51:54 +01:00
  • ba7c331984 Update __mlua_async_poll chunk name Alex Orlenko 2025-05-04 11:00:27 +01:00
  • 53dea3166a Update Lua* dependencies Alex Orlenko 2025-05-03 17:58:33 +01:00
  • 129dec43ed Silence clippy false positives Alex Orlenko 2025-05-01 13:18:40 +01:00
  • a7f58e57ec Update scoped userdata mismatch tests Alex Orlenko 2025-05-01 13:12:00 +01:00
  • e6871525c4 Check that type passed to scoped userdata self argument is userdata. If passed type is non-userdata we try to get a pointer (which will be null) that triggers an assertion. Having a check also allow us to generate right error message. Fixes #569 Alex Orlenko 2025-05-01 11:15:31 +01:00
  • c4956dbf49 Make StateGuard automatically enabled inside callback_error_ext. Remove manual usage of StateGuard in other places. Closes #567 Alex Orlenko 2025-04-27 23:09:20 +01:00
  • d0ea428e23 Add encode_empty_tables_as_array serialize option. This will change the behaviour of encoding empty Lua tables into array instead of map. Alex Orlenko 2025-04-26 17:53:56 +01:00
  • 3e87d3ea9b Optimize Table::is_empty Alex Orlenko 2025-04-26 15:17:54 +01:00
  • 0f8bde4b4e Fix Reversed Comments & Typo (#560) krakow10 2025-04-26 05:49:50 -07:00
  • b9c9dfbd03 mlua-sys: Update Luau to 0.671 Alex Orlenko 2025-04-25 23:38:49 +01:00
  • 71824297f6 mlua-sys: Add definitions for Luau require library (since 0.669) Alex Orlenko 2025-04-20 21:44:16 +02:00
  • c0a8064228 Update references to mlua repo Alex Orlenko 2025-04-06 15:37:38 +01:00
  • 84efb8bf95 Fix warnings when testing documentation Alex Orlenko 2025-04-05 23:44:25 +01:00
  • cf687a6ac6 Make Lua::weak() method and WeakLua struct public. This can be useful to prevent circular dependencies between Rust and Lua or check that Lua instance is still alive. Alex Orlenko 2025-04-05 23:40:05 +01:00
  • ea85edb242 Update dependencies Alex Orlenko 2025-04-05 18:30:22 +01:00
  • 788175e0d6 Restrict access to Luau VM from UserData destructors. It's unsafe to make almost any Lua calls when userdata destructor is running. This can cause recursive GC run and crash. See https://github.com/luau-lang/luau/pull/510 for some details. Alex Orlenko 2025-04-04 22:18:14 +01:00
  • 90ef25a6ee Prepare for custom (Luau) userdata destructors. We need to add logic later to prevent calling any Lua functions when UserData destructor is running. Alex Orlenko 2025-04-04 16:36:06 +01:00
  • ac72f6acae Do not propagate collect_garbage flag when clonning Lua Alex Orlenko 2025-04-04 10:58:08 +01:00
  • 4444ac4ea3 Add AnyUserData::type_id method Alex Orlenko 2025-03-31 22:41:42 +01:00
  • 5f950e30ec Update Lua::poll_pending doc (still hidden) Alex Orlenko 2025-03-31 22:26:47 +01:00
  • 311aa5f6e1 Bump Luau to 0.667 Alex Orlenko 2025-03-30 11:12:14 +01:00
  • 739d5f5262 Reduce stack operations when creating userdata Alex Orlenko 2025-03-22 14:23:34 +00:00
  • 375028e13f Add Chunk::name(), Chunk::environment() and Chunk::mode() functions. They can be used to retrieve existing chunk params. Alex Orlenko 2025-03-22 00:17:28 +00:00
  • 46e949c184 Use c string literal where appropriate Alex Orlenko 2025-03-21 15:36:32 +00:00
  • 62b53e218c Move some userdata helpers from crate::util to crate::userdata::util Alex Orlenko 2025-03-21 15:11:09 +00:00
  • 0393406b9f Refactor userdata-wrappers feature. Support borrowing underlying data in UserDataRef and UserDataRefMut. Alex Orlenko 2025-03-21 12:29:47 +00:00
  • 272cfdb89b Change Lua library name constants from &str to *const c_char. It makes easier to pass them to Lua API functions. Alex Orlenko 2025-03-14 23:10:14 +00:00
  • 8e244a25ea Update test case Alex Orlenko 2025-03-13 17:41:13 +00:00
  • ef8b8e11ec Support 52-bit integers for Luau Simply to float conversion (it actually never fails or goes out of range) Alex Orlenko 2025-03-13 16:18:44 +00:00
  • 2543414726 Fix clippy warnings Alex Orlenko 2025-03-07 21:21:14 +00:00
  • ee112568d6 Remove Roblox from references to Luau Closes #537 Alex Orlenko 2025-02-24 19:03:33 +00:00
  • 69d3ddec29 Remove (internal) borrow counter and use instead "locked" flag and strong reference counter Alex Orlenko 2025-02-14 14:41:37 +00:00
  • 5b0d811c5a Add Variadic to prelude Alex Orlenko 2025-02-14 12:06:25 +00:00
  • 19536db976 Add bstr/serde dependency if serialize feature flag is enabled Alex Orlenko 2025-02-11 13:36:03 +00:00
  • fc69551f87 Fix tests Alex Orlenko 2025-02-09 22:17:25 +00:00
  • a68b0b6905 Do not allow recursive warnings (Lua 5.4) Alex Orlenko 2025-02-09 15:08:52 +00:00
  • 1ec1cc9922 Fix tests Alex Orlenko 2025-02-05 19:01:07 +00:00
  • fd68b033f0 Fix typos (#522) Joel Natividad 2025-02-05 11:16:20 -05:00
  • c3817409a8 Fix version number in changelog (#521) Andrew Farkas 2025-02-04 02:33:33 -05:00
  • 863d8092d6 Imporove BorrowedStr/BorrowedBytes ergonomic. Implement FromLua and IntoLua for these types to allow working with them directly. Alex Orlenko 2025-01-30 23:07:02 +00:00
  • 24b6ff3c20 Improve From/Into Lua char conversion Alex Orlenko 2025-01-28 10:41:10 +00:00
  • bc36261f5c impl FromLua/IntoLua for char (#516) tk 2025-01-28 10:10:28 +00:00
  • bcb9a4d220 Enable Thread::reset() for all Lua versions Alex Orlenko 2025-01-12 00:04:56 +00:00
  • ed796fff51 Support async require loaders for Luau Alex Orlenko 2025-05-04 11:00:59 +01:00
  • 65e5be81ba Update __mlua_async_poll chunk name Alex Orlenko 2025-05-04 11:00:27 +01:00
  • 4fa8e645b7 Fix Luau "require" tests Alex Orlenko 2025-05-03 21:45:39 +01:00
  • 05a0abb8c2 Replace Requite::load with Require::loader Alex Orlenko 2025-05-03 18:00:02 +01:00
  • f0c0527c2b Update Lua* dependencies Alex Orlenko 2025-05-03 17:58:33 +01:00
  • 2490dfeb38 Silence clippy false positives Alex Orlenko 2025-05-01 13:18:40 +01:00
  • 4a3dbafb6e Update scoped userdata mismatch tests Alex Orlenko 2025-05-01 13:12:00 +01:00
  • 97ca3e2c08 Check that type passed to scoped userdata self argument is userdata. If passed type is non-userdata we try to get a pointer (which will be null) that triggers an assertion. Having a check also allow us to generate right error message. Fixes #569 Alex Orlenko 2025-05-01 11:15:31 +01:00
  • d6fb328660 Don't use Lua::get_or_init_from_ptr in Require::load wrapper Alex Orlenko 2025-04-28 10:07:11 +01:00
  • edd508ed1f Make StateGuard automatically enabled inside callback_error_ext. Remove manual usage of StateGuard in other places. Closes #567 Alex Orlenko 2025-04-27 23:09:20 +01:00
  • a30a736291 Don't borrow mutably appdata container when working with require content cache Alex Orlenko 2025-04-27 00:38:30 +01:00
  • 8e1df48e81 Add encode_empty_tables_as_array serialize option. This will change the behaviour of encoding empty Lua tables into array instead of map. Alex Orlenko 2025-04-26 17:53:56 +01:00
  • efd192b816 Optimize Table::is_empty Alex Orlenko 2025-04-26 15:17:54 +01:00
  • 5e1451a465 Fix Reversed Comments & Typo (#560) krakow10 2025-04-26 05:49:50 -07:00
  • 64b1d152b9 Deprecate Lua::load_from_finction and replace it with Lua::register_module and Lua::preload_module instead. Alex Orlenko 2025-04-26 13:38:13 +01:00
  • a8a4aa8c93 Switch to "proxyrequire" function (follow up Luau 0.671) Alex Orlenko 2025-04-25 23:41:11 +01:00
  • 9fda2ecfcc mlua-sys: Update Luau to 0.671 Alex Orlenko 2025-04-25 23:38:49 +01:00
  • 21fc924457 Add Lua::create_require_function method Alex Orlenko 2025-04-25 18:43:52 +01:00
  • 30d5e08a8a Add MaybeSend to Require trait Alex Orlenko 2025-04-25 15:51:33 +01:00
  • 560a30ca02 Support new Luau require system This commit introduces the Require trait that be used to change require behaviour. By default mlua implements behaviour same as ReplRequirer in the original Luau. Unfortunately binary Luau modules are no longer supported by the new system. Alex Orlenko 2025-04-25 14:19:41 +01:00
  • 117f8377e2 mlua-sys: Add definitions for Luau require library (since 0.669) Alex Orlenko 2025-04-20 21:44:16 +02:00
  • 8173ef2fa8 Update README Alex Orlenko 2025-04-06 17:51:54 +01:00
  • 4e5677ae54 Update references to mlua repo Alex Orlenko 2025-04-06 15:37:38 +01:00
  • 49958f4827 Split Luau thread event callback to creation and collection callbacks. We need this because they have different requirements: - Thread creation callback can return Error or panic - Thread collection callback runs during Luau GC cycle and cannot make any Lua calls or trigger panics. Alex Orlenko 2025-04-06 13:57:15 +01:00
  • 39b3af2ff2 Fix warnings when testing documentation Alex Orlenko 2025-04-05 23:44:25 +01:00
  • b805939320 Make Lua::weak() method and WeakLua struct public. This can be useful to prevent circular dependencies between Rust and Lua or check that Lua instance is still alive. Alex Orlenko 2025-04-05 23:40:05 +01:00
  • bd13300288 Update dependencies Alex Orlenko 2025-04-05 18:30:22 +01:00
  • 12e61e01f6 Restrict access to Luau VM from UserData destructors. It's unsafe to make almost any Lua calls when userdata destructor is running. This can cause recursive GC run and crash. See https://github.com/luau-lang/luau/pull/510 for some details. Alex Orlenko 2025-04-04 22:18:14 +01:00
  • 53ff494ab9 Prepare for custom (Luau) userdata destructors. We need to add logic later to prevent calling any Lua functions when UserData destructor is running. Alex Orlenko 2025-04-04 16:36:06 +01:00
  • 1cb081d20a Do not propagate collect_garbage flag when clonning Lua Alex Orlenko 2025-04-04 10:58:08 +01:00
  • c1a018a60d Add AnyUserData::type_id method Alex Orlenko 2025-03-31 22:41:42 +01:00
  • 4d2ff45a8b Update Lua::poll_pending doc (still hidden) Alex Orlenko 2025-03-31 22:26:47 +01:00
  • 72682198eb Bump Luau to 0.667 Alex Orlenko 2025-03-30 11:12:14 +01:00
  • 87fa663ac1 Remove deprecated functions Alex Orlenko 2025-03-28 13:24:15 +00:00
  • 1f970824b4 Support user thread creation callback (Luau) Alex Orlenko 2025-03-28 11:51:35 +00:00