Skip to content

refactor(mobile): the shell's page is its own object, hosted by the view - #32202

Closed
Jinwoo-H wants to merge 3 commits into
mainfrom
jinwoo/wv-spare-1-page-split
Closed

Jinwoo-H wants to merge 3 commits into
mainfrom
jinwoo/wv-spare-1-page-split

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​953 $\color{#cf222e}{\Huge{\mathbf{−}}}$​840 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​113

Summary

The phone's shell WebView is now a page object hosted by the native view, on Android and iOS. A page reports its load states, bridge frames and external navigations through a sink. Today the view is that sink and owns exactly one page, created on its first props.

This is the first of three stacked PRs that let the phone boot the next screen's page before it is opened. Splitting the page from the view is what lets a page exist before any view hosts it.

  • Android: MobileWebShellPage.kt holds the former view body (WebView, fences, bridge listener, load-state machine, request intercept, render-process-gone). MobileWebShellView.kt creates it and forwards the sink to its events. The deferred document-failure report posts to the main looper instead of the view, because the page is not a view.
  • iOS: the former view body is now MobileWebShellPage in MobileWebShellPage.swift. MobileWebShellView.swift hosts the page's WKWebView with constraints and is the sink.

One timing change on Android: a document failure was reported through View.post, which waits for the view to be attached. It now posts to the main looper, so a failure on a detached view is reported straight away instead of when the view reattaches. The next PR needs this, because a parked page has no attached view. Otherwise behaviour is unchanged.

Mostly a move: the large line counts are the old view body moving into the page file.

Checks

Release builds, device-check flows on the Android emulator (API 36) and the iOS 26.5 and 18.1 simulators: first open, host to session, New Workspace overlay, pop to an existing screen (#32110), renderer kill then remount, background then foreground, new page generation from a desktop update, host removal and re-pair.

Flow Android emulator API 36 iOS 26.5 simulator iOS 18.1 simulator
First open pass pass pass
Host to session pass pass pass
New Workspace overlay pass pass pass
Pop to an existing screen (#32110) pass pass pass
Renderer kill then remount pass pass pass
Background then foreground pass pass pass
New page generation from a desktop update pass pass pass
Host removal and re-pair pass pass pass

Compat

Native-only refactor. No change to props, events, bridge protocol or the page bundle.

The native shell view built its WebView in its constructor and was the page:
fences, clients, load state and bridge all lived on the Expo view. They now
live on a MobileWebShellPage per platform, which reports through a sink, and
the view creates one on its first prop commit and hosts it.

No behaviour change: the same fences are installed in the same order, the
view still builds one page per mount and forwards the same three events.
Android's deferred document-failure report now posts to the main looper
rather than View.post, which is the same thread and order for an attached
view and does not wait for an attach that a detached view never gets.

This is the seam a page booted ahead of its screen needs.

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 717ecd99-b682-417c-8757-fc599ebb8f67
Commits

Reviewing files that changed from the base of the PR and between 4052cc5 and 38922c8.

Files selected for processing: 4
  • mobile/modules/orca-mobile-web-shell/android/src/main/java/expo/modules/orcamobilewebshell/MobileWebShellPage.kt
  • mobile/modules/orca-mobile-web-shell/android/src/main/java/expo/modules/orcamobilewebshell/MobileWebShellView.kt
  • mobile/modules/orca-mobile-web-shell/ios/MobileWebShellPage.swift
  • mobile/modules/orca-mobile-web-shell/ios/MobileWebShellView.swift

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

Android and iOS now place WebView ownership, asset loading, navigation, load-state reporting, and bridge messaging in dedicated page hosts. The shell views create and host these page instances, pass current properties, delegate bridge posting and destruction, and forward page events to existing dispatchers.

Priority: Low

Merge Risk: Minimal · up to 38922

This refactor moves the shell's WebView page into its own object on Android and iOS. The supplied evidence shows no concrete regression, and the reported device flows passed. It looks safe to merge after the usual checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the refactor, motivation, platform-specific changes, compatibility, and reported testing results. However, it omits most required template sections, including the linked issue… Complete the required description template. Add the linked issue, visual proof or an explicit N/A explanation, testing checklist status, applicable AI disclosure, review and agent skill sections, notes on compatibility and security, and the…
Docstring Coverage Warning Docstring coverage is 37.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 70 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: separating the shell page from the native view and hosting the page through the view.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the refactor, motivation, platform-specific changes, compatibility, and reported testing results. However, it omits most required template sections, including the linked issue, visual proof or an explicit N/A explanation, testing checkboxes, AI disclosure, review, agent skill boundary, notes, and checklist.

Resolution

Complete the required description template. Add the linked issue, visual proof or an explicit N/A explanation, testing checklist status, applicable AI disclosure, review and agent skill sections, notes on compatibility and security, and the final checklist.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…e-split

# Conflicts:
#	mobile/modules/orca-mobile-web-shell/android/src/main/java/expo/modules/orcamobilewebshell/MobileWebShellView.kt
#	mobile/modules/orca-mobile-web-shell/ios/MobileWebShellView.swift
AmoabaKelvin added a commit that referenced this pull request Nov 9, 2026
…ment object (#39946)

The native shell view now hosts a MobileWebShellDocument that owns the
WebView, its scheme handler or request intercept, the network block, the
bridge and the navigation policy. The view keeps layout, the back-edge
swipe and its React events. Nothing changes for a page; this is the seam
a prewarmed spare page needs.

Based on Jinwoo's page split in #32202.

Co-authored-by: Jinwoo-H <[email protected]>
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