Skip to content

Commit 6188b05

Browse files
committed
and now everything works well
1 parent 17cf62c commit 6188b05

11 files changed

Lines changed: 375 additions & 351 deletions

File tree

Cargo.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ jacquard-lexicon = { path = "../jacquard/crates/jacquard-lexicon", default-featu
5656

5757
[profile]
5858

59+
[profile.wasm-release]
60+
inherits = "release"
61+
opt-level = "z"
62+
debug = false
63+
lto = true
64+
codegen-units = 1
65+
panic = "abort"
66+
incremental = false
67+
strip = "debuginfo"
68+
69+
5970
[profile.wasm-dev]
6071
inherits = "dev"
6172
debug = true
@@ -64,5 +75,10 @@ debug = true
6475
inherits = "dev"
6576
debug = true
6677

78+
79+
[profile.server-release]
80+
inherits = "release"
81+
opt-level = 2
82+
6783
[profile.android-dev]
6884
inherits = "dev"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
WEAVER_APP_ENV="prod"
2-
WEAVER_APP_HOST="https://alpha.weaver.sh"
3-
WEAVER_APP_DOMAIN="https://alpha.weaver.sh"
1+
WEAVER_APP_ENV="dev"
2+
WEAVER_APP_HOST="http://localhost"
3+
WEAVER_APP_DOMAIN=""
44
WEAVER_PORT=8080
55
WEAVER_APP_SCOPES="atproto transition:generic"
66
WEAVER_CLIENT_NAME="Weaver"

crates/weaver-app/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ serde_ipld_dagcbor = { version = "0.6" }
5252

5353
[target.'cfg(not(all(target_arch = "wasm32", target_os = "unknown")))'.dependencies]
5454
webbrowser = "1.0.6"
55-
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
55+
reqwest = { version = "0.12", default-features = false, features = ["json"] }
5656

5757
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies]
5858
reqwest = { version = "0.12", default-features = false, features = ["json"] }
196 KB
Loading

crates/weaver-app/src/blobcache.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ impl BlobCache {
4242
}
4343
AtIdentifier::Handle(handle) => self.client.pds_for_handle(&handle).await?,
4444
};
45+
if self.get_cid(&cid).is_some() {
46+
return Ok(());
47+
}
4548
let blob = if let Ok(blob_stream) = self
4649
.client
4750
.xrpc(pds_url)

crates/weaver-app/src/components/entry.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub fn EntryPage(
6969
match &*entry.read() {
7070
Some((book_entry_view, entry_record)) => {
7171
if let Some(embeds) = &entry_record.embeds {
72-
if let Some(images) = &embeds.images {
72+
if let Some(_images) = &embeds.images {
7373
// Register blob mappings with service worker (client-side only)
7474
#[cfg(all(
7575
target_family = "wasm",
@@ -83,7 +83,7 @@ pub fn EntryPage(
8383
let _ = crate::service_worker::register_entry_blobs(
8484
&ident(),
8585
book_title().as_str(),
86-
&images,
86+
&_images,
8787
&fetcher,
8888
)
8989
.await;
@@ -118,6 +118,8 @@ fn EntryPageView(
118118
.map(|t| t.as_ref())
119119
.unwrap_or("Untitled");
120120

121+
tracing::info!("Entry: {book_title} - {title}");
122+
121123
rsx! {
122124
// Set page title
123125
document::Title { "{title}" }

crates/weaver-app/src/data.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -470,29 +470,25 @@ pub fn use_profile_data(
470470
Memo<Option<ProfileDataView<'static>>>,
471471
) {
472472
let fetcher = use_context::<crate::fetch::Fetcher>();
473-
let res = use_server_future(use_reactive!(|ident| {
473+
let res = use_resource(use_reactive!(|ident| {
474474
let fetcher = fetcher.clone();
475475
async move {
476-
tracing::debug!("use_profile_data server future STARTED for {:?}", ident);
477-
let result = fetcher
476+
fetcher
478477
.fetch_profile(&ident())
479478
.await
480479
.ok()
481480
.map(|arc| serde_json::to_value(&*arc).ok())
482-
.flatten();
483-
tracing::debug!("use_profile_data server future COMPLETED for {:?}", ident);
484-
result
481+
.flatten()
485482
}
486483
}));
487484
let memo = use_memo(use_reactive!(|res| {
488-
let res = res.as_ref().ok()?;
489485
if let Some(Some(value)) = &*res.read() {
490486
jacquard::from_json_value::<ProfileDataView>(value.clone()).ok()
491487
} else {
492488
None
493489
}
494490
}));
495-
(res, memo)
491+
(Ok(res), memo)
496492
}
497493

498494
/// Fetches profile data client-side only (no SSR)

crates/weaver-app/src/env.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// This file is automatically generated by build.rs
22

33
#[allow(unused)]
4-
pub const WEAVER_APP_ENV: &'static str = "dev";
4+
pub const WEAVER_APP_ENV: &'static str = "prod";
55
#[allow(unused)]
6-
pub const WEAVER_APP_HOST: &'static str = "http://localhost";
6+
pub const WEAVER_APP_HOST: &'static str = "https://alpha.weaver.sh";
77
#[allow(unused)]
8-
pub const WEAVER_APP_DOMAIN: &'static str = "";
8+
pub const WEAVER_APP_DOMAIN: &'static str = "https://alpha.weaver.sh";
99
#[allow(unused)]
1010
pub const WEAVER_PORT: &'static str = "8080";
1111
#[allow(unused)]
1212
pub const WEAVER_APP_SCOPES: &'static str = "atproto transition:generic";
1313
#[allow(unused)]
1414
pub const WEAVER_CLIENT_NAME: &'static str = "Weaver";
1515
#[allow(unused)]
16-
pub const WEAVER_LOGO_URI: &'static str = "";
16+
pub const WEAVER_LOGO_URI: &'static str = "https://alpha.weaver.sh/favicon.ico";
1717
#[allow(unused)]
1818
pub const WEAVER_TOS_URI: &'static str = "";
1919
#[allow(unused)]

0 commit comments

Comments
 (0)