fix: probing for forms that mount after the content script runs - #19
Open
Woodstock-IL-Cameras wants to merge 1 commit into
Open
Woodstock-IL-Cameras wants to merge 1 commit into
Woodstock-IL-Cameras wants to merge 1 commit into
Conversation
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.
Problem
content.ts posts INIT once at document_idle, and the page only announces itself in reply. Any DevTool mounting after that never hears it, a race with hydration for forms on the first paint, and never for anything rendered later. The panel then shows no React Hook Form while the in-app works.
Repro
Put on a form that isn't rendered on first paint.
Load the page, then render the form.
Panel says "This page isn't using the debug mode of React Hook Form"; reloading doesn't help.
Fix
Probe on an interval, paused while the tab is hidden.
Tradeoff
One WELCOME per form per probe. Having DevTool announce on mount would drop the polling, but needs a @hookform/devtools release.
Fixes #15. Not run as a loaded extension yet.