Skip to content

fix(shadcn): invalid postfix ++ on type assertion in ReactShaderToy#1329

Open
thomasyuill-livekit wants to merge 1 commit into
mainfrom
ty/shader-toy-line-824-ts-check
Open

fix(shadcn): invalid postfix ++ on type assertion in ReactShaderToy#1329
thomasyuill-livekit wants to merge 1 commit into
mainfrom
ty/shader-toy-line-824-ts-check

Conversation

@thomasyuill-livekit
Copy link
Copy Markdown
Contributor

@thomasyuill-livekit thomasyuill-livekit commented May 20, 2026

What

Fixes invalid TypeScript on react-shader-toy.tsx:824.

// Before — TS error: operand of ++ must be a variable or property access
gl.uniform1i(timeDeltaUniform, (uniformsRef.current.iFrame.value as number)++);

// After
const frame = uniformsRef.current.iFrame.value as number;
gl.uniform1i(timeDeltaUniform, frame);
uniformsRef.current.iFrame.value = frame + 1;

Why

Unblocks the Vercel build when this component is pulled into web https://github.com/livekit/web/pull/4377.

The original expression applies postfix ++ to a type assertion, which TS rejects since assertions aren't valid l-values.

Notes

  • Preserves postfix-increment semantics: pass current frame to the uniform, then increment.
  • tsc --noEmit on packages/shadcn passes.

🤖 Generated with Claude Code

…niform

The expression `(value as number)++` is not valid TypeScript because the
increment operator requires a variable or property access, not a type
assertion expression. Split into a read, uniform write, and explicit
re-assignment to preserve postfix-increment semantics.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

⚠️ No Changeset found

Latest commit: 0002d78

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
components-js-storybook-5kld Ready Ready Preview, Comment May 20, 2026 1:41am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
LiveKitRoom only 6.01 KB (0%)
LiveKitRoom with VideoConference 32.24 KB (0%)
All exports 43.69 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant