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