wick icon indicating copy to clipboard operation
wick copied to clipboard

feat: Browser usage docs/example

Open DougAnderson444 opened this issue 2 years ago • 10 comments

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.

DougAnderson444 avatar Oct 30 '23 17:10 DougAnderson444

Thanks for the issue @DougAnderson444. I'm working on that now so good timing. I will have more docs and tutorials out this week.

jsoverson avatar Oct 30 '23 18:10 jsoverson

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 avatar Oct 30 '23 20:10 DougAnderson444

@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.

jsoverson avatar Nov 03 '23 15:11 jsoverson

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

DougAnderson444 avatar Nov 03 '23 15:11 DougAnderson444

While I'm here, can you confirm if the LLM Llama example also is running 100% on the browser client too?

DougAnderson444 avatar Nov 03 '23 15:11 DougAnderson444

Yes, there's no server-side aspect to any of the in-browser demos.

jsoverson avatar Nov 03 '23 15:11 jsoverson

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.

DougAnderson444 avatar Nov 05 '23 11:11 DougAnderson444

Found just, will make a PR to add a line to the docs

DougAnderson444 avatar Nov 05 '23 11:11 DougAnderson444

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

DougAnderson444 avatar Nov 05 '23 11:11 DougAnderson444

Looks like the operations block needs to be indented one more level to just build. Pull request sent.

DougAnderson444 avatar Nov 05 '23 13:11 DougAnderson444