Repository navigation
feat(ui): refs #517 — un-stub MapView on tvOS / GTK4 / Android / watchOS - #558
Merged
Merged
Conversation
…hOS (v0.5.637) Builds on v0.5.636's MapView API (`MapView(w,h)` + `mapViewSetRegion` / `mapViewAddPin` / `mapViewClearPins` / `mapViewSetMapType`) by replacing the silent-zero-handle stubs on four platforms. Windows remains stubbed pending WinUI MapControl XAML Islands work — separate follow-up. tvOS — source-equivalent UIKit copy of the iOS MKMapView impl. Adds `-framework MapKit` to the tvOS arm of link.rs. GTK4 — wraps `libshumate` (GNOME's GTK4 vector-tile widget). Default OSM-mapnik tile source, no API key. Markers go into a lazy MarkerLayer overlay; clear_pins drops the layer. set_region converts MapKit's lat/lon span to libshumate's tile zoom via log2(360 / span). Cargo dep `libshumate = "0.6"` (matches gtk4-rs 0.9). New pkg-config / hardcoded-fallback link block in link.rs for shumate-1.0. Android — Google Maps SDK MapView via 5 new PerryBridge.kt static helpers + lifecycle forwarding (forwardMapsLifecycle event hook) in PerryActivity.kt. Pending-ops queue replays calls once getMapAsync fires. set_map_type translates 0/1/2 → MAP_TYPE_NORMAL/SATELLITE/HYBRID explicitly (Google's enum is 1/2/3/4 with TERRAIN=3). Gradle dep play-services-maps:18.2.0; AndroidManifest meta-data placeholder for the Google Maps API key. watchOS — extends the data-driven SwiftUI tree model with NodeKind::MapView + map_lat/lon/lat_span/lon_span/type/pins fields, 9 new FFI getters, and a `mapView` SwiftUI subview rendering Map(coordinateRegion:annotationItems:) with MapMarker pins (the deprecated-but-watchOS-7-compatible API; newer Marker shape requires watchOS 10). Adds `import MapKit` to PerryWatchApp.swift. Verified - Workspace builds clean on macOS host (libshumate 0.6 resolves against gtk4-rs 0.9, no gtk-4 links collision) - perry-ui-watchos cargo check clean - Minimal MapView smoke test (MapView/setRegion/addPin/clearPins/ setMapType) compiles + binary launches into a real MKMapView - Cross-compile verification (NDK / GTK4 on Linux / WatchKit) deferred to maintainer's host environments at merge time - Parallel android-build/ template at repo root needs the same Kotlin / Manifest / Gradle changes — synced at merge time per the v0.5.632 convention
proggeramlug
force-pushed
the
worktree-issue-517-map-widget
branch
from
May 7, 2026 13:08
a70baea to
f42da21
Compare
proggeramlug
added a commit
that referenced
this pull request
May 7, 2026
…metadata for non-exported classes (v0.5.638)
Lib3 exports class C with populate() { this.children['a'] = new Inner(); },
where Inner is a sibling class declared in the same module BUT not exported.
The HIR-level inliner harvested populate as cross-module-inlinable (the
is_cross_module_safe filter only rejects FuncRef / ExternFuncRef / GlobalGet
/ Closure — NOT Expr::New { class_name } against an unexported local class).
Body got copied verbatim; consumer's lower_new("Inner") fell into the
no-class-metadata fallback and emitted js_object_alloc(0, 0); subsequent
inst.method() dispatch found class_id=0 and fell through to NULL.
Fix adds collect_nonexported_class_names + body_references_class_in_set
helpers to crates/perry-transform/src/inline.rs. Methods whose body
references any local non-exported class via Expr::New / ClassRef /
StaticFieldGet / StaticFieldSet / ClassStaticSymbolSet / StaticMethodCall
are excluded from the cross-module inline candidates. Such methods stay as
real cross-module method calls (bl perry_method_<src>__C__populate), where
the source module's codegen — which DOES have the class metadata — emits
the correct inline-alloc with the right class_id.
__AnonShape_* content-addressed shapes are deliberately KEPT inlinable
because they're already propagated via extra_anon_classes so the
destination module synthesizes the same definition.
End-to-end: minimal repro (new Inner() inside populate()) prints
'result: hello-inner' matching Node byte-for-byte (was '[object Object]').
Sanity tests test_inheritance / test_gap_class_advanced / test_gap_closures
/ test_edge_promises all match Node. Hono canonical
app.get('/', c => c.text('hello')) still passes.
Version bumped from the original 0.5.637 to 0.5.638 because v0.5.637 was
already taken by the parallel MapView un-stub merge (c3bc684, PR #558)
that landed first.
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
Un-stubs the
MapViewwidget on tvOS, GTK4, Android, and watchOS, complementing v0.5.636's macOS / iOS / visionOS impls. Windows remains stubbed pending WinUI MapControl XAML Islands work — tracked as a separate follow-up issue.This PR was originally a parallel
Map(lat, lng, zoom)API, but main shipped a differentMapView(w, h)API in v0.5.636 first. This rewrites everything onto main'sMapViewAPI so the four newly-supported platforms speak the same surface as the Apple platforms.What it un-stubs
-framework MapKitto tvOS link arm.libshumateset_regionconverts lat/lon span to libshumate's tile zoom vialog2(360 / span).PerryBridge.kthelpers + activity lifecycle forwarding (forwardMapsLifecycle). Per-MapView pending-ops queue replays calls untilgetMapAsyncfires.set_map_typeexplicitly translates 0/1/2 →MAP_TYPE_NORMAL/_SATELLITE/_HYBRID.NodeKind::MapView+ 6 fields + 9 FFI getters;Map(coordinateRegion:annotationItems:)withMapMarkerpins (watchOS 7+ API).Required user action
__YOUR_GOOGLE_MAPS_API_KEY__inAndroidManifest.xmlwith a real key from Google Cloud Console (Maps SDK for Android enabled).libshumate-dev(Debian/Ubuntu) orlibshumate-devel(Fedora/RHEL).Test plan
gtk-4links collision)cargo check -p perry-ui-watchoscleanMapView+setRegion+addPin+clearPins+setMapType(1)smoke test compiles, binary launches into a real MKMapViewandroid-build/template at repo root needs same Kotlin / Manifest / Gradle changes — synced at merge time per v0.5.632 conventionWhy this PR (timeline)
Map(lat,lng,zoom)API on Apple platformsMapView(w,h)API on macOS/iOS/visionOS while this PR was open — superseded the Apple-side workMapViewAPI. Strictly additive vs main now.