Skip to content

Commit 2192ff6

Browse files
committed
Merge branch 'tlg/uniffi-tweaks' into 'develop'
Small Uniffi Followup Changes See merge request polycentric/polycentric!506
2 parents b71f6c8 + 9197b0c commit 2192ff6

4 files changed

Lines changed: 5 additions & 72 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,4 @@ exclude = ["legacy/"]
1111
resolver = "2"
1212

1313
[workspace.dependencies]
14-
uniffi = { version = "=0.31.0", features = ["tokio"] }
15-
16-
# Size-optimized profile for rs-core FFI artifacts (Android, iOS).
17-
[profile.release-rs-core]
18-
inherits = "release"
19-
opt-level = "s"
20-
lto = "fat"
21-
codegen-units = 1
22-
panic = "abort"
23-
strip = "debuginfo"
14+
uniffi = { version = "=0.31.0", features = ["tokio"] }

apps/polycentric/src/features/composer/ComposeSheetInner.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ export function ComposeSheetInner({
178178
const event = await client.buildEvent(content);
179179

180180
const signedEvent = await client.signEvent(event);
181-
console.log(signedEvent);
182181
// `commitEvent` persists the event locally and, when content is
183182
// passed, seeds the core's content store + emits contentCreated
184183
// with both signedEvent and content so feeds can decode directly.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
"lint:fix": "turbo run lint:fix",
1313
"run:ios": "pnpm -C apps/polycentric run ios",
1414
"run:android": "pnpm -C apps/polycentric run android",
15-
"run:web": "pnpm -C apps/polycentric run web"
15+
"run:web": "pnpm -C apps/polycentric run web",
16+
"ubrn:android": "pnpm -C packages/react-native ubrn:android",
17+
"ubrn:ios": "sh -c 'if [ \"$(uname -s)\" = Darwin ]; then pnpm -C packages/react-native ubrn:ios; else echo Skipping ubrn:ios: macOS-only build; fi'",
18+
"ubrn": "pnpm ubrn:android && pnpm ubrn:ios"
1619
},
1720
"devDependencies": {
1821
"@types/react": "~19.2.10",

packages/rs-core/justfile

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ _ensure-protos:
77
exit 1; \
88
fi
99

10-
_ensure-ffi: _ensure-protos
11-
@if ! command -v llvm-strip > /dev/null; then \
12-
echo "llvm-strip not found, skipping."; \
13-
fi
14-
1510
# Run all tests
1611
test: _ensure-protos
1712
@echo "Running tests..."
@@ -50,63 +45,8 @@ open-docs:
5045
@echo "Opening documentation..."
5146
@open target/doc/polycentric_core/index.html
5247

53-
# Build, strip, and deploy FFI static lib for a given target
54-
_build-ffi target dest: _ensure-ffi
55-
#!/usr/bin/env bash
56-
# Skip Apple targets on non-macOS
57-
if [[ "{{target}}" == *apple* ]] && [[ "$(uname)" != "Darwin" ]]; then
58-
echo "Skipping {{target}} (requires macOS)"
59-
exit 0
60-
fi
61-
if ! rustup target list --installed | grep -q '^{{target}}$'; then
62-
echo "Skipping {{target}} (not installed — run 'rustup target add {{target}}' to enable)"
63-
exit 0
64-
fi
65-
if ! cargo rustc --profile release-rs-core --target {{target}} --features ffi --no-default-features --crate-type staticlib 2>&1; then
66-
echo "FAILED: {{target}}"
67-
exit 1
68-
fi
69-
lib="../../target/{{target}}/release-rs-core/libpolycentric_core.a"
70-
if command -v llvm-strip > /dev/null; then llvm-strip --strip-debug "$lib"; fi
71-
mkdir -p "{{dest}}"
72-
cp "$lib" "{{dest}}/libpolycentric_core.a"
73-
size=$(du -sh "{{dest}}/libpolycentric_core.a" | cut -f1 | xargs)
74-
printf "%-30s %s\n" "{{target}}" "$size"
75-
76-
ios-libs := "../react-native/ios/libs"
77-
android-libs := "../react-native/android/libs"
78-
79-
# Build FFI for real iOS devices (ARM64)
80-
build-ffi-ios: (_build-ffi "aarch64-apple-ios" (ios-libs / "aarch64-apple-ios"))
81-
# Build FFI for iOS simulator on Apple Silicon Macs
82-
build-ffi-ios-sim: (_build-ffi "aarch64-apple-ios-sim" (ios-libs / "aarch64-apple-ios-sim"))
83-
# Build FFI for iOS simulator on Intel Macs
84-
build-ffi-ios-sim-x86: (_build-ffi "x86_64-apple-ios" (ios-libs / "x86_64-apple-ios"))
85-
# Build FFI for Android ARM64
86-
build-ffi-android-arm64: (_build-ffi "aarch64-linux-android" (android-libs / "arm64-v8a"))
87-
# Build FFI for Android ARMv7
88-
build-ffi-android-armv7: (_build-ffi "armv7-linux-androideabi" (android-libs / "armeabi-v7a"))
89-
# Build FFI for Android x86
90-
build-ffi-android-x86: (_build-ffi "i686-linux-android" (android-libs / "x86"))
91-
# Build FFI for Android x86_64
92-
build-ffi-android-x86_64: (_build-ffi "x86_64-linux-android" (android-libs / "x86_64"))
93-
94-
_clean-react-native-libs:
95-
@rm -rf {{ios-libs}} {{android-libs}}
96-
# Build all Android targets
97-
build-ffi-android-all: build-ffi-android-arm64 build-ffi-android-armv7 build-ffi-android-x86 build-ffi-android-x86_64
98-
99-
# Build everything (sim + android), deploy to react-native
100-
build-all: _clean-react-native-libs build-ffi-ios-sim build-ffi-android-all
101-
102-
# Build everything (device + android), deploy to react-native
103-
build-all-device: _clean-react-native-libs build-ffi-ios build-ffi-android-all
104-
105-
10648
# Clean build artifacts
10749
clean:
10850
@echo "Cleaning build artifacts..."
10951
@cargo clean
110-
@if [ -d pkg-web ]; then rm -rf pkg-web; echo "Removed pkg-web directory."; fi
111-
@if [ -d pkg-node ]; then rm -rf pkg-node; echo "Removed pkg-node directory."; fi
11252
@echo "Build artifacts have been removed."

0 commit comments

Comments
 (0)