Skip to content

fix(example): remove unnecessary Vite workarounds#7

Merged
piotrski merged 1 commit into
mainfrom
fix/simplify-example-app
Feb 10, 2026
Merged

fix(example): remove unnecessary Vite workarounds#7
piotrski merged 1 commit into
mainfrom
fix/simplify-example-app

Conversation

@piotrski
Copy link
Copy Markdown
Collaborator

@piotrski piotrski commented Feb 10, 2026

Summary

  • Remove Vite __REACT_DEVTOOLS_GLOBAL_HOOK__ deletion hack
  • Remove manual WebSocket awaiting and dynamic imports
  • Simplify to the standard initialize() + connectToDevTools() flow

The workarounds were not needed — the connection issues were caused by a separate bug.

Test plan

  • Run example app with npx vite and verify devtools connects

🤖 Generated with Claude Code

The Vite hook deletion, manual WebSocket awaiting, and dynamic imports
were not needed — the connection issues were caused by a separate bug.
Simplify to the straightforward initialize() + connectToDevTools() flow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 10, 2026

⚠️ No Changeset found

Latest commit: 08faebb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@piotrski piotrski merged commit 088e10a into main Feb 10, 2026
3 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 08faebb9b4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

} catch {
// ignore — property may be non-configurable (browser extension)
}
import { createRoot } from 'react-dom/client';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Initialize DevTools hook before importing react-dom

react-dom/client is imported before initialize() runs, and ES module dependencies execute before top-level statements. That means ReactDOM can attempt DevTools injection before the standalone hook exists; in contexts without a preinstalled hook (for example, production builds or entrypoints without React Refresh), the renderer is never registered and connectToDevTools() cannot populate the tree. This ordering regression is introduced by switching from dynamic imports to the static react-dom/client import.

Useful? React with 👍 / 👎.

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