fix(shared-ui): use named React hook imports in Account panels#1274
Conversation
BillingPanel used React.useMemo and ProfilePanel used React.useState/ React.useEffect via the default React namespace. Under the web Module Federation build (React as a shared singleton) the minifier rewrites the property access into a bare, unbound useMemo reference, crashing the Account screen with 'ReferenceError: useMemo is not defined'. The VS Code build (React bundled directly) is unaffected, which is why it was web-only. Switch both panels to named hook imports, matching every other panel in the account module (AccountView, MembersPanel, EnvironmentPanel). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID. Do not edit or delete. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo account panel components — ChangesNamed React Hook Imports Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
ReferenceError: useMemo is not definedwhen opening the Account screen.BillingPanel.tsxandProfilePanel.tsxreferenced React hooks through the defaultReactnamespace (React.useMemo,React.useState,React.useEffect); under the web Module Federation build (React as a shared singleton) the minifier rewrites that property access into a bare, unbounduseMemo/hook reference, crashing the view. VS Code (React bundled directly) was unaffected — hence web-only.AccountView,MembersPanel,EnvironmentPanel).Type
fix
Testing
./builder testpassesChecklist
Linked Issue
Fixes #1273
Summary by CodeRabbit