Repository navigation
fix(octane): move delegated event slots off Solid's $$<type> expando - #1883
Conversation
Octane stamped delegated handlers at `node.$$click`, the same property Solid's event delegation reads from its document listener. Inside an Octane root each dispatcher ran the other's handlers, so one click ran a handler twice: TanStack Query devtools rows toggled selection on and off, and every Octane onClick ran twice once Solid was on the page. Bubble slots are now `$o<type>` and capture slots `$ocapture:<type>`, emitted identically by the compiler. Keys keep their length, so compiled output does not grow. Fixes octanejs#1882 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 77a9c89. Configure here.
…wait The resource wait skipped images whose `onLoad` the app handles by reading `$$load`, which the slot rename left behind, so those images could hold the snapshot for up to the 500ms wait again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Benchmark report
Compares js-framework: 1k/10k row operations
All 20 timed operations (19 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
24 other measured values are unchanged. Public-import reachability bundles (bytes)
79 other measured values are unchanged. |
The `EVENT_SLOT_PREFIX` constant grew every production bundle by four raw bytes and pushed `bindings_fw_gzip` and `bindings_js_gzip` over their committed budgets. Inlining the `'$o'` literal at its three uses returns raw size to the `main` level; the slot keys are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Inlining the bubble event-slot prefix shrank seven measured values below their committed budget minus headroom, which `--ratchet` rejects. Lower each budget to the CI measurement plus headroom: root-static, deferred-hydration and hydrate-frame gzip, binding-radix-esbuild brotli, the bindings app brotli, and the octane-jsx total and app gzip. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main c0192ec (#1889, #1872, #1883, #1878 landing together) failed the new "bundle size checks" job: binding-base-ui-vite measures 62,351 gzip, so the downward ratchet requires its budget to drop from 62,384 to 62,383. run-minimal.mjs and run.mjs --write-budgets on that head change nothing else. Co-Authored-By: Claude Opus 5.5 <[email protected]>

Summary
$$<type>expando with Solid, so handlers fire twice inside Octane roots #1882. Octane's delegated-handler DOM slots move from$$<type>/$$capture:<type>to$o<type>/$ocapture:<type>, in both the runtime and the compiler.Why
node.$$clickand calls them from adocumentlistener. Octane used the identical property, so inside an Octane root each dispatcher ran the other's handlers:onClickon the page ran twice. Inexamples/hacker-news, the header link handler measured 2 calls per click.$$click, including Octane'sHandlerBundleobjects.Changes
runtime.ts: newEVENT_SLOT_PREFIX = '$o'andCAPTURE_PREFIX = '$ocapture:', used byeventSlot(),createDelegatedEventType(), and the prototype expando seeding. The direct slot reads in the controlled-input and hydration-claim paths ($oinput,$ochange,$oclick, and their capture forms) use the new keys too.compile.js: event attributes lower to the same$o…keys.$oloadwhen it skips images whoseonLoadthe app handles. Cursor Bugbot caught this read, which the first commit missed. A new regression inview-transition-scoped-effects.test.tscovers it.$$portalParent,$$ctrl,$$formAction, …) are unchanged. No DOM event type matches their names, so no delegation looks them up.octanepatch. The old key was internal and undocumented.Validation
All local runs were on Windows.
packages/octane/tests/foreign-delegation.test.tscovers two cases:$$clickstamp inside an Octane root must never run through Octane.documentdelegation installed, an Octane button and a foreign$$clickelement must each run once.octaneandoctane-prodprojects with the expected assertions: 1 call instead of 0, and a doubledoctane-bubble. After the fix, both pass.does not wait for an image whose onLoad the app handlesfailed on 77a9c89 in dev and prod and passes on 6c1d212. All view-transition suites pass (18 files, 344 tests).prop-removal,portal-events,capture-events,compiler-inspect-segments, andwebsite/tests/playground-mapping(10 files, 325 tests).packages/octane/testsrun: 45,513 passed and 96 failed. I reran every failing file against unmodifiedupstream/mainon the same machine:main. They are symlink, Vite, typecheck, and Volar tests that break on Windows.behavior-root,hydration-ssr-diagnostics, two Volar cases). They pass when those files run alone with this change.octane-tsc -p packages/octane/tsconfig.jsonpnpm syncis clean, apart from a Windows-only backslash rewrite ofdocs/binding-parity-gaps.md, which I reverted and did not commit.pnpm changeset:checkpasses.examples/hacker-newswithReactQueryDevtoolsdocked. Clicking a query row now opens Query Details, and the header link's Octane handler runs once per click.maintoo, so the Linux CI budget shard decides.pnpm typecheck(full) andpnpm test(full): not run locally because of Windows command-line and path limits. CI covers them.573127fd3vs91f770fd0): the check passed, with no value over budget and all 64 js-framework work counters unchanged. Raw bytes move +2 to +6 per bundle (the same-length key rename, plus one string literal the minifier no longer shares). gzip moves −17 to +16 and brotli −145 to +101 in both directions, which fits the non-monotonic brotli behavior thatbenchmarks/README.mddocuments. One timing is flagged (perf review row 3).perf-review: report below.Perf review: fix/event-slot-namespace (upstream/main..HEAD)
Scan:
node scripts/perf-review-scan.mjs --base upstream/mainfound 0 candidates. The same scan onpackages/octane/src/compiler/also found 0.Hot paths touched:
snapshotDelegatedSlots) runs per event and per ancestor. It still readsnode[type.bubbleKey], and only the key string changes.eventSlotruns per spread or de-opt event prop. It changes only the cached key string.seedExpando(Element.prototype, EVENT_SLOT_PREFIX + name))slotKey)'$$click'→'$oclick'). The bundle rows above show +2 to +4 raw bytes per app, which suggests the minifier now shares one fewer literal with other$$names.octane-jsx/clear$$retiredEpoch, which is unchanged, and the diff only renames key strings. All 64 work counters are unchanged, andoctane-tsrx/clear, which runs the same runtime path, is within noise (+1.4%, CI −0.6% … +2.7%). This reads as runner noise.Not checked: browser event latency, since the dispatch logic is unchanged.
Risk / follow-ups
octane-jsx/clearat +6.3%. The reasoning is in perf review row 3, and a maintainer rerun of PR bench on the current head would settle it.el.$$clickby hand to piggyback on Octane's delegation stops receiving events. That was never a documented API, and the changeset says so.__<type>and Inferno$EV, so neither collides with$o. I know of no library that uses$o<type>.@octanejs/tanstack-query-devtools) depends on this fix for its docked-panel row selection.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Renames every delegated event DOM slot used on every click path; behavior change is intentional but touches core event infrastructure and breaks undocumented
$$clickexpando usage.Overview
Fixes double-firing delegated clicks when Solid (or anything using
node.$$click) lives inside an Octane root by moving Octane’s handler expandos from$$<type>/$$capture:<type>to$o<type>/$ocapture:<type>in the runtime and compiler.The dispatch and seeding paths use the new keys; spread/removal, form diagnostics, and portal delegation tests follow the same naming. View-transition image waits now check
$oloadso images with an apponLoadare not held incorrectly after the rename.Adds
foreign-delegationregression tests and updates bundle-size budgets for tiny gzip/brotli drift. Hand-writtenel.$$clickhooks are no longer supported—useel.$oclick.Reviewed by Cursor Bugbot for commit b8357bb. Bugbot is set up for automated code reviews on this repo. Configure here.