Repository navigation
fix: preserve PreviewGroup imageRender contract - #529
Cherry7593 wants to merge 1 commit into
Conversation
|
@Cherry7593 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
nrps9909
left a comment
There was a problem hiding this comment.
Verified exact head 0621d2d5a87b7eeb9075d0f2495d16c4e9d1ff72 independently. The Omit<InternalPreviewConfig, 'imageRender'> boundary is the right way to keep the group-only callback contract (current required) separate from the single-image/internal contract (current optional), without changing the runtime forwarding path. I ran npm test -- tests/previewGroup.test.tsx --runInBand (17/17 passing, including the new 0→1 index assertion) and npm run tsc successfully. No blocking issues found.
|
Thanks for the proposed correction and the existing review. We are tracking this PR as a release blocker for a downstream strict TypeScript consumer in the Tiktikvroom Platform. With published The proposed We have reviewed the proposed change and its regression-test evidence. However, our strict external consumer has not yet passed against an officially published corrected package. Could the author and maintainers please review the remaining requirements, confirm whether this PR is ready to leave Draft, and advise on the path toward an official corrected release? Once a compatible version is published, we will verify it using our strict external TypeScript consumer and React runtime/browser tests. We will not use unpublished commits, local declaration patches, or TypeScript compiler suppressions. Thank you for maintaining this component. |
What changed
Make
GroupPreviewConfigomit the baseimageRendermember before redeclaring the grouped callback, and add a runtime regression test for its numericcurrentvalue.Root cause
GroupPreviewConfigextendsInternalPreviewConfig, but narrowsimageRenderfrom an optionalinfo.currentto a required one. Strict TypeScript consumers therefore report TS2430 for the published declaration.The runtime contracts are genuinely different: single-image rendering may omit
current, while PreviewGroup always supplies its active numeric index.Why this shape
Omit<InternalPreviewConfig, 'imageRender'>preserves all other base members and allows the grouped callback to retain its stronger contract without invalid interface inheritance. Runtime JavaScript is unchanged.Validation
skipLibCheck: falsepassedThe added test verifies
imageRenderreceivescurrent0 initially and 1 after navigation.