AppFlowy-Cloud/libs/client-api-wasm
Nathan.fooo 5f126375ed
chore: separate client api (#567)
2024-05-21 12:20:15 +08:00
..
src chore: separate client api (#567) 2024-05-21 12:20:15 +08:00
.gitignore feat: support client api to wasm (#426) 2024-04-02 15:19:21 +08:00
Cargo.toml feat: implement grpc for history server (#470) 2024-04-16 14:10:56 +08:00
README.md feat: support client api to wasm (#426) 2024-04-02 15:19:21 +08:00

README.md

Client API WASM

Client-API to WebAssembly Compiler

🚴 Usage

🐑 Prepare

# Clone the repository (if you haven't already)
git clone https://github.com/AppFlowy-IO/AppFlowy-Cloud.git

# Navigate to the client-for-wasm directory
cd libs/client-api-wasm

# Install the dependencies (if you haven't already)
cargo install wasm-pack

🛠️ Build with wasm-pack build

wasm-pack build

🔬 Test in Headless Browsers with wasm-pack test

# Ensure you have geckodriver installed
wasm-pack test --headless --firefox

# or
# Ensure you have chromedriver installed
# https://googlechromelabs.github.io/chrome-for-testing/
# Example (Linux):
# 1. wget https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.86/linux64/chromedriver-linux64.zip
# 2. unzip chromedriver-linux64.zip
# 3. sudo mv chromedriver /usr/local/bin
# 4. chromedriver -v
# If you see the version, then you have successfully installed chromedriver
# Note: the version of chromedriver should match the version of chrome installed on your system
wasm-pack test --headless --chrome

🎁 Publish to NPM with wasm-pack publish

Don't publish in local development, only publish in github actions
wasm-pack publish

📦 Use your package as a dependency

npm install --save @appflowy/client-api-for-wasm

📝 How to use the package in development?

See the README.md in the AppFlowy Repository.