feat: Browser usage docs/example
Is your feature request related to a problem? Please describe. The problem is I would like to try to run Wick components in the browser, but it's unclear to me if that's possible and how.
Propose a solution Possible solution is a basic example in the examples folder and/or details in the docs on how-to.
Describe alternatives you've considered
I did find the https://www.npmjs.com/package/@candlecorp/wick package, but it lacks a README or any docs.
Thanks for the issue @DougAnderson444. I'm working on that now so good timing. I will have more docs and tutorials out this week.
That's awesome @jsoverson! Thanks so much, this Wick project is super cool looking and I'm interested in building some browser components. I've been following the WIT Component Model and have even contributed to jco in order to get things working in the browser. Very interested in seeing how it would work with Wick.
@DougAnderson444
- I updated the WebAssembly tutorial here: https://candle.dev/docs/wick/getting-started/webassembly/
- I added a component loader here, which is also an example of a minimal Vite/Svelte app here.
- I added a node.js quickstart here and example project.
The documentation will improve over time, but this is a start.
Thanks @jsoverson (especially for choosing Svelte & Vite over React 😂). I just need enough to get started and check this out in the browser.
I'll give it a shot and can provide some feedback as I experiment
While I'm here, can you confirm if the LLM Llama example also is running 100% on the browser client too?
Yes, there's no server-side aspect to any of the in-browser demos.
Ran into the first issue: build.rs won't build:
cargo build
unknown field operations
error: failed to run custom build command for `jinja v0.1.0`
Caused by:
process didn't exit successfully: (exit status: 1)
--- stdout
cargo:rerun-if-changed=component.wick
--- stderr
Error: Could not parse manifest /home/doug/code/rust/components/jinja/component.wick as YAML: unknown field `operations`,
expected one of `name`, `metadata`, `package`, `host`, `resources`, `import`, `types`, `requires`, `component`, `tests` at
line unknown, column unknown
I think I need this just cli installed, but not seeing how to install it. I've installed wick-cli but still not getting a just command.
Found just, will make a PR to add a line to the docs
Even when using just build I still get
Error: Could not parse manifest /home/doug/code/rust/components/jinja/component.wick as YAML: unknown field `operations`, expected one of `name`
, `metadata`, `package`, `host`, `resources`, `import`, `types`, `requires`, `component`, `tests` at line unknown, column unknown
Looks like the operations block needs to be indented one more level to just build. Pull request sent.