typescript-to-lua
Advanced tools
Changelog
0.24.0
Returns in try/catch statements now properly return from the current function.
TypeScript's globalThis
is now translated to lua's _G
. Lualib functions were updated where relevant.
Fixed issue where string/table literals were missing parentheses and caused lua syntax errors.
Various improvements/refactorings across the codebase.
Fixed syntax error in for...of loops with empty destructuring argument.
Fixed issue with do ... while
scope.
Fixed a bug with @combileMembersOnly where it would ignore anything before the enum name.
Changelog
0.23.0
Added support for OmittedExpression in array literals and array binding patterns.
Added support for tagged template literals.
Changed output lua formatting to be more debugger-friendly.
Various improvements to source maps.
Fixed an issue with the interaction of super calls and exported classes.
Fixed @noResolution
not working on named modules.
Fixed namespace merging not working due to an earlier change.
Some refactoring and plumbing for the website.
Changelog
0.21.0
Imports/exports that are ambient (declarations, types, interfaces, etc) or are not used in value positions no longer generate require
statements.
For ... of loops are now translated using ipairs
.
Added support for array.reduce
.
Added support for import foo = bar.baz;
statements.
Fixed some issues with binding pattern parameter default values.
Fixed some issues with variable naming.
Enabled prettier on the entire codebase.
Changelog
0.20.0
string.repeat
, string.padStart
and string.padEnd
./** @tupleReturn */
not working for function types (i.e myFunc: () => [number, number]
)Changelog
0.19.0
BREAKING CHANGE: All tstl-specific options should now be inside the "tstl" section in tsconfig.json (see README.md). Root-level options are no longer supported.
Added a compiler API to programmatically invoke TypeScriptToLua, and to modify or extend the default transpiler. More info on the Compiler API wiki page.
Added support for class decorators.
Added support for the @luaTable directive which will force a class to be transpiled as vanilla lua table.
Added support for NaN, Infinity and related number functions.
Added support for string.startsWith, string.endsWith and improved string.replace implementation.
Added support for Symbol.hasInstance.
Hoisting now also considers imports.
Various improvements to iterators and arrays, they also work with the spread operator now.
Fixed an issue with parameters that had false
as default value.
Changelog
0.18.0
Added support for setting array length. Doing array.length = x
will set the length of the array to x
(or shorter, if the starting array was shorter!).
Added the .name
property to all transpiled classes, so class.name
will contain the classname as string.
Changed class = class or {}
syntax to just be class = {}
.
Cleaned up printer output so it produces more human-readable code.
Fixed bug with expression statements.
Fixed incorrect inline sourcemap format.
Fixed bug when merging an interface and module.
Fixed a bug with inherited constructor super call ordering.
Enabled strict tsconfig.
Changelog
0.17.0
We now support source maps in the standard JS v3 format. You can generate source maps with the --sourceMap
CLI argument, or by adding sourceMap: true
to your tsconfig. Inline source maps are also supported with --inlineSourceMap
CLI/tsconfig parameter.
Also added tstl option --sourceMapTraceback
, which will add an override to Lua's debug.traceback()
to each file, so source maps will automatically be applied to Lua stacktraces (i.e. in errors).
Made watch mode incremental.
Added support for Object.fromEntries
, array.flat
and array.flatMap
.
BREAKING CHANGE: Directive @tupleReturn
should now be specified per overload.
Fixed a bug where rest parameters would not transpile correctly.
Fixed an issue with escaped backticks.
Various small fixes function inference and array detection.
Changed testing framework to jest.