Skip to content

Commit f4da13a

Browse files
committed
new: update template deps (hyperapp)
1 parent 31f663f commit f4da13a

8 files changed

Lines changed: 31 additions & 51 deletions

File tree

src/new/templates/rust/ui/hyperapp-skeleton/example-apps/file-explorer/explorer/Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
[dependencies]
22
anyhow = "1.0"
33
md5 = "0.7"
4+
hyperapp_macro = "0.1.1"
45
process_macros = "0.1"
56
serde_json = "1.0"
67
serde_urlencoded = "0.7"
78
tracing = "0.1.37"
89
wit-bindgen = "0.42.1"
910

10-
[dependencies.hyperprocess_macro]
11-
git = "https://github.com/hyperware-ai/hyperprocess-macro"
12-
rev = "66884c0"
13-
1411
[dependencies.hyperware_process_lib]
1512
features = ["hyperapp"]
1613
git = "https://github.com/hyperware-ai/process_lib"
17-
rev = "4beff93"
14+
rev = "1a6ad9d"
1815

1916
[dependencies.serde]
2017
features = ["derive"]

src/new/templates/rust/ui/hyperapp-skeleton/example-apps/file-explorer/explorer/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use hyperprocess_macro::hyperprocess;
21
use hyperware_process_lib::hyperapp::{add_response_header, get_path, send, SaveOptions};
32
use hyperware_process_lib::logging::{debug, error, info, init_logging, Level};
43
use hyperware_process_lib::our;
@@ -11,7 +10,6 @@ const ICON: &str = include_str!("./icon");
1110
const PROCESS_ID_LINK: &str = "explorer:file-explorer:sys";
1211

