Skip to content

About

ArkTS bindings for Loro CRDT

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

loro-arkts

ArkTS bindings for Loro generated from loro-dev/loro-ffi with uniffi-bindgen-arkts.

This project follows the same shape as aholstenson/loro-go: a thin Rust crate pins the loro-ffi version and re-exports its UniFFI scaffolding, then a script builds the native library with ohrs and generates the language package.

Generate

./scripts/generate.sh

The generated ArkTS package is written to generated/example/packages/loro. The script keeps the uniffi-bindgen-arkts package layout intact and only adds the built N-API adapter library. Keeping the package inside the example project avoids ArkTS rejecting relative imports inside symlinked dependencies that resolve outside the project root.

Defaults can be overridden:

OUT_DIR=/path/to/output ./scripts/generate.sh

The default native target is OHOS_ARCH=arm64 / OHOS_ABI=arm64-v8a.

Native Adapter

The generated package contains a Rust N-API adapter under generated/example/packages/loro/native.

cd generated/example/packages/loro/native
ohrs build --release --arch arm64

The adapter output is generated/example/packages/loro/native/dist/arm64-v8a/libloro.so.

Example

cd generated/example
ohpm install --all
hvigorw assembleHap --mode module -p module=entry@default

The example consumes @ohos-rs/loro through local package dependencies: file:../packages/loro and file:../packages/loro/types/libloro. Keep useNormalizedOHMUrl enabled for this symlinked package workflow.

License

MIT

About

ArkTS bindings for Loro CRDT

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages