@variance-authority/core 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -36
- package/README.md +255 -128
- package/dist/attribute/call-site.d.ts +20 -2
- package/dist/attribute/call-site.js +17 -20
- package/dist/attribute/call-site.js.map +1 -1
- package/dist/attribute/composition.js +67 -11
- package/dist/attribute/composition.js.map +1 -1
- package/dist/attribute/index.d.ts +2 -0
- package/dist/attribute/index.js +1 -0
- package/dist/attribute/index.js.map +1 -1
- package/dist/attribute/landmark.d.ts +97 -0
- package/dist/attribute/landmark.js +144 -0
- package/dist/attribute/landmark.js.map +1 -0
- package/dist/attribute/lexicon.d.ts +25 -1
- package/dist/attribute/lexicon.js +87 -27
- package/dist/attribute/lexicon.js.map +1 -1
- package/dist/attribute/stack.d.ts +62 -1
- package/dist/attribute/stack.js +116 -5
- package/dist/attribute/stack.js.map +1 -1
- package/dist/judge/inspect.js +57 -4
- package/dist/judge/inspect.js.map +1 -1
- package/dist/relate/before.d.ts +137 -0
- package/dist/relate/before.js +155 -0
- package/dist/relate/before.js.map +1 -0
- package/dist/relate/graph.d.ts +28 -11
- package/dist/relate/graph.js +20 -9
- package/dist/relate/graph.js.map +1 -1
- package/dist/relate/index.d.ts +2 -1
- package/dist/relate/index.js +1 -0
- package/dist/relate/index.js.map +1 -1
- package/dist/relate/merkle.d.ts +6 -0
- package/dist/relate/merkle.js +6 -0
- package/dist/relate/merkle.js.map +1 -1
- package/dist/relate/records.d.ts +67 -1
- package/dist/relate/records.js +34 -7
- package/dist/relate/records.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,67 +1,110 @@
|
|
|
1
1
|
# @variance-authority/core
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 05d6683: Changes before and beyond reach
|
|
8
|
+
|
|
9
|
+
A run reads left to right: the harness starts it, the tests enter your code,
|
|
10
|
+
your code goes out into the install and never comes back. Selection lives in the
|
|
11
|
+
middle, and both ends were invisible for opposite reasons.
|
|
12
|
+
|
|
13
|
+
The far right already arrived — a package is a node, a bump is a seed, the same
|
|
14
|
+
backwards walk answers it. The far left is this. Nothing imports a
|
|
15
|
+
`vitest.config.ts`, a setup module, a CI workflow or a `.nvmrc`, so no walk
|
|
16
|
+
reaches one and the honest structural answer about a change to one is *no
|
|
17
|
+
component moved*: a skipped suite over the file that decides how every test in
|
|
18
|
+
it runs. A diff that was *wholly* outside the graph already widened. The hole
|
|
19
|
+
was a config edited beside an ordinary source file, where the walk had a seed
|
|
20
|
+
and answered confidently about a change it never looked at.
|
|
21
|
+
|
|
22
|
+
`source.before` names those files, repository-root-relative, and a directory
|
|
23
|
+
claims everything under it. What a declaration buys beyond its own name is
|
|
24
|
+
everything below it: `beforeReach` in `@variance-authority/core/relate` walks
|
|
25
|
+
*along* the arrows from each entry — the one question whose subject has no
|
|
26
|
+
dependents — and collects the setup module, the fixture only that setup
|
|
27
|
+
imports, and the packages the environment rests on. The descent stops at the
|
|
28
|
+
first file `source.dirs` already covers, because that file has dependents and a
|
|
29
|
+
change to it is answered exactly by walking them; everything below it is
|
|
30
|
+
reached through it and does not arrive either.
|
|
31
|
+
|
|
32
|
+
The two ends meet there. A `jsdom` bump is named by the install comparison,
|
|
33
|
+
reaches `jest-environment-jsdom`, and reaches a config no file in the
|
|
34
|
+
repository imports — a change beyond reach arriving before it.
|
|
35
|
+
|
|
36
|
+
`scanRelations` takes `before` to seed those paths by name, since a harness
|
|
37
|
+
lives above every directory a component scan is pointed at. A named path that
|
|
38
|
+
is absent or has no reader is dropped rather than recorded unreadable: an
|
|
39
|
+
unknown file seeds every walk forever, so a typo would otherwise widen every
|
|
40
|
+
run in the repository. A declared entry the graph does not hold contributes
|
|
41
|
+
only its own name, which is the whole answer for a `.nvmrc` and a symptom for a
|
|
42
|
+
harness config, so the run reports it as a note rather than guessing.
|
|
43
|
+
|
|
44
|
+
`source.before` requires `source.relations: true`.
|
|
45
|
+
|
|
3
46
|
## 0.2.0
|
|
4
47
|
|
|
5
48
|
### Minor Changes
|
|
6
49
|
|
|
7
50
|
- e546e21: A collector's complaints travel into the observation
|
|
8
|
-
|
|
51
|
+
|
|
9
52
|
A finding produced at collection reached the CLI's record and nobody else. A
|
|
10
53
|
suite driving this from its own runner asks the observation what is wrong with a
|
|
11
54
|
subject, and the one diagnostic that explained the moved pixels — the host, not
|
|
12
55
|
the stylesheet, chose the typeface — was produced, carried, and dropped one call
|
|
13
56
|
short of the person reading the failure.
|
|
14
|
-
|
|
57
|
+
|
|
15
58
|
`mergeDiagnostics` dedupes on every field, so the CLI, which now meets the same
|
|
16
59
|
list twice, says a shared complaint once.
|
|
17
60
|
- f4b328b: Mainline's evaluation can travel, so the next machine does not derive it again
|
|
18
|
-
|
|
61
|
+
|
|
19
62
|
A suite index is bytes addressed by the commit they were written at, which is
|
|
20
63
|
exactly the shape a cache already wants. What was missing was anywhere to put
|
|
21
64
|
them: every checkout that wanted to know what `main` looked like had to run
|
|
22
65
|
`main`, and in CI that is the whole suite, twice, on every pull request.
|
|
23
|
-
|
|
66
|
+
|
|
24
67
|
`@variance-authority/core/share` is the transport, and it has two backends
|
|
25
68
|
because there are two. A **directory** is what `actions/cache`, `aws s3 sync`, a
|
|
26
69
|
network mount and a laptop all are once the bytes are on disk; an **HTTP
|
|
27
70
|
endpoint** is what a bucket, a presigned URL and a tribunal deployment all are.
|
|
28
71
|
`createDirectoryShare` in `@variance-authority/store/share` is the filesystem
|
|
29
72
|
half, kept out of `core` because `core` takes no platform.
|
|
30
|
-
|
|
73
|
+
|
|
31
74
|
A share never fails a run. `get` answers `null` and `put` resolves, whatever the
|
|
32
75
|
network did — a share that is down, misconfigured or empty is indistinguishable
|
|
33
76
|
from a cold one, and the run derives its own index and continues. The cost is
|
|
34
77
|
deliberate: a typo in an endpoint is a suite that quietly got slower rather than
|
|
35
78
|
a build that went red, and the `behind` count `variance share` prints is the
|
|
36
79
|
signal that publishing has stopped.
|
|
37
|
-
|
|
80
|
+
|
|
38
81
|
The CLI gained a `share` section in its config, a `variance share` command that
|
|
39
82
|
says what the share holds for mainline or publishes what this run derived, and a
|
|
40
83
|
line on `variance run` naming where the index went. A lookup walks the lineage —
|
|
41
84
|
`merge-base` with the configured `mainline`, then first-parent — and asks this
|
|
42
85
|
machine's own cache for every commit before it asks the share, because the run
|
|
43
86
|
that just published is usually the one asking.
|
|
44
|
-
|
|
87
|
+
|
|
45
88
|
`docs/sharing.md` is the arrangement end to end, GitHub Actions first.
|
|
46
89
|
- e546e21: A subject is allowed to reference something that is not there
|
|
47
|
-
|
|
90
|
+
|
|
48
91
|
A fixture that points an `<img>` at a path nobody serves is testing the fallback,
|
|
49
92
|
and the broken state is the subject. Capture had no way to say so: the resolver
|
|
50
93
|
returned bytes or the capture was refused, so Material UI's CardMedia,
|
|
51
94
|
ImageListItem and Avatar suites — which all reference a deliberately absent
|
|
52
95
|
`/fake.png` — could not be captured at all.
|
|
53
|
-
|
|
96
|
+
|
|
54
97
|
`resolveResource` may answer `{ absent: true }`. The resource is recorded with
|
|
55
98
|
its status, and the renderer answers that status instead of counting the request
|
|
56
99
|
as one the document failed to carry.
|
|
57
100
|
- e546e21: A subject with no pixels is a baseline without an image, not a subject that got away
|
|
58
|
-
|
|
101
|
+
|
|
59
102
|
A wrapper whose only child went to a portal, or a conformance mount with no
|
|
60
103
|
children, occupies nothing. Refusing to photograph it is right; refusing the
|
|
61
104
|
subject was not. On Material UI's unit tier that was 1109 of 4371 subjects
|
|
62
105
|
reported as unobserved while the capture held their markup, their rules, their
|
|
63
106
|
component hashes and their accessibility tree — none of which was in doubt.
|
|
64
|
-
|
|
107
|
+
|
|
65
108
|
`Raster` makes the image optional: `bytes`, `width` and `height` are absent
|
|
66
109
|
together or present together, and `pictured` is the one place that narrows all
|
|
67
110
|
three. Absent means *this subject has no pixels*, which is a measurement — it
|
|
@@ -72,25 +115,25 @@
|
|
|
72
115
|
verdict. `promotionOf` promotes the sidecar alone when there is no `after`,
|
|
73
116
|
because the subject reached a verdict and the only missing half is the one a
|
|
74
117
|
camera would have produced.
|
|
75
|
-
|
|
118
|
+
|
|
76
119
|
The file-backed store carries the same nullable pair, and with it the split of a
|
|
77
120
|
baseline's two halves into two path prefixes. `identities` scans the record root,
|
|
78
121
|
because a subject with no pixels has no image directory to be found in and the
|
|
79
122
|
sibling scan would otherwise call another machine's baseline new.
|
|
80
|
-
|
|
123
|
+
|
|
81
124
|
Capture stops handing this to Playwright to fail on. Both screenshot paths used
|
|
82
125
|
to refuse a zero-area subject in terms of their own arguments — the clip path
|
|
83
126
|
with `Expected options.clip.height to be greater than 0`, the element path by
|
|
84
127
|
spending the full actionability timeout and then complaining about visibility —
|
|
85
128
|
so a reader had a component that rendered nothing and a sentence about a
|
|
86
129
|
rectangle. `captureSubject` decides it now, and the renderer names the subject.
|
|
87
|
-
|
|
130
|
+
|
|
88
131
|
**Operators:** this is schema **18**. `baselines` and `render_cache` drop
|
|
89
132
|
`NOT NULL` from `width` and `height`, shipped as `0016_pixel-less-baselines.sql`.
|
|
90
133
|
Apply it before pointing a CLI of this version at the deployment; `GET /version`
|
|
91
134
|
reports the schema a build expects.
|
|
92
135
|
- f4b328b: A run leaves behind what its suite looked like, in bytes another checkout can read
|
|
93
|
-
|
|
136
|
+
|
|
94
137
|
A run report answers about *this run*. Nothing answered about the suite from
|
|
95
138
|
somewhere else: which components exist, which subjects hold them, which of them
|
|
96
139
|
has an example of its own, and every name the run indexed. A branch asking any
|
|
@@ -98,7 +141,7 @@
|
|
|
98
141
|
on a machine that has since gone away — which is why *this component is not
|
|
99
142
|
covered anywhere* was a question with no reader, and why a second run could only
|
|
100
143
|
re-derive what the first already knew.
|
|
101
|
-
|
|
144
|
+
|
|
102
145
|
`@variance-authority/report/suite-index` is that artifact. `suiteIndexOf` takes
|
|
103
146
|
the baseline-bearing half of a report — the census, the subject denominator it is
|
|
104
147
|
counted against, and the lexicon — and `encodeSuiteIndex` writes it as one
|
|
@@ -106,18 +149,18 @@
|
|
|
106
149
|
functions. The other half of a composition does not travel: `movements` is what
|
|
107
150
|
moved since a comparison nobody else made, and `divergences` and `echoes` are
|
|
108
151
|
readings of one commit's snapshots. None of the three is a fact about the suite.
|
|
109
|
-
|
|
152
|
+
|
|
110
153
|
It carries the commit it was written at and nothing else about where it is, which
|
|
111
154
|
is the rule the selection index already settled — a commit answers *what changed
|
|
112
155
|
since this was written* exactly, and a timestamp says when a machine was rather
|
|
113
156
|
than where a tree was. An index that cannot name itself is the honest record of a
|
|
114
157
|
run that could not, and a reader holding one has nothing to diff.
|
|
115
|
-
|
|
158
|
+
|
|
116
159
|
It is not JSON. A lexicon is the same few thousand strings written once per
|
|
117
160
|
subject that holds them, and in JSON the repetition *is* the payload. Interned
|
|
118
161
|
once and referenced by number it stops being one, and equal facts encode to equal
|
|
119
162
|
bytes — a sorted dictionary, so a cache that keys on content actually hits.
|
|
120
|
-
|
|
163
|
+
|
|
121
164
|
`@variance-authority/core/segment` is the arithmetic underneath: named columns,
|
|
122
165
|
alignment, interned strings, and the validation a decode performs before it
|
|
123
166
|
believes a file. A column's width comes from the array's own type, so a mismatch
|
|
@@ -127,17 +170,17 @@
|
|
|
127
170
|
now reads and writes through it and keeps its own bytes; what it still owns is the
|
|
128
171
|
part that is about source.
|
|
129
172
|
- e546e21: Two readings of two places are not a flake
|
|
130
|
-
|
|
173
|
+
|
|
131
174
|
`flake` is an accusation — *this reading is not repeatable* — and it was being
|
|
132
175
|
made about a comparison that never claimed repeatability. Lifting two instances
|
|
133
176
|
out of two subjects at one commit and parting them produces a case where every
|
|
134
177
|
input agrees, the tree holds, and the output moved; the old table had exactly one
|
|
135
178
|
row for that.
|
|
136
|
-
|
|
179
|
+
|
|
137
180
|
Where a component sits is decided by the boxes around it, and no component
|
|
138
181
|
receives its own position as a prop. Two instances that agreed on everything they
|
|
139
182
|
were handed and landed at different coordinates have contradicted nothing.
|
|
140
|
-
|
|
183
|
+
|
|
141
184
|
`partingOf` takes a `PartingPlace`: `same` for one subject read twice, across
|
|
142
185
|
revisions or across two moments of one scenario, and `elsewhere` for two
|
|
143
186
|
instances at one commit. It decides only between `flake` and the new `placed`
|
|
@@ -149,7 +192,7 @@
|
|
|
149
192
|
### Patch Changes
|
|
150
193
|
|
|
151
194
|
- e546e21: Four ways a large unit tier lost subjects, none of which said so
|
|
152
|
-
|
|
195
|
+
|
|
153
196
|
**The styling was gone before the capture looked.** A capture taken from a setup
|
|
154
197
|
file runs in the outermost `afterEach` a run has; every hook registered inside a
|
|
155
198
|
`describe` has already finished, and `onTestFinished` runs later still. CSS-in-JS
|
|
@@ -162,7 +205,7 @@
|
|
|
162
205
|
`retainStyles` records style elements as they are inserted and puts the removed
|
|
163
206
|
ones back, in insertion order, for the length of one capture. The next test still
|
|
164
207
|
gets a clean page.
|
|
165
|
-
|
|
208
|
+
|
|
166
209
|
**A subject id can be longer than a filename.** A suite that names subjects after
|
|
167
210
|
the test that produced them — a file path and a full test name — passes 255 bytes
|
|
168
211
|
on ordinary tests, and the point of that convention is that the id says where the
|
|
@@ -175,13 +218,13 @@
|
|
|
175
218
|
`@variance-authority/core` directly rather than reaching it through `react` — the
|
|
176
219
|
host stacks it keeps optional are Playwright and Testing Library, and a filename
|
|
177
220
|
rule is not one of them.
|
|
178
|
-
|
|
221
|
+
|
|
179
222
|
**An inline `url()` is spelled in entities.** `style="background-image:url("/a.png")"`
|
|
180
223
|
reaches the scan through HTML serialization, and reading it literally asked the
|
|
181
224
|
caller for bytes at a URL that exists nowhere but in the escaping. The HTML half
|
|
182
225
|
is scanned with the attribute's entities undone; the stylesheet half, which was
|
|
183
226
|
never escaped, is scanned as before.
|
|
184
|
-
|
|
227
|
+
|
|
185
228
|
**A stubbed `getComputedStyle` is not a broken asset scan.** Replacing
|
|
186
229
|
`window.getComputedStyle` with a map of the two properties a component reads is
|
|
187
230
|
the only way to drive some layouts in jsdom. The scan called `getPropertyValue`
|
|
@@ -192,12 +235,14 @@
|
|
|
192
235
|
|
|
193
236
|
## 0.1.1
|
|
194
237
|
|
|
238
|
+
Lockstep release — nothing in this package changed. Every `@variance-authority/*` package shares one version.
|
|
239
|
+
|
|
195
240
|
## 0.1.0
|
|
196
241
|
|
|
197
242
|
### Minor Changes
|
|
198
243
|
|
|
199
244
|
- 5c34e6d: Say which input moved, not just which tag did
|
|
200
|
-
|
|
245
|
+
|
|
201
246
|
`partingOf(baseline, candidate)` climbs from a set of deltas to the component
|
|
202
247
|
boundary that owns them and names the input that carried the decision:
|
|
203
248
|
`Cart chose differently — useState #0 moved`, with `Summary` reported as having
|
|
@@ -206,7 +251,7 @@
|
|
|
206
251
|
as lines. Two runs of one page that differ in a `<p>` where the other has a
|
|
207
252
|
`<span>` previously produced a structural delta and nothing to say about it;
|
|
208
253
|
the tag is now the symptom and the hook cell is the report.
|
|
209
|
-
|
|
254
|
+
|
|
210
255
|
`holdingOf` from `@variance-authority/react` supplies the evidence — props,
|
|
211
256
|
context values and hook cells as digests, per boundary, including
|
|
212
257
|
`useSyncExternalStore` snapshots so a store that moved outside React is
|
|
@@ -218,28 +263,28 @@
|
|
|
218
263
|
caller-supplied reader, opt in separately from `wiringOf`, and `capture` in
|
|
219
264
|
`@variance-authority/unit-test` now accepts `provenanceOf`, `wiringOf` and
|
|
220
265
|
`holdingOf` so a unit test can read one.
|
|
221
|
-
|
|
266
|
+
|
|
222
267
|
A boundary whose own input could not be read is reported as `unread` and never
|
|
223
268
|
as nondeterminism: `undetermined` is reserved for a component whose every input
|
|
224
269
|
was read and agreed. A wrapper that roots a component boundary no longer
|
|
225
270
|
collapses, because collapsing it discarded the holding — the cost is that a run
|
|
226
271
|
reading holdings keeps wrappers a run without them removes, which is why both
|
|
227
272
|
sides of a comparison must be read the same way.
|
|
228
|
-
|
|
273
|
+
|
|
229
274
|
A component that ran no hooks is read as having run none, rather than as
|
|
230
275
|
unreadable. React writes `_debugHookTypes = null` on every fiber and fills it on
|
|
231
276
|
the first hook call, so the property's absence is the only silence — and
|
|
232
277
|
collapsing the two reported the one shape most worth calling nondeterministic, a
|
|
233
278
|
component with no props and no hooks that renders differently twice, as
|
|
234
279
|
something nothing could be said about.
|
|
235
|
-
|
|
280
|
+
|
|
236
281
|
`PartedBoundary.moved` names the properties the owned deltas named — `color`,
|
|
237
282
|
`padding-top`, `width` — and `explainParting` spends them on the delta line.
|
|
238
283
|
That is the last joint of the chain the rungs climb: a hook cell moved, a prop
|
|
239
284
|
carried it down, and this is what the prop turned into on the page. A count and
|
|
240
285
|
a band stop one link short of what somebody chasing a visual regression is
|
|
241
286
|
trying to name.
|
|
242
|
-
|
|
287
|
+
|
|
243
288
|
`Parting.slice` answers the question asked before which input moved: is this
|
|
244
289
|
worth opening. Three facts are read independently — did the component tree
|
|
245
290
|
move, did any input move, did the output move — and the combinations collapse
|
|
@@ -248,24 +293,24 @@
|
|
|
248
293
|
since a pixel differ can say the screenshots match and nothing about what was
|
|
249
294
|
rewritten underneath. `flake` is `settled`'s opposite number and is refused on
|
|
250
295
|
silence — a run that read no boundary reports `unread`, never `flake`.
|
|
251
|
-
|
|
296
|
+
|
|
252
297
|
`explainParting` leads with that line, and stops enumerating manifestations
|
|
253
298
|
past three: one input at a fork can put a boundary on every component beneath
|
|
254
299
|
it, and nine lines carrying one decision bury the one line worth reading.
|
|
255
|
-
|
|
300
|
+
|
|
256
301
|
The whole layer is documented in `docs/parting.md`: the six slices, the seven
|
|
257
302
|
rungs, what a holding carries and what it deliberately does not.
|
|
258
303
|
|
|
259
304
|
### Patch Changes
|
|
260
305
|
|
|
261
306
|
- e8fee66: Refuse a value whose state is not in its own enumerable keys.
|
|
262
|
-
|
|
307
|
+
|
|
263
308
|
`shapeValue` documented a `Date` as refused and encoded it instead. `typeof`
|
|
264
309
|
answers `object`, `Object.entries` answers empty, and the canonical text came
|
|
265
310
|
out `{}` — so a snapshot holding a timestamp addressed to the digest of an empty
|
|
266
311
|
object, and a later run comparing a different timestamp reported unchanged. The
|
|
267
312
|
same hole swallowed `Map`, `Set`, `URL`, and `RegExp`.
|
|
268
|
-
|
|
313
|
+
|
|
269
314
|
An object with no own enumerable keys and a prototype other than `Object`'s is
|
|
270
315
|
now refused by name at its pointer. A genuinely empty object is still a value,
|
|
271
316
|
and an instance carrying its own fields still serializes them.
|