Skip to content

fix: memo deps - use root identifiers on other-context directive - #553

Merged
leonidaz merged 3 commits into
mainfrom
deps2
Aug 3, 2026
Merged

leonidaz merged 3 commits into
mainfrom
deps2

Conversation

@leonidaz

@leonidaz leonidaz commented Aug 3, 2026 •

Copy link
Copy Markdown
Collaborator

addresses the second issue in #542


Note

Medium Risk
Changes compiler dependency inference for a narrow allowlist of directives; incorrect truncation could miss real deps or over-track, but behavior is gated and heavily tested.

Overview
Hook dependency inference no longer hoists member reads from nested functions whose directive prologue marks another execution context ('use gpu', 'worklet'). Those closures contribute only root captures to inferred arrays, so render-time dependency evaluation never touches getters like TypeGPU's .$ that are legal only inside shader/worklet code.

The compiler walks callbacks with an allowlisted opaqueDepth counter: inside such functions, MemberExpression, ChainExpression, and method-call deps collapse to identifier roots; 'use strict', 'use memo', 'use server', and unknown directives keep today's one-level member inference.

Docs and a changeset describe the behavior; compiler, runtime, and plain-TS surgical tests cover TypeGPU-shaped memos, worklets, and non-truncating directives.

Reviewed by Cursor Bugbot for commit d6fe0f1. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
octane-website Skipped Skipped Aug 3, 2026 9:08pm
octane-website-mcp Skipped Skipped Aug 3, 2026 9:08pm

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp August 3, 2026 21:04 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website August 3, 2026 21:05 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp August 3, 2026 21:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website August 3, 2026 21:08 Inactive
@leonidaz leonidaz changed the title Deps2 fix: memo deps - use root identifiers on other-context directive Aug 3, 2026
@github-actions github-actions Bot added the fix PR: bug fix label Aug 3, 2026
@leonidaz
leonidaz merged commit 9b032d8 into main Aug 3, 2026
35 checks passed
@leonidaz
leonidaz deleted the deps2 branch August 3, 2026 21:18

This branch was previously deployed

2 inactive deployments
Preview – octane-website — d6fe0f1d Deployed Aug 3, 2026 by vercel[bot]
Preview – octane-website-mcp — d6fe0f1d Deployed Aug 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant