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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ nuget/wwwroot/
# The browser CI installs for the browser tests.
.playwright/

# Work that belongs to a person: experiments, spikes and notes.
.local/
# Work that stays out of the repository: experiments, spikes, notes, scratch and temporary files, and benchmark baselines.
.sandbox/

# npm's logs.
npm-debug.log*
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ 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-4"></a>

## `1.0.0-preview.4`

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

- An element's `layoutSize` answers the size layout gives its border box, along its writing mode's axes, `{ inline, block }`, a transform aside, from the browser's resize observer, null where the element is laid out as no one box or as one of no size, and a watch follows every change of it.
- A watch of an element's `size` is refused unless it accepts partial observation, since a transform changes the box as it is drawn with no observer reporting it. Watch `layoutSize`, or accept partial observation.
- A watch of `autofilled` follows an animation the page's style starts on a field as the browser fills or empties it.
- An event source declaring `answers` is answered: `deliver` fulfils with its first subscription's answer, the handler's return or its promise's value, captured as the declared type, where it fulfilled with undefined.
- Runs on Nexo's language `1.0.0-preview.3`, from Nexo's release `1.0.0-preview.4`, as the [version history](VERSION-HISTORY.md#v1-0-0-preview-2) sets out: a refusal of `root` written where no object expression encloses it, or read other than through its fields, says that a binding named root is read as `~root`. `domql.info.versions.language` reports `1.0.0-preview.3`.
- A continuous execution's start, a subscription's start and a once execution find where their call stands only where a failure names it, so one that fails nowhere reads its query's text no second time: in Node, a query's first run took about 0.47 ms where it took 0.58, and its first once execution about 0.51 ms where it took 0.57.
- DOMQL's module and its registry are created under the manifest Nexo makes of the module, which DOMQL's sources hold, so a start makes none of the checks it records: in Chromium, cold, DOMQL's import took about 33.5 ms where it took 43, and its first resolution and registrations about 2 ms more. DOMQL on a Nexo other than the one it was built against creates its module with every check, as before.
- `domql.connect(deliver)` carries this instance's operations across a boundary as messages: a host's requests in batches, each answered once its task ends, a watch's first snapshot among the answers, and each task's deliveries together, a watch's paced by its acknowledgment and an event behind nothing.
- A host prepares its modules and queries ahead of time: `domql.prepare(modules, { scripts })` answers Nexo's manifest, and `createModule`, `registerModule`, `registerModuleLoader` and `query` take it as `manifest`, sparing the checks it records. In Chromium, cold, a host's first query took about 5.6 ms where it took 11.6, and its module, a subscription and a run about 3.2 ms where they took 5.4.

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

## `1.0.0-preview.3`
Expand Down
16 changes: 9 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Read the documents that govern the affected contract:

| Document | Authority |
| --- | --- |
| [Nexo specification](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.1/spec/README.md) | Nexo's two contracts, at the release DOMQL builds against: the language's, what a query means, and the runtime's, how DOMQL as its host binds, resolves, evaluates and registers modules |
| [Nexo specification](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/spec/README.md) | Nexo's two contracts, at the release DOMQL builds against: the language's, what a query means, and the runtime's, how DOMQL as its host binds, resolves, evaluates and registers modules |
| [DOMQL specification](spec/README.md) | DOMQL's module and DOMQL as host: queries, nodes and shadow trees, the built-in vocabulary, evaluation, watching, results, events, executions, and the public API, one document per subject |
| [Nexo design](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.1/docs/nexo-design.md) | How Nexo is built: its stages, modules, evaluation and tooling |
| [Nexo design](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/docs/nexo-design.md) | How Nexo is built: its stages, modules, evaluation and tooling |
| [DOMQL design](docs/domql-design.md) | How DOMQL is built: its architecture, resolution, sessions, watching, comparing and patching, the C# half, and the decisions not taken |
| [Status](docs/features-status.md) | What is implemented, the migration to Nexo, the planned capabilities, open decisions and deferred work |
| [Decisions](docs/decisions.md) | Each decision taken without stopping to ask, with why and what was declined, for review |
Expand All @@ -32,22 +32,24 @@ Use these sources rather than inventing scope, status or style rules.
| `src/domql.js` | Entry point that composes the library's modules |
| `src/Versions.mjs` | The versions DOMQL reports: its runtime release, the specification it follows, and the language its Nexo runtime follows |
| `src/dom/` | Evaluation, watches, events, executions, observations, sessions and built-in implementations |
| `src/connections/` | A connection: DOMQL's operations carried across a boundary as messages, for a host whose code runs elsewhere |
| `src/snapshots/` | Computing, comparing, dispatching and applying snapshot updates using identity metadata; no DOM access |
| `tests/` | Tests mirroring the source folders |
| `scripts/` | Bundling scripts, and the package's file lists and verification |
| `tests/` | Tests mirroring the source folders, and the change sets' conformance corpus in `tests/_conformance/`, which DOMQL.NET's tests read too |
| `scripts/` | Bundling scripts, the manifest of DOMQL's own module, and the package's file lists and verification |
| `spec/` | The specification, one document per subject, indexed by `spec/README.md` |
| `docs/` | The design, the status overview and the decisions |
| `VERSION-HISTORY.md` | Each DOMQL version and what it changed |
| `CHANGELOG.md` | Each release of the packages and what it changed |
| `nuget/` | The package project, which distributes the bundle, and the library guide |
| `.local/` | Personal experiments, spikes, notes and benchmark baselines; ignored by Git |
| `.sandbox/` | Work that stays out of the repository: experiments, spikes, notes, scratch and temporary files, and benchmark baselines; ignored by Git |

Add a folder when a new responsibility needs one. Keep dependencies in this direction:

- `dom/` may depend on Nexo and `snapshots/`.
- `snapshots/` may depend on Nexo.
- `connections/` may depend on Nexo, and reaches DOMQL through the instance its entry point gives it.

The language is Nexo, the package `@formaui-net/nexo`, which DOMQL imports by its name and installs from npm, at the release `package.json` declares as the lowest it works with and its lock installs, so a change reaches DOMQL only when that version moves to a release that holds it; with `NEXO_SOURCE` naming a checkout, `build.ps1` links that checkout's working tree in the package's place instead. A change to the language is made there, and a change DOMQL needs of it in both repositories together, with `NEXO_SOURCE` set, moving the version once Nexo releases it. Link Nexo's documents at the release's tag, as `https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.1/spec/README.md`, so they move with it; the link test reads them from a checkout of [FormaUI/Nexo](https://github.com/FormaUI/Nexo) beside this one, named `formaui-net.Nexo`.
The language is Nexo, the package `@formaui-net/nexo`, which DOMQL imports by its name and installs from npm, at the release `package.json` declares as the lowest it works with and its lock installs, so a change reaches DOMQL only when that version moves to a release that holds it; with `NEXO_SOURCE` naming a checkout, `build.ps1` links that checkout's working tree in the package's place instead. A change to the language is made there, and a change DOMQL needs of it in both repositories together, with `NEXO_SOURCE` set, moving the version once Nexo releases it. Link Nexo's documents at the release's tag, as `https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/spec/README.md`, so they move with it; the link test reads them from a checkout of [FormaUI/Nexo](https://github.com/FormaUI/Nexo) beside this one, named `formaui-net.Nexo`.

Pass the window and document into DOM code; do not read globals there. Importing the language layer and resolving a query must work without a DOM.

Expand Down Expand Up @@ -100,7 +102,7 @@ Tests mirror `src/` under `tests/`. Layout, geometry and browser-managed state b
| `./build.ps1 -Browser` | Repository root | Gate including browser tests |
| `./build.ps1 -Browser -Full` | Repository root | The full gate: the gate including browser tests, then the NuGet package packed and verified as consumers install it |

Every compiler warning is a build failure. Keep `*.bench.js` and `*.scale.js` beside the corresponding tests, store baselines in `.local/`, and record a measurement that decides something in the design, beside the decision it settles.
Every compiler warning is a build failure. Keep `*.bench.js` and `*.scale.js` beside the corresponding tests, store baselines in `.sandbox/`, and record a measurement that decides something in the design, beside the decision it settles.

## Documentation and versions

Expand Down
13 changes: 8 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You'll need:
- PowerShell to run the build scripts.
- The .NET SDK pinned in `nuget/global.json`.

DOMQL is written in [Nexo](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.1/spec/README.md), which it installs from npm, `@formaui-net/nexo`, at the release `package.json` declares and its lock installs. Its link test reads Nexo's documents at that release's tag from a checkout of [FormaUI/Nexo](https://github.com/FormaUI/Nexo) beside this one, so clone it beside this repository under the name the build looks for:
DOMQL is written in [Nexo](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/spec/README.md), which it installs from npm, `@formaui-net/nexo`, at the release `package.json` declares and its lock installs. Its link test reads Nexo's documents at that release's tag from a checkout of [FormaUI/Nexo](https://github.com/FormaUI/Nexo) beside this one, so clone it beside this repository under the name the build looks for:

```sh
git clone https://github.com/FormaUI/Nexo.git formaui-net.Nexo
Expand All @@ -39,16 +39,18 @@ Run the full build from the repository root:
| Location | Contents |
| --- | --- |
| `src/dom/` | DOM evaluation, observations, watches, events, executions and the dispatch table of host calls |
| `src/connections/` | A connection, which carries DOMQL's operations across a boundary as messages |
| `src/snapshots/` | Snapshot comparison and updates |
| `tests/` | Tests arranged to match the source folders |
| `scripts/` | Bundling scripts |
| `scripts/` | Bundling scripts, and the one that writes the manifest of DOMQL's own module, `npm run manifest` |
| `nuget/` | Package project and library guide |
| `spec/` | The specification, split by subject, with its index |
| `docs/` | The design and the status overview |
| `VERSION-HISTORY.md` | Each DOMQL version and what it changed |
| `CHANGELOG.md` | Each release of the packages and what it changed |
| `.sandbox/` | Your own work that stays out of the repository, which Git ignores: experiments, notes, scratch and temporary files, and benchmark baselines |

The [Nexo specification](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.1/spec/README.md) defines the language and its runtime, and the [DOMQL specification](spec/README.md) the DOM vocabulary, how queries are carried out, and the public API. The [Nexo design](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.1/docs/nexo-design.md) and the [DOMQL design](docs/domql-design.md) set out how each is built. If a change affects either contract, update the relevant document before implementing it. The [status overview](docs/features-status.md) tracks what is implemented, what is being built, and what remains.
The [Nexo specification](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/spec/README.md) defines the language and its runtime, and the [DOMQL specification](spec/README.md) the DOM vocabulary, how queries are carried out, and the public API. The [Nexo design](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/docs/nexo-design.md) and the [DOMQL design](docs/domql-design.md) set out how each is built. If a change affects either contract, update the relevant document before implementing it. The [status overview](docs/features-status.md) tracks what is implemented, what is being built, and what remains.

## Develop a change

Expand Down Expand Up @@ -80,12 +82,13 @@ The simulated DOM does not calculate layout. Run browser tests from the reposito

You can also run `npm run test:browser` from `tests/`, and `npm run test:engines` for the tests run in each engine.

Two details to keep in mind:
Three details to keep in mind:

- **Module registration persists.** A test that registers a module needs its own `domql` instance. Call `vi.resetModules()` and import it afresh so tests remain independent of execution order.
- **DOMQL's own module has a manifest.** After a change to its declarations, run `npm run manifest` from the repository root, which writes `src/dom/ModuleManifest.mjs` again; a test fails until it does.
- **README examples are tested.** When you change an example in the package guide, update its fixture in `tests/_examples/` and the answer `tests/PackageReadme.test.js` expects. The repository README's examples run as they are written.

For performance changes, run `npm run bench` from `tests/` for simulated-DOM benchmarks and `npm run scale` for Chromium workloads: a watch of 1,000 to 100,000 rows, a drag through owned writes, an edit in a large editor, a behavior's deliveries and owners, and transient measurements beside many observers. Name a file to run one workload, as `npm run scale -- dom/OwnedWrites.scale.js`; each reports the machine's load as it ran, its own included, so compare runs made at a low load alone. Compare against a baseline, keep gains that repeat beyond measurement noise, and record a conclusion that decides something in the [design](docs/domql-design.md), beside the decision it settles. Report the memory a change retains apart from what it allocates: a bound can slow a case's allocation and still end growth that outlived disposal, as [D84](docs/decisions.md#d84) did. Benchmarks are separate from the build gate.
For performance changes, run `npm run bench` from `tests/` for simulated-DOM benchmarks and `npm run scale` for Chromium workloads: a watch of 1,000 to 100,000 rows, a drag through owned writes, an edit in a large editor, a behavior's deliveries and owners, and transient measurements beside many observers. Name a file to run one workload, as `npm run scale -- dom/OwnedWrites.scale.js`; each reports the machine's load as it ran, its own included, so compare runs made at a low load alone. Compare against a baseline kept in `.sandbox/`, keep gains that repeat beyond measurement noise, and record a conclusion that decides something in the [design](docs/domql-design.md), beside the decision it settles. Report the memory a change retains apart from what it allocates: a bound can slow a case's allocation and still end growth that outlived disposal, as [D84](docs/decisions.md#d84) did. Benchmarks are separate from the build gate.

<a id="versions-and-releases"></a>

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

**A declarative approach to managing the DOM.**

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.1/spec/README.md).
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.3`, implements DOMQL's specification `1.0.0-preview.1` on Nexo's language `1.0.0-preview.1`, 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.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).

## Features

Expand Down Expand Up @@ -144,7 +144,7 @@ A JavaScript callback gives none of this by itself. A restricted JavaScript API,
| --- | --- |
| [Library guide](nuget/README.md) | Install DOMQL, learn the language by example and use the API |
| [DOMQL specification](spec/README.md) | Queries, the DOM's vocabulary, evaluating and watching a query, its results, events, executions, and the API |
| [Nexo specification](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.1/spec/README.md) | The language DOMQL is written in, and its runtime, at the release DOMQL builds against |
| [Nexo specification](https://github.com/FormaUI/Nexo/blob/v1.0.0-preview.4/spec/README.md) | The language DOMQL is written in, and its runtime, at the release DOMQL builds against |
| [Version history](VERSION-HISTORY.md) | Each version of DOMQL, with the features it added and what it changed |
| [Changelog](CHANGELOG.md) | Each release of the packages and what it changed |
| [Design](docs/domql-design.md) | How DOMQL is built, and the decisions it did not take |
Expand Down
Loading