Skip to content

Harden instrumentation and remove dead code - #80

Open
aidenybai wants to merge 2 commits into
mainfrom
codex/document-0-6-removed-exports
Open

Harden instrumentation and remove dead code#80
aidenybai wants to merge 2 commits into
mainfrom
codex/document-0-6-removed-exports

Conversation

@aidenybai

@aidenybai aidenybai commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • harden fiber lookup, hook inspection, owner-stack formatting, DevTools hook detection, and React Refresh subscription cleanup
  • preserve the intentional strong _fiberRoots tracking while removing dead commit/root bookkeeping
  • remove unused website modes, provider state, component variants, helpers, and the resulting dependency
  • preserve the compact agent prompt while restoring the detailed integration prompt copied to the clipboard
  • make the root test command unit-only and make HMR browser tests restore fixtures deterministically
  • document the 0.6 public API, renderer support, and migrations for removed exports
  • add a patch changeset for the public bippy runtime changes

Root causes addressed

Several independent mutable values were being treated as though they had one global owner:

  • memo-cache inspection advanced and returned React's live cache slots
  • latest-fiber fallback searched only the requested half of an alternate pair
  • React Refresh subscriptions were keyed by handler identity and async transport detection could outlive all subscribers
  • React Refresh detection cached a global answer instead of the hook that was inspected
  • an own DevTools-hook property with a nullish value was mistaken for an installed hook
  • getRDTHook returned the hook captured before an activation callback could synchronously replace it
  • browser tests restored edited HMR fixtures without waiting for the restore update to finish

The website also carried generalized UI variants and eight visualization modes although the app rendered only one fixed configuration.

Item 8: dispatcher handling

The dispatcher clearing is necessary while describeNativeComponentFrame invokes a component outside a React render to synthesize its stack frame. Leaving a live dispatcher installed can make hook calls read or mutate renderer state during that probe.

The previous implementation was unsafe for multiple renderers: it read one dispatcher from either renderer collection, wrote only the internal collection, and restored that one value into every renderer. Renderers may also expose the ref as either H or current. The new implementation deduplicates all renderer refs, snapshots each ref independently, clears each during the probe, and restores its exact prior value. Removing the mechanism entirely would require removing this fallback stack-frame synthesis.

Intentional behavior retained

_fiberRoots remains a strong set. It is required for root traversal and host-instance fallback behavior and was explicitly treated as intentional.

Validation

  • vp install --frozen-lockfile
  • vp check — 0 errors; 24 existing warnings
  • vp test — 569 passed, 2 skipped
  • nr test:e2e — 381 passed, 3 skipped across Vite, Next.js, and TanStack
  • nr build
  • vp run @bippy/website#build
  • nr publint — passed with the existing non-breaking pkg.browser suggestion

@changeset-bot

changeset-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7388b4c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
bippy Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bippy Ready Ready Preview, Comment Jul 24, 2026 4:49am

@pkg-pr-new

pkg-pr-new Bot commented Jul 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/bippy@80

commit: 7388b4c

@aidenybai
aidenybai marked this pull request as ready for review July 24, 2026 04:28
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