← All components
Published module

Reflection

The reflection layer gives Tom programs runtime introspection and dynamic invocation, plus analyzer-based extraction of a codebase's API. It is the base technology behind auto-assembling Tom applications at runtime.

5 modules
28.4k loc · 410 tests · 285.3k test LOC
0 released 2 published 2 in works 1 not started

Reflection is the base technology that lets Tom applications assemble themselves at runtime. It provides two complementary capabilities: runtime reflection over Dart objects, and static analysis of source code into a structured API description.

Runtime reflection is delivered by `tom_reflection`, a code-generation-based mirror system that exposes class members, types, and metadata and allows methods and properties to be invoked by name. The reflection data it relies on is produced by `tom_reflection_generator`, which runs as a build_runner builder or a standalone CLI.

A second line analyzes Dart sources directly: `tom_reflector` walks a codebase with the Dart analyzer and emits a structured API snapshot, and `tom_reflector_model` defines the object model and serialization for that result. The serialized `analyzer_analysis.json` is what the website renders to describe each module's API.

Reflectable forks

tom_reflection Published

tom_reflection · v1.0.2
3.0k loc · 0 tests · 0 test LOC
Runtime reflection support for Dart based on code generation, using capabilities to select which operations to support. It exposes class structure and metadata and invokes methods and properties by name.
Published

tom_reflection role: foundation

tom_reflection · v1.0.2

`tom_reflection` provides runtime introspection and dynamic invocation for Dart. Code marked with a reflector annotation can be examined at runtime — its members, types, and metadata — and its methods, constructors, and properties can be called by name. Reflection support is opt-in through capabilities, so a program includes only the operations it needs and keeps generated code small. The mirror data itself is produced ahead of time rather than at runtime; in Tom that generation is handled by `tom_reflection_generator`. It is a fork of the `reflectable` package adapted to the Tom framework. As the base technology for runtime reflection, it underpins the auto-assembly of Tom applications.

LOC
3.0k
Tests
0
Test LOC
0
2 docs · 1 API

tom_reflection_generator Published

tom_reflection_generator · v1.1.1
7.0k loc · 4 tests · 46 test LOC
The standalone generator that produces the `.reflection.dart` files `tom_reflection` consumes. It runs as a build_runner builder or a CLI for one-off and CI builds.
Published

tom_reflection_generator role: extension

tom_reflection_generator · v1.1.1

`tom_reflection_generator` builds the reflection data that `tom_reflection` depends on. It scans annotated Dart sources and emits the `.reflection.dart` files that carry the mirror information for runtime introspection and invocation. It can run two ways: as a `build_runner` builder wired through `build.yaml`, or as a standalone command-line tool for single entry points, recursive directory processing, or CI pipelines. A programmatic API is also exposed for embedding generation in other tools. The package bundles the builder, the build_runner integration, and the CLI that were previously part of the Tom build tooling, so any Dart or Flutter workspace using `tom_reflection` can generate reflection without that heavier dependency.

LOC
7.0k
Tests
4
Test LOC
46
7 docs · 1 API

tom_reflection_test Not started

tom_reflection_test · v1.0.1
82 loc · 215 tests · 61.7k test LOC
Tests for the `tom_reflection` standalone reflection generator.
Not started

tom_reflection_test role: extension

tom_reflection_test · v1.0.1

Tests for the `tom_reflection` standalone reflection generator.

LOC
82
Tests
215
Test LOC
61.7k
2 docs · 1 API
Alternative

tom_reflector In the works

tom_reflector · v1.0.0
14.9k loc · 191 tests · 223.6k test LOC
Analyzer-based code reflection engine for the Tom framework. It walks Dart sources with the Dart analyzer and produces a structured snapshot of a codebase's API.
In the works

tom_reflector role: extension

tom_reflector · v1.0.0

`tom_reflector` analyzes Dart source code and captures a complete, stable description of its API. It uses the Dart analyzer to resolve exports, types, generics, and members, then serializes the result so downstream tools can consume it without re-running the analyzer. It runs as a standalone CLI, a build_runner builder, or a library. Two modes are supported: a barrel-based analysis of all exports, and an entry-point mode with reachability analysis and rich include/exclude filtering by package, annotation, path, type, or element. The serialized output is the `analyzer_analysis.json` the website renders to describe each module's API. The structure is insulated from analyzer and Dart version changes, giving downstream tools a stable API surface to build on.

LOC
14.9k
Tests
191
Test LOC
223.6k
16 docs · 1 API

tom_reflector_model In the works

tom_reflector_model · v1.0.0
3.3k loc · 0 tests · 0 test LOC
The object model and serialization for `tom_reflector`'s code-analysis results. It defines the data structures that represent an analyzed codebase's API and their JSON round-trip.
In the works

tom_reflector_model role: extension

tom_reflector_model · v1.0.0

`tom_reflector_model` defines the data model that `tom_reflector` populates: the classes, types, members, and metadata that represent an analyzed codebase's API. It handles full JSON serialization and deserialization of that model, so analysis results can be written out, stored, and read back without re-running the analyzer. This is the shape of the `analyzer_analysis.json` that downstream tools and the website consume. Keeping the model in its own package lets consumers depend on the structured result and its serialization without pulling in the analyzer engine itself.

LOC
3.3k
Tests
0
Test LOC
0
0 docs · 1 API
License
# License

See each folder/package for its specific license.