Repository navigation
feat: Reject Strong render-time state getter calls - #1031
Merged
domgan-oai merged 1 commit intoSep 10, 2026
Merged
domgan-oai merged 1 commit into
domgan-oai merged 1 commit into
Conversation
domgan-oai
marked this pull request as ready for review
September 10, 2026 11:32
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
Why
The getter can observe scheduled state that differs from the current render snapshot. Rendering should read the tuple's first member; events, effects, and deferred callbacks can use the getter for the latest value.
Changes
useState,useReducer, anduseLinkedStatethrough tuple aliases, destructuring, direct indexing, and synchronous helper arguments/defaults.OCTANE_STRONG_RENDER_STATE_GETTER_CALLerror only when the known getter is invoked during a Strong render.octaneand@octanejs/mcp-server.Validation
pnpm format:check(scoped formatting check passed)pnpm typecheckpnpm test(full repository CI runs when the PR is ready)pnpm exec vitest run packages/octane/tests/compiler --reporter=dot --silent=passed-only— 55 files passed, 1,927 tests passed, 14 expected failures.pnpm format:files:checkon changed files;pnpm sync;git diff --check.Risk / follow-ups
.call/.applyinvocations; the existing setter check has the same limit. Unknown call shapes are left to the separately proposed dev runtime guard in Extend Strong mode: read-side snapshot checks, silent-degradation escape hatches, and dev runtime enforcement #1027.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Adds compile-time enforcement in Strong modules for a previously legal Octane API pattern; valid emitted code is unchanged, but apps on Strong may need to stop calling getters during render.
Overview
Strong mode now treats render-time calls to the third-tuple getter from
useState,useReducer, anduseLinkedStateas compile errors (OCTANE_STRONG_RENDER_STATE_GETTER_CALL), alongside the existing ref-read guard. The analyzer tracks index-2getters through destructuring, tuple indexing/aliases, parameters, and synchronous helper paths, while events, effects, deferred work, and compatibility modules stay unchanged.Implementation extends
strong-mode.jswith getter bindings and folds ref-read checks undercurrentFunctionChecksRenderReads. Docs, MCP skill text, website build-tools page, a patch changeset, and broad compiler/Volar tests document and lock the snapshot-safe pattern (render from tuple index0; use the getter outside render).Reviewed by Cursor Bugbot for commit 57c461e. Bugbot is set up for automated code reviews on this repo. Configure here.