Skip to content

feat(paywalls): enable web_view component (7/7)#7233

Open
JZDesign wants to merge 113 commits into
pallares/webview-gesture-arbitrationfrom
webview/7-activate
Open

feat(paywalls): enable web_view component (7/7)#7233
JZDesign wants to merge 113 commits into
pallares/webview-gesture-arbitrationfrom
webview/7-activate

Conversation

@JZDesign

@JZDesign JZDesign commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-android and hybrids

Motivation

Part 7 of 7 splitting #7183. This is the activation PR — the only change that alters runtime behavior. Reverting it alone turns web_view off.

Description

Registers PaywallComponent.webView / ComponentType.webView, wires cache warming / presented-partials / view-model factory / ComponentsView, restores PaywallWebViewComponent.type to ComponentType, and adds decode + ViewModelFactory tests.

Also gates decoding on protocol_version: a web_view declaring a version this SDK doesn't implement is treated as an unrecognized component and renders the author's fallback (throws if none), as client-side defense in depth. Mirrors purchases-android (#3787) and purchases-js.

Until this merges, paywall JSON containing web_view behaves exactly as on main (unknown type → fallback path).

Stacking: Based on webview/6-view (Part 6). Retarget to main after Part 6 merges.

PR Plan

PWENG-99

Part PR Branch Base
1/7 #7227 webview/1-public-api main
2/7 #7228 webview/2-envelope webview/1-public-api (retarget to main after I1)
3/7 #7229 webview/3-isolation-navigation main
4/7 #7230 webview/4-schema main
5/7 #7231 webview/5-session webview/deps-123 (retarget after I1–I3)
6/7 #7232 webview/6-view webview/deps-45 (retarget after I4–I5)
7/7 #7233 webview/7-activate webview/6-view (retarget to main after I6)

also needs #7226 to merge, there will be some code changes when it does

Open in Web Open in Cursor 

cursoragent and others added 9 commits July 15, 2026 20:18
Add PaywallWebViewMessage/Value/Controller/Action types and API baselines.
Controller post APIs are no-ops until the session PR wires WebKit.

Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Add WebViewEnvelope encode/decode and input hardening tests.
Inert until Part 7; builds on the public API from Part 1.

Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
…3/7)

Extract origin normalization, main-frame navigation policy, and WK content
rule isolation as inert helpers used by later session/view PRs.

Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Add PaywallComponent.WebViewComponent as dead code without registering
ComponentType.webView or PaywallComponent.webView, so paywall JSON is
unchanged until the activation PR.

Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
… (5/7)

Add WebViewSession (using WebViewOrigin), restore controller session wiring,
and document-reset so reloads can re-handshake. Includes session tests plus
reconnect/resize-threshold/onDocumentReset coverage.

Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
…6/7)

Add WebViewComponentView/ViewModel with document-reset and content-process
termination lifecycle, fit-axes identity, and coordinator tests. Still
unreferenced by the render pipeline until Part 7.

Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
cursoragent and others added 2 commits July 15, 2026 20:36
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
@cursor
cursor Bot force-pushed the webview/7-activate branch from a9207e6 to 709203c Compare July 15, 2026 20:36
cursoragent and others added 2 commits July 15, 2026 20:36
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Register web_view in PaywallComponent decoding/encoding, view-model factory,
and ComponentsView dispatch. Reverting this PR alone turns the feature off.

Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
@cursor
cursor Bot force-pushed the webview/7-activate branch from 890dd02 to ea83431 Compare July 15, 2026 20:36
@emerge-tools

emerge-tools Bot commented Jul 15, 2026

Copy link
Copy Markdown

4 builds increased size

Name Version Download Change Install Change Approval
RevenueCat
com.revenuecat.PaywallsTester
1.0 (1) 19.3 MB ⬆️ 23.4 kB (0.12%) 70.0 MB ⬆️ 119.3 kB (0.17%) N/A
BinarySizeTest
com.revenuecat.binary-size-test.local-source
1.0 (1) 4.5 MB ⬆️ 19.3 kB (0.43%) 13.5 MB ⬆️ 49.9 kB (0.37%) ⏳ Needs approval
BinarySizeTest
com.revenuecat.binary-size-test.cocoapods
1.0 (1) 6.8 MB ⬆️ 21.6 kB (0.32%) 29.7 MB ⬆️ 108.2 kB (0.37%) ⏳ Needs approval
BinarySizeTest
com.revenuecat.binary-size-test.spm
1.0 (1) 4.6 MB ⬆️ 19.6 kB (0.43%) 11.8 MB ⬆️ 45.0 kB (0.39%) ⏳ Needs approval

RevenueCat 1.0 (1)
com.revenuecat.PaywallsTester

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 119.3 kB (0.17%)
Total download size change: ⬆️ 23.4 kB (0.12%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 60.2 kB
📝 RevenueCatUI.WebViewScrollOwnershipRecognizer.Objc Metadata ⬆️ 10.3 kB
Code Signature ⬆️ 2.7 kB
DYLD.Exports ⬆️ 1.9 kB
Strings.Unmapped ⬆️ 1.4 kB
View Treemap

Image of diff

BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.local-source

⚖️ Compare build
📦 Install build
⏱️ Analyze build performance

Total install size change: ⬆️ 49.9 kB (0.37%)
Total download size change: ⬆️ 19.3 kB (0.43%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 7.6 kB
📝 RevenueCatUI.WebViewComponentView.body ⬆️ 2.0 kB
📝 RevenueCatUI.WebViewRepresentable.value witness ⬆️ 2.0 kB
📝 RevenueCatUI.BridgedWebViewComponentView.value witness ⬆️ 1.8 kB
📝 RevenueCatUI.View.webViewWidth(measuredWidth) ⬆️ 1.7 kB
View Treemap

Image of diff

BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.cocoapods

⚖️ Compare build
📦 Install build
⏱️ Analyze build performance

Total install size change: ⬆️ 108.2 kB (0.37%)
Total download size change: ⬆️ 21.6 kB (0.32%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 39.0 kB
Code Signature ⬆️ 2.3 kB
📝 RevenueCatUI.WebViewComponentView.body ⬆️ 2.0 kB
📝 RevenueCatUI.WebViewRepresentable.value witness ⬆️ 2.0 kB
📝 RevenueCatUI.BridgedWebViewComponentView.value witness ⬆️ 1.8 kB
View Treemap

Image of diff

BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.spm

⚖️ Compare build
📦 Install build
⏱️ Analyze build performance

Total install size change: ⬆️ 45.0 kB (0.39%)
Total download size change: ⬆️ 19.6 kB (0.43%)

Largest size changes

Item Install Size Change
📝 RevenueCatUI.WebViewComponentView.body ⬆️ 2.0 kB
📝 RevenueCatUI.WebViewRepresentable.value witness ⬆️ 2.0 kB
📝 RevenueCatUI.BridgedWebViewComponentView.value witness ⬆️ 1.8 kB
Strings.Unmapped ⬆️ 1.8 kB
📝 RevenueCatUI.View.webViewWidth(measuredWidth) ⬆️ 1.7 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Comment trigger: Size diff threshold of 100.00kB exceeded

Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
@ajpallares
ajpallares changed the base branch from main to pallares/web-view-allow-media-autoplay July 23, 2026 10:18

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1c4a04f. Configure here.

Comment thread Sources/Paywalls/Components/Common/PaywallComponentBase.swift
Base automatically changed from pallares/web-view-allow-media-autoplay to main July 23, 2026 10:29
@ajpallares
ajpallares changed the base branch from main to pallares/web-view-hardening July 23, 2026 10:59
ajpallares and others added 10 commits July 23, 2026 12:59
Gate on the fallback key's presence so a keyNotFound thrown while decoding the
fallback's own subtree is reported with its underlying error instead of being
misclassified as a missing fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
…esponse

WebKit treats HTTP error status codes as successful navigations (the error body renders and didFail* never fires), so terminal load-failure handling missed them. Inspect the status code in decidePolicyFor navigationResponse and, on a main-frame 4xx/5xx, log an error, remove the web view, and cancel the load. Sub-frame/sub-resource errors are ignored so a single failing asset doesn't tear down the whole component.

Co-authored-by: Cursor <cursoragent@cursor.com>
Base automatically changed from pallares/web-view-hardening to main July 23, 2026 16:04
@ajpallares
ajpallares changed the base branch from main to pallares/webview-enable-scroll July 23, 2026 16:05
@ajpallares
ajpallares changed the base branch from pallares/webview-enable-scroll to pallares/webview-gesture-arbitration July 24, 2026 09:17
@ajpallares
ajpallares force-pushed the pallares/webview-gesture-arbitration branch from 544d49c to a7ed568 Compare July 24, 2026 14:23
@ajpallares
ajpallares force-pushed the webview/7-activate branch from 9e73e90 to 6827f72 Compare July 24, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants