Releases: lune-org/lune
0.10.1
Fixed
- Fixed a regression where it was not possible to run directories with
init.luau
files in them directly usinglune run directory-name
. - Fixed a panic when calling
process.exit
inside a file thatrequire
was called on. (#333) - Fixed a panic when calling
process.exit
inside a request handler fornet.serve
. (#333)
0.10.0
This version of Lune contains a major internal refactoring of the require
function, now using the proper require-by-string APIs exposed by Luau.
If you relied on any (incorrect) behavior of relative, non-@self
requires, from within init.luau
files in Lune 0.9.0
, you may need to update your code.
No other usages of require
will be affected - but if you previously encountered any internal bugs or panics during require
, these will have been fixed!
Added
-
Added support for TCP client in the
net
standard library.
It may be used either with TLS or not, and basic usage looks as such:-- Plain TCP connections local stream = net.tcp.connect("example.com", 80) -- TLS connections (shorthand) local tlsStream = net.tcp.connect("example.com", 443, true) -- Connections with custom TLS setting & TTL local customStream = net.tcp.connect("192.168.1.100", 8080, { tls = false, ttl = 128 }) -- Interacting with the stream tlsStream:write("GET / HTTP/1.1\r\nHost: example.com\r\n\r\n") while true do local data = tlsStream:read() if data ~= nil then print(data) else break -- Connection was closed end end
-
Added submodules to the
net
standard library:http
,tcp
, andws
.These will be the preferred way of interacting with the
net
standard library going forward, but none of the old functions have been removed or deprecated yet to allow users time to migrate.In a future major version of Lune, direct functions such as
net.socket
will be removed in favor of their equivalent functions in submodules, such asnet.ws.connect
. Here is the full new list of functions:net.http.request
net.http.serve
net.tcp.connect
net.ws.connect
-
Added a method
with_lib
to theRuntime
struct in thelune
crate, to allow registering custom libraries.
Changed
- Updated to Luau version
0.682
- Upgraded to
mlua
version0.11
- if you use any of the Lune crates as a dependency, you may also need to upgrade
Fixed
- Fixed errors being emitted twice when the error is thrown from the main (entrypoint) script
- Fixed a panic when calling
net.request
and related functions in the main body of a module duringrequire
- Fixed various issues with not conforming to the new Luau require-by-string semantics
0.9.4
Changed
lune setup
now properly sets up a.luaurc
file instead of using legacy VSCode-specific settingsprocess.args
andprocess.env
are now plain tables again - not userdata - thank you to everyone who provided feedback on this and the usability issues!
Fixed
- Fixed invalid handling of http redirects in
net.request
- Fixed not being able to download binaries for cross-compiling with
lune build
- Fixed binary output when running
lune build
not being deterministic and sometimes truncating - Fixed
cargo install lune
failing due to a yanked dependency (#323)
0.9.3
Added
- Added support for non-UTF8 strings in arguments to
process.exec
andprocess.spawn
Changed
- Improved cross-platform compatibility and correctness for values in
process.args
andprocess.env
, especially on Windows
Fixed
- Fixed stdin not being properly closed when not providing the stdin option to
process.exec
- Fixed various crashes during require that had the error
cannot mutably borrow app data container
0.9.2
Changed
- Improved performance of
net.request
andnet.serve
when handling large request bodies - Improved performance and memory usage of
task.spawn
,task.defer
, andtask.delay
Fixed
- Fixed accidental breakage of
net.request
in version0.9.1
0.9.1
0.9.0
The next major version of Lune has finally been released!
This release has been a long time coming, and many breaking changes have been made.
If you are an existing Lune user upgrading to this version, you will most likely be affected.
The full list of breaking changes can be found on below.
Breaking changes & additions
-
The behavior of
require
has changed, according to the latest Luau RFCs and specifications.For the full details, feel free to read documentation here, otherwise, the most notable changes here are:
- Paths passed to require must start with either
./
,../
or@
- require statements such asrequire("foo")
will now error and must be changed torequire("./foo")
. - The behavior of require from within
init.luau
andinit.lua
files has changed - previouslyrequire("./foo")
would resolve
to the file or directoryfoo
as a sibling of the init file, but will now resolve to the file or directoryfoo
which is a sibling of the parent directory of the init file.
To require files inside of the same directory as the init file, the new@self
alias must be used - likerequire("@self/foo")
.
- Paths passed to require must start with either
-
The main
lune run
subcommand will no longer sink flags passed to it -lune run --
will now literally pass the string--
as the first
value inprocess.args
, and--
is no longer necessary to be able to pass flag arguments such as--foo
and-b
properly to your Lune programs. -
Two new process spawning functions -
process.create
andprocess.exec
- replace the previousprocess.spawn
API. (#211)To migrate from
process.spawn
, use the newprocess.exec
API which retains the same behavior as the old function, with slight changes in how thestdin
option is passed.The new
process.create
function is a non-blocking process creation API and can be used to interactively
read and write to standard input and output streams of the child process.local child = process.create("program", { "first-argument", "second-argument" }) -- Writing to stdin child.stdin:write("Hello from Lune!") -- Reading partial data from stdout local data = child.stdout:read() print(data) -- Reading the full stdout local full = child.stdout:readToEnd() print(full)
-
Removed
net.jsonEncode
andnet.jsonDecode
- please use the equivalentserde.encode("json", ...)
andserde.decode("json", ...)
instead -
WebSocket methods in
net.socket
andnet.serve
now use standard Lua method calling convention and colon syntax.
This meanssocket.send(...)
is nowsocket:send(...)
,socket.close(...)
is nowsocket:close(...)
, and so on. -
Various changes have been made to the Lune Rust crates:
Runtime::run
now returns a more useful value instead of anExitCode
(#178)- All Lune standard library crates now export a
typedefs
function that returns the source code for the respective standard library module type definitions - All Lune crates now depend on
mlua
version0.10
or above - Most Lune crates have been migrated to the
smol
andasync-*
ecosystem instead oftokio
, with a full migration expected soon (this will not break public types) - The
roblox
crate re-export has been removed from the mainlune
crate - please depend onlune-roblox
crate directly instead
Added
- Added functions for getting Roblox Studio locations to the
roblox
standard library (#284) - Added support for the
Content
datatype in theroblox
standard library (#305) - Added support for
EnumItem
instance attributes in theroblox
standard library (#306) - Added support for RFC 2822 dates in the
datetime
standard library usingfromRfc2822
(#285) - thefromIsoDate
function has also been deprecated (not removed yet) andfromRfc3339
should instead be preferred for any new work. - Added a
readLine
function to thestdio
standard library for reading line-by-line from stdin. - Added a way to disable JIT by setting the
LUNE_LUAU_JIT
environment variable tofalse
before running Lune. - Added
process.endianness
constant (#267)
Changed
- Documentation comments for several standard library properties have been improved (#248, #250)
- Error messages no longer contain redundant or duplicate stack trace information
- Updated to Luau version
0.663
- Updated to rbx-dom database version
0.670
Fixed
- Fixed deadlock in
stdio.format
calls in__tostring
metamethods (#288) - Fixed
task.wait
andtask.delay
not being guaranteed to yield when duration is set to zero or very small values - Fixed
__tostring
metamethods sometimes not being respected inprint
andstdio.format
calls
0.8.9
Changed
- Updated to Luau version
0.640
0.8.8
0.8.7
Added
- Added a compression level option to
serde.compress
(#224) - Added missing vector methods to the
roblox
library (#228)
Changed
- Updated to Luau version
0.635
- Updated to rbx-dom database version
0.634
Fixed
- Fixed
fs.readDir
with trailing forward-slash on Windows (#220) - Fixed
__type
and__tostring
metamethods not always being respected when formatting tables