You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b50ede7
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: move the type-surface check out of the runtime gate
Splits this pull request along the seam between the two issues it was serving.
What remains is #765: does the built artifact still work. The type surface,
which is #749, moves to the follow-up that also carries the API compatibility
check, so it lands together with the thing that classifies it rather than ahead
of it.
The motivation is that the gate's `types` check answered "did anything change"
and then asked a human to decide whether the change was breaking, via
`gate:accept` and a committed digest. That decision is now made mechanically by
the differ. Landing the acknowledgment here and deleting it days later would put
code through `main` twice, and would discard review effort already spent on it.
Removed: `checkTypes`, `typesDigest`, `diffLines`, `listTypeFiles`,
`isReleaseCandidate`, `isMinorOrMajorBump`, the `types` field in
`accepted.json`, and their tests. The acknowledgment survives for `size`, which
has no automatic classifier: there is no principled way to decide that a bundle
growing 4% was intended.
One thing worth calling out, because a refactor could have reintroduced it
silently. `checkSize` stayed quiet on a failed registry fetch and relied on
`checkTypes` having already failed the run for the same reason. With `checkTypes`
gone, that deferral would have turned a registry failure into a silent skip,
which is exactly the fail-open this gate was fixed for earlier. `checkSize` now
reports it itself, and a test pins it.
|`no-cjs-in-esm`| A CJS module inlined into **any** ESM chunk, i.e. the #759 crash. Matches the bare `require` identifier, since the output is minified and the shipped 4.2.5 bundle never literally wrote `require(`. |
75
-
|`externals`| Externals getting inlined (duplicate React instance, the shim regression) or new dependencies leaking out as runtime imports. |
76
-
|`exports-map`| Any path in `exports` / `main` / `module` / `typings` missing from the tarball. |
77
-
|`types`| Any change to the emitted `.d.ts` versus the published release, i.e. the #749 class. Covers added and removed declaration files as well as changed ones. On a release commit, also fails a changed type surface cut as a patch bump. |
78
-
|`size`| Packed tarball and entry-point gzip size moving more than ±2% from the published release. |
|`no-cjs-in-esm`| A CJS module inlined into **any** ESM chunk, i.e. the #759 crash. Matches the bare `require` identifier, since the output is minified and the shipped 4.2.5 bundle never literally wrote `require(`. |
81
+
|`externals`| Externals getting inlined (duplicate React instance, the shim regression) or new dependencies leaking out as runtime imports. |
82
+
|`exports-map`| Any path in `exports` / `main` / `module` / `typings` missing from the tarball. |
83
+
|`size`| Packed tarball and entry-point gzip size moving more than ±2% from the published release. |
79
84
80
85
### What `size` is and is not
81
86
@@ -119,74 +124,48 @@ The local pack stages from `git ls-files` plus `dist/`, not the working tree.
119
124
untracked scratch work under `src/`. Staging keeps a local run comparable with
120
125
what CI packs from a clean checkout.
121
126
122
-
## Accepting a change
127
+
## Accepting a size change
123
128
124
-
A type or size change is not by itself a regression: adding a hook legitimately
125
-
changes the type surface. What the gate refuses is a change nobody looked at. So
126
-
when the change is intended:
129
+
Size is the one check with no way to tell an intended change from a regression:
130
+
there is no principled basis for deciding that a bundle growing 4% was meant. So
131
+
when it was:
127
132
128
133
```sh
134
+
npx tsc && npx vite build # accept measures the current build
129
135
npm run gate:accept
130
136
```
131
137
132
-
Then **commit `accepted.json` in the same pull request**. It records a digest of
133
-
the type surface, the measured sizes, and the published version they were taken
134
-
against:
138
+
Then **commit `accepted.json` in the same pull request**:
0 commit comments