Skip to content

Explore bridgeless constructViewTest with WindowManager + CONTENT_APPEARED#104

Draft
EmilioBejasa wants to merge 2 commits intomainfrom
explore-prerender-start-bridgeless
Draft

Explore bridgeless constructViewTest with WindowManager + CONTENT_APPEARED#104
EmilioBejasa wants to merge 2 commits intomainfrom
explore-prerender-start-bridgeless

Conversation

@EmilioBejasa
Copy link
Copy Markdown
Collaborator

Summary

Exploratory branch investigating the correct approach to render a React Native surface in bridgeless mode during instrumentation tests and capture a non-blank screenshot.

Key findings:

  • ViewHelpers.setupView does not attach the view to a real Window, so Fabric's Choreographer never fires and mutations never apply (blank screenshot)
  • WindowManager.TYPE_APPLICATION_OVERLAY with alpha=0f provides a real Window without needing an Activity
  • reactHost.onHostResume(null) is required before surface.start() — without RESUMED lifecycle state, Fabric silently drops all render tree mutations
  • ReactMarkerConstants.CONTENT_APPEARED is the correct signal for knowing Fabric's first render is complete
  • Software layer type (LAYER_TYPE_SOFTWARE) is required for Screenshot.snap() to capture via draw(canvas)

This branch is exploratory — the actual fix was applied to PR #103.

🤖 Generated with Claude Code

EmilioBejasa and others added 2 commits April 3, 2026 14:37
…EARED

Two key findings:
- reactHost.onHostResume(null) must be called before surface.start() or
  Fabric won't commit mutations even though JS renders successfully
- TYPE_APPLICATION_OVERLAY gives Fabric a real Window so the Choreographer
  fires and commits the shadow tree; ViewHelpers.setupView is not enough

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@EmilioBejasa EmilioBejasa requested a review from tdrhq April 3, 2026 19:39
Copy link
Copy Markdown
Contributor

@tdrhq tdrhq left a comment

Choose a reason for hiding this comment

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

ViewHelpers.setupView does not attach the view to a real Window, so Fabric's Choreographer never fires and mutations never apply (blank screenshot)

I linked to how to fix this in your previous PR without using a real window

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.

2 participants