@flamework-experimental/components
v2.0.0-beta.1
Published
Readme
Flamework
Flamework is an extensible framework for roblox-ts. It is built around modules that are portable, isolated and easy to test.
Documentation
Start with docs/. It holds a twelve-part guide, which starts from a working entry point and builds up to plugins, project layout, scopes and testing. It also holds reference material:
| | | |---|---| | Guide | Getting started, modules, providers, lifecycle events, components, networking, macros, plugins, project structure, migrating from v1, scopes, testing in the place. | | Internals | What the transformer does to your code and what the runtime does with the result. | | Transformer plugins | Adding macro types of your own. |
The guide also ships inside the core package, for the version you installed:
node_modules/@flamework-experimental/core/docs/README.md is its index, and the pages are in
node_modules/@flamework-experimental/core/docs/guide/. Core also ships instructions for a coding
assistant, for the same version: a project's CLAUDE.md loads them with the line
@node_modules/@flamework-experimental/core/docs/ai/flamework.md (see
For a coding assistant).
The Flamework website documents v1, most of which no longer applies:
https://flamework.fireboltofdeath.dev/docs/introduction
Development
This repository is a Bun workspace. It also needs
Lune on PATH to run the runtime specs.
bun install
bun run build # builds every package in dependency order
bun run test # build + transformer tests + runtime specs
bun run lint
bun run test:place # the in-place suite in Roblox Studio (tests/place); needs Studio, Rojo and LunePackages
| Package | Description |
|---|---|
| packages/core | Modules, dependency injection, plugins and lifecycle events |
| packages/components | CollectionService components, built on the core plugin system |
| packages/networking | Remote events and functions |
| packages/testing | Tests that run inside a place: sections, cleanup, a bindable and a remote that run them, and a cloud entry point. Also flamework-test (cli/), the CLI that runs them in Roblox Studio on this machine or through Open Cloud |
| packages/transformer | The roblox-ts transformer |
| packages/transformer-plugin | Public API for writing transformer plugins |
| packages/specs | Runtime specs, built by rbxtsc and run under Lune |
Tests
bun run test runs two suites:
Transformer tests (
bun run test:unit) build a fixture project with the realrbxtscand check the Luau it emits: guard generation, identifiers, nested macros and the plugin system.Runtime specs (
bun run test:runtime) run the built@flamework-experimental/core,componentsandnetworkingpackages under Lune. The harness intests/runtimemodels roblox-ts'sTS.importtree over the filesystem. It also stubs the parts of the Roblox API that Flamework uses: Instances, attributes, CollectionService, RemoteEvents, Players, signals,task,Enum, and aHeartbeatpump so thatPromise.delayruns (and with it, request timeouts). The specs cover dependency injection, modules, hooks and the per-frame lifecycle events; component construction, dependencies and streaming; and both halves of networking: events, functions, middleware and the generated guards.The specs run twice, once as
Serverand once asClient, because some code paths depend on the realm:@Provider's metadata, component streaming, and the client and server halves of networking. Running a realm-specific spec from both sides proves that the two sides agree. For example, from the server a function receives on$nameand sends on@name, and from the client it does the reverse, so the two runs pin down the wire format from both ends.
A third suite runs against the real engine, and bun run test leaves it out. It lives in the
test place, a small game linked to the packages' builds.
bun run test:place runs its @flamework-experimental/testing sections in Roblox Studio, on both
realms, under four Rojo projects (see Testing in Roblox Studio).
