limbo/bindings/wasm
Pere Diaz Bou 9291f60722 Introduce Register struct
OwnedValue has become a powerhouse of madness, mainly because I decided
to do it like that when I first introduced AggContext. I decided it was
enough and I introduced a `Register` struct that contains `OwnedValue`,
`Record` and `Aggregation`, this way we don't use `OwnedValue` for
everything make everyone's life harder.

This is the next step towards making ImmutableRecords the default
because I want to remove unnecessary allocations. Right now we clone
OwnedValues when we generate a record more than needed.
2025-03-27 17:53:02 +01:00
..
docs bindings/wasm: Add API reference document 2024-12-16 18:45:18 +02:00
examples Limbo 0.0.13 2025-01-19 13:30:56 +02:00
integration-tests Limbo 0.0.18-pre.2 2025-03-20 08:45:34 +02:00
node/src Reorg to single package 2025-01-16 21:29:19 -05:00
perf Improve JavaScript benchmarks 2025-01-05 20:43:55 +02:00
scripts Reorg to single package 2025-01-16 21:29:19 -05:00
test-limbo-pkg bindings/wasm: Don't depend on specific version 2025-03-19 19:12:40 +02:00
web Reorg to single package 2025-01-16 21:29:19 -05:00
.gitignore reorg package structure 2025-01-16 21:29:19 -05:00
Cargo.toml add js feature to nodejs build 2025-02-11 12:13:46 -04:00
lib.rs Introduce Register struct 2025-03-27 17:53:02 +01:00
package-lock.json Limbo 0.0.18-pre.2 2025-03-20 08:45:34 +02:00
package.json Limbo 0.0.17 2025-03-19 17:29:17 +02:00
README.md Add build for nodejs or web 2025-01-01 16:54:31 -05:00

Limbo Wasm bindings

This source tree contains Limbo Wasm bindings.

Building

For nodejs

./scripts/build

For web

./scripts/build web

Browser Support

Adding experimental support for limbo in the browser. This is done by adding support for OPFS as a VFS.

To see a basic example of this npm run dev and navigate to http://localhost:5173/limbo-opfs-test.html and open the console.

Design

This design mirrors sqlite's approach for OPFS support. It has a sync api in opfs.js which communicates with opfs-sync-proxy.js via SharedArrayBuffer and Atomics.wait. This allows us to live the VFS api in lib.rs unchanged.

You can see limbo-opfs-test.html for basic usage.

UTs

There are OPFS specific unit tests and then some basic limbo unit tests. These are run via npm test or npx vitest.

For more info and log output you can run npx vitest:ui but you can get some parallel execution of test cases which cause issues.

TODO

-[] Add a wrapper js that provides a clean interface to the limbo-worker.js -[] Add more tests for opfs.js operations -[] Add error return handling -[] Make sure posix flags for open are handled instead of just being ignored (this requires creating a mapping of behaviors from posix to opfs as far as makes sense)