Skip to content

Releases: regginator/LuaEncode

1.4.3

01 Dec 20:50
Compare
Choose a tag to compare

Changes

  • Fix edge-case inaccuracies in string byte escapes (use hex escapes instead of decimal)

1.4.2

30 Nov 06:38
Compare
Choose a tag to compare

Changes

(@notpoiu) Fix Color3 type serialization

1.4.0

27 Nov 05:16
Compare
Choose a tag to compare

Changes

  • Add options.InsertCycles flag to API (See below for more info)
  • Use a stack-based system for table depth as opposed to costly call recursion, optimize output concatenation (~20x faster on LargeTableBenchmark)
  • Fix misc. edge-case logic bugs

Manual Cycle Insert Codegen (options.InsertCycles)

By setting the InsertCycles option to true, if there are cyclic references in your table, the output will be wrapped in an anonymous function that adds codegen to manually set paths to those references on the output table. NOTE: If a key in the index path to the cycle is a reference type (e.g. table, function), the codegen can't externally set that path, and it will be ignored.

options.InsertCycles is set to false by default, as potentially wrapping the output table in an anonymous function and storing reference paths during the serialization process may not be ideal for all scenarios.

Example Input:

local Table = {
    {
        "Hello",
        AnotherTable = {},
        ["This can't be indexed raw"] = {}
    },
}

Table.Self = Table
Table[2] = Table[1].AnotherTable
Table["3"] = Table[1]["This can't be indexed raw"]

print(LuaEncode(Table, {
    Prettify = true,
    InsertCycles = true,
    OutputWarnings = false, -- Silence any "warning" codeblocks
}))

Output:

(function(t)
    t.Self = t
    t[2] = t[1].AnotherTable
    t["3"] = t[1]["This can't be indexed raw"]

    return t
end)({
    {
        "Hello",
        AnotherTable = {},
        ["This can't be indexed raw"] = {}
    },
    {},
    Self = {},
    ["3"] = {}
})

1.3.1

30 Jun 05:17
Compare
Choose a tag to compare

[1.3.1]

Additions

Changes/Fixes

(@lolmanurfunny) Don't use table.clone for recursive table config 9f6b4a1
Use optimize (Luau) compiler flag comment 9f6b4a1
Make EvaluateInstancePath use a while loop instead of recursive function calls c5e78c3
(@lolmanurfunny) Use and/or cond instead of tostring() for boolean 1933fb3

1.2.2

29 Jun 05:56
Compare
Choose a tag to compare

[1.2.2]

Changes/Fixes

(@lolmanurfunny) Improve inf/-inf number ser speeds a bit 395f910

1.2.1

02 Apr 02:41
Compare
Choose a tag to compare

[1.2.1]

Changes/Fixes

  • Fixed reserved Lua/Luau keywords not being respected for table keys, causing potentially invalid syntax in output when they're used. (64510a5)

1.2.0

15 Mar 08:27
Compare
Choose a tag to compare

[1.2.0]

Changes/Fixes

  • Options.PrettyPrinting has been renamed to "Prettify"; PrettyPrinting has been deprecated, and will be supported in the future for compatibility. Please don't use it for current work/use.
  • If Options.IndentCount is unspecified and Options.Prettify is true, it will automatically be set to 4, as usual in expected behavior.
  • Multiple runtime optimizations and internal codebase improvements, large and small.
  • Comment blocks are now properly escaped for any errors/warnings placed into output by default.
  • Options.UseInstancePaths is now set to true by default, and instances without evaluated paths will be set to nil in output, with a comment block containing the ClassName to prevent unexpected instancing errors at runtime.
  • We're now using a more proper test suite with Lune, providing complete source testing utils for both Luau, Lua 5.1, and LuaJIT.

Notes

  • A ton has changed internally in this release, PLEASE let me know if there's absolutely any issues with output etc.
  • i sleep

1.1.6

1.1.5

07 Jan 00:22
Compare
Choose a tag to compare

1.1.4

22 Dec 21:54
Compare
Choose a tag to compare

[1.1.4]

Changes/Fixes

  • Speed/efficiency improvements with string serialization.
  • Fixed DockWidgetPluginGuiInfo returning a slightly incorrect output.