Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ Each release of DOMQL's packages, newest first. The npm package `@formaui-net/do
- **An entry is dated when its release is cut,** and reads *Unreleased* until then. [Cutting a release](CONTRIBUTING.md#cut-a-release) tags its commit, and its packages are published from that tag.
- **A change a caller can notice** is listed in the newest entry while it is unreleased. Once it is released, the change opens the next version's entry, and the sources declare that version in the same commit.

<a id="v1-0-0-preview-5"></a>

## `1.0.0-preview.5`

*December 3, 2026 · specification `1.0.0-preview.3` · Nexo language `1.0.0-preview.3` · definition format 38*

- A connection's watch request that sets `waitForAcknowledgment` to false sends each change with the task it happened in, joined to none, so a host hears it in order with the events after it, where a watch's change otherwise waits while the one before it is unacknowledged. A `waitForAcknowledgment` that is neither true, false nor null is refused with `DOMQL2023`.
- A refusal quotes a value it can't write as JSON, as a BigInt, by its type, where it failed without a code.
- A batch a host rejects after it refreshed or updated a watch no longer suspends the watch, since what it rejects came before them.

<a id="v1-0-0-preview-4"></a>

## `1.0.0-preview.4`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

DOMQL is a JavaScript library for querying the DOM, allowing you to read information from a document once or observe it as it changes. Its queries are written in [Nexo](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/spec/README.md).

> **Preview.** No breaking redesign is planned, and a version that breaks what the one before it allowed says how to migrate. The runtime, `1.0.0-preview.4`, implements DOMQL's specification `1.0.0-preview.2` on Nexo's language `1.0.0-preview.3`, definition version 38. DOMQL declares the DOM as types of its own. It is published to npm and NuGet, as [installing it](#install) sets out, and you can also [build and try it locally](#build-and-try-it). See [the status overview](docs/features-status.md), and [what 1.0 requires](docs/features-status.md#what-1-0-requires).
> **Preview.** No breaking redesign is planned, and a version that breaks what the one before it allowed says how to migrate. The runtime, `1.0.0-preview.5`, implements DOMQL's specification `1.0.0-preview.3` on Nexo's language `1.0.0-preview.3`, definition version 38. DOMQL declares the DOM as types of its own. It is published to npm and NuGet, as [installing it](#install) sets out, and you can also [build and try it locally](#build-and-try-it). See [the status overview](docs/features-status.md), and [what 1.0 requires](docs/features-status.md#what-1-0-requires).

## Features

Expand Down
18 changes: 18 additions & 0 deletions VERSION-HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ Each entry says what its version breaks:
- **From `1.0.0-beta.1` until the first release candidate,** through the betas and the previews, a decision may be replaced where a demonstrated fault, an ambiguous contract or a measured cost justifies it, whether or not Forma has met it, as [D100](docs/decisions.md#d100) records. A version that breaks what the one before it allowed says, beside each break, how a query, a caller or a module migrates.
- **From `1.0.0-rc.1` on,** nothing breaks before 2.0, as [FormaUI Versioning's stages](https://github.com/FormaUI/Versioning/blob/v1.0.0-preview.1/docs/versions.md#stages) promise.

<a id="v1-0-0-preview-3"></a>

## `1.0.0-preview.3`

*December 3, 2026 · Nexo language `1.0.0-preview.3` · definition format 38*

```js
await connection.requestAsync([{ request: 'watch', handle: 1, query: { key: 'focus', text: 'Domql.document.activeElement?.id' }, options: { schedule: 'immediate' }, waitForAcknowledgment: false }]);
// each change crosses with the task it happened in, so the host hears it before a key pressed after it; before, a change waited behind the last one's acknowledgment while the key crossed at once

await connection.requestAsync([{ request: 'watch', handle: 2, query: 'focus', waitForAcknowledgment: 'no' }]); // [{ error: { code: 'DOMQL2023', … } }]; the field unread before
```

**Connections**

- [A watch that waits for no acknowledgment](spec/connections.md#connections-pacing): a watch request that sets `waitForAcknowledgment` to false sends each change with the task it happened in, joined to none, as an event is sent, so a host hears it in order with the page's events. A watch waits as before unless its request says otherwise, an update keeps what its request said, and a `waitForAcknowledgment` that is neither true, false nor null is refused with `DOMQL2023`, as [D121](docs/decisions.md#d121) records.
- A rejection that settles after a watch's refresh or update suspends the watch no more, since the delivery it rejects came before them.

<a id="v1-0-0-preview-2"></a>

## `1.0.0-preview.2`
Expand Down
24 changes: 24 additions & 0 deletions docs/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1889,3 +1889,27 @@ Each entry is one of three kinds:
- DOMQL is a JavaScript library. Its gate, its package and its records had grown a .NET project, a C# test step and a dependency a JavaScript host never uses.
- The .NET half versions apart from DOMQL: a change to its API is no change to DOMQL's contract.
- **Declined:** Moving the connection too. DOMQL would keep no API for a host across a boundary, and DOMQL.NET would reach into DOMQL's internals.

<a id="d121"></a>

## D121 — A watch a host acts on with events can wait for no acknowledgment

*December 3, 2026*

- **Kind:** Contract: a feature Forma's scripts need, as [what 1.0 requires](features-status.md#what-1-0-requires) allows, refining [D118](#d118)'s pacing.
- **Decision:**
- A connection's watch request may set `waitForAcknowledgment` to false. Each change of that watch then crosses with the task it happened in, joined to none, as an event does.
- A watch waits for its acknowledgments unless its request says otherwise, as [D118](#d118) set out; null or absent, it waits. An update keeps what the request said. A `waitForAcknowledgment` that is neither true, false nor null is refused with `DOMQL2023`.
- A batch the host rejects leaves either kind of watch waiting until it is refreshed. Each refresh and update starts an epoch of the watch's, so the rejection of a delivery sent before it, which a watch that waits for none may have in flight, suspends nothing.
- Its deliveries count toward the connection's limit of 4,096 unacknowledged, as events do.
- **Why:**
- A watch's change waits while the one before it is unacknowledged, and an event never waits. So an event could reach the host before a change the page made ahead of it. Focus moved twice, then a key pressed: the host heard the first move, the key, then the second move.
- Forma's design asks that a press or a key act on where the focus went, so its host sends every state of focus in the order it is measured, each as it happens. DOMQL's connection is that host now ([D118](#d118)), so it carries the same order.
- Projecting the focus into each event would serve the events a host subscribes to, not one it hears by another route, as a framework's own click.
- The name says what the option turns off, as `acceptPartialObservation` says what it turns on, and spells acknowledgment out, as the specification does.
- The cost is the host's choice: a delivery for each change, for the watches that need their order.
- **Declined:**
- Every event carrying the changes waiting before it. Every watch would cross with each event of a drag, so pacing would end where a slow host needs it most.
- Waiting for none by default. A watch nothing acts on in order would cost a delivery for each change.
- `paced`, the name first given, which names the specification's section rather than what a host turns off; and `waitForAck`, which abbreviates the term the specification spells out.
- A name for the effect, as `ordered`, which would say nothing of the delivery each change costs.
8 changes: 5 additions & 3 deletions docs/domql-design.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DOMQL Design v1.0.0-preview.2
# DOMQL Design v1.0.0-preview.3

The [DOMQL specification](../spec/README.md) is the contract: DOMQL's module, which declares the DOM as Nexo's domain, and the host that carries queries out against a document. This design sets out how this implementation is built to meet it, and the reasons behind the choices that shape it. It describes DOMQL's version `1.0.0-preview.2` on Nexo's definition version 38, as the specification does, and an outline of the C# half, which waits for its design; [the status overview](features-status.md) says where the implementation still differs. [Nexo's design](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/docs/nexo-design.md), at the release DOMQL builds against, sets out how the language and its runtime are built.
The [DOMQL specification](../spec/README.md) is the contract: DOMQL's module, which declares the DOM as Nexo's domain, and the host that carries queries out against a document. This design sets out how this implementation is built to meet it, and the reasons behind the choices that shape it. It describes DOMQL's version `1.0.0-preview.3` on Nexo's definition version 38, as the specification does, and an outline of the C# half, which waits for its design; [the status overview](features-status.md) says where the implementation still differs. [Nexo's design](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/docs/nexo-design.md), at the release DOMQL builds against, sets out how the language and its runtime are built.

In this document:

Expand Down Expand Up @@ -131,7 +131,7 @@ A host whose code runs elsewhere, as a .NET application's does, reaches DOMQL th

| Part | What it does | Source |
| --- | --- | --- |
| The connection | Carries a host's requests out in batches, answering each once its task ends, and sends the deliveries of each task together, a watch's paced by the acknowledgment of the one before it | `src/connections/Connection.mjs` |
| The connection | Carries a host's requests out in batches, answering each once its task ends, and sends the deliveries of each task together, a watch's paced by the acknowledgment of the one before it unless its request waits for none | `src/connections/Connection.mjs` |
| The conformance corpus | Each case a previous result, a change set and the result they give, which DOMQL's applier passes, and a host's that keeps a copy of a result | `tests/_conformance/change-sets.json` |

### A task's requests and deliveries
Expand All @@ -145,6 +145,8 @@ A host whose code runs elsewhere, as a .NET application's does, reaches DOMQL th

- **A watch in the browser** watches live state, so each change event carries its change set. Its first result answers its request, or is delivered whole.
- **One delivery in flight.** Each later delivery waits for the acknowledgment of the batch holding the one before it. What arises meanwhile is joined: change sets concatenated, since they compose ([D65](decisions.md#d65)), unless the snapshot whole is shorter; a snapshot whole in place of what waits before it; a failure kept in its place.
- **Or none waiting.** A watch whose request sets `waitForAcknowledgment` to false sends each delivery as it is queued, joined to none, so it crosses in order with the events of its task and those after it, as [D121](decisions.md#d121) records. A rejected batch suspends it until a refresh, as it suspends one that waits, and what arises meanwhile is joined.
- **Epochs.** Each refresh and update starts an epoch of the watch's, in which its deliveries are sent, so the rejection of a delivery from an earlier epoch, settling late, suspends nothing.

### Events

Expand Down
11 changes: 6 additions & 5 deletions docs/features-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Current state

**DOMQL is in its preview, `1.0.0-preview.2`. Its vocabulary, queries, watches, events, executions and behaviors are implemented on Nexo's language `1.0.0-preview.3`, definition version 38. The specification describes DOMQL's `1.0.0-preview.2`, which the implementation follows: the DOM declared as DOMQL's own types, read through the `Domql` module every query imports. Every [planned capability](#planned-capabilities) is implemented or declined, the C# half's among them.**
**DOMQL is in its preview, `1.0.0-preview.3`. Its vocabulary, queries, watches, events, executions and behaviors are implemented on Nexo's language `1.0.0-preview.3`, definition version 38. The specification describes DOMQL's `1.0.0-preview.3`, which the implementation follows: the DOM declared as DOMQL's own types, read through the `Domql` module every query imports. Every [planned capability](#planned-capabilities) is implemented or declined, the C# half's among them.**

| Version | Implementation | Specification |
| --- | --- | --- |
| DOMQL specification | `1.0.0-preview.2` | `1.0.0-preview.2` |
| DOMQL specification | `1.0.0-preview.3` | `1.0.0-preview.3` |
| Nexo language | `1.0.0-preview.3` | `1.0.0-preview.3` |
| Definition format | 38 | 38 |

Expand All @@ -24,7 +24,7 @@ The [specification](../spec/README.md) defines the contract, and the [design](do
| --- | --- |
| [The C# half](#the-c-half) | Implemented |
| [Planned capabilities](#planned-capabilities) | Each implemented or declined |
| [Release](#release) | Done: `1.0.0-preview.4`, on the specification `1.0.0-preview.2`, is released |
| [Release](#release) | Done: `1.0.0-preview.5`, on the specification `1.0.0-preview.3`, is released |
| [What 1.0 requires](#what-1-0-requires) | Six requirements, three met |

- **A specification version collects the changes between two releases.** A change to DOMQL's contract joins the [version history](../VERSION-HISTORY.md)'s newest entry while it reads *Unreleased*, and opens the next version's entry once it is released, as [D79](decisions.md#d79) records.
Expand Down Expand Up @@ -134,6 +134,7 @@ Each feature, the contract that states it, its state in the implementation, and
| The beta, its promise and the changelog | [Version history](../VERSION-HISTORY.md#v1-0-0-beta-1), [changelog](../CHANGELOG.md) | Implemented, as [D75](decisions.md#d75) records | [`beta.1`](../VERSION-HISTORY.md#v1-0-0-beta-1) |
| The preview, the beta's promise under FormaUI Versioning's name for it | [Stages](https://github.com/FormaUI/Versioning/blob/v1.0.0-preview.1/docs/versions.md#stages) | Implemented, as [D106](decisions.md#d106) records | [`preview.1`](../VERSION-HISTORY.md#v1-0-0-preview-1) |
| A connection, carrying DOMQL's operations across a boundary as messages, which [DOMQL.NET](https://github.com/FormaUI/DOMQL.NET) hosts for .NET applications | [Connections](../spec/connections.md) | Implemented, as [D118](decisions.md#d118) records | [`preview.2`](../VERSION-HISTORY.md#v1-0-0-preview-2) |
| A watch that waits for no acknowledgment, each change crossing in order with the page's events | [Pacing](../spec/connections.md#connections-pacing) | Implemented, as [D121](decisions.md#d121) records | [`preview.3`](../VERSION-HISTORY.md#v1-0-0-preview-3) |

<a id="migration-to-nexo"></a>
<a id="implementation-plan"></a>
Expand All @@ -158,7 +159,7 @@ Contracts: [Queries](../spec/queries.md), [types](../spec/vocabulary.md#vocabula

**Implemented.** [D118](decisions.md#d118) records the connection, in place of the outline [D46](decisions.md#d46) waited with, and [D120](decisions.md#d120) the .NET half's move to a project of its own.

- **A connection,** `domql.connect`, carries a host's requests in batches, answered as their task ends, and sends each task's deliveries together, a watch's paced by its acknowledgment and an event behind nothing.
- **A connection,** `domql.connect`, carries a host's requests in batches, answered as their task ends, and sends each task's deliveries together, a watch's paced by its acknowledgment and an event behind nothing. A watch whose request sets `waitForAcknowledgment` to false crosses each change as it happens, in order with the events after it ([D121](decisions.md#d121)).
- **[DOMQL.NET](https://github.com/FormaUI/DOMQL.NET)** is DOMQL's host of one for .NET applications, with its own specification, status and records.
- **One way of applying:** the conformance corpus, `tests/_conformance/change-sets.json`, which DOMQL's JavaScript applier passes, and DOMQL.NET's tests read and pass.

Expand Down Expand Up @@ -268,7 +269,7 @@ None remains: T1 to T3 are implemented, as [the features](#the-host) show: an im

DOMQL releases as [cutting a release](../CONTRIBUTING.md#cut-a-release) sets out, by FormaUI Versioning's path, as [D107](decisions.md#d107) records. Its first release, `1.0.0-preview.1`, is released, tagged `v1.0.0-preview.1`, and `release.yml` publishes its NuGet package, with Nexo inside its bundle, to nuget.org through trusted publishing. nuget.org's policy names `FormaUI/DOMQL`, `release.yml` and the `release` environment.

Its second, `1.0.0-preview.2`, is released, tagged `v1.0.0-preview.2`, and `release.yml` publishes its npm package beside the NuGet package, as [D110](decisions.md#d110) records. npm's trusted publisher names the same repository, workflow and environment, and allows `npm publish`. A deprecated placeholder, `@formaui-net/domql@0.0.0`, holds npm's `latest` dist-tag until 1.0, as Nexo's does, since npm takes a trusted publisher only for a package it holds. Its third, `1.0.0-preview.3`, whose npm package changes only the README it carries, is released, tagged `v1.0.0-preview.3`, and published the same way, and so is its fourth, `1.0.0-preview.4`, on the specification `1.0.0-preview.2` and Nexo's `1.0.0-preview.4`.
Its second, `1.0.0-preview.2`, is released, tagged `v1.0.0-preview.2`, and `release.yml` publishes its npm package beside the NuGet package, as [D110](decisions.md#d110) records. npm's trusted publisher names the same repository, workflow and environment, and allows `npm publish`. A deprecated placeholder, `@formaui-net/domql@0.0.0`, holds npm's `latest` dist-tag until 1.0, as Nexo's does, since npm takes a trusted publisher only for a package it holds. Its third, `1.0.0-preview.3`, whose npm package changes only the README it carries, is released, tagged `v1.0.0-preview.3`, and published the same way, and so are its fourth, `1.0.0-preview.4`, on the specification `1.0.0-preview.2` and Nexo's `1.0.0-preview.4`, and its fifth, `1.0.0-preview.5`, on the specification `1.0.0-preview.3`.

<a id="consuming-lexica"></a>
<a id="consuming-nexo"></a>
Expand Down
2 changes: 1 addition & 1 deletion nuget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

DOMQL is a JavaScript library for querying the DOM, allowing you to read information from a document once or observe it as it changes. This guide takes you from your first query to watching results, handling events and extending the library. Its queries are written in [Nexo](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/spec/README.md).

> **Preview:** no breaking redesign is planned, and a version that breaks what the one before it allowed says how to migrate. `formaui-net.DOMQL` is published to NuGet as a pre-release, which you [install by name](#install-and-load). The package distributes a JavaScript ES module; the API in this guide runs in JavaScript. Every example here runs on this preview. The runtime, `1.0.0-preview.4`, implements DOMQL's specification `1.0.0-preview.2` on Nexo's language `1.0.0-preview.3`, definition version 38. [The status overview](https://github.com/FormaUI/DOMQL/blob/main/docs/features-status.md) says what is implemented and what is being built.
> **Preview:** no breaking redesign is planned, and a version that breaks what the one before it allowed says how to migrate. `formaui-net.DOMQL` is published to NuGet as a pre-release, which you [install by name](#install-and-load). The package distributes a JavaScript ES module; the API in this guide runs in JavaScript. Every example here runs on this preview. The runtime, `1.0.0-preview.5`, implements DOMQL's specification `1.0.0-preview.3` on Nexo's language `1.0.0-preview.3`, definition version 38. [The status overview](https://github.com/FormaUI/DOMQL/blob/main/docs/features-status.md) says what is implemented and what is being built.

## In this guide

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading