compileAppDeclarations function
Compiles only declaration-level DSL constructs into FFProject.
This currently covers:
- enums
- data structs
- app state
- app constants
- API groups and endpoints
Components, pages, widget trees, and action wiring are intentionally left for later compiler passes.
Implementation
DslDeclarationCompileResult compileAppDeclarations(
App app, {
FFProject? project,
}) {
final compiler = _DeclarationCompiler(project ?? FFProject());
compiler.compile(app);
return DslDeclarationCompileResult(
project: compiler.project,
enumIdentifiers: Map.unmodifiable(compiler.enumIdentifiers),
structIdentifiers: Map.unmodifiable(compiler.structIdentifiers),
collectionIdentifiers: Map.unmodifiable(compiler.collectionIdentifiers),
tableIdentifiers: Map.unmodifiable(compiler.tableIdentifiers),
appStateIdentifiers: Map.unmodifiable(compiler.appStateIdentifiers),
constantIdentifiers: Map.unmodifiable(compiler.constantIdentifiers),
customFunctionIdentifiers: Map.unmodifiable(
compiler.customFunctionIdentifiers,
),
apiGroupIdentifiers: Map.unmodifiable(compiler.apiGroupIdentifiers),
collectionFieldIdentifiers: Map.unmodifiable(
compiler.collectionFieldIdentifiers.map(
(key, value) =>
MapEntry(key, Map<String, FFIdentifier>.unmodifiable(value)),
),
),
tableFieldIdentifiers: Map.unmodifiable(
compiler.tableFieldIdentifiers.map(
(key, value) =>
MapEntry(key, Map<String, FFIdentifier>.unmodifiable(value)),
),
),
);
}