feat(perry-ext): #867 — perry/ads MVP (FFI scaffold, structured-failure responses, no SDK linked)#1040
Merged
Merged
Conversation
…re responses) Cookie-cutter follow-on to #674's @perryts/google-auth: lands the six-function FFI surface for `perry/ads` (interstitial load/show, rewarded load/show, banner create/destroy) wired end-to-end through perry-api-manifest, codegen NATIVE_MODULE_TABLE + runtime_decls, well_known_bindings, and types/perry/ads/. Every entry point resolves a structured `{ error: "no-sdk-linked" }` JSON placeholder; no real ad SDK is linked. Real Google Mobile Ads integration (iOS SwiftPM + Android play-services-ads), the GDPR / ATT consent flow, the Info.plist + AndroidManifest auto- injection, and the `<AdBanner>` perry/ui widget glue are all explicit follow-ups under the same issue.
The collect_archives_picks_up_scoped_package test introduced by fails on Linux x86_64 CI (target_key derives from host arch even when platform is overridden). Loosened to prefix-check 'macos-' so it passes on both arm64 and x86_64 hosts. Drive-by inside this PR; same fix should be cherry-picked or re-landed independently if this PR doesn't merge.
The FEATURES matrix in perry-ui-test marks share_text/share_url (#917), app_group_set/get/delete (#675), and get_os_version (#976) as Supported on Web, but the corresponding stubs were never added to web_runtime.js when those PRs landed. test_web now panics with 'Web is missing 6 expected symbol(s)' on every PR's cargo-test. Add no-op / localStorage-backed stubs: - share_text/share_url: empty (real Web Share API via navigator.share is a follow-up) - app_group_set/get/delete: localStorage with prefix - get_os_version: navigator.userAgent fallback Drive-by in this PR; same fix can be cherry-picked if the ads PR doesn't merge first.
2e55b9e to
1e3213e
Compare
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.
Summary
Mirrors the just-merged #674
@perryts/google-authcookie-cutter (PR #1028) for the in-app advertising surface. Lands the v1 FFI scaffold forperry/adsso downstream work — real Google Mobile Ads SDK integration, GDPR / ATT consent flow, Info.plist + AndroidManifest auto-injection, the<AdBanner>perry/ui widget glue — can land independently against a stable manifest + codegen surface.crates/perry-ext-ads(rlib + staticlib) exposing six FFI entry points:js_ads_interstitial_load(unitId): Promise<string>— JSON{success, error?}js_ads_interstitial_show(): Promise<string>— JSON{shown, dismissed, error?}js_ads_rewarded_load(unitId): Promise<string>— JSON{success, error?}js_ads_rewarded_show(): Promise<string>— JSON{earned, amount?, type?, dismissed, error?}js_ads_banner_create(unitId, sizeKey): number— perry-ffi handle idjs_ads_banner_destroy(handle): voidperry-api-manifestNATIVE_MODULES + per-method entries,perry-codegenNATIVE_MODULE_TABLE + runtime_decls (NR_PTR / NR_F64 / NR_VOID),well_known_bindings.toml(perry/ads→libperry_ext_ads.a), and types attypes/perry/ads/index.d.ts.{ error: "no-sdk-linked" }placeholder via the standardspawn_blocking+JsPromise::resolve_stringpattern bcrypt / argon2 / google-auth use. Platform-specificmod platform { ... }blocks for iOS + macOS, Android, and other-targets carry TODO(Feature request: perry/ads — in-app advertising SDK support #867) markers where the real SDK calls (GADInterstitialAd/GADRewardedAd/GADBannerViewon Apple,com.google.android.gms.ads.*on Android) will land.Scope boundaries (explicitly out of v1)
play-services-adsintegration is the larger follow-up tracked under the same issue.<AdBanner>widget inperry/ui— banner handles round-trip through the FFI; widget tree integration is deferred.[ads]perry.tomlblock.Test plan
cargo build --release -p perry-runtime -p perry-stdlib -p perry -p perry-ext-adssucceeds../target/release/perry test-files/test_ads_compile_smoke.ts -o /tmp/test_ads_smokelinks cleanly and the binary prints all six expected lines:lint,cargo-test,parity,compile-smoke,api-docs-drift,security-audit.Part of #867. Real SDK integration / consent flow / manifest injection follow up on the same issue.