- TypeScript dependency updated to 5.5.3 (#2617, #2648, #2716, #2736)
- Generic JSX (#2404)
- JSX can now be used for any library which matches
React.createElement()syntax
- JSX can now be used for any library which matches
--optimizedLoopsflag is now enabled by default- this will optimize loops like
for (let i = 1; i <= 10; i++) {}intofor i = 1, 10 do end - please report any issues here
- if necessary, you can run the compiler with
--optimizedLoops=falseto return to the old behavior
- this will optimize loops like
- Improve emit for
a.b()anda[b]()(#2623) - Fixed bug where
noMacroExtendsdiagnostic would never be reported (#2587) - Fixed bug where
noRobloxSymbolInstanceofdiagnostic would not always be reported (#2672) - Fixed watch mode error for files with "unsupported extensions" (#2701)
- Fixed multiline template string bug on Windows (roblox-ts/luau-ast#483)
- Fixed template string unicode escape sequence bug (roblox-ts/luau-ast#483)
- Fixed optional arguments when spreading into macro (#2528)
- Fixed nested classes not getting hoisted (#2728)
- Pinned exact versions of @roblox-ts dependencies (#2724)
- Fixed bug where error was not rethrown after a
finallyblock (#2726) - Fixed bug where
finallyblock was not run if thecatchblock errored (#2726) - Fixed importing directories that are symlinked twice (#2704)
- Moved all
@types/*to devDependencies (#2737) - Corrected parameter decorator name argument (#2460)
- Corrected decorator execution ordering (#2759)
- Fixed
export {}not working on imported variables (#2796) - Fixed statements before super breaking class initialization (#2778)
- Fixed internal transformPaths transformer (#2800)
- Added support for
.luaufile extension (#2802) - Fix typo in issue #1149's diagnostic (#2649)
- Added an error if
typesspecified in tsconfig.json are not found (#2533)
- To continue using
@rbxts/roact+ JSX- roblox-ts 3.0.0+ will require
@rbxts/roact3.0.1+ - Class components must be tagged with
@Roact.ClassComponent - Top-level JSX expressions no longer support
Key. To preserve previous behavior, you should wrap it in a fragment:<><screengui Key="ScreenGui" /></>
- In
tsconfig.jsonyou should set the following"jsx": "react", "jsxFactory": "Roact.jsx", "jsxFragmentFactory": "Roact.Fragment",
- roblox-ts 3.0.0+ will require
- Upgraded bundled
roblox-lua-promisefrom 3.2.1 to 4.0.0. See possible breaking changes here. - The TypeScript update includes a few edge-case breaking changes: 5.4 and 5.5
- roblox-ts will emit compiled files as
.luauby default. You can keep the old behaviour by running with--luau=false. - Parameter decorators will now be called with the name of the method, instead of the name of the parameter. This matches TypeScript behaviour.
typeRootsare now verified relative to the project folder, not thepackage.json. For more info, see (#2533)
- Removed
rbxtsc initin favor ofnpm create roblox-ts(#2503) - Lune Unit Testing (#2489)
- Not user facing, but the compiler should be more stable going forwards! π
- Removed enum inverse mapping for string values (#2506)
- $range macro optimizations (#2130, #2196)
- Added support for
typeIs(value, "buffer")(#2588) - Fixed
Array.push()inserting multiple values for different tables (#2597) - Support interpolated string emit for template expressions (#2591)
- Removed unnecessary parentheses for chained binary expressions like
a && b && c(#2242) - Better usage analysis for function expressions +
...(#2527) - Fixed
noAnydiagnostic fora.b()anda[b]()(#2550) - Optimized array offset emit so that
x[n - 1]becomesx[n]instead ofx[n - 1 + 1](#2567) - Optimized object spread assignment when the spread is the first entry in the object, i.e.
{ ...obj, foo: "bar" }(#2546) - Fixed bug related to
new Map( ... ).delete(exp)andnew Set( ... ).delete(exp)(#2605) - Split off PathTranslator class into it's own package (#2614)
- Added support integer division operator via macro:
Number.idiv(),Vector2.idiv(), andVector3.idiv()(#2606)- these compile to
a // b - number literals should be wrapped in parentheses, i.e.
(10).idiv(3)
- these compile to
- TypeScript 5.2.2 Support (#2401, #2466)
- Support for instantiated expressions (#2445)
- Support for Luau comment directives like
//!native(#2465) - Fixed incorrect emit with
array[n]?.()(#2475) - Support for class static blocks (#2480)
- Enable
--optimizedLoopsflag for Playground environment (#2271) - Fix for updating non-compiled files in transformer watch mode (#2385)
- Add
$getModuleTreemacro (#2302)
- TypeScript 4.9 Support (#2195)
- Adds support for
satisfieskeyword - Adds disagnostic for the
accessorkeyword (requires getters/setters which are not supported)
- Adds support for
- Removed diagnostic for comma operator (#2045)
- Banned instanceof on roblox types (#2225)
- Disabled networkType check for dynamic import() (#2197)
- Added
--writeTransformedFilesto write transformed TypeScript ASTs to out directory (#2255) - Small improvements and fixes for
--optimizedLoops(#2201, #2265)
- Updated deprecated APIs for TS 4.8 (#2143)
- Fixed new regression with incremental mode (#2138)
- Fixed new regression with Playground environment
- Fixed new regression with Package projects importing package dependencies (#2125)
- Breaking Changes
- Other Changes
- Fixed bug with
Array.unorderedRemoveforfalsevalues (#1883) - Added support for
preserveConstEnumstsconfig.json option (#1894) - Upgraded to TypeScript 4.8.3 (#1903, #2121)
- Fixed a bug with
typekeyword and named exports (#1922) - Improved JSX config error messages (#1817)
- Improved detection of Roact Change/Event attributes (#1972)
- Improved naming of for-of statement temporary identifiers (#1896)
- Added experimental compiler flag
--optimizedLoopsto compile some numeric for loops to be Lua for loops (#1977) - Fixed duplicate diagnostics for enum and namespace merging (#1981)
- Added
$rangemacro (#1979) - Added
$tuplemacro (#1980) - Optimized array destructuring from array literal (#1994)
- Added support for
import K = X.Y.Z;(#2001) - Emit no longer uses
pairs()/ipairs(), in favor of generalized iteration (#2008) - Added diagnostic for non-Server .ts files importing Server .ts files (#1899)
- Fixed
npm initpackage manager detection bug - Fixed
npm initnot properly exiting on Ctrl+C - Fixed
npm initexisting path recognition (#2019) - Prevent compiler from crashing when identifiers have no symbol (#1987)
- Improved support for compiler build flags in
"rbxts"field oftsconfig.json(#2023) - Banned usage of
@ts-ignoreand add --allowCommentDirectives (#2024) - Improved
rbxtsc init plugintemplate to use "types" in tsconfig.json instead of triple slash directives (#2028) - Fixed
rbxtsc initusage with pnpm (#2060)
- Fixed bug with
- Fixed some regressions for compiling void-returning macros as expressions (#1864, #1876)
- Improved validation for
tsconfig.json"typeRoots"field (#1873) - Fixed a crash when referencing global const enums in the same file they're declared in (#1878)
Array.pushnow optimizes to usetable.insert()- Macro emit is no longer wrapped in comments for single statements
- null coalescing expressions can now be inlined if Lua truthiness allows (#1857)
- Fixed conditional expression usage inside for loops (#1856)
- Added "experimentalDecorators" tsconfig.json option to templates + playground (#1850)
- Split out compiler parts into multiple packages (#1775)
- Fixed broken hoisting on arrow function variables (#1777)
- Improved emit for expression statement ternaries (#1783)
- Improved watch mode stability (#1787)
- Loosened "any" type checks to allow for improved usage with type variables
- Improved support for object destructuring assignment (#1822)
rbxtsc initwill no longer prompt forgit initif git isn't installed (#1823)- Fix
LuaTuple<T>wrapping in for loop condition (#1819) - Added initial support for TypeScript decorators π (#1793)
- Bumped TypeScript version to 4.5.5
- Upgraded built-in roblox-lua-promise to v3.2.1
- Improved incremental mode to recognize tsconfig.json "plugins"
- Package template from
rbxtsc initnow ignores.tsbuildinfofiles when uploading to npm - Fixed compiler crash when calling Roblox API methods via element expression
game["Destroy"]()(#1761) - Fixed Luau if-expression truthiness bug (#1762)
- Fixed Luau if-expression precedence bug (#1763)
- Added
ignorePatternstorbxtsc initeslint config - Improved diagnostic for assignment of methods and non-methods to one another (#1667)
- Added support for Luau if-expressions in emit (#1675)
- Improved watch mode not recompiling after errors (#1682)
- Added warning for transformers failing to initialize (#1683)
- Improved JSX tsconfig.json errors to allow for custom JSX transformers (#1690)
- Allowed for method indexing in
typeIs()macro calls (#1696) - Removed
"baseUrl"setting fromrbxtsc init packagetsconfig.json template - Fixed error with export * from .d.ts file (#1727)
- Fixed double
notkeywords in do-while with negated condition (#1749) - Reworked the internals for
rbxtsc init, added use of prettier without eslint (#1659) - Incremental mode now considers
--typeflag
- Fixed roblox-ts pre-emit diagnostics being reported before TypeScript pre-emit diagnostics (#1663)
- Fixed regression with
...argsin built-in functions that support var args (#1665)
- Fixed regression with using
defined/unknownvalues in string templates (#1652) - Added method assignment validation diagnostics (#1651)
- Fixed playground crash (#1648)
- Improved temporary identifier names in a few cases
- Small optimization for macros with defaults (#1521)
- Fixed binary expression equal precedence issues (#1538)
- Skip rendering parentheses for literals / simple expressions (#1543)
- Fixed emitted type declarations with transformers (#1557)
- Fixed enum hoisting (#1555)
- Fixed namespace bugs (#1563)
- Fixed template literal infinite recursion bug (#1564)
- Improved incremental mode hash generation (#1589)
- Improved detection for
definedtype - Improvements for watch mode (#1520)
- Improved testing and code coverage π
- Fixed crash with for-of loops over
pairs(this)(#1629)
- Fixed a bug with array spread expressions like
[a, ...b] - Fixed playground environment crash
- Fixed a bug with temporary identifiers shadowing each other incorrectly.
- Add contextual info to the 'noRojoData' diagnostic (#1354)
- Fixed LuaTuples don't compile correctly with optional chaining (#1338)
- Added compiler warnings for using the RuntimeLib from ReplicatedFirst
- Improved
LuaTuple<T>detection (#1356) - Added support for tsconfig.json
"extends"with transformer plugins (#1357) - Added default "build" and "watch" scripts to
rbxtsc initpackage.json files - Added check against merging functions and namespaces, fixed bug where
declaredeclarations were incorrectly seen as "merging". - Improved detection of
definedtype. - Added support for diagnostics emitted from transformer plugins (#1387)
- Added support for
typeIs(v, "vector") - Added diagnostic for use of reserved fields
"new"and"__index"in class declarations - Reworked ForStatement emit to handle complex cases better (#1315)
- Added package manager selection to
rbxtsc init(#1346) - Removed
--logStringChangesflag - Added support for variable assignments in for..of loops (#1253)
- Added support for "named" temporary identifiers (used internally by the compiler) to make the emit more readable (#1382)
- Fixed crash on iteration over
WeakSet<T>andWeakMap<K, V>(#1417) - Improved performance for transformer plugins (#1416)
rbxtsc-devnow force disables incremental mode for compiler development (#1420)- Fixed watch mode dependency bugs without incremental mode (#1424)
- Added
serve.project.jsontorbxtsc init plugintemplate (#1419) - Array spread now uses
table.move()(#1437) - noAny diagnostic will now only be reported once per symbol (#1435)
- Fixed Luau emit bug with multiline strings used as table keys (#1453)
- Added support for
returnin class constructors (#1455) - Fixed Luau emit bug with strings containing
',", and ending in](#1467) - Added support for alternative npm scopes other than
@rbxtsπ (#1474) - Added a friendly notice for when
git initfails inrbxtsc initinitialization step (#1477) - Fixed
init.luafiles being incorrectly deleted in watch mode - Cleaned out old and unused
RuntimeLib.luafunctions - Added
"forceConsistentCasingInFileNames": true,torbxtsc inittsconfig.json files - Fixed
rbxtsc initunder@nextbuilds (#1479) - Fixed
.d.tsfiles not being deleted in watch mode (#1445) - Added diagnostic for
initbeing reserved in Roact.Component classes (#1454) instanceofemit now uses RuntimeLib functionTS.instanceof()(#1491)- Fixed bug where
"include"folder was copied for package projects
- Fixed crash when using
@rbxts/roactin the playground
- Reorganized
@rbxts/roacttypes and improved compiler support for detecting the types@rbxts/roact@>=1.3.0-ts.13requiresroblox-ts@>=1.1.0
Array.includes()now compiles to atable.find()call (#1299).d.tsfiles are no longer copied tooutdirectory if tsconfig.json "declaration" setting is not enabled- Fixed switch statement bug with missing parentheses (#1304)
- Fixed
export * as Nbug (#1320) - Fixed expressions with prereqs / macros in "else if" conditions not compiling correctly (#1314)
- Globals used by the compiler (
type(),typeof(),table, etc.) will now error if shadowed by a variable or parameter name - Fixed macro math order of operations bugs
- Updated to TypeScript 4.2.3
- Updated "out of date of types" error message text
- Added a diagnostic for (#1149)
- Fixed JSX fragments used as children (#1285)
- Updated
rbxtsc init packageto use package.json "files" - Updated
rbxtsc initto use default.project.json "globIgnorePaths" - Fixed JSX fragments in playground environment
- Fixed export tables for "declared" identifiers
- Fixed error message text for when
@rbxts/compiler-typesis out of date - Added a diagnostic error for (#1149)
- Fixed using a JSX fragment as a child (#1285)
- Updated
rbxtsc initto use"files"in package.json for packages - Added a default
"globIgnorePaths"setting to default.project.json files forrbxtsc init - Fixed JSX fragment support in the playground environment
- Disallowed usage of unary
-on non-number types (#1288) Array.unorderedRemovenow checks to see if the input is within the array's range.- Added a diagnostic for iterating over
Iterable<T>directly (#1202)
- Compiler will now warn if any input files will result in an output collision (#1254)
- Fixed generator methods not properly compiling (#1243)
- Fixed numeric for loops not creating internal variable after condition check with prerequisite statements (#1250)
- Fixed bugs relating to calling "super" methods (#1266)
- Added
Array<T>.clear()
- Added support for JSX Fragment Shorthand Expressions
<><frame/></> - Fixed iterating over an IterableFunction without destructuring (#1215)
- Fixed
array | undefinedindex not being incremented (#1226) - Fixed wrap return if LuaTuple in optional call (#1227)
- Fixed JSX map expressions replacing children bug
- Add project package.json version into hashing for incremental mode
- Compiler now exits with exit code 1 if there are any error diagnostics (This was a bug from the new diagnostic system)
- Added new roblox-ts VSCode extension to
.vscode/extensions.jsonfile - Improved
rbxtsc initsupport for config flags +-y - Banned macro classes being used in object spreads (#1206)
- Added support for array literals with omitted expressions (#1207)
- Fixed bug with for-statements ending with
continue(#1208)
- Added dynamic import expression support (#1203)
import("./module").then(({ x }) => print(x)); - Fixed bug with transformers + macros introduced in beta.12 (#1204)
- Added checks against variables named
_N(whereNis a number) andTS. These are used internally by the compiler- In the future, we'll add a system that works around this
- Fixed a performance issue for compiling transformers where type checking work was duplicated
- Exposed new VirtualProject APIs for improved playground support
- Fixed unit tests π
- Fixed bug with Promise await rejection errors returning arrays instead of single values
- Fixed destructuring occurs out of order in custom iterator code (#1189)
- Compiler will no longer delete
.gitdirectories inoutDir(useful for diffing emit!) - Simplified logic for creating the returned export table at the bottom of files, which fixed a few bugs
- Updated compiler dependencies (+ TypeScript 4.1.3)
rbxtsc initwill now output error messages for failed commands (#1188)
- Fixed "bad node_modules" Rojo config error for compiling packages
- Fixed bug with transformers + pre-emit checks
- Only reparse transformed SourceFiles (#1177)
- Fixed
Set<T>spread bug rbxtsc initnow uses special npm tags for@rbxts/compiler-typesto grab the right version- Synthetic RojoResolver is now based off of
outDirinstead of the project path (node_modules are done with a separate RojoResolver)
- Fix init command failing to install
@rbxts/compiler-types
- Added support for TypeScript Transformer plugins π (#1169)
- Thanks to fireboltofdeath for implementing this! π
- Added error message for conditional imports (#1168)
- Fixed packages installed while watch mode is running may create broken imports (#1165)
- Added macro for assert, it now uses JS truthiness (
"",0, andNaNwill now fail assertions) - Upgraded roblox-lua-promise to v3.1.0
- Added back
ReadonlyArray.findIndex
- BREAKING CHANGES
- Updated internal Promise implementation to roblox-lua-promise v3.0.1
- Removed static
Promise.spawn(usePromise.deferinstead) - Removed
Promise.isRejected(usePromise.getStatus+Promise.Statusinstead) - Removed
Promise.isResolved(usePromise.getStatus+Promise.Statusinstead) - Removed
Promise.isPending(usePromise.getStatus+Promise.Statusinstead) - Removed
Promise.isCancelled(usePromise.getStatus+Promise.Statusinstead)
- Removed static
- String macros no longer increment inputs and outputs
- Added
--logStringChangesto help catch these issues - The following methods were changed:
string.byte(first argument is no longer incremented)string.find(second argument is no longer incremented)string.sub(first two arguments are no longer incremented)
- Added
- Removed the following API:
Array.copyWithinArray.spliceObjectConstructor.assignObjectConstructor.copyObjectConstructor.deepCopyObjectConstructor.deepEqualsObjectConstructor.entriesObjectConstructor.fromEntriesObjectConstructor.isEmptyObjectConstructor.keysObjectConstructor.valuesReadonlyArray.concatReadonlyArray.copyReadonlyArray.deepCopyReadonlyArray.deepEqualsReadonlyArray.entriesReadonlyArray.findIndexReadonlyArray.lastIndexOfReadonlyArray.reduceRightReadonlyArray.reverseReadonlyArray.sliceReadonlyArray.toStringReadonlyMap.entriesReadonlyMap.keysReadonlyMap.toStringReadonlyMap.valuesReadonlySet.differenceReadonlySet.intersectReadonlySet.isDisjointWithReadonlySet.isSubsetOfReadonlySet.toStringReadonlySet.unionReadonlySet.valuesString.endsWithString.includesString.indexOfString.padEndString.padStartString.sliceString.startsWithString.trimString.trimEndString.trimStart- You can use @rbxts/object-utils to replace
Object.*functions - If there's demand, we can add other packages to replace some of these old APIs.
- Improved method index without call detection (#1146)
- Fixed functions with overload signatures inside namespaces compile incorrectly (#1162)
- Fixed bugs relating to default imports
- Updated internal Promise implementation to roblox-lua-promise v3.0.1
- Improved Rojo support for packages
- Fixed block comment compiling bug (#1147)
- Added --writeOnlyChanged (temporary flag to fix Rojo issues on MacOS)
- Added unit tests for diagnostics
- Fixed numeric loops not retaining loop variable value (#1145)
- Fixed empty
LuaTuple<T>destructure assignment causing invalid Luau emit (#1151) - Fixed JSON module always importing as a "default import" (#1148)
- BREAKING CHANGES
@rbxts/typeshas been broken up into two packages:@rbxts/typesand@rbxts/compiler-types.@rbxts/compiler-typesis versioned based on the compatible compiler version. You should ensure your versions match up. i.e. compiler1.0.0-beta.3should use@rbxts/compiler-types1.0.0-beta.3.x- Version
1.0.410and later will no longer work with previous 1.0.0 betas! - You should update to the latest beta or revert to the legacy compiler if necessary.
- Fix Array.unshift return bug
- Fix missing string methods not being recognized as errors at compile time
- Add support for ReadonlyArray.move (#1138)
- Fix bug with single statement else blocks
- Fix playground filesystem issues
- Added
--usePollingto indicate that watch mode should use polling instead of fs events - Fixed symlinks inside node_modules, allowing pnpm and local packages
- Fixed bug with playground imports
- Fixed LuaTuple array destructuring bug (#1117)
- Updated template default.project.json to have sensible default service properties
- Added support for
declare function identity<T>(value: T): T;, useful for ensuring an expression is a given type! - Referencing call macros without calling them will now error
print(typeOf) - Fixed switch statement rendering bug (#1123)
- Fixed init mode's .vscode formatting settings to include
[typescriptreact] - Fixed destructure spread parameters resulting in bad hoisting (#1127)
- Improved JSX emit (#1114)
- Fixed bug where property access expressions were not evalutated in the correct order (#1126)
- Added support for using call spread operator in property call macros (#1112)
- i.e.
map.set(...x)
- i.e.
- Optimized function array spread parameters (#1128)
- Added support for all array spread expression types (#1108)
- Added support for all call spread expression types (#1107)
- Added support for ForOf loops with
IterableFunction<LuaTuple<T>>without destructure- i.e.
for (const x of "abc".gmatch("%w")) {}
- i.e.
- Fixed getChangedSourceFiles.ts crash (#1134)
- Added support for
--logTruthyChangesflag (#1135) - Added support for warning diagnostics (#1136)
- Added errors for incorrectly using unions with macros (#1113)
- Added support for emitting
table.create()instead of{}where table size is known (#1119) - Fixed package resolution bug for symlinked packages
- Fixed watch mode Windows-style path bug
π The entire compiler has been rewritten to improve speed and stability!
After an almost year long effort and with help from a bunch of contributors, I'm excited to release this first beta for 1.0.0.
This new compiler is still missing some features and emit optimizations, but should be usable for testing. Feel free to file an issue if you run into any bugs.
-
Import erasure is now configurable with the tsconfig.json
"importsNotUsedAsValues"option -
Compilation now supports incremental mode with the following two tsconfig.json options:
"incremental": true,"tsBuildInfoFile": "out/tsconfig.tsbuildinfo",
-
Rojo 6 nested projects are now supported
-
Adds support for null-coalescing operator
??and optional chaining operators?.,?.[x],?.() -
Adds support for compound coalescing assignment expressions:
??= -
Adds support for compound logical assignment expressoins:
&&=and||= -
BREAKING CHANGES FROM 0.3.2
- "isolatedModules" tsconfig.json option can now be omitted.
- Bitwise operators are now backed by bit32 functions and will always return positive values
- Spread operator in function calls must be the last argument
Changes prior to 1.0.0-beta.0 have been removed from this page since the entire compiler was rewritten. To view the legacy change log, click here.