flow-web 0.5.19
Install from the command line:
Learn more about npm packages
$ npm install @estuary/flow-web@0.5.19
Install via package.json:
"@estuary/flow-web": "0.5.19"
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-packCLI- The
wasm32-unknown-unknowncompilation 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, andinferredschemas (whereinferredis null if no inferred schema is available), and returns an updated read-schema bundle which potentially inlines the write and inferred schemas. -
get_resource_config_pointers: takes a resourcespecas string and produces metadata about the pointers -
update_materialization_resource_spec: takessource_capture,resource_spec_pointers,collection_name, andresource_spec.resource_specis the object that is getting updated and the other fields are used to update that. It will return a copy of theresource_specwith the new fields populated.
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.