DOMQL.NET runs DOMQL queries from a .NET application. It watches the DOM, subscribes to its events and carries out executions in the browser, and keeps a typed copy of each result in .NET. It is published by FormaUI, beside DOMQL and Forma.
Preview. DOMQL.NET's first preview,
1.0.0-preview.1, is published to NuGet. It runs over DOMQL's connection, and its package depends on DOMQL's release1.0.0-preview.5. See the status.
builder.Services.AddDomql();public sealed record PanelState(double? Width, bool HasFocus);
static readonly DomqlQuery<PanelState> Panel = DomqlQuery.Create<PanelState>("panel { width = it.layoutSize?.inline, hasFocus = it.focusWithin }");
DomqlOwner owner = connection.CreateOwner();
DomqlWatch<PanelState> watch = owner.Watch(Panel, new Dictionary<string, object?> { ["panel"] = panelElement }, state => RenderAsync(state));
PanelState first = await watch.ReadyAsync(); // Arrives with the watch's own request.
await owner.DisposeAsync(); // Ends every operation the owner started, in one call.- One call for one turn. Every operation your code starts before it yields crosses to the browser in one call, and its answer brings back each watch's first result.
- A watch keeps a copy. Each change arrives as a change set, applied to the watch's copy before the browser sends the next.
- Events arrive as they happen, and a subscription's handler can answer one.
dotnet add package formaui-net.DOMQL.NET --prereleaseIt brings DOMQL's package, formaui-net.DOMQL, whose bundle it serves beside its own browser module. A page needs no script of its own: AddDomql registers the connection, and its first request imports the module.
| Document | What it holds |
|---|---|
| Specification | DOMQL.NET's API: its connection, queries and their types, owners, watches, subscriptions, executions, crossings and failures |
| Design | How DOMQL.NET is built |
| Status | What is implemented, and what remains |
| Decisions | Each decision, with why and what was declined |
| Changelog | Each release of the package |
| Contributing | Building and testing DOMQL.NET |
DOMQL.NET builds and tests against a DOMQL checkout beside it, as contributing sets out:
git clone https://github.com/FormaUI/DOMQL.git formaui-net.DOMQL
git clone https://github.com/FormaUI/DOMQL.NET.git formaui-net.DOMQL.NET
cd formaui-net.DOMQL.NET
./build.ps1