@isentinel/roblox-ts
v4.0.12
Published
A TypeScript-to-Luau Compiler for Roblox
Readme
Introduction
roblox-ts is an attempt to bridge the abilities of TypeScript to work in a Roblox environment. We break down your code into an abstract syntax tree and emit functionally similar structures in Luau so that the code behaves the same.
Quick start & Documentation
Ready to dive in? Check out the documentation.
Performance tuning
The compileFiles write phase is async by default. On a fresh build of a
~2.6k-file workspace it drops from ~27s to ~6s on the default libuv pool
(UV_THREADPOOL_SIZE=4) — roughly a 4–5× speedup with no configuration.
For an additional ~3–4× on large workspaces, bump the libuv thread pool
before Node starts. Each pool thread reserves ~1 MiB of stack:
UV_THREADPOOL_SIZE=32 adds ~32 MiB resident, =64 adds ~64 MiB. Returns
diminish past 32. Setting process.env.UV_THREADPOOL_SIZE = "..." from
inside JS has no effect — libuv reads the variable once at process init.
There is no single cross-shell invocation form. Use the one that matches your environment:
// package.json — recommended cross-platform form via `cross-env`
"scripts": {
"build": "cross-env UV_THREADPOOL_SIZE=32 rbxtsc ..."
}# POSIX (bash/zsh): inline assignment
UV_THREADPOOL_SIZE=32 rbxtsc ...REM Windows cmd: set + && chain
set UV_THREADPOOL_SIZE=32&& rbxtsc ...# PowerShell: $env: assignment + statement separator
$env:UV_THREADPOOL_SIZE=32; rbxtsc ...Heads up: the bare POSIX
VAR=value cmdform does not work in Windows cmd —UV_THREADPOOL_SIZE=32 rbxtsc ...silently produces a slower build there. Prefercross-envin scripts that ship across machines.
If you want finer control, RBXTSC_WRITE_CONCURRENCY=N overrides the
helper's drainer count directly (defaults to UV_THREADPOOL_SIZE × 2,
capped at 256). Useful when tuning against a saturated disk or reproducing
a serial baseline (RBXTSC_WRITE_CONCURRENCY=1).
Join the Community!
https://discord.roblox-ts.com
Games that use roblox-ts
