Skip to content

Commit 6ce992d

Browse files
proggeramlugclaude
andcommitted
feat: perry/widget full iOS + Android + watchOS + Wear OS support
Extend the widget system from iOS-only static widgets to a full four-platform story with config, native data fetching, and new components. New crates: perry-codegen-glance (Android Glance widgets), perry-codegen-wear-tiles (Wear OS Tiles). HIR extended with WidgetConfigParam, ForEach/Divider/Label/FamilySwitch/Gauge nodes, Array/Optional/Object field types, placeholder data, and native provider support. SwiftUI codegen enhanced with AppIntentConfiguration, native FFI glue, nested Codable structs, and Gauge emission. Four new compile targets: --target android-widget, watchos-widget, watchos-widget-simulator, wearos-tile. Documentation expanded from 3 to 8 pages covering all platforms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dff644f commit 6ce992d

29 files changed

Lines changed: 3840 additions & 165 deletions

File tree

CLAUDE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
88

99
Perry is a native TypeScript compiler written in Rust that compiles TypeScript source code directly to native executables. It uses SWC for TypeScript parsing and Cranelift for code generation.
1010

11-
**Current Version:** 0.2.197
11+
**Current Version:** 0.2.198
1212

1313
## Workflow Requirements
1414

@@ -153,6 +153,9 @@ Projects can list npm packages to compile natively instead of routing to V8. Con
153153

154154
## Recent Changes
155155

156+
### v0.2.198
157+
- **Widget: full iOS + Android + watchOS + Wear OS support**: WidgetDecl extended with `config_params` (AppIntent), `provider_func_name` (native Cranelift provider), `placeholder`, `family_param_name` (family-specific rendering), `app_group` (shared storage), `reload_after_seconds`; new WidgetNode variants: ForEach, Divider, Label, FamilySwitch, Gauge (watchOS); new WidgetModifier variants: MinimumScaleFactor, ContainerBackground, FrameMaxWidth, WidgetURL, PaddingEdge; WidgetFieldType extended with Array/Optional/Object for nested entry structs; new `perry-codegen-glance` crate (Android Glance widgets: GlanceAppWidget, Receiver, ConfigActivity, widget_info XML, manifest snippet); new `perry-codegen-wear-tiles` crate (Wear OS Tiles: TileService, JNI bridge, manifest); SwiftUI codegen enhanced with AppIntentConfiguration, native provider glue (FFI bridge), nested Codable structs, Gauge emission, family switch; 4 new compile targets: `--target watchos-widget`, `--target android-widget`, `--target wearos-tile`, `--target watchos-widget-simulator`; lowering: parse `config`, `provider`, `placeholder`, `appGroup` properties, family-switch detection from if/else on family param, ForEach/Label/Gauge/Divider node parsing, recursive WidgetFieldType parsing (arrays, optionals, nested objects)
158+
156159
### v0.2.197
157160
- **Cross-platform `menuClear` + `menuAddStandardAction` + Windows RefCell fix**: add `perry_ui_menu_clear` and `perry_ui_menu_add_standard_action` FFI to all 6 platforms (were macOS-only); fix `dispatch_menu_item` RefCell re-entrancy panic on Windows (extract callback before calling, matching macOS fix from v0.2.196); update web/WASM runtimes and feature parity test matrix
158161

Cargo.lock

Lines changed: 38 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ members = [
2020
"crates/perry-ui-geisterhand",
2121
"crates/perry-codegen-js",
2222
"crates/perry-codegen-swiftui",
23+
"crates/perry-codegen-glance",
24+
"crates/perry-codegen-wear-tiles",
2325
"crates/perry-codegen-wasm",
2426
"crates/perry-ui-test",
2527
]
@@ -40,6 +42,8 @@ default-members = [
4042
"crates/perry-ui",
4143
"crates/perry-codegen-js",
4244
"crates/perry-codegen-swiftui",
45+
"crates/perry-codegen-glance",
46+
"crates/perry-codegen-wear-tiles",
4347
"crates/perry-codegen-wasm",
4448
]
4549

@@ -75,7 +79,7 @@ opt-level = "s" # Optimize for size in stdlib
7579
opt-level = 3
7680

7781
[workspace.package]
78-
version = "0.2.197"
82+
version = "0.2.198"
7983
edition = "2021"
8084
license = "MIT"
8185
repository = "https://github.com/PerryTS/perry"
@@ -151,4 +155,6 @@ perry-diagnostics = { path = "crates/perry-diagnostics" }
151155
perry-jsruntime = { path = "crates/perry-jsruntime" }
152156
perry-codegen-js = { path = "crates/perry-codegen-js" }
153157
perry-codegen-swiftui = { path = "crates/perry-codegen-swiftui" }
158+
perry-codegen-glance = { path = "crates/perry-codegen-glance" }
159+
perry-codegen-wear-tiles = { path = "crates/perry-codegen-wear-tiles" }
154160
perry-codegen-wasm = { path = "crates/perry-codegen-wasm" }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "perry-codegen-glance"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
6+
description = "Android Glance widget code generation for Perry (--target android-widget)"
7+
8+
[dependencies]
9+
perry-hir.workspace = true
10+
anyhow.workspace = true

0 commit comments

Comments
 (0)