Skip to content

Commit

Permalink
Update changelog, some other minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Jun 5, 2024
1 parent d3b9a4b commit c94ab0c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added

- Added a builtin API for hashing and calculating HMACs as part of the `serde` library

Basic usage:
Expand All @@ -26,6 +28,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
The returned hashes are sequences of lowercase hexadecimal digits. The following algorithms are supported:
`md5`, `sha1`, `sha224`, `sha256`, `sha384`, `sha512`, `sha3-224`, `sha3-256`, `sha3-384`, `sha3-512`, `blake3`

- Added two new options to `luau.load`:

- `codegenEnabled` - whether or not codegen should be enabled for the loaded chunk.
- `injectGlobals` - whether or not to inject globals into a passed `environment`.

By default, globals are injected and codegen is disabled.
Check the documentation for the `luau` standard library for more information.

### Changed

- Sandboxing and codegen in the Luau VM is now fully enabled, resulting in up to 2x or faster code execution.
This should not result in any behavior differences in Lune, but if it does, please open an issue.

## `0.8.5` - June 1st, 2024

### Changed
Expand Down
4 changes: 2 additions & 2 deletions tests/luau/safeenv.luau
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ local safeCodegenFunction = luau.load(TEST_BYTECODE, {
})
local unsafeCodegenFunction = luau.load(TEST_BYTECODE, {
debugName = "unsafeCodegenFunction",
codegenEnabled = true,
environment = {},
injectGlobals = true,
codegenEnabled = true,
})
local safeFunction = luau.load(TEST_BYTECODE, {
debugName = "safeFunction",
codegenEnabled = false,
})
local unsafeFunction = luau.load(TEST_BYTECODE, {
debugName = "unsafeFunction",
codegenEnabled = false,
environment = {},
injectGlobals = true,
codegenEnabled = false,
})

-- Run the functions to get the timings
Expand Down
2 changes: 1 addition & 1 deletion types/luau.luau
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type CompileOptions = {
* `debugName` - The debug name of the closure. Defaults to `luau.load(...)`.
* `environment` - A custom environment to load the chunk in. Setting a custom environment will deoptimize the chunk and forcefully disable codegen. Defaults to the global environment.
* `injectGlobals` - Whether or not to inject globals in the custom environment. Has no effect if no custom environment is provided. Defaults to `true`.
* `codegenEnabled` - Whether or not to enable codegen. Defaults to `true`.
* `codegenEnabled` - Whether or not to enable codegen. Defaults to `false`.
]=]
export type LoadOptions = {
debugName: string?,
Expand Down

0 comments on commit c94ab0c

Please sign in to comment.