Skip to content

Commit d287fc6

Browse files
committed
feature: release version 1.3.0
- Added LuaState#close for memory management - Renamed install command to build for clarity - Fixed Lua stack overflow and dangling pointers - Refactored internal core and conversion logic - Updated changelog and versioning
1 parent da08e86 commit d287fc6

3 files changed

Lines changed: 42 additions & 4 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,44 @@ Both npm package versions (`packageVersion`) and native binary versions (`native
55

66
---
77

8+
## [1.3.0 / native 1.3.0]
9+
10+
### Added
11+
12+
- `LuaState#close()` method to explicitly free native memory
13+
- `ERR_LUA_STATE_CLOSED` error code for operations on closed state
14+
15+
### Changed
16+
17+
- **Breaking:** CLI command `lua-state install` renamed to `lua-state build`. The old name was misleading — the command actually builds a native binary rather than installing anything. Use `lua-state build` (e.g. `npx lua-state build --mode=official --version=5.2.4`).
18+
- **Breaking:** `--force` removed. Use `--mode=official` to download and compile official Lua sources instead of a prebuilt binary.
19+
- Operations on a closed state now throw a dedicated `LuaStateError` (a JS API-layer error class) instead of a generic `Error`. `LuaStateError` extends `Error` and is distinct from `LuaError`.
20+
- `build` now always produces a fresh binary instead of silently reusing an existing one; added `--skip-if-exists` (also `LUA_STATE_SKIP_IF_EXISTS`) to skip the rebuild when `build/Release/lua-state.node` is already present — used by the npm `install` hook. It is orthogonal to `--out`/`--prebuild`, which still copy the existing binary.
21+
- Added `--prebuild [path]` option to `lua-state build` — builds into the standard `prebuilds/{platform}-{arch}/lua-state[.glibc|.musl].node` layout for the current platform, compatible with `node-gyp-build` and `prebuildify`. Takes priority over `--out`.
22+
- Added `--out <path>` option to `lua-state build` as a low-level alternative to copy the built binary to an exact path (parent directories are created automatically).
23+
- Added `npm run build` script alias.
24+
25+
### Fixed
26+
27+
- Lua `stack overflow` under sustained load - added a `StackGuard` that unwinds the Lua stack after every operation
28+
- Error handling compatibility with Lua 5.1
29+
- Dangling pointer in `LuaToJsConverter` when objects map rehashes
30+
31+
### Internal improvements
32+
33+
- Reorganized `src/` into `core/`, `conversion/`, `napi/`, `runtime/` subdirectories
34+
- Extracted JS↔Lua value conversion into dedicated `JsToLuaConverter` and `LuaToJsConverter` components
35+
- Added `NapiStringBuffer` for fast string key handling
36+
- `JsObjectLuaRefCache` with vector-to-map strategy switch (avoids allocation for small object graphs)
37+
- Removed `std::function`-based `FunctionFactory` dispatch from hot paths
38+
- Build configuration with debugging support
39+
40+
### Documentation
41+
42+
- Added docs for `LuaState#close()` in README
43+
44+
---
45+
846
## [1.2.0 / native 1.2.0]
947

1048
### Changed

‎package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "lua-state",
3-
"version": "1.2.0",
4-
"nativeVersion": "1.2.0",
3+
"version": "1.3.0",
4+
"nativeVersion": "1.3.0",
55
"description": "Native Lua & LuaJIT bindings for Node.js (5.1-5.5)",
66
"keywords": [
77
"lua",

0 commit comments

Comments
 (0)