development_optimization #1

Open
timur wants to merge 16 commits from development_optimization into development
Owner
No description provided.
WebDAV is now served at /webdav/{context}/* on the main backend server.
No longer needs separate webdav_url - uses backend_url for all requests.

URL pattern: {backend_url}/webdav/{context}/{path}
- Add release profile with opt-level='z', LTO, single codegen unit, strip symbols, panic=abort
- Add wee_alloc as global allocator for smaller memory footprint
- Add wasm-opt optimization script with correct feature flags
- Update Makefile with release-optimized and sizes targets
- Results: ~14% size reduction (1.1MB -> 946KB for filesystem island)

Requires: brew install binaryen (for wasm-opt)
- Add release_max_level_warn feature to tracing
- Reduces filesystem island from 946KB to 931KB

Network transfer sizes (compressed):
- Gzip: 377KB
- Brotli: 299KB
- Switch to default-features = false with minimal + web + document
- Add Location, History, Url to web-sys features (required by dioxus-web)
- Removes devtools, logger overhead from release builds

Size reduction:
- 931KB -> 926KB (wasm-opt)
- 377KB -> 375KB (gzip)
- 299KB -> 297KB (brotli)
- Add 'mounted' feature to Dioxus (required for WebEventExt on MountedData)
- Add wasm-opt = false to settings island Cargo.toml
- Fix room island: use (*evt.data()).try_as_web_event() for Dioxus 0.7 API

All islands now build successfully with minimal Dioxus features.
Documents current optimization state, applied techniques, and architectural trade-offs for island WASM sizes.
- Add wee_alloc as global allocator for smaller WASM size
- Implement standalone feature flag for embedded vs separate builds
- Add IslandMetadata type for consistent metadata across islands
- Add WASM_OPTIMIZATION.md documentation
- Add optimization script with wasm-opt flags
- Makefile targets: release-optimized, sizes
- Expected savings: 83% when using embedded mode
- Update messaging/chats to use unified IdentityClient
- Update communication/room to use unified CommunicationClient
- Update intelligence/ai to use unified AiClient with chatservice_completion
- Update calendar to use unified CalendarClient
- Update system/contexts to use unified BaseClient
- Update code to use unified CodeClient

Services now work on all platforms (WASM, iOS, native) using the
unified clients from herozero-sdk that handle platform differences internally.
- Update calendar, ai, chats, chat_preview, contexts Cargo.toml files with mobile feature
- Make WASM dependencies optional with web/mobile feature flags
- Update os_components Cargo.toml to include mobile-compatible islands
- Update registry.rs to register islands for mobile platform

This enables these islands to compile for iOS/mobile targets.
- Add #[cfg(feature = "web")] gates to wasm_bindgen, web_sys, js_sys imports and usage
- Make calendar, ai, room, contexts app.rs files compile for mobile targets
- Add platform-independent helpers for timestamp generation in AI island

This fixes compilation errors when building islands for iOS/mobile.
Other islands (room, chats, chat_preview, calendar, ai, contexts) have
extensive web-specific code (js_sys, web_sys, wasm_bindgen) that needs
comprehensive cfg gating before they can compile for mobile.

For now, only contacts island is mobile-compatible.
- Create platform.rs module in core with unified APIs:
  - current_timestamp_ms(), current_timestamp_secs()
  - generate_id(prefix)
  - format_time(), format_date(), format_relative_time()
  - dispatch_event() - works on web, no-op on mobile
  - log(), warn(), error() - console on web, tracing on mobile

- Update islands to use platform abstractions:
  - AI island: app.rs, message_bubble.rs, message_list.rs
  - Chat preview: app.rs, chat_preview_component.rs
  - Contexts: app.rs

- Add mobile feature support for: contacts, ai, chats, contexts
- Update registry.rs to include mobile islands

This allows islands to compile for both web and mobile targets
without manual cfg gates throughout the codebase.
- Add platform abstraction layer in core (platform.rs) for cross-platform APIs
- Update AI, chats, chat_preview, contexts islands to use platform abstractions
- Update chats service to use unified CommunicationClient SDK (no mock data)
- Add mobile island imports and render cases in island_content.rs
- Fix page ordering: latest island appears first on mobile
- Remove redundant header/plus button from chats list (use toolbar instead)
- Fix Makefile to properly background web build in 'make all'
- Track touch start/end Y coordinates on dock container
- Detect swipe-down gesture (delta < -50px)
- Open AI island when swipe-down detected on mobile
- Add 44px icon containers with background around dock icons
- Make dock horizontally scrollable for overflow items
- Replace app icon with Home button in focused mode
- Center sections when 4 or fewer, scroll when more
- Increase mobile toolbar height to 40px
- Remove page indicator dots
- Adjust dock positioning and sizing for mobile
This pull request has changes conflicting with the target branch.
  • Cargo.toml
  • archipelagos/communication/room/src/services/room_service.rs
  • archipelagos/intelligence/agents/Cargo.toml
  • archipelagos/messaging/message/Cargo.toml
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin development_optimization:development_optimization
git switch development_optimization

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch development
git merge --no-ff development_optimization
git switch development_optimization
git rebase development
git switch development
git merge --ff-only development_optimization
git switch development_optimization
git rebase development
git switch development
git merge --no-ff development_optimization
git switch development
git merge --squash development_optimization
git switch development
git merge --ff-only development_optimization
git switch development
git merge development_optimization
git push origin development
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_archipelagos!1
No description provided.