Repository navigation
feat: Reject Strong render-time ref reads - #1029
Merged
domgan-oai merged 1 commit intoSep 10, 2026
Merged
Conversation
domgan-oai
marked this pull request as ready for review
September 10, 2026 10:53
14 of 21 tasks
27 of 35 tasks
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.
Summary
OCTANE_STRONG_RENDER_REF_READas a source-located error for provableuseRef.currentreads during Strong render.Part of #1027.
Why
A ref can change without a render input changing. Strong render output that reads
currentcan therefore become stale when compilation reuses a region.Changes
awaitcompound assignments.octaneand@octanejs/mcp-server.Validation
pnpm format:check(scopedpnpm format:files:checkpassed for all changed files)pnpm typecheckpnpm test(prechecks passed; full Vitest stopped after browser suites failed to launch Chromium in the local sandbox)pnpm exec vitest run packages/octane/tests/compiler/strong-mode.test.ts --silent=passed-only(754 passed)pnpm sync(no generated changes)Risk / follow-ups
The static proof follows known refs and synchronous calls; opaque values remain outside this diagnostic. The remaining items in #1027 should land as separate PRs. Browser coverage needs CI because local Chromium exits before test bodies with
MachPortRendezvousServer: Permission denied.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Opt-in Strong mode gains a new compile-time error that can break apps reading refs during render; emitted code for valid modules is unchanged per tests.
Overview
Strong mode now rejects reading
useRefobject'scurrentduring render, not only assigning to it. Modules with"use strong"orcompiler.strong: trueget compile errorOCTANE_STRONG_RENDER_REF_READwith source locations (compiler + Volar); compatibility modules are unchanged.The Strong analyzer tracks ref identities through aliases, optional/computed
.current, destructuring/spread, synchronous helpers (useMemo/useCallback/IIFEs), and compound assignments that read beforeawait. Ref writes still useOCTANE_STRONG_RENDER_REF_WRITE; reads in events, effects, cleanup, and post-yield async paths stay allowed.Docs (TSRX basics, React differences, build tools) and the MCP react-divergences skill document the rule. Patch changesets cover
octaneand@octanejs/mcp-server.Reviewed by Cursor Bugbot for commit 51e956f. Bugbot is set up for automated code reviews on this repo. Configure here.