fix: keep the animated-image test fixtures BlobPart-compatible under TypeScript >= 5.7 - #371
Merged
Merged
Conversation
…TypeScript >= 5.7 (#351 unblock)
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unblocks the three npm dependabot PRs (#351, #355, #356), whose rebased lockfiles float
typescript5.6.3 → 5.9.3 and all fail Typecheck the same way.The defect
PR #365's animated-image test fixtures postdate #368's
Uint8Array-generics sweep (which was verified at dev9b381b8b, before #365 merged) and reintroduce the same pattern: explicit: Uint8Arrayreturn annotations, which on TypeScript ≥ 5.7 meanUint8Array<ArrayBufferLike>— not assignable toBlobPart.RED, from the live Typecheck failure on #355's rebase (7 errors, all
@upupjs/core):The fix (same convention as #368)
tests/helpers/animated-image-fixtures.ts: dropped the 12 explicit: Uint8Arrayreturn annotations — inference fromnew Uint8Array(number[])yields the narrowUint8Array<ArrayBuffer>on TS ≥ 5.7 and plainUint8Arrayon ≤ 5.6.tests/steps/image-processing.test.ts: theanimatedtable annotation[string, string, Uint8Array][]→[string, string, BlobPart][](valid on both TS versions; the bytes only ever feedmakeUploadFile, whose parameter isBlobPart). NoteUint8Array<ArrayBuffer>syntax was NOT an option — it's a parse error on TS ≤ 5.6.Test-only; no runtime or published-surface change, so no changeset.
Verification (raw exit codes)
pnpm update -r typescript(lands typescript@5.9.3, same resolution as the dependabot lockfiles; angular held at 5.6.3 by fix: make Blob/BodyInit fixture types and the Angular TS pin survive a lockfile float (#351 unblock) #368's~5.6.0pin) →tsc --versionprints 5.9.3 →@upupjs/coretypecheck (base +tsconfig.test.json) exit 0.pnpm install --frozen-lockfileexit 0,tsc --versionprints 5.6.3, core typecheck exit 0.packages/*/src(CI-blind for formatting): explicitprettier --checkon both — clean.