From 71c3526f2344065e36b31be5374f74be97b541e5 Mon Sep 17 00:00:00 2001
From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com>
Date: Thu, 3 Dec 2026 03:44:18 +0200
Subject: [PATCH 1/2] feat(domql): let a watch cross without waiting
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. A watch otherwise
waits while its last change is unacknowledged, and an event crossing
at once could overtake it: focus moved twice, then a key, reached the
host as the first move, the key, then the second move.
A rejection that settles after a watch's refresh or update no longer
suspends the watch, and a refusal quotes a value JSON can't write by
its type, where it failed without a code. The specification opens
1.0.0-preview.3 and the runtime 1.0.0-preview.5. D121 records it.
---
CHANGELOG.md | 10 ++++
README.md | 2 +-
VERSION-HISTORY.md | 18 +++++++
docs/decisions.md | 24 +++++++++
docs/domql-design.md | 8 +--
docs/features-status.md | 9 ++--
nuget/README.md | 2 +-
package-lock.json | 4 +-
package.json | 2 +-
spec/README.md | 4 +-
spec/connections.md | 17 +++---
spec/errors.md | 2 +-
src/Versions.mjs | 4 +-
src/connections/Connection.mjs | 63 ++++++++++++++++------
src/domql.d.ts | 2 +-
tests/connections/Connection.test.js | 81 +++++++++++++++++++++++++++-
16 files changed, 211 insertions(+), 41 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0892662..0e7ec45 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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.
+
+
+## `1.0.0-preview.5`
+
+*Unreleased · 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.
+
## `1.0.0-preview.4`
diff --git a/README.md b/README.md
index 69c13c1..02d5915 100644
--- a/README.md
+++ b/README.md
@@ -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
diff --git a/VERSION-HISTORY.md b/VERSION-HISTORY.md
index cd253db..4ebc8df 100644
--- a/VERSION-HISTORY.md
+++ b/VERSION-HISTORY.md
@@ -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.
+
+
+## `1.0.0-preview.3`
+
+*Unreleased · 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.
+
## `1.0.0-preview.2`
diff --git a/docs/decisions.md b/docs/decisions.md
index ea4fe28..86bc3d5 100644
--- a/docs/decisions.md
+++ b/docs/decisions.md
@@ -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.
+
+
+
+## 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.
diff --git a/docs/domql-design.md b/docs/domql-design.md
index 331e2dd..c2d4b80 100644
--- a/docs/domql-design.md
+++ b/docs/domql-design.md
@@ -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:
@@ -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
@@ -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
diff --git a/docs/features-status.md b/docs/features-status.md
index ccf9e30..5f89843 100644
--- a/docs/features-status.md
+++ b/docs/features-status.md
@@ -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 |
@@ -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) | `1.0.0-preview.4` is released; `1.0.0-preview.5`, on the specification `1.0.0-preview.3`, is unreleased |
| [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.
@@ -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) |
@@ -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.
diff --git a/nuget/README.md b/nuget/README.md
index eb91bc3..d02d39d 100644
--- a/nuget/README.md
+++ b/nuget/README.md
@@ -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
diff --git a/package-lock.json b/package-lock.json
index 2712550..119ae5a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@formaui-net/domql",
- "version": "1.0.0-preview.4",
+ "version": "1.0.0-preview.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@formaui-net/domql",
- "version": "1.0.0-preview.4",
+ "version": "1.0.0-preview.5",
"license": "Apache-2.0",
"dependencies": {
"@formaui-net/nexo": "^1.0.0-preview.4"
diff --git a/package.json b/package.json
index c88d7a6..179eb28 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@formaui-net/domql",
- "version": "1.0.0-preview.4",
+ "version": "1.0.0-preview.5",
"description": "DOMQL is a JavaScript library for querying the DOM, allowing you to read information from a document once or observe it as it changes.",
"license": "Apache-2.0",
"author": "Eyal Alon",
diff --git a/spec/README.md b/spec/README.md
index 8886ea4..facef64 100644
--- a/spec/README.md
+++ b/spec/README.md
@@ -1,4 +1,4 @@
-# DOMQL Specification v1.0.0-preview.2
+# DOMQL Specification v1.0.0-preview.3
DOMQL reads the DOM and shapes what it reads as data, keeps that data current as the document changes, delivers the page's events as data, and carries out the executions its own module and its extensions declare. Its queries are scripts written in [Nexo](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/spec/README.md), whose specification holds two contracts: the language's, what a script means, and the runtime's, how a host binds, resolves and evaluates a script. DOMQL declares the DOM as Nexo's domain, in a module like any other, and is the host that carries each query out against a document. It adds no language rule: a rule of the language or of its runtime is Nexo's, and this specification links to it.
@@ -6,7 +6,7 @@ This specification is the authoritative contract for DOMQL. It states what DOMQL
-**Version.** This specification describes DOMQL's version `1.0.0-preview.2`, which changes as DOMQL's contract does, apart from its runtime's version and from Nexo's language. It describes DOMQL on Nexo's language version `1.0.0-preview.3`, of [definition version 38](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/spec/README.md#version). An implementation says which specification it follows, and which language version its Nexo runtime follows, in `domql.info.versions`, as [the API](api.md#api-entry-points-and-operations) sets out.
+**Version.** This specification describes DOMQL's version `1.0.0-preview.3`, which changes as DOMQL's contract does, apart from its runtime's version and from Nexo's language. It describes DOMQL on Nexo's language version `1.0.0-preview.3`, of [definition version 38](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/spec/README.md#version). An implementation says which specification it follows, and which language version its Nexo runtime follows, in `domql.info.versions`, as [the API](api.md#api-entry-points-and-operations) sets out.
## What it covers
diff --git a/spec/connections.md b/spec/connections.md
index 0fd996b..2b4ea9e 100644
--- a/spec/connections.md
+++ b/spec/connections.md
@@ -47,19 +47,19 @@ In this document:
| Request | Fields | Answer |
| --- | --- | --- |
-| `watch` | `handle`, `owner`, `query`, `bindings`, `options`: `schedule`, `delay`, `reportOn`, `acceptPartialObservation` | `{ snapshot }`; or `{ pending: true }`, the snapshot delivered whole, with `error` where the first evaluation failed |
+| `watch` | `handle`, `owner`, `query`, `bindings`, `waitForAcknowledgment`, `options`: `schedule`, `delay`, `reportOn`, `acceptPartialObservation` | `{ snapshot }`; or `{ pending: true }`, the snapshot delivered whole, with `error` where the first evaluation failed |
| `subscribe` | `handle`, `owner`, `query`, `bindings`, `options`: `throttle`, `reactions` | `{}` |
| `run` | `handle`, `owner`, `query`, `bindings` | `{}` |
| `execute` | `handle`, `owner`, `query`, `bindings` | `{ value }` or `{ pending: true }` |
| `evaluate` | `handle`, `owner`, `query`, `bindings` | `{ value }` or `{ pending: true }`, waiting for maintained members as `evaluateAsync` does |
| `load` | `handle`, `modules` | `{ value: null }` or `{ pending: true }`, as `loadModulesAsync` loads them |
-| `update` | `handle`, `generation`, `bindings`, `options` | A watch watches anew with the new bindings and answers as a `watch` request does. A subscription subscribes anew, and an execution is updated in place, each answering `{}` |
+| `update` | `handle`, `generation`, `bindings`, `options` | A watch watches anew with the new bindings and answers as a `watch` request does, waiting for acknowledgments as its request said. A subscription subscribes anew, and an execution is updated in place, each answering `{}` |
| `refresh` | `handle`, or none for every watch; `generation`; `resample` | `{}`; each watch's snapshot is delivered whole, changed or not |
| `dispose` | `handle` | `{}` |
| `release` | `owner` | `{}`; every handle of the owner ends |
- **Each request fails alone.** A request that fails answers `{ error }`, and starts no handle. The others of its batch are carried out.
-- **Malformed requests.** One that names no request of the table is refused with `DOMQL2023`. A list of requests that is no list rejects the whole call with `DOMQL2023`.
+- **Malformed requests.** One that names no request of the table, or a watch whose `waitForAcknowledgment` is neither true, false nor null, is refused with `DOMQL2023`. A list of requests that is no list rejects the whole call with `DOMQL2023`.
- **Queries cross once.** A request names its query as `{ key, text }`, or `{ key, definition }`, the first time. It may give `types` and `manifest` beside it, as [`domql.query`](queries.md#making-a-query-declared-types) takes them. Every later request names the query by its key alone. A key no earlier request made is refused with `DOMQL2024`. A query whose making was refused is made by no key, so the host sends its text again.
- **Bindings** are the values the transport carried. An element the transport revives, as a .NET element reference becomes the element it names, binds as an element.
- **Reactions** are given in the connection's own form, each `{ query, bindings }`.
@@ -80,19 +80,22 @@ Each delivery names the handle it belongs to:
- **One task, one batch.** The deliveries of one task cross in one call to `deliver`, in the order they happened, across handles.
- **The answers.** `deliver`'s promise answers one answer for each delivery. An event's answer is the host's answer to it. Where the event source declares [`answers`](behaviors.md#behaviors-answers), that answer answers the source. Every other answer is ignored.
-- **A host keeps its copy** of a watch's result by applying each delivery in order, as [keeping a copy of a result](results.md#results-keeping-a-copy) sets out.
+- **A host keeps its copy** of a watch's result by applying each delivery in order, as [keeping a copy of a result](results.md#results-keeping-a-copy) sets out: a watch that waits for no acknowledgment may have deliveries in several batches the host has not acknowledged, which it applies in the order `deliver` was called.
## Pacing
-- **A watch waits for its acknowledgment.** A watch's next delivery waits until `deliver` has settled the batch holding its last one. Whatever arises meanwhile waits, joined:
+- **A watch waits for its acknowledgment,** unless its request sets `waitForAcknowledgment` to false; a null or absent one waits. A watch's next delivery waits until `deliver` has settled the batch holding its last one. Whatever arises meanwhile waits, joined:
- Two change sets join into one, concatenated, unless the snapshot whole is shorter.
- A snapshot whole replaces everything waiting before it.
- A failure keeps its place after what came before it.
+- **Or it waits for none.** Each change of a watch whose request sets `waitForAcknowledgment` to false crosses with the task it happened in, joined to none, as an event does, as [D121](../docs/decisions.md#d121) records:
+ - A host hears its changes in order with the page's events. One that acts on an event by the state the watch keeps, as a press acts on where the focus went, finds every change the watch evaluated before the event, so under the `immediate` schedule the state as it was when the event happened.
+ - It costs a delivery for each change, where a watch that waits joins those that arise while one is unacknowledged.
- **An event never waits.** It crosses with the task it happened in, behind nothing, and is never joined or dropped, so a host hears events in the order the page did, as [D69](../docs/decisions.md#d69) requires. Its acknowledgment settles once the host has applied it: `deliver`'s promise settles the event's acknowledgment in the browser, so an event source that waits for it waits for the host.
-- **A rejected batch.** Where `deliver`'s promise rejects, each event of the batch is rejected in the browser. Each watch of the batch waits until it is refreshed, which delivers its snapshot whole.
-- **A limit.** Where earlier batches have left 4,096 deliveries the host has not acknowledged, the next batch closes the connection, reporting `DOMQL5026` to the window, rather than hold every occurrence for a host that answers none. One task of many deliveries crosses whole.
+- **A rejected batch.** Where `deliver`'s promise rejects, each event of the batch is rejected in the browser. Each watch of the batch waits until it is refreshed, which delivers its snapshot whole, joining what arises meanwhile, whether or not it waits for acknowledgments. A watch that waits for none may have later batches in flight: a host that rejects one of its batches applies none of its deliveries after it until the refresh's snapshot. A rejection that settles after the watch's refresh or update suspends it no more, since the delivery it rejects came before them.
+- **A limit.** Where earlier batches have left 4,096 deliveries the host has not acknowledged, the next batch closes the connection, reporting `DOMQL5026` to the window, rather than hold every occurrence for a host that answers none. Each change of a watch that waits for no acknowledgment counts toward it, as an event does. One task of many deliveries crosses whole.
diff --git a/spec/errors.md b/spec/errors.md
index 3a7d510..694f5d7 100644
--- a/spec/errors.md
+++ b/spec/errors.md
@@ -47,7 +47,7 @@ A caller's use of the API, refused where it is made.
| `DOMQL2020` | A watch's `reportOn` that is no list of paths |
| `DOMQL2021` | A query `domql.prepare` is given that gives `imports` of its own, since DOMQL reads its text with `Domql` supplied |
| `DOMQL2022` | `domql.connect` given a deliver that is no function |
-| `DOMQL2023` | A [connection's](connections.md#connections-requests) request that names no request it carries out, or a list of requests that is no list |
+| `DOMQL2023` | A [connection's](connections.md#connections-requests) request that names no request it carries out, a watch request whose `waitForAcknowledgment` is neither true, false nor null, or a list of requests that is no list |
| `DOMQL2024` | A connection's request naming a query by a key no earlier request made |
| `DOMQL2025` | A connection's request whose handle is no string or number, runs already, or runs no operation of the kind it asks for; or whose owner is no string, number or null |
diff --git a/src/Versions.mjs b/src/Versions.mjs
index a55a55b..97b356b 100644
--- a/src/Versions.mjs
+++ b/src/Versions.mjs
@@ -6,10 +6,10 @@ import { nexo } from '@formaui-net/nexo';
export class Versions {
/** The runtime release version, which the package and the bundle carry. */
- static runtime = '1.0.0-preview.4';
+ static runtime = '1.0.0-preview.5';
/** The DOMQL specification version the implementation follows. */
- static specification = '1.0.0-preview.2';
+ static specification = '1.0.0-preview.3';
/** The language specification version the Nexo runtime DOMQL runs on follows, as that runtime reports it. */
static language = nexo.info.versions.language;
diff --git a/src/connections/Connection.mjs b/src/connections/Connection.mjs
index 8313922..932f014 100644
--- a/src/connections/Connection.mjs
+++ b/src/connections/Connection.mjs
@@ -1,6 +1,6 @@
/**
* Connection — DOMQL's operations carried across a boundary as messages: the requests a host sends in batches, each answered as its batch's task ends, and the deliveries DOMQL sends back, those of one task together,
- * each watch's paced by the acknowledgment of the one before it
+ * each watch's paced by the acknowledgment of the one before it, unless its request waits for no acknowledgment
*/
import { NexoError } from '@formaui-net/nexo';
@@ -104,7 +104,7 @@ export class Connection {
}
if (request === null || typeof request !== 'object' || !REQUESTS.has(request.request)) {
- throw NexoError.structure('DOMQL2023', `A request names what it asks for, as request: 'watch', and this one names ${JSON.stringify(request?.request ?? null)}`, {});
+ throw NexoError.structure('DOMQL2023', `A request names what it asks for, as request: 'watch', and this one names ${Connection.#quote(request?.request ?? null)}`, {});
}
if (STARTING.has(request.request)) {
@@ -172,9 +172,21 @@ export class Connection {
};
}
- /** Starts a watch of live state, whose first snapshot answers the request where the task gave it one, and whose every later change is delivered, paced by the acknowledgment of the one before it. */
+ /**
+ * Starts a watch of live state, whose first snapshot answers the request where the task gave it one, and whose every later change is delivered: paced by the acknowledgment of the one before it, or, where the
+ * request's `waitForAcknowledgment` is false, with the task it happened in, as an event is. A null or absent `waitForAcknowledgment` waits.
+ */
#watch(request) {
- const handle = { id: request.handle, kind: 'watch', owner: this.#ownerOf(request), generation: Connection.#generationOf(request), request, watch: null, isAnswered: false, isWholeNext: false, isSuspended: false, unacknowledged: 0, waiting: [] };
+ const wait = request.waitForAcknowledgment ?? true;
+
+ if (typeof wait !== 'boolean') {
+ throw NexoError.structure('DOMQL2023', `A watch request's waitForAcknowledgment is true, false or null, and this one is ${Connection.#quote(wait)}`, {});
+ }
+
+ const handle = {
+ id: request.handle, kind: 'watch', owner: this.#ownerOf(request), generation: Connection.#generationOf(request), request, watch: null,
+ waitsForAcknowledgment: wait, epoch: 0, isAnswered: false, isWholeNext: false, isSuspended: false, unacknowledged: 0, waiting: [],
+ };
this.#startWatch(handle, request);
this.#handles.set(handle.id, handle);
@@ -216,33 +228,36 @@ export class Connection {
}
if (args.status === 'failed') {
- this.#paced(handle, { error: Connection.#errorOf(args.error) });
+ this.#pace(handle, { error: Connection.#errorOf(args.error) });
return;
}
if (handle.isWholeNext) {
handle.isWholeNext = false;
- this.#paced(handle, { snapshot: args.snapshot });
+ this.#pace(handle, { snapshot: args.snapshot });
return;
}
if (args.changes.length > 0) {
- this.#paced(handle, { changes: args.changes, snapshot: args.snapshot });
+ this.#pace(handle, { changes: args.changes, snapshot: args.snapshot });
}
}
/**
* Sends a watch's delivery where none of its own is unacknowledged, and otherwise keeps it waiting, joined to those waiting already: a change set to the one before it, concatenated, as change sets compose, unless
* the snapshot whole is shorter; a snapshot whole in place of all that waits, which it brings the host's copy past; and a failure after what came before it, in place of a failure waiting last. So the host hears a
- * watch's deliveries in the order they happened, every one it waits for joined in one batch. A watch whose delivery the host rejected waits until it is refreshed.
+ * watch's deliveries in the order they happened, every one it waits for joined in one batch. A watch that waits for no acknowledgment sends each delivery at once, joined to none. A watch whose delivery the host
+ * rejected waits, joining what arises, until it is refreshed.
*/
- #paced(handle, delivery) {
+ #pace(handle, delivery) {
const { waiting } = handle;
const last = waiting.at(-1);
- if (delivery.snapshot !== undefined && delivery.changes === undefined) {
+ if (!handle.waitsForAcknowledgment && !handle.isSuspended) {
+ waiting.push(delivery);
+ } else if (delivery.snapshot !== undefined && delivery.changes === undefined) {
waiting.splice(0, waiting.length, delivery);
} else if (delivery.error !== undefined && last?.error !== undefined) {
waiting[waiting.length - 1] = delivery;
@@ -254,14 +269,18 @@ export class Connection {
waiting.push(delivery);
}
- if (handle.unacknowledged === 0 && !handle.isSuspended) {
+ if ((handle.unacknowledged === 0 || !handle.waitsForAcknowledgment) && !handle.isSuspended) {
this.#sendWaiting(handle);
}
}
- /** Queues every delivery waiting of a watch, in order, each holding its change set, its snapshot or its failure, and the watch's own unacknowledged until the host settles them. */
+ /**
+ * Queues every delivery waiting of a watch, in order, each holding its change set, its snapshot or its failure, and the watch's own unacknowledged until the host settles them. A rejection suspends the watch only
+ * where no refresh or update has come since the delivery was sent, as a host that rejects a batch late may, with a later one of the watch in flight.
+ */
#sendWaiting(handle) {
const deliveries = handle.waiting.splice(0);
+ const { epoch } = handle;
handle.unacknowledged += deliveries.length;
@@ -269,7 +288,10 @@ export class Connection {
const sent = { handle: handle.id, generation: handle.generation, ...(changes !== undefined ? { changes } : error !== undefined ? { error } : { snapshot }) };
this.#enqueue(sent, () => this.#acknowledged(handle), () => {
- handle.isSuspended = true;
+ if (handle.epoch === epoch) {
+ handle.isSuspended = true;
+ }
+
this.#acknowledged(handle);
});
}
@@ -351,6 +373,7 @@ export class Connection {
this.#startWatch(handle, next);
watch.dispose();
+ handle.epoch += 1;
handle.isSuspended = false;
handle.request = next;
handle.generation = Connection.#generationOf(request, handle.generation);
@@ -374,18 +397,19 @@ export class Connection {
}
handle.isWholeNext = true;
+ handle.epoch += 1;
handle.isSuspended = false;
handle.waiting = [];
watch.refreshAsync({ resample: request.resample === true }).then(() => {
// A refresh whose result is unchanged raises no change, so the snapshot it settled on is delivered whole.
if (handle.watch === watch && handle.isWholeNext && watch.status === 'ready') {
handle.isWholeNext = false;
- this.#paced(handle, { snapshot: watch.snapshot });
+ this.#pace(handle, { snapshot: watch.snapshot });
}
}, error => {
// A failed evaluation raises its change, which delivered the failure already; a refresh that failed otherwise delivers its own.
if (handle.watch === watch && !(watch.status === 'failed' && watch.error === error)) {
- this.#paced(handle, { error: Connection.#errorOf(error) });
+ this.#pace(handle, { error: Connection.#errorOf(error) });
}
});
}
@@ -582,6 +606,15 @@ export class Connection {
return source === null || typeof source !== 'object' ? {} : Object.fromEntries(keys.filter(key => Object.hasOwn(source, key)).map(key => [key, source[key]]));
}
+ /** A value as a refusal quotes it: as JSON, or by its type where JSON can't write it, as a BigInt or a cycle. */
+ static #quote(value) {
+ try {
+ return JSON.stringify(value) ?? typeof value;
+ } catch {
+ return `a ${typeof value}`;
+ }
+ }
+
/** A failure as a host reads it: its code, kind, message and location where DOMQL or Nexo made it, its message alone otherwise. */
static #errorOf(error) {
if (error instanceof NexoError) {
diff --git a/src/domql.d.ts b/src/domql.d.ts
index beb1aea..dc60428 100644
--- a/src/domql.d.ts
+++ b/src/domql.d.ts
@@ -785,7 +785,7 @@ interface DomqlHandleRequest {
/** A request a host sends a connection, in a batch. */
export type DomqlConnectionRequest =
| (DomqlHandleRequest & { readonly request: 'evaluate' | 'execute'; readonly query: DomqlConnectionQuery; readonly bindings?: DomqlBindings })
- | (DomqlHandleRequest & { readonly request: 'watch'; readonly query: DomqlConnectionQuery; readonly bindings?: DomqlBindings; readonly options?: { readonly schedule?: 'frame' | 'immediate' | 'delayed'; readonly delay?: number; readonly reportOn?: readonly (readonly DomqlPathItem[])[]; readonly acceptPartialObservation?: boolean } })
+ | (DomqlHandleRequest & { readonly request: 'watch'; readonly query: DomqlConnectionQuery; readonly bindings?: DomqlBindings; readonly waitForAcknowledgment?: boolean | null; readonly options?: { readonly schedule?: 'frame' | 'immediate' | 'delayed'; readonly delay?: number; readonly reportOn?: readonly (readonly DomqlPathItem[])[]; readonly acceptPartialObservation?: boolean } })
| (DomqlHandleRequest & { readonly request: 'subscribe'; readonly query: DomqlConnectionQuery; readonly bindings?: DomqlBindings; readonly options?: { readonly throttle?: number; readonly reactions?: readonly { readonly query: DomqlConnectionQuery; readonly bindings?: DomqlBindings }[] } })
| (DomqlHandleRequest & { readonly request: 'run'; readonly query: DomqlConnectionQuery; readonly bindings?: DomqlBindings })
| (DomqlHandleRequest & { readonly request: 'load'; readonly modules: readonly string[] })
diff --git a/tests/connections/Connection.test.js b/tests/connections/Connection.test.js
index 8f07dd6..735e5e5 100644
--- a/tests/connections/Connection.test.js
+++ b/tests/connections/Connection.test.js
@@ -115,10 +115,17 @@ describe('a connection', () => {
{ request: 'watch', handle: 1, query: 'count', bindings: { panel } },
{ request: 'watch', handle: 7, owner: { name: 'a' }, query: 'count', bindings: { panel } },
{ request: 'watch', handle: 8, query: { key: 'broken', text: 'panel {' } },
+ { request: 'watch', handle: 9, query: 'count', bindings: { panel }, waitForAcknowledgment: 'no' },
+ { request: 'watch', handle: 10, query: 'count', bindings: { panel }, waitForAcknowledgment: 1n },
+ { request: 'watch', handle: 11, query: 'count', bindings: { panel }, waitForAcknowledgment: null },
]);
expect(answers.slice(0, 4)).toEqual([{ snapshot: { count: 1 } }, { snapshot: { count: 1 } }, { value: true }, { value: 1 }]);
- expect(answers.slice(4).map(({ error }) => [error.code, error.kind])).toEqual([['DOMQL2024', 'structure'], ['DOMQL2023', 'structure'], ['DOMQL2025', 'structure'], ['DOMQL2025', 'structure'], ['NEXO1051', 'syntax']]);
+ expect(answers.slice(4, 11).map(({ error }) => [error.code, error.kind])).toEqual([
+ ['DOMQL2024', 'structure'], ['DOMQL2023', 'structure'], ['DOMQL2025', 'structure'], ['DOMQL2025', 'structure'], ['NEXO1051', 'syntax'], ['DOMQL2023', 'structure'], ['DOMQL2023', 'structure'],
+ ]);
+ expect(answers[10].error.message).toContain('a bigint');
+ expect(answers[11]).toEqual({ snapshot: { count: 1 } });
expect(answers[8].error.location).toMatchObject({ line: 1 });
});
@@ -177,6 +184,78 @@ describe('a connection', () => {
expect(await Promise.all([first, second])).toEqual(['one', 'two']);
});
+ it('delivers each change of a watch that waits for no acknowledgment with the task it happened in, joined to none, so the host hears it in order with the events after it, as it can\'t a paced watch\'s', async () => {
+ await host.connection.requestAsync([
+ { request: 'watch', handle: 1, query: count, bindings: { panel }, options: immediately, waitForAcknowledgment: false },
+ { request: 'watch', handle: 2, query: 'count', bindings: { panel }, options: immediately },
+ { request: 'subscribe', handle: 3, owner: 'a', query: { key: 'presses', text: 'import Desk\npanel:presses()' }, bindings: { panel } },
+ ]);
+
+ panel.append(document.createElement('i'));
+ await nextTask();
+ panel.append(document.createElement('u'));
+ await nextTask();
+ presses(1);
+ await nextTask();
+
+ const sent = () => host.batches.map(batch => batch.map(({ handle, event, changes, snapshot }) => [handle, event ?? changes?.[0].value ?? snapshot.count]));
+
+ // The other watch's second change waits for the host to apply its first, so the press crosses before it.
+ expect(sent()).toEqual([[[1, 2], [2, 2]], [[1, 3]], [[3, 1]]]);
+
+ host.settle(0);
+ await nextTask();
+
+ expect(sent().slice(3)).toEqual([[[2, 3]]]);
+
+ // A batch the host rejected leaves the watch waiting, joining what arises, until it is refreshed.
+ host.reject(1, new Error('lost'));
+ await nextTask();
+ panel.append(document.createElement('s'));
+ await nextTask();
+
+ expect(sent().slice(4)).toEqual([]);
+
+ await host.connection.requestAsync([{ request: 'refresh', handle: 1 }]);
+ await nextTask();
+
+ expect(host.batches.slice(4)).toEqual([[{ handle: 1, generation: 0, snapshot: { count: 4 } }]]);
+ });
+
+ it('lets a batch the host rejects after a refresh or an update suspend no watch that waits for no acknowledgment, which an update keeps', async () => {
+ await host.connection.requestAsync([{ request: 'watch', handle: 1, query: count, bindings: { panel }, options: immediately, waitForAcknowledgment: false }]);
+
+ const counts = () => host.batches.map(batch => batch.map(({ generation, changes, snapshot }) => [generation, changes?.[0].value ?? snapshot.count]));
+
+ panel.append(document.createElement('i'));
+ await nextTask();
+ panel.append(document.createElement('u'));
+ await nextTask();
+
+ // The first batch is rejected, the watch refreshed, and only then the second rejected: the refresh resumed the watch, and the late rejection leaves it resumed.
+ host.reject(0, new Error('lost'));
+ await nextTask();
+ await host.connection.requestAsync([{ request: 'refresh', handle: 1 }]);
+ await nextTask();
+ host.reject(1, new Error('lost'));
+ await nextTask();
+ panel.append(document.createElement('s'));
+ await nextTask();
+
+ expect(counts()).toEqual([[[0, 2]], [[0, 3]], [[0, 3]], [[0, 4]]]);
+
+ // An update keeps the watch's waiting, whatever it gives, and a rejection of a batch sent before it suspends nothing.
+ await host.connection.requestAsync([{ request: 'update', handle: 1, generation: 1, bindings: { panel }, options: immediately, waitForAcknowledgment: true }]);
+ host.reject(3, new Error('lost'));
+ await nextTask();
+ panel.append(document.createElement('b'));
+ await nextTask();
+ panel.append(document.createElement('q'));
+ await nextTask();
+
+ expect(counts().slice(4)).toEqual([[[1, 5]], [[1, 6]]]);
+ });
+
it('answers an execution still waiting as its task ends as pending, and delivers its value once it settles', async () => {
const [answer] = await host.connection.requestAsync([{ request: 'execute', handle: 1, query: { key: 'later', text: 'import Desk\npanel:later()' }, bindings: { panel } }]);
From 60913253197838067c04a81d408f4072398ebb5f Mon Sep 17 00:00:00 2001
From: Eyal Alon <3756641+soyeyalon@users.noreply.github.com>
Date: Thu, 3 Dec 2026 03:52:31 +0200
Subject: [PATCH 2/2] chore(domql): release 1.0.0-preview.5
The fifth preview, implementing DOMQL's specification 1.0.0-preview.3
on Nexo's language 1.0.0-preview.3, from Nexo's release
1.0.0-preview.4. It dates the changelog's and the version history's
entries, and is tagged v1.0.0-preview.5, whose release publishes both
packages.
---
CHANGELOG.md | 2 +-
VERSION-HISTORY.md | 2 +-
docs/features-status.md | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0e7ec45..460fd81 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,7 +9,7 @@ Each release of DOMQL's packages, newest first. The npm package `@formaui-net/do
## `1.0.0-preview.5`
-*Unreleased · specification `1.0.0-preview.3` · Nexo language `1.0.0-preview.3` · definition format 38*
+*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.
diff --git a/VERSION-HISTORY.md b/VERSION-HISTORY.md
index 4ebc8df..146a5e2 100644
--- a/VERSION-HISTORY.md
+++ b/VERSION-HISTORY.md
@@ -17,7 +17,7 @@ Each entry says what its version breaks:
## `1.0.0-preview.3`
-*Unreleased · Nexo language `1.0.0-preview.3` · definition format 38*
+*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 }]);
diff --git a/docs/features-status.md b/docs/features-status.md
index 5f89843..28f3683 100644
--- a/docs/features-status.md
+++ b/docs/features-status.md
@@ -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) | `1.0.0-preview.4` is released; `1.0.0-preview.5`, on the specification `1.0.0-preview.3`, is unreleased |
+| [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.
@@ -269,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`.