@shapeshift-labs/frontier-lang-swiftui
v0.1.1
Published
SwiftUI projection adapter for Frontier Lang view graphs.
Maintainers
Readme
@shapeshift-labs/frontier-lang-swiftui
SwiftUI projection adapter for Frontier Lang view graphs.
This package lowers runtime-neutral Frontier view nodes into deterministic SwiftUI source. It is a projection surface, not a claim that arbitrary React, DOM, or CSS has already become SwiftUI. The result carries source-map and loss evidence so downstream merge admission can fail closed when a view feature is not represented.
Usage
import { emitSwiftUi, projectSwiftUi } from '@shapeshift-labs/frontier-lang-swiftui';
const projection = projectSwiftUi(document, {
sourcePath: 'todo.frontier',
targetPath: 'TodoViews.swift'
});
console.log(projection.output);
console.log(emitSwiftUi(document));Supported first-slice render nodes include Button, Text, Label, VStack, and HStack. Unknown render nodes are emitted as fallback Text nodes and recorded as projection losses.
Use renderSwiftUiAstWithSourceMap(ast, options) when the caller already has a
SwiftUI AST and needs compiler-compatible generated-source evidence. The source
map is declaration-level evidence for Frontier view nodes; it is not a claim of
SwiftUI runtime, layout, focus, accessibility, or event equivalence.
