FE-1856: Restore React Compiler for the Live voice control and session indicator - #9907
kostandinang wants to merge 1 commit into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryLow Risk Overview In live conversation control, the Live bridge In voice session indicator, initializing Reviewed by Cursor Bugbot for commit 1115dc4. Bugbot is set up for automated code reviews on this repo. Configure here. |
🌟 What is the purpose of this PR?
Let React Compiler optimize
LiveConversationControlandVoiceSessionIndicatoragain. Each contained a construct the compiler doesn't support, so it skipped the whole component without failing the build.LiveConversationControlcompiled until #9829 and #9836.VoiceSessionIndicatorhadn't compiled since #9467.🔗 Related links
PinnedVoiceInterviewControl.🚫 Blocked by
Nothing.
🔍 What does this change?
LiveConversationControl:finally, which the compiler doesn't support. Itscatchhandles every error, so resetting the checking state after thetrybehaves the same.mediationobject moves into acreateLiveMediationhelper outside the component, because the compiler can't compile itshistorygetter. The getter still reads the current conversation's history each time.VoiceSessionIndicator:colorRef.current ??= targetColorbecomes anif, because the compiler doesn't support logical assignment operators.Both components now compile with no compiler diagnostics.
Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
The
@hashintel/petrinautchange doesn't change behaviour, so it has no changeset.📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
LiveConversationControlkeeps its fiveuseCallbacks. Each is auseEffectoruseLayoutEffectdependency, and thereact/exhaustive-depslint rule fails on a plain function in a dependency list even when the compiler keeps it stable.LiveConversationControl,react-hooks-js/set-state-in-effectwarns about thesetStartAwaitingStop(false)call in its voice-selection layout effect. It's a warning, not an error, and the code is unchanged.🐾 Next steps
LocalStorageDemoAppalready compiles, so its manualuseMemoanduseCallbackcalls can go once #9894, which rewrites much of that file, lands. Some will stay for the sameexhaustive-depsreason.🛡 What tests cover this?
❓ How to test this?
live-conversation-control.tsxorvoice-session-indicator.tsx.