feat(paywalls): enable web_view component (7/7)#7233
Conversation
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>
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
a9207e6 to
709203c
Compare
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>
890dd02 to
ea83431
Compare
4 builds increased size
RevenueCat 1.0 (1)
|
| 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 |
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 |
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 |
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 |
🛸 Powered by Emerge Tools
Comment trigger: Size diff threshold of 100.00kB exceeded
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
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>
544d49c to
a7ed568
Compare
9e73e90 to
6827f72
Compare





Checklist
purchases-androidand hybridsMotivation
Part 7 of 7 splitting #7183. This is the activation PR — the only change that alters runtime behavior. Reverting it alone turns
web_viewoff.Description
Registers
PaywallComponent.webView/ComponentType.webView, wires cache warming / presented-partials / view-model factory /ComponentsView, restoresPaywallWebViewComponent.typetoComponentType, and adds decode +ViewModelFactorytests.Also gates decoding on
protocol_version: aweb_viewdeclaring a version this SDK doesn't implement is treated as an unrecognized component and renders the author'sfallback(throws if none), as client-side defense in depth. Mirrors purchases-android (#3787) and purchases-js.Until this merges, paywall JSON containing
web_viewbehaves exactly as onmain(unknown type → fallback path).Stacking: Based on
webview/6-view(Part 6). Retarget tomainafter Part 6 merges.PR Plan
PWENG-99
also needs #7226 to merge, there will be some code changes when it does