= List.empty()
): DeprecatedElements {
return new DeprecatedElements(message, List.from(errors));
}
diff --git a/packages/alfa-rules/test/sia-r70/rule.spec.tsx b/packages/alfa-rules/test/sia-r70/rule.spec.tsx
index eebac5253d..cf5075bb76 100644
--- a/packages/alfa-rules/test/sia-r70/rule.spec.tsx
+++ b/packages/alfa-rules/test/sia-r70/rule.spec.tsx
@@ -22,7 +22,7 @@ test("evaluate() passes a page with no deprecated / obsolete elements ", async (
]);
});
-test("evaluate() passes a page with deprecated non visible element not into accessibility tree", async (t) => {
+test("evaluate() passes a page with a deprecated but not rendered element", async (t) => {
const target = (
@@ -40,7 +40,7 @@ test("evaluate() passes a page with deprecated non visible element not into acce
]);
});
-test("evaluate() fails a page with deprecated visible element in accessibility tree", async (t) => {
+test("evaluate() fails a page with deprecated and rendered element", async (t) => {
const blink = not ;
const target = (
@@ -95,7 +95,7 @@ test("evaluate() fails a page with two deprecated elements in the accessibility
]);
});
-test("evaluate() is inapplicable to text nodes in disabled groups", async (t) => {
+test("evaluate() is inapplicable to non-HTML documents", async (t) => {
const document = h.document([
This is a circle
From d0929e90cda7d575cccfd4f52f523eb0a2438d07 Mon Sep 17 00:00:00 2001
From: elenamongelli <52746406+elenamongelli@users.noreply.github.com>
Date: Mon, 5 Jul 2021 15:21:22 +0200
Subject: [PATCH 06/11] Comments implemented
---
packages/alfa-rules/src/sia-r70/rule.ts | 13 ++++++-------
packages/alfa-rules/test/sia-r70/rule.spec.tsx | 10 +++++-----
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/packages/alfa-rules/src/sia-r70/rule.ts b/packages/alfa-rules/src/sia-r70/rule.ts
index db03b0f2c4..b508aff583 100644
--- a/packages/alfa-rules/src/sia-r70/rule.ts
+++ b/packages/alfa-rules/src/sia-r70/rule.ts
@@ -8,7 +8,6 @@ import { Iterable } from "@siteimprove/alfa-iterable";
import { expectation } from "../common/expectation";
import { hasChild, isRendered, isDocumentElement } from "../common/predicate";
-import { Group } from "../common/group";
const { isElement, hasName, hasNamespace } = Element;
const { and, test } = Predicate;
@@ -66,8 +65,8 @@ export default Rule.Atomic.of({
return {
1: expectation(
deprecatedElements.isEmpty(),
- () => Outcomes.IsNotDeprecated,
- () => Outcomes.IsDeprecated(deprecatedElements)
+ () => Outcomes.HasNoDeprecatedElement,
+ () => Outcomes.HasDeprecatedElements(deprecatedElements)
),
};
},
@@ -76,11 +75,11 @@ export default Rule.Atomic.of({
});
export namespace Outcomes {
- export const IsNotDeprecated = Ok.of(
- Diagnostic.of(`The document doesn't contain deprecated elements`)
+ export const HasNoDeprecatedElement = Ok.of(
+ Diagnostic.of(`The document doesn't contain any deprecated element`)
);
- export const IsDeprecated = (errors: Iterable) =>
+ export const HasDeprecatedElements = (errors: Iterable) =>
Err.of(
DeprecatedElements.of(
`The document contains deprecated elements: `,
@@ -133,7 +132,7 @@ namespace DeprecatedElements {
errors: List.JSON;
}
- export function areDeprecatedElements(
+ export function isDeprecatedElements(
value: unknown
): value is DeprecatedElements {
return value instanceof DeprecatedElements;
diff --git a/packages/alfa-rules/test/sia-r70/rule.spec.tsx b/packages/alfa-rules/test/sia-r70/rule.spec.tsx
index cf5075bb76..f4b85098cc 100644
--- a/packages/alfa-rules/test/sia-r70/rule.spec.tsx
+++ b/packages/alfa-rules/test/sia-r70/rule.spec.tsx
@@ -17,7 +17,7 @@ test("evaluate() passes a page with no deprecated / obsolete elements ", async (
t.deepEqual(await evaluate(R70, { document }), [
passed(R70, document, {
- 1: Outcomes.IsNotDeprecated,
+ 1: Outcomes.HasNoDeprecatedElement,
}),
]);
});
@@ -35,7 +35,7 @@ test("evaluate() passes a page with a deprecated but not rendered element", asyn
t.deepEqual(await evaluate(R70, { document }), [
passed(R70, document, {
- 1: Outcomes.IsNotDeprecated,
+ 1: Outcomes.HasNoDeprecatedElement,
}),
]);
});
@@ -52,7 +52,7 @@ test("evaluate() fails a page with deprecated and rendered element", async (t) =
t.deepEqual(await evaluate(R70, { document }), [
failed(R70, document, {
- 1: Outcomes.IsDeprecated([blink]),
+ 1: Outcomes.HasDeprecatedElements([blink]),
}),
]);
});
@@ -69,7 +69,7 @@ test("evaluate() fails a page with deprecated visible element", async (t) => {
t.deepEqual(await evaluate(R70, { document }), [
failed(R70, document, {
- 1: Outcomes.IsDeprecated([blink]),
+ 1: Outcomes.HasDeprecatedElements([blink]),
}),
]);
});
@@ -90,7 +90,7 @@ test("evaluate() fails a page with two deprecated elements in the accessibility
t.deepEqual(await evaluate(R70, { document }), [
failed(R70, document, {
- 1: Outcomes.IsDeprecated([menuitem1, menuitem2]),
+ 1: Outcomes.HasDeprecatedElements([menuitem1, menuitem2]),
}),
]);
});
From 29aa4b48f7cf0d52b4c155cb6c5cb5e9d676fb27 Mon Sep 17 00:00:00 2001
From: elenamongelli <52746406+elenamongelli@users.noreply.github.com>
Date: Mon, 5 Jul 2021 15:26:58 +0200
Subject: [PATCH 07/11] Forgot exports
---
packages/alfa-rules/src/rules.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/packages/alfa-rules/src/rules.ts b/packages/alfa-rules/src/rules.ts
index e2a7de2cfa..a0f6b9702b 100644
--- a/packages/alfa-rules/src/rules.ts
+++ b/packages/alfa-rules/src/rules.ts
@@ -63,6 +63,7 @@ export { default as R66 } from "./sia-r66/rule";
export { default as R67 } from "./sia-r67/rule";
export { default as R68 } from "./sia-r68/rule";
export { default as R69 } from "./sia-r69/rule";
+export { default as R70 } from "./sia-r70/rule";
export { default as R71 } from "./sia-r71/rule";
export { default as R72 } from "./sia-r72/rule";
export { default as R73 } from "./sia-r73/rule";
From 3a757c683427f26c35dd6c1432ad508517bdaaf3 Mon Sep 17 00:00:00 2001
From: elenamongelli <52746406+elenamongelli@users.noreply.github.com>
Date: Thu, 8 Jul 2021 12:28:04 +0200
Subject: [PATCH 08/11] Comments implemented
---
packages/alfa-rules/src/sia-r70/rule.ts | 36 ++++++++++++-------------
1 file changed, 17 insertions(+), 19 deletions(-)
diff --git a/packages/alfa-rules/src/sia-r70/rule.ts b/packages/alfa-rules/src/sia-r70/rule.ts
index b508aff583..014af5f632 100644
--- a/packages/alfa-rules/src/sia-r70/rule.ts
+++ b/packages/alfa-rules/src/sia-r70/rule.ts
@@ -5,6 +5,7 @@ import { Err, Ok } from "@siteimprove/alfa-result";
import { Page } from "@siteimprove/alfa-web";
import { List } from "@siteimprove/alfa-list";
import { Iterable } from "@siteimprove/alfa-iterable";
+import { Array } from "@siteimprove/alfa-array";
import { expectation } from "../common/expectation";
import { hasChild, isRendered, isDocumentElement } from "../common/predicate";
@@ -12,7 +13,8 @@ import { hasChild, isRendered, isDocumentElement } from "../common/predicate";
const { isElement, hasName, hasNamespace } = Element;
const { and, test } = Predicate;
-const deprecated = [
+const isDeprecated = hasName(
+ "acronym",
"applet",
"basefont",
"bgsound",
@@ -39,8 +41,8 @@ const deprecated = [
"spacer",
"strike",
"tt",
- "xmp",
-];
+ "xmp"
+);
export default Rule.Atomic.of({
uri: "https://alfa.siteimprove.com/rules/sia-r70",
@@ -55,11 +57,7 @@ export default Rule.Atomic.of({
.descendants({ flattened: true, nested: true })
.filter(isElement)
.filter(
- and(
- hasNamespace(Namespace.HTML),
- hasName("acronym", ...deprecated),
- isRendered(device)
- )
+ and(hasNamespace(Namespace.HTML), isDeprecated, isRendered(device))
);
return {
@@ -91,14 +89,12 @@ export namespace Outcomes {
class DeprecatedElements extends Diagnostic implements Iterable {
public static of(
message: string,
- errors: Iterable = List.empty()
+ errors: Iterable = []
): DeprecatedElements {
- return new DeprecatedElements(message, List.from(errors));
+ return new DeprecatedElements(message, Array.from(errors));
}
- private readonly _errors: List;
-
- private constructor(message: string, errors: List) {
+ private constructor(message: string, errors: Array) {
super(message);
this._errors = errors;
}
@@ -107,24 +103,26 @@ class DeprecatedElements extends Diagnostic implements Iterable {
yield* this._errors;
}
- public equals(value: DeprecatedElements): boolean;
-
- public equals(value: unknown): value is this;
+ private _errors: ReadonlyArray;
- public equals(value: unknown): boolean {
+ public equalsError(value: unknown, errors: ReadonlyArray): boolean {
return (
value instanceof DeprecatedElements &&
value._message === this._message &&
- value._errors.equals(this._errors)
+ Array.equals(value._errors, this._errors)
);
}
public toJSON(): DeprecatedElements.JSON {
return {
...super.toJSON(),
- errors: this._errors.toJSON(),
+ errors: Array.toJSON(this._errors),
};
}
+
+ public get errors(): ReadonlyArray {
+ return this._errors;
+ }
}
namespace DeprecatedElements {
From 06bd3978d4a2f173201be5e40acd42c4a5183ad8 Mon Sep 17 00:00:00 2001
From: elenamongelli <52746406+elenamongelli@users.noreply.github.com>
Date: Fri, 16 Jul 2021 11:23:11 +0200
Subject: [PATCH 09/11] Apply suggestions from code review
Co-authored-by: Kasper Isager
---
packages/alfa-rules/src/sia-r70/rule.ts | 26 ++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/packages/alfa-rules/src/sia-r70/rule.ts b/packages/alfa-rules/src/sia-r70/rule.ts
index 014af5f632..f5bef71514 100644
--- a/packages/alfa-rules/src/sia-r70/rule.ts
+++ b/packages/alfa-rules/src/sia-r70/rule.ts
@@ -93,41 +93,45 @@ class DeprecatedElements extends Diagnostic implements Iterable {
): DeprecatedElements {
return new DeprecatedElements(message, Array.from(errors));
}
+
+ private _errors: ReadonlyArray;
private constructor(message: string, errors: Array) {
super(message);
this._errors = errors;
}
-
- public *[Symbol.iterator](): Iterator {
- yield* this._errors;
+
+ public get errors(): ReadonlyArray {
+ return this._errors;
}
- private _errors: ReadonlyArray;
+ public equals(value: DeprecatedElements): boolean;
+
+ public equals(value: unknown): value is this;
- public equalsError(value: unknown, errors: ReadonlyArray): boolean {
+ public equals(value: unknown): boolean {
return (
value instanceof DeprecatedElements &&
value._message === this._message &&
Array.equals(value._errors, this._errors)
);
}
+
+ public *[Symbol.iterator](): Iterator {
+ yield* this._errors;
+ }
public toJSON(): DeprecatedElements.JSON {
return {
...super.toJSON(),
- errors: Array.toJSON(this._errors),
+ errors: this._errors.map((element) => element.path()),
};
}
-
- public get errors(): ReadonlyArray {
- return this._errors;
- }
}
namespace DeprecatedElements {
export interface JSON extends Diagnostic.JSON {
- errors: List.JSON;
+ errors: Array;
}
export function isDeprecatedElements(
From 11fc48b017e3f3da6c491cf45f29cef90fc9f81e Mon Sep 17 00:00:00 2001
From: elenamongelli <52746406+elenamongelli@users.noreply.github.com>
Date: Fri, 16 Jul 2021 16:22:54 +0200
Subject: [PATCH 10/11] Ran yarn document
---
.github/workflows/integrate.yml | 2 +
.github/workflows/release.yml | 2 +-
CHANGELOG.md | 18 -
docs/api.md | 56 +-
docs/releasing.md | 2 +-
docs/review/api/alfa-act.api.md | 14 +-
docs/review/api/alfa-applicative.api.md | 6 +-
docs/review/api/alfa-array.api.md | 8 +-
docs/review/api/alfa-branched.api.md | 9 +-
docs/review/api/alfa-collection.api.md | 31 +-
docs/review/api/alfa-comparable.api.md | 23 +-
docs/review/api/alfa-css.api.md | 118 +-
docs/review/api/alfa-dom.api.md | 17 +-
docs/review/api/alfa-either.api.md | 36 +-
docs/review/api/alfa-equatable.api.md | 5 +-
docs/review/api/alfa-future.api.md | 5 +-
docs/review/api/alfa-iterable.api.md | 10 +-
docs/review/api/alfa-lazy.api.md | 10 +-
docs/review/api/alfa-list.api.md | 19 +-
docs/review/api/alfa-map.api.md | 39 +-
docs/review/api/alfa-monad.api.md | 11 +-
docs/review/api/alfa-option.api.md | 21 +-
docs/review/api/alfa-result.api.md | 31 +-
docs/review/api/alfa-rules.api.md | 17 +-
docs/review/api/alfa-selective.api.md | 12 +-
docs/review/api/alfa-sequence.api.md | 31 +-
docs/review/api/alfa-set.api.md | 6 +-
docs/review/api/alfa-slice.api.md | 14 +-
docs/review/api/alfa-style.api.md | 7 +-
docs/review/api/alfa-trampoline.api.md | 5 +-
package.json | 4 +-
packages/alfa-act/package.json | 39 +-
packages/alfa-act/src/question.ts | 20 +-
packages/alfa-act/tsconfig.json | 3 -
packages/alfa-affine/package.json | 12 +-
packages/alfa-angular/package.json | 14 +-
packages/alfa-applicative/package.json | 7 +-
packages/alfa-applicative/src/applicative.ts | 4 +-
packages/alfa-applicative/tsconfig.json | 3 -
packages/alfa-aria/package.json | 48 +-
packages/alfa-aria/src/feature.ts | 47 +-
packages/alfa-aria/src/name.ts | 5 +-
packages/alfa-aria/test/name.spec.tsx | 143 --
packages/alfa-aria/test/node.spec.tsx | 76 +-
packages/alfa-array/package.json | 28 +-
packages/alfa-array/src/array.ts | 19 +-
packages/alfa-assert/package.json | 12 +-
packages/alfa-bits/package.json | 4 +-
packages/alfa-branched/package.json | 28 +-
packages/alfa-branched/src/branched.ts | 15 +-
packages/alfa-cache/package.json | 10 +-
packages/alfa-callback/package.json | 6 +-
packages/alfa-cascade/package.json | 28 +-
packages/alfa-chai/package.json | 12 +-
packages/alfa-cheerio/package.json | 14 +-
packages/alfa-cli/package.json | 44 +-
packages/alfa-clone/package.json | 4 +-
packages/alfa-collection/package.json | 34 +-
packages/alfa-collection/src/collection.ts | 43 +-
packages/alfa-command/package.json | 24 +-
packages/alfa-comparable/package.json | 6 +-
packages/alfa-comparable/src/comparable.ts | 99 +-
packages/alfa-comparable/src/comparer.ts | 4 +-
packages/alfa-compatibility/package.json | 8 +-
packages/alfa-continuation/package.json | 8 +-
packages/alfa-crawler/package.json | 18 +-
packages/alfa-css/package.json | 36 +-
packages/alfa-css/src/value/length.ts | 10 +-
packages/alfa-cypress/package.json | 22 +-
packages/alfa-device/package.json | 14 +-
packages/alfa-dom/package.json | 28 +-
packages/alfa-dom/src/jsx-runtime.ts | 4 +-
packages/alfa-dom/src/jsx.ts | 16 +-
packages/alfa-earl/package.json | 10 +-
packages/alfa-either/package.json | 23 +-
packages/alfa-either/src/either.ts | 16 +-
packages/alfa-either/src/left.ts | 21 +-
packages/alfa-either/src/right.ts | 12 +-
packages/alfa-either/tsconfig.json | 3 -
packages/alfa-emitter/package.json | 12 +-
packages/alfa-encoding/package.json | 4 +-
packages/alfa-enzyme/package.json | 8 +-
packages/alfa-equatable/package.json | 4 +-
packages/alfa-equatable/src/equatable.ts | 25 -
packages/alfa-fnv/package.json | 6 +-
packages/alfa-foldable/package.json | 6 +-
packages/alfa-formatter-earl/package.json | 8 +-
packages/alfa-formatter-json/package.json | 8 +-
packages/alfa-formatter-sarif/package.json | 8 +-
packages/alfa-formatter/package.json | 8 +-
packages/alfa-frontier/package.json | 14 +-
packages/alfa-functor/package.json | 6 +-
packages/alfa-future/package.json | 24 +-
packages/alfa-future/src/future.ts | 13 +-
packages/alfa-generator/package.json | 8 +-
packages/alfa-graph/package.json | 18 +-
packages/alfa-hash/package.json | 12 +-
packages/alfa-highlight/package.json | 2 +-
packages/alfa-http/package.json | 22 +-
packages/alfa-iana/package.json | 16 +-
packages/alfa-interviewer/package.json | 8 +-
packages/alfa-iterable/package.json | 24 +-
packages/alfa-iterable/src/iterable.ts | 36 +-
packages/alfa-jasmine/package.json | 14 +-
packages/alfa-jest/package.json | 14 +-
packages/alfa-jquery/package.json | 14 +-
packages/alfa-json-ld/package.json | 6 +-
packages/alfa-json/package.json | 6 +-
packages/alfa-json/src/serializable.ts | 10 +-
packages/alfa-lazy/package.json | 19 +-
packages/alfa-lazy/src/lazy.ts | 13 +-
packages/alfa-lazy/tsconfig.json | 3 -
packages/alfa-list/package.json | 40 +-
packages/alfa-list/src/list.ts | 48 +-
packages/alfa-list/test/list.spec.ts | 7 -
packages/alfa-map/package.json | 34 +-
packages/alfa-map/src/map.ts | 79 +-
packages/alfa-map/src/status.ts | 16 +-
packages/alfa-map/test/map.spec.ts | 52 -
packages/alfa-mapper/package.json | 4 +-
packages/alfa-math/package.json | 4 +-
packages/alfa-media/package.json | 24 +-
packages/alfa-monad/package.json | 8 +-
packages/alfa-monad/src/monad.ts | 7 +-
packages/alfa-monad/tsconfig.json | 6 -
packages/alfa-network/package.json | 20 +-
packages/alfa-option/package.json | 30 +-
packages/alfa-option/src/none.ts | 23 +-
packages/alfa-option/src/option.ts | 19 +-
packages/alfa-option/src/some.ts | 24 +-
packages/alfa-option/test/option.spec.ts | 4 -
packages/alfa-parser/package.json | 16 +-
packages/alfa-performance/package.json | 12 +-
packages/alfa-playwright/package.json | 14 +-
packages/alfa-predicate/package.json | 10 +-
packages/alfa-promise/package.json | 10 +-
packages/alfa-protractor/package.json | 12 +-
packages/alfa-puppeteer/package.json | 14 +-
packages/alfa-react/package.json | 16 +-
packages/alfa-record/package.json | 20 +-
packages/alfa-reducer/package.json | 4 +-
packages/alfa-refinement/package.json | 8 +-
packages/alfa-result/package.json | 30 +-
packages/alfa-result/src/err.ts | 20 +-
packages/alfa-result/src/ok.ts | 20 +-
packages/alfa-result/src/result.ts | 5 +-
packages/alfa-rules/package.json | 78 +-
.../src/common/expectation/get-colors.ts | 8 -
packages/alfa-rules/src/sia-r62/rule.ts | 270 +--
packages/alfa-rules/src/sia-r70/rule.ts | 26 +-
packages/alfa-rules/src/sia-r75/rule.ts | 32 +-
.../alfa-rules/test/sia-r62/rule.spec.tsx | 355 +---
.../alfa-rules/test/sia-r69/rule.spec.tsx | 9 -
packages/alfa-sarif/package.json | 8 +-
packages/alfa-scraper/package.json | 32 +-
packages/alfa-selective/package.json | 23 +-
packages/alfa-selective/src/selective.ts | 46 +-
.../alfa-selective/test/selective.spec.ts | 35 -
packages/alfa-selective/tsconfig.json | 3 -
packages/alfa-selector/package.json | 28 +-
packages/alfa-sequence/package.json | 36 +-
packages/alfa-sequence/src/cons.ts | 47 +-
packages/alfa-sequence/src/nil.ts | 31 +-
packages/alfa-sequence/src/sequence.ts | 35 +-
packages/alfa-sequence/test/sequence.spec.ts | 32 -
packages/alfa-set/package.json | 28 +-
packages/alfa-set/src/set.ts | 12 +-
packages/alfa-slice/package.json | 30 +-
packages/alfa-slice/src/slice.ts | 47 +-
packages/alfa-style/package.json | 49 +-
packages/alfa-style/src/index.ts | 1 -
.../alfa-style/src/property/text-shadow.ts | 111 --
packages/alfa-style/src/style.ts | 2 +-
packages/alfa-style/src/value.ts | 13 +-
.../test/property/text-shadow.spec.tsx | 78 -
packages/alfa-style/tsconfig.json | 5 -
packages/alfa-table/package.json | 26 +-
packages/alfa-table/test/table.spec.tsx | 72 -
packages/alfa-test/package.json | 4 +-
packages/alfa-thenable/package.json | 6 +-
packages/alfa-thunk/package.json | 8 +-
packages/alfa-time/package.json | 4 +-
packages/alfa-trampoline/package.json | 24 +-
packages/alfa-trampoline/src/trampoline.ts | 15 +-
packages/alfa-trilean/package.json | 8 +-
packages/alfa-unexpected/package.json | 14 +-
packages/alfa-url/package.json | 18 +-
packages/alfa-vue/package.json | 14 +-
packages/alfa-wcag/package.json | 12 +-
packages/alfa-web/package.json | 22 +-
packages/alfa-webdriver/package.json | 12 +-
packages/alfa-xpath/package.json | 22 +-
scripts/publish.sh | 2 +-
scripts/version.sh | 2 +-
yarn.lock | 1656 ++++++++---------
195 files changed, 2423 insertions(+), 3780 deletions(-)
delete mode 100644 packages/alfa-style/src/property/text-shadow.ts
delete mode 100644 packages/alfa-style/test/property/text-shadow.spec.tsx
diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml
index 80b27b39d6..106628de7b 100644
--- a/.github/workflows/integrate.yml
+++ b/.github/workflows/integrate.yml
@@ -14,6 +14,8 @@ jobs:
os: [ubuntu-latest, windows-latest]
node: [14, 16]
runs-on: ${{ matrix.os }}
+ env:
+ NODE_OPTIONS: "--max-old-space-size=4096"
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-node@v2.2.0
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 9ee9022705..749219a4d1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -23,7 +23,7 @@ jobs:
- run: >
yarn workspaces foreach
--no-private
- --topological-dev
+ --topological
npm publish --tolerate-republish
- uses: actions/create-release@v1.1.4
env:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e2fe230a8e..a15d965b84 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,30 +21,12 @@ Items that are related, such as breaking changes, new features, or changes to ex
## [Unreleased]
-## [0.20.0](../../compare/v0.19.0...v0.20.0) (2021-07-09)
-
In addition to the changes listed below, this release adjusts the compile target from `es2018` to `es2020`.
-### Added
-
-- [@siteimprove/alfa-rules](packages/alfa-rules): Implementations of SIA-R54, SIA-R55, and SIA-R78 are now available. ([#834](../../pull/834), [#835](../../pull/835), [#854](../../pull/854))
-
-- [@siteimprove/alfa-scraper](packages/alfa-scraper): The `Scraper#scrape()` methods now accepts an `archive` option for storing an archive of the page scraped. ([#840](../../pull/840))
-
-- [@siteimprove/alfa-cli](packages/alfa-cli): Two new flags, `--archive` and `--archive-format`, are now available in the `alfa scrape` command for storing an archive of the page scraped. ([#840](../../pull/840))
-
-- [@siteimprove/alfa-hash](packages/alfa-hash): `Hash#writeBigInt()`, `Hash#writeBigInt64()`, `Hash#writeBigUint64()`, `Hash#writeUndefined()`, `Hash#writeNull()`,`Hash#writeObject()`, and `Hash#writeSymbol()` are now available. ([#853](../../pull/853))
-
### Fixed
-- [@siteimprove/alfa-aria](packages/alfa-aria): A bug in how names were computed for subtrees and implicitly referenced `` elements has been fixed. ([#808](../../issues/808), [#859](../../pull/859))
-
- [@siteimprove/alfa-rules](packages/alfa-rules): The contrast ratios output in messages from SIA-R66 and SIA-R69 are now correctly listed as `:` rather than `:`.
-- [@siteimprove/alfa-rules](packages/alfa-rules): SIA-R56 is now correctly exported and available for audits. ([#850](../../pull/850))
-
-- [@siteimprove/alfa-rules](packages/alfa-rules): `isClipped()` now considers elements with a height or width of 0 as clipping if overflow causes scrolling. It now also checks if the ancestors of an element might cause it to clip. ([#731](../../issues/731), [#774](../../issues/774), [#827](../../pull/827), [#848](../../pull/848))
-
## [0.19.0](../../compare/v0.18.0...v0.19.0) (2021-06-15)
### Breaking
diff --git a/docs/api.md b/docs/api.md
index a05c805ae1..c166a8e90e 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -395,9 +395,7 @@ In Alfa, JSON serialization is often used as a means of asserting the structure
We've already seen quite a bit about the `@siteimprove/alfa-map` package and its `Map` class. The `Map` class is, however, just one out of several collections used throughout Alfa. In this section, we'll provide an overview of the most common collections and their intended use. As with any data structures, they each have their own strengths and weaknesses to be mindful of when choosing a collection for a given task.
-#### `Collection.Indexed`
-
-##### `List`
+#### `List`
The `List` class provides an implementation of a [persistent][] [vector trie][] for storing a list of values of type `T`. It provides effectively constant time `#append()`, `#set()`, and `#get()`.
@@ -415,67 +413,63 @@ For values, `List` uses an implementation of `Equatable`, when available. Tha
- You're only interested in a few values of the list, which might be better served by the `Sequence` class.
-##### `Sequence`
+#### `Map`
-The `Sequence` class provides an implementation of a [persistent][] [lazy][] list for storing a possibly infinite sequence of values of type `T`. By virtue of being lazy, it provides mostly constant time operations as no computations are actually performed until the corresponding values are requested.
+The `Map` class provides an implementation of a [persistent][] [hash trie][] for associating unique keys of type `K` with values of type `V`. It provides effectively constant time `#set()`, `#has()`, `#get()`, and `#delete()`.
-**Do use when:**
+For keys, `Map` uses implementations of `Equatable` and `Hashable`, when available. That is, two keys `a` and `b` are considered the same key if `a.hash().equals(b.hash())` and `a.equals(b)`.
-- You're performing sequence operations on an arbitrary and possible infinite `Iterable`. This includes generator functions, which can be beneficial to wrap in a `Sequence`.
+For values, `Map` uses an implementation of `Equatable`, when available. That is, no modifications are made when updating the value of a key with the current value `a` and the new value `b` if `a.equals(b)`.
-- You're working with a sequence of values that don't all need to be determined at once. Using `Sequence`, such sequences can be constructed in constant time and only the needed values yielded as necessary.
+**Do use when:**
-- You're performing sequence operations where eager evaluation would lead to suboptimal performance, such as `#map()` followed by `#find()`. With eager evaluation, `#map()` will be applied to _every_ value of the sequence, even those _after_ the value returned by `#find()`. With lazy evaluation, `#map()` will only be applied _up to and including_ the value returned by `#find()`.
+- Your keys have custom equivalence and hashing constraints.
**Don't use when:**
-- You're often modifying the sequence which for each modification, with the exception of prepends, is done in time proportional to the number of values yielded by the sequence.
+- You're working with performance critical code, which may be better served by the builtin `Map` or `WeakMap` class.
-##### `Slice`
+#### `Set`
-The `Slice` class provides an implementation of a [persistent][] [copy-on-write][] array for storing values of type `T`. It provides constant time `#get()`, `#has()`, and `#slice()`.
+The `Set` class provides an implementation of a [persistent][] [hash trie][] for storing a set of unique values of type `K`. It provides effectively constant time `#add()`, `#has()`, and `#delete()`.
+
+For values, `Set` uses implementations of `Equatable` and `Hashable`, when available. That is, two values `a` and `b` are considered the same value if `a.hash().equals(b.hash())` and `a.equals(b)`.
**Do use when:**
-- You're working with increasingly smaller portions of a backing array, such as when parsing a list of tokens.
+- Your values have custom equivalence and hashing constraints.
**Don't use when:**
-- You're working with performance critical code, which may be better served by manually tracking a pointer into the backing array.
-
-#### `Collection.Keyed`
-
-##### `Map`
-
-The `Map` class provides an implementation of a [persistent][] [hash trie][] for associating unique keys of type `K` with values of type `V`. It provides effectively constant time `#set()`, `#has()`, `#get()`, and `#delete()`.
+- You're working with performance critical code, which may be better served by the builtin `Set` or `WeakSet` class.
-For keys, `Map` uses implementations of `Equatable` and `Hashable`, when available. That is, two keys `a` and `b` are considered the same key if `a.hash().equals(b.hash())` and `a.equals(b)`.
+#### `Sequence`
-For values, `Map` uses an implementation of `Equatable`, when available. That is, no modifications are made when updating the value of a key with the current value `a` and the new value `b` if `a.equals(b)`.
+The `Sequence` class provides an implementation of a [persistent][] [lazy][] list for storing a possibly infinite sequence of values of type `T`. By virtue of being lazy, it provides mostly constant time operations as no computations are actually performed until the corresponding values are requested.
**Do use when:**
-- Your keys have custom equivalence and hashing constraints.
+- You're performing sequence operations on an arbitrary and possible infinite `Iterable`. This includes generator functions, which can be beneficial to wrap in a `Sequence`.
-**Don't use when:**
+- You're working with a sequence of values that don't all need to be determined at once. Using `Sequence`, such sequences can be constructed in constant time and only the needed values yielded as necessary.
-- You're working with performance critical code, which may be better served by the builtin `Map` or `WeakMap` class.
+- You're performing sequence operations where eager evaluation would lead to suboptimal performance, such as `#map()` followed by `#find()`. With eager evaluation, `#map()` will be applied to _every_ value of the sequence, even those _after_ the value returned by `#find()`. With lazy evaluation, `#map()` will only be applied _up to and including_ the value returned by `#find()`.
-#### `Collection.Unkeyed`
+**Don't use when:**
-##### `Set`
+- You're often modifying the sequence which for each modification, with the exception of prepends, is done in time proportional to the number of values yielded by the sequence.
-The `Set` class provides an implementation of a [persistent][] [hash trie][] for storing a set of unique values of type `K`. It provides effectively constant time `#add()`, `#has()`, and `#delete()`.
+#### `Slice`
-For values, `Set` uses implementations of `Equatable` and `Hashable`, when available. That is, two values `a` and `b` are considered the same value if `a.hash().equals(b.hash())` and `a.equals(b)`.
+The `Slice` class provides an implementation of a [persistent][] [copy-on-write][] array for storing values of type `T`. It provides constant time `#get()`, `#has()`, and `#slice()`.
**Do use when:**
-- Your values have custom equivalence and hashing constraints.
+- You're working with increasingly smaller portions of a backing array, such as when parsing a list of tokens.
**Don't use when:**
-- You're working with performance critical code, which may be better served by the builtin `Set` or `WeakSet` class.
+- You're working with performance critical code, which may be better served by manually tracking a pointer into the backing array.
[abstract relational comparison]: https://tc39.es/ecma262/#sec-abstract-relational-comparison
[copy-on-write]: https://en.wikipedia.org/wiki/Copy-on-write
diff --git a/docs/releasing.md b/docs/releasing.md
index d9d41b7c75..4533f52d0d 100644
--- a/docs/releasing.md
+++ b/docs/releasing.md
@@ -7,7 +7,7 @@ Alfa uses the currently experimental [Yarn release workflow](https://yarnpkg.com
```console
$ yarn workspaces foreach \
--no-private \
- --topological-dev \
+ --topological \
version --deferred
```
diff --git a/docs/review/api/alfa-act.api.md b/docs/review/api/alfa-act.api.md
index f1d7a52479..bacfec9754 100644
--- a/docs/review/api/alfa-act.api.md
+++ b/docs/review/api/alfa-act.api.md
@@ -4,7 +4,6 @@
```ts
-import { Applicative } from '@siteimprove/alfa-applicative';
import * as earl from '@siteimprove/alfa-earl';
import { Equatable } from '@siteimprove/alfa-equatable';
import { Functor } from '@siteimprove/alfa-functor';
@@ -28,7 +27,7 @@ export class Audit {
evaluate(performance?: Performance>): Future>>;
// (undocumented)
static of(input: I, rules: Iterable_2>, oracle?: Oracle): Audit;
-}
+ }
// @public (undocumented)
export namespace Audit {
@@ -73,7 +72,7 @@ export class Cache {
static empty(): Cache;
// (undocumented)
get(rule: Rule, ifMissing: Thunk>>>): Future>>;
-}
+ }
// @public (undocumented)
export class Diagnostic implements Equatable, Serializable {
@@ -383,17 +382,13 @@ export namespace Outcome {
}
// @public (undocumented)
-export class Question implements Functor, Applicative, Monad, Serializable> {
+export class Question implements Functor, Monad, Serializable> {
protected constructor(uri: string, type: Q, subject: S, message: string, quester: Mapper);
// (undocumented)
answer(answer: A): T;
// (undocumented)
- apply(mapper: Question>): Question;
- // (undocumented)
flatMap(mapper: Mapper>): Question;
// (undocumented)
- flatten(this: Question>): Question;
- // (undocumented)
map(mapper: Mapper): Question;
// (undocumented)
get message(): string;
@@ -407,7 +402,7 @@ export class Question implements Functor, Applicative, Mon
get type(): Q;
// (undocumented)
get uri(): string;
-}
+ }
// @public (undocumented)
export namespace Question {
@@ -644,4 +639,5 @@ export namespace Tag {
}
}
+
```
diff --git a/docs/review/api/alfa-applicative.api.md b/docs/review/api/alfa-applicative.api.md
index 4b9140e70d..2de3416243 100644
--- a/docs/review/api/alfa-applicative.api.md
+++ b/docs/review/api/alfa-applicative.api.md
@@ -4,15 +4,13 @@
```ts
-import { Functor } from '@siteimprove/alfa-functor';
import { Mapper } from '@siteimprove/alfa-mapper';
// @public (undocumented)
-export interface Applicative extends Functor {
+export interface Applicative {
// (undocumented)
apply(mapper: Applicative>): Applicative;
- // (undocumented)
- map(mapper: Mapper): Applicative;
}
+
```
diff --git a/docs/review/api/alfa-array.api.md b/docs/review/api/alfa-array.api.md
index b646bd0fd7..4b233d181a 100644
--- a/docs/review/api/alfa-array.api.md
+++ b/docs/review/api/alfa-array.api.md
@@ -28,7 +28,7 @@ namespace Array_2 {
// (undocumented)
function append(array: Array_2, value: T): Array_2;
// (undocumented)
- function apply(array: ReadonlyArray, mapper: ReadonlyArray>): Array_2;
+ function apply(iterable: ReadonlyArray, mapper: ReadonlyArray>): Array_2;
// (undocumented)
function clone>(array: ReadonlyArray): Array_2;
// (undocumented)
@@ -36,9 +36,9 @@ namespace Array_2 {
// (undocumented)
function collectFirst(array: ReadonlyArray, mapper: Mapper, [index: number]>): Option;
// (undocumented)
- function compare, U = T>(a: ReadonlyArray, b: Iterable_2): Comparison;
+ function compare>(a: ReadonlyArray, b: Iterable_2): Comparison;
// (undocumented)
- function compareWith(a: ReadonlyArray, b: Iterable_2, comparer: Comparer): Comparison;
+ function compareWith(a: ReadonlyArray, b: Iterable_2, comparer: Comparer): Comparison;
// (undocumented)
function concat(array: ReadonlyArray, ...iterables: Array_2>): Array_2;
// (undocumented)
@@ -134,6 +134,8 @@ namespace Array_2 {
// (undocumented)
function zip(array: ReadonlyArray, iterable: Iterable_2): Array_2<[T, U]>;
}
+
export { Array_2 as Array }
+
```
diff --git a/docs/review/api/alfa-branched.api.md b/docs/review/api/alfa-branched.api.md
index 01f393fc04..073f4d9118 100644
--- a/docs/review/api/alfa-branched.api.md
+++ b/docs/review/api/alfa-branched.api.md
@@ -48,8 +48,6 @@ export class Branched implements Collection, Iterable_2<[T, Ite
// (undocumented)
flatMap(mapper: Mapper, [Iterable_2]>): Branched;
// (undocumented)
- flatten(this: Branched, B>): Branched;
- // (undocumented)
forEach(callback: Callback]>): void;
// (undocumented)
hash(hash: Hash): void;
@@ -77,7 +75,7 @@ export class Branched implements Collection, Iterable_2<[T, Ite
toArray(): Array<[T, Array]>;
// (undocumented)
toJSON(): Branched.JSON;
-}
+ }
// @public (undocumented)
export namespace Branched {
@@ -87,8 +85,8 @@ export namespace Branched {
export function isBranched(value: unknown): value is Branched;
// (undocumented)
export type JSON = Array<[
- Serializable.ToJSON,
- Array>
+ Serializable.ToJSON,
+ Array>
]>;
// (undocumented)
export function sequence(values: Iterable_2>): Branched, B>;
@@ -96,6 +94,7 @@ export namespace Branched {
export function traverse(values: Iterable_2, mapper: Mapper, [index: number]>): Branched, B>;
}
+
// (No @packageDocumentation comment for this package)
```
diff --git a/docs/review/api/alfa-collection.api.md b/docs/review/api/alfa-collection.api.md
index 788455631b..1e34d647b5 100644
--- a/docs/review/api/alfa-collection.api.md
+++ b/docs/review/api/alfa-collection.api.md
@@ -23,7 +23,7 @@ import { Refinement } from '@siteimprove/alfa-refinement';
import { Serializable } from '@siteimprove/alfa-json';
// @public (undocumented)
-export interface Collection extends Functor, Applicative, Monad, Foldable, Equatable, Hashable {
+export interface Collection extends Functor, Monad, Foldable, Applicative, Equatable, Hashable {
// (undocumented)
apply(mapper: Collection>): Collection;
// (undocumented)
@@ -47,8 +47,6 @@ export interface Collection extends Functor, Applicative, Monad, Fol
// (undocumented)
flatMap(mapper: Mapper>): Collection;
// (undocumented)
- flatten(this: Collection>): Collection;
- // (undocumented)
forEach(callback: Callback): void;
// (undocumented)
includes(value: T): boolean;
@@ -73,7 +71,9 @@ export interface Collection extends Functor, Applicative, Monad, Fol
// @public (undocumented)
export namespace Collection {
// (undocumented)
- export interface Indexed extends Collection, Iterable_2, Comparable>, Serializable> {
+ export function compare>(a: Indexed, b: Iterable_2): Comparison;
+ // (undocumented)
+ export interface Indexed extends Collection, Iterable_2, Serializable> {
// (undocumented)
append(value: T): Indexed;
// (undocumented)
@@ -83,9 +83,7 @@ export namespace Collection {
// (undocumented)
collectFirst(mapper: Mapper