Repository navigation
v3.0.0-beta.2: Opt-in Luau types, sloptor lsp, and import fixes
Pre-release
Pre-release
·
305 commits
to main
since this release
This beta adds sloptor lsp and opt-in Luau type annotations, changes generated Luau for switch, try, and object spreads, and fixes a false sloptor check error and two import bugs.
🚀 Added
- sloptor lsp: Runs a stdio language server that publishes sloptor's transformer diagnostics to editors for unsaved buffers, and hides
TS####type errors unless the client setsinitializationOptions.typeErrors. Previously those diagnostics appeared only insloptor diagnostics. - by @howmanysmall in #177 - rotor.toml [nativeTypes]: Set
nativeTypes = trueinrotor.toml, orrbxts.nativeTypesintsconfig.json(tsconfig wins), to annotate parameters and returns in//!nativefiles, e.g.local function addVector(a: vector, b: vector): vector. Previously that function emitted aslocal function addVector(a, b). - by @howmanysmall in #178 - sloptor build: Pass
--luauTypes, or setluauTypesinrotor.tomlorrbxts.luauTypesintsconfig.json, to emit full type annotations for locals, signatures, classes, enums, and exported aliases. Previously output had no type annotations, and this experimental mode can change between releases. - by @howmanysmall in #179
🐞 Fixed
- sloptor check: No longer reports TS2441 for a top-level
Objectbinding, such asimport Object from "@rbxts/object-utils"in a CommonJS module, whilerequireandexportsbindings still do. Previously that import failedcheckon projects thatrbxtsccompiles cleanly. - by @paradoxuum in #172 - emit: A file that calls a Flamework guard macro and also declares a
@Componentnow importstonce, from the same guard library as the macro. Previously the decorator importedtfrom@flamework/core/out/prelude, so a project with its own@rbxts/tgot twotimports. - by @paradoxuum in #173 - emit: An import used only in a qualified type name, such as
Namespace.Typefrom a.d.tsnamespace, is now elided. Previously theTS.importstayed in the Luau and failed at runtime withFailed to import! Expected ModuleScript, got Folder. - by @paradoxuum in #174
🔧 Changed
- emit: A
switchwith acaseafterdefaultnow selects the first matching case before running any body, sopick("b")returns2instead of0. This diverges fromrbxtsc 3.0.0for those switches; switches with a trailingdefaultare unchanged. - by @christopher-buss in #185 - emit: A
trywhosetryandcatchboth always exit no longer emits the trailingif _exitType thenguard, soreturn unpack(_returns)is emitted directly. Previously the guard was emitted. This diverges fromrbxtsc 3.0.0for thosetrystatements; ones that can complete normally keep the guard. - by @christopher-buss in #183 - emit: Spreading an operand typed
objectinto an object literal or JSX element no longer emits a nil-check guard, so{ ...source }copies without anif. Previously it was guarded, which diverges fromrbxtsc 3.0.0;object | undefinedstays guarded. - by @christopher-buss in #182
New Contributors
- @paradoxuum made their first contribution in #172
Full Changelog: v3.0.0-beta.1...v3.0.0-beta.2