Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor alfa-selector #1508

Merged
merged 45 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
34fe46d
Break down (a bit) huge selector file
Jym77 Nov 13, 2023
5eaef86
Clean up types
Jym77 Nov 13, 2023
d0a1823
Imprvoe documentation
Jym77 Nov 14, 2023
a36434e
Merge branch 'main' into refactor-alfa-selector
Jym77 Nov 14, 2023
33ae293
Refactor selector type
Jym77 Nov 14, 2023
2fbc6e5
Start breaking simple.ts
Jym77 Nov 14, 2023
7e0eee0
Merge branch 'main' into refactor-alfa-selector
Jym77 Nov 14, 2023
063e680
Improve inheritance
Jym77 Nov 14, 2023
30d2210
Extract some simple selectors
Jym77 Nov 14, 2023
aaa02c0
Extract more simple selectors
Jym77 Nov 14, 2023
defdafe
Extract pseudo-class and -element
Jym77 Nov 15, 2023
a99a14e
Rework exports from alfa-selector
Jym77 Nov 15, 2023
cae6829
Simplify parsing in tests
Jym77 Nov 16, 2023
28e0b6c
Merge branch 'main' into refactor-alfa-selector
Jym77 Nov 20, 2023
8a6384b
Split test file
Jym77 Nov 20, 2023
4372a55
Improve typing
Jym77 Nov 20, 2023
f8419cf
Start breaking down pseudo-class.ts
Jym77 Nov 20, 2023
3fd1306
Break down pseudo-class
Jym77 Nov 20, 2023
fbbe35c
Move stuff around
Jym77 Nov 20, 2023
390a15b
Move stuff around
Jym77 Nov 20, 2023
b3c28bf
Move stuff around
Jym77 Nov 20, 2023
f87cdf4
Allow thunks in Function.parse
Jym77 Nov 20, 2023
5fab9d4
Refactor parsers
Jym77 Nov 20, 2023
b9c1dd4
Improve parsers
Jym77 Nov 21, 2023
b81681f
Merge branch 'main' into refactor-alfa-selector
Jym77 Nov 21, 2023
2da5653
Fix version numbers
Jym77 Nov 21, 2023
4ed5159
Improve parsers
Jym77 Nov 21, 2023
04a6a40
Finish refactoring pseudo-classes
Jym77 Nov 21, 2023
55f476d
Break down pseudo-element
Jym77 Nov 21, 2023
78a306c
Improve parsers
Jym77 Nov 21, 2023
82a8084
Improve parsers
Jym77 Nov 21, 2023
5200aa4
Improve parsers
Jym77 Nov 21, 2023
82ca461
Update documentation
Jym77 Nov 21, 2023
12b1a9c
Clean up
Jym77 Nov 21, 2023
48e87de
Clean up
Jym77 Nov 21, 2023
12c5774
Clean up
Jym77 Nov 21, 2023
6b2f3f1
Extract API
github-actions[bot] Nov 21, 2023
2e5e9b5
Typo
Jym77 Nov 22, 2023
929a308
Break down double file/directory naming
Jym77 Nov 22, 2023
b1ac7fa
Mark unused exports as public
Jym77 Nov 22, 2023
3f39217
Improve parser
Jym77 Nov 22, 2023
a539edc
Rework List
Jym77 Nov 22, 2023
d2a05fc
Clean up
Jym77 Nov 22, 2023
77cb81b
Rework Compound selectors
Jym77 Nov 22, 2023
3c0011d
Extract API
github-actions[bot] Nov 22, 2023
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
7 changes: 7 additions & 0 deletions .changeset/lemon-rabbits-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@siteimprove/alfa-selector": minor
---

**Breaking:** The type guards on selectors are now under the namespace of the same name.

That is, use `Compound.isCompound` instead of `Selector.isCompound`, …
7 changes: 7 additions & 0 deletions .changeset/metal-pandas-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@siteimprove/alfa-selector": minor
---

**Breaking:** `Compound` selectors are now built on top of Iterable, rather than re-inventing chained lists.

That is, `Compound#left` and `Compound#right` are no more available, but `Compound.selectors` replaces them.
7 changes: 7 additions & 0 deletions .changeset/moody-kings-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@siteimprove/alfa-selector": minor
---

**Breaking:** The various kinds of selectors are now directly exported from the package, out of the `Selector` namespace.

That is, use `Id` instead of `Selector.Id`, … (or `import * as Selector` and keep using `Selector.Id`).
7 changes: 7 additions & 0 deletions .changeset/tidy-cars-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@siteimprove/alfa-css": minor
---

**Added:** `Function.parse` now also accepts a `Thunk` as body parser.

This notably allows to build recursive parsers by wrapping them in continuation.
7 changes: 7 additions & 0 deletions .changeset/twenty-seahorses-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@siteimprove/alfa-selector": minor
---

**Breaking:** `List` selectors are now built on top of Iterable, rather than re-inventing chained lists.

That is, `List#left` and `List#right` are no more available, but `List.selectors` replaces them.
3 changes: 2 additions & 1 deletion docs/review/api/alfa-css.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Record as Record_2 } from '@siteimprove/alfa-record';
import { Result } from '@siteimprove/alfa-result';
import { Serializable } from '@siteimprove/alfa-json';
import { Slice } from '@siteimprove/alfa-slice';
import { Thunk } from '@siteimprove/alfa-thunk';

// @public (undocumented)
export type Angle<U extends Unit.Angle = Unit.Angle> = Angle.Calculated | Angle.Fixed<U>;
Expand Down Expand Up @@ -539,7 +540,7 @@ namespace Function_2 {
const // (undocumented)
consume: Parser<Function_2>;
const // (undocumented)
parse: <T>(query?: string | Predicate<Token.Function>, body?: Parser<T> | undefined) => Parser_2<Slice<Token>, readonly [Function_2, T], string, []>;
parse: <T>(query?: string | Predicate<Token.Function>, body?: Parser<T> | Thunk<Parser<T>> | undefined) => Parser_2<Slice<Token>, readonly [Function_2, T], string, []>;
}
export { Function_2 as Function }

Expand Down
Loading