1312
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
14-
#[serde(rename_all = "camelCase")]
1513
pub struct FileInfo {
1614
pub name: String,
1715
pub path: String,
@@ -36,7 +34,7 @@ struct FileExplorerState {
3634
cwd: String,
3735
}
3836

39-
#[hyperprocess(
37+
#[hyperapp_macro::hyperapp(
4038
name = "file-explorer",
4139
ui = Some(HttpBindingConfig::default().secure_subdomain(true)),
4240
endpoints = vec![

src/new/templates/rust/ui/hyperapp-skeleton/example-apps/id/id/Cargo.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[dependencies]
22
anyhow = "1.0.97"
3+
hyperapp = "0.1.1"
34
process_macros = "0.1"
45
rmp-serde = "1.3.0"
56
serde_json = "1.0"
@@ -8,13 +9,9 @@ wit-bindgen = "0.36.0"
89
[dependencies.caller-utils]
910
path = "../target/caller-utils"
1011

11-
[dependencies.hyperprocess_macro]
12-
git = "https://github.com/hyperware-ai/hyperprocess-macro"
13-
rev = "4c944b2"
14-
15-
[dependencies.hyperware_app_common]
16-
git = "https://github.com/hyperware-ai/hyperprocess-macro"
17-
rev = "4c944b2"
12+
[dependencies.hyperware_process_lib]
13+
version = "2.2.0"
14+
features = ["hyperapp"]
1815

1916
[dependencies.serde]
2017
features = ["derive"]

src/new/templates/rust/ui/hyperapp-skeleton/example-apps/id/id/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use caller_utils::sign::{sign_local_rpc, verify_local_rpc};
2-
use hyperprocess_macro::hyperprocess;
32
use hyperware_process_lib::logging::{init_logging, Level};
43
use hyperware_process_lib::Address;
54

@@ -10,7 +9,7 @@ fn make_sign_sys() -> Address {
109
Address::new("our", ("sign", "sign", "sys"))
1110
}
1211

13-
#[hyperprocess(
12+
#[hyperapp_macro::hyperapp(
1413
name = "id",
1514
ui = Some(HttpBindingConfig::default()),
1615
endpoints = vec![

src/new/templates/rust/ui/hyperapp-skeleton/example-apps/sign/sign/Cargo.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[dependencies]
22
anyhow = "1.0.97"
3+
hyperapp_macro = "0.1.1"
34
process_macros = "0.1"
45
rmp-serde = "1.1.2"
56
serde_json = "1.0"
@@ -8,13 +9,9 @@ wit-bindgen = "0.36.0"
89
[dependencies.caller-utils]
910
path = "../target/caller-utils"
1011

11-
[dependencies.hyperprocess_macro]
12-
git = "https://github.com/hyperware-ai/hyperprocess-macro"
13-
rev = "4c944b2"
14-
15-
[dependencies.hyperware_app_common]
16-
git = "https://github.com/hyperware-ai/hyperprocess-macro"
17-
rev = "4c944b2"
12+
[dependencies.hyperware_process_lib]
13+
version = "2.2.0"
14+
features = ["hyperapp"]
1815

1916
[dependencies.serde]
2017
features = ["derive"]

src/new/templates/rust/ui/hyperapp-skeleton/example-apps/sign/sign/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use hyperware_process_lib::logging::{init_logging, Level};
44
use hyperware_process_lib::net::{NetAction, NetResponse};
55
use hyperware_process_lib::{last_blob, our, LazyLoadBlob, Request};
66

7-
use hyperware_app_common::{send_rmp, source};
8-
use hyperprocess_macro::hyperprocess;
7+
use hyperware_app_common::hyperapp::{send_rmp, source};
98

109
#[derive(Default, Debug, serde::Serialize, serde::Deserialize)]
1110
struct SignState {}
@@ -69,7 +68,7 @@ fn make_message(bytes: &Vec<u8>) -> Vec<u8> {
6968
[source().to_string().as_bytes(), &bytes].concat()
7069
}
7170

72-
#[hyperprocess(
71+
#[hyperapp_macro::hyperapp(
7372
name = "sign",
7473
ui = None,
7574
endpoints = vec![],

src/new/templates/rust/ui/hyperapp-skeleton/hyperapp-skeleton/Cargo.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[dependencies]
22
anyhow = "1.0"
3+
hyperapp_macro = "0.1.1"
34
process_macros = "0.1"
45
serde_json = "1.0"
56
wit-bindgen = "0.42.1"
@@ -8,14 +9,9 @@ wit-bindgen = "0.42.1"
89
optional = true
910
path = "../target/hyperapp-skeleton-caller-utils"
1011

11-
[dependencies.hyperprocess_macro]
12-
git = "https://github.com/hyperware-ai/hyperprocess-macro"
13-
rev = "aaf7e02"
14-
1512
[dependencies.hyperware_process_lib]
13+
version = "2.2.0"
1614
features = ["hyperapp"]
17-
git = "https://github.com/hyperware-ai/process_lib"
18-
rev = "e8b065179ce5d15893a23142416e59c87e0f31f6"
1915

2016
[dependencies.serde]
2117
features = ["derive"]

src/new/templates/rust/ui/hyperapp-skeleton/hyperapp-skeleton/src/lib.rs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
// This is a minimal, well-commented skeleton app for the Hyperware platform
33
// using the Hyperapp framework (macro-driven approach).
44

5-
// CRITICAL IMPORTS - DO NOT MODIFY THESE
6-
// The hyperprocess_macro provides everything you need including:
7-
// - Async/await support (custom runtime)
8-
// - Automatic WIT (WebAssembly Interface Types) generation
9-
// - State persistence
10-
// - HTTP/WebSocket bindings
11-
use hyperprocess_macro::hyperprocess;
12-
135
use hyperware_process_lib::{homepage::add_to_homepage, our, println};
146
use serde::{Deserialize, Serialize};
157

@@ -33,8 +25,13 @@ pub struct Status {
3325
}
3426

3527
// STEP 2: IMPLEMENT YOUR APP LOGIC
36-
// The #[hyperprocess] attribute goes HERE, before the impl block
37-
#[hyperprocess(
28+
29+
// The hyperapp_macro provides:
30+
// - Async/await support (custom runtime)
31+
// - Automatic WIT (WebAssembly Interface Types) generation
32+
// - State persistence
33+
// - HTTP/WebSocket bindings
34+
#[hyperapp_macro::hyperapp(
3835
name = "HyperappSkeleton App",
3936
ui = Some(hyperware_process_lib::http::server::HttpBindingConfig::default()),
4037
endpoints = vec![
@@ -58,16 +55,16 @@ impl AppState {
5855
// Add your app to the Hyperware homepage
5956
// Parameters: name, icon, path, widget
6057
add_to_homepage("HyperappSkeleton App", Some(ICON), Some("/"), None);
61-
58+
6259
// Initialize your app state
6360
self.counter = 0;
6461
self.messages.push("App initialized!".to_string());
65-
62+
6663
// Get our node identity (useful for P2P apps)
6764
let our_node = our().node.clone();
6865
println!("HyperappSkeleton app initialized on node: {}", our_node);
6966
}
70-
67+
7168
// HTTP ENDPOINT EXAMPLE
7269
#[local]
7370
#[http]
@@ -78,7 +75,7 @@ impl AppState {
7875
node: our().node.clone(),
7976
})
8077
}
81-
78+
8279
// HTTP ENDPOINT WITH PARAMETERS
8380
// Frontend sends parameters as either:
8481
// - Single value: { "MethodName": value }
@@ -92,23 +89,23 @@ impl AppState {
9289

9390
Ok(self.counter)
9491
}
95-
92+
9693
// HTTP ENDPOINT RETURNING COMPLEX DATA
9794
// For complex types, return as JSON string to avoid WIT limitations
9895
#[local]
9996
#[http]
10097
async fn get_messages(&self) -> Result<Vec<String>, String> {
10198
Ok(self.messages.clone())
102-
}
99+
}
103100
}
104101

105102

106103
// WIT TYPE COMPATIBILITY NOTES:
107-
// The hyperprocess macro generates WebAssembly Interface Types from your code.
104+
// The hyperapp macro generates WebAssembly Interface Types from your code.
108105
// Supported types:
109106
// ✅ Primitives: bool, u8-u64, i8-i64, f32, f64, String
110107
// ✅ Vec<T> where T is supported
111-
// ✅ Option<T> where T is supported
108+
// ✅ Option<T> where T is supported
112109
// ✅ Simple structs with public fields
113110
// ❌ HashMap - use Vec<(K,V)> instead
114111
// ❌ Fixed arrays [T; N] - use Vec<T>

0 commit comments

Comments
 (0)