Skip to content

javascript: a function passed as a JSX attribute is a registered hand-off - #1741

Merged
swapnilpaliwal-sd merged 2 commits into
0.1.8from
loop/ja-js-jsx-attribute-handler-unused
Sep 29, 2026
Merged

swapnilpaliwal-sd merged 2 commits into
0.1.8from
loop/ja-js-jsx-attribute-handler-unused

Conversation

@swapnilpaliwal-sd

@swapnilpaliwal-sd swapnilpaliwal-sd commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

A function passed as a JSX attribute (<form onSubmit={submit}>, onClick={h}, <UserForm action={createUser}/>) had no incoming edge, so impact called it unused and a delete looked safe. A call argument is already treated as a hand-off.

  • jsx.dl: an attribute whose value is a function emits a callback_registered edge (new kind JSX_ATTRIBUTE) from the callable that holds the markup. This works on any tag, the same way a call argument does.
  • Golden case 70-jsx-attribute-handler covers handlers on intrinsic tags, an inline arrow and a server action passed to a component. Its control attributes (value={count}, className, title={label()}, an object) produce no edge. Case 62 gains 3 edges of the same kind.
  • Real apps, call_edges before → after: React/Context 20→21, Next.js 21→23, React/Zustand 20→22. Index time is unchanged (~3.1s).
  • Checked: JS golden suite 79/79 with --oracle (2 re-blessed), bundle-test ok (SCHEMA.md regenerated).

… hand-off

onSubmit={submit}, onClick={h}, <UserForm action={create}/> had no incoming
edge, so impact called the handler unused. Each attribute whose value is a
function now emits a callback_registered edge (kind JSX_ATTRIBUTE) from the
callable holding the markup, on any tag, as a call argument does.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit 1fc1c41 into 0.1.8 Sep 29, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the loop/ja-js-jsx-attribute-handler-unused branch September 29, 2026 03:49
@swapnilpaliwal-sd swapnilpaliwal-sd mentioned this pull request Sep 29, 2026
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