Repository navigation
perf: create the host MutationObserver only on the iOS native path - #43
Merged
Merged
Conversation
joeblau
force-pushed
the
perf/38-ios-only-observer
branch
from
October 21, 2026 00:47
aefa5b1 to
4204d19
Compare
This was referenced Oct 21, 2026
Merged
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.
Closes #38
What
MutationObservernow lives in its own committed (layout-phase) effect keyed on[native]. Vibration and desktop targets construct zero observers. The click-timehostDisabled()check on the vibration path is unchanged.blockedHoststartstrueand is synchronized in the layout phase whennativeturns on, so an actionable overlay is never committed over a host that isdisabled,aria-disabled, or insideinert, including on the commit wherenativebecomes true.blockedHostupdates are skipped (for example the observer seeing the overlay's own insertion), so the iOS path doesn't get an extra commit from this change (3 commits per mount, same as main; goes to 2 once Resolve iOS routing with useSyncExternalStore to cut iOS mount renders from 3 to 1 #39 lands, measured on a combined build).disabled/aria-disabledcustom hosts and hosts under aninertancestor never commit an overlay (checked at every Profiler commit, React 18 and 19); dynamicinerttoggles.Implemented with the Codex CLI on the shared box; I added the redundant-update guard and verified by hand.
Benchmark (
npm run bench, same box, interleaved runs)The box was shared with other agents during measurement, so timings are noisy; the ranges show every run.
78ec2f2(5 runs)Verification
npm run lint,typecheck(ESM+CJS+DTS build),coverage(140 tests, 100% statements/branches/functions/lines),size,pack:checkpass locally.blockedHostonly matters whennativeis true, which is false on the server).Device-testing notes
These are simulated-browser numbers (Node 24, production React, jsdom with stubbed
navigator), not physical-device measurements. No physical device was used. Physical iPhone/Android/iPadOS/VoiceOver certification remains tracked in #9.