flow-web 0.3.0
Install from the command line:
Learn more about npm packages
$ npm install @estuary/flow-web@0.3.0
Install via package.json:
"@estuary/flow-web": "0.3.0"
About this version
This is the source for the flow-web
NPM package, which exposes Javascript/Typescript bindings to Flow library functions in Web Assembly (WASM). The gist is
that we compile this Rust crate to WASM and then generate the corresponding JS/TS files using wasm-bindgen
. We use wasm-pack
to put everything together into
an NPM package that works with Webpack, and publish that to Github packages.
In order to build this crate, you need the following things installed:
wasm-pack
CLI- The
wasm32-unknown-unknown
compilation target (rustup target add wasm32-unknown-unknown
)
wasm-pack build crates/flow-web
wasm-pack test --headless --firefox crates/flow-web
-
infer
: takes a JSON schema as input, and produces metadata about its inferred locations. -
extend_read_bundle
: takesread
,write
, andinferred
schemas (whereinferred
is null if no inferred schema is available), and returns an updated read-schema bundle which potentially inlines the write and inferred schemas.
Update the version in crates/flow-web/Cargo.toml
.
The crate version needs to be updated in that file in order for the publication to the GitHub NPM registry to succeed. That registry doesn't allow overwriting versions. When when originally set this up, it wasn't clear how to plumb through our dynamically generated versions through all the wasm/js/npm layers. It may be possible to improve, but for now, flow-web will only be successfully published when the version number in Cargo.toml is incremented.