3 releases (breaking)

0.4.0 Oct 18, 2023
0.3.0 Sep 14, 2023
0.2.0 Apr 18, 2023

#1414 in Procedural macros

Download history 45/week @ 2023-12-18 33/week @ 2023-12-25 13/week @ 2024-01-01 39/week @ 2024-01-08 29/week @ 2024-01-15 24/week @ 2024-01-22 13/week @ 2024-01-29 34/week @ 2024-02-05 34/week @ 2024-02-12 70/week @ 2024-02-19 65/week @ 2024-02-26 55/week @ 2024-03-04 55/week @ 2024-03-11 56/week @ 2024-03-18 110/week @ 2024-03-25 135/week @ 2024-04-01

370 downloads per month
Used in 21 crates (via wick-config)

Apache-2.0

32KB
862 lines

Contributors Issues Chat Build Version Twitter LinkedIn


wick logo

A functional framework for WebAssembly components that run on the server and client.
Explore the docs »

Install · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Wick is a runtime for running and composing WebAssembly components together as full applications. Wick is built With ❤️, Rust, and Wasm.

(back to top)

Why Wick?

We built wick because we wanted a secure, fast, functional framework that used WebAssembly as its core component model. We wanted to build applications and libraries that could run on the server, client, and everywhere else. We needed it to be async first, streaming, and not rely on external systems. Suprisingly, nothing like this existed, so we built it.

Who should use Wick?

If you:

  • Like functional programming ideas.
  • Want to write code once and use it the same way everywhere.
  • Like security baked into your applications.
  • Have built enough software to recognize everyone is solving the same problems.
  • Play on the bleeding edge of technology.

Then Wick is for you.

Demos/Examples

Online demos of Wick in action:

Public repository of component examples:

Wick's example directory:

Getting Started

You'll need the wick binary to run Wick applications or invoke Wick components. You can install it with one of the following methods:

Installation

Pick your installation preference:

  1. Cargo
  2. Homebrew
  3. Pre-built binaries
  4. Install from source

Install with Cargo

cargo install wick-cli

(back to top)

Install with Homebrew

brew install candlecorp/tap/wick

(back to top)

Install pre-built binaries

Mac/Linux
curl -sSL sh.wick.run | bash
Windows
curl https://ps.wick.run -UseBasicParsing | Invoke-Expression

(back to top)

Install from source

git clone https://github.com/candlecorp/wick.git && cd wick
just deps # install necessary dependencies
just install # or cargo install --path .

(back to top)

Usage

Wick's original WebAssembly component protocol uses RSocket to support complex, rich streams in WebAssembly.

Wick supports varying degrees of the standard WebAssembly component model and will continue to support more as the specification stabilizes.

To build a WebAssembly component

  • Clone the template with cargo generate (or git clone)
  • Build & sign it with just build
  • Execute your new library component with wick invoke
$ cargo generate candlecorp/wick templates/rust --name my-project
$ cd my-project
$ just build
$ wick invoke component.wick greet -- --input="$USER"
{"payload":{"value":"Hello, jsoverson"},"port":"output"}

Check out the WebAssembly tutorial to learn more and go from here.

Examples

We're always adding examples to the ./examples directory, which we also use as a base for our integration tests.

For more information, please refer to the Documentation

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Wick is distributed under the Elastic License 2.0 and Apache-2.0 licenses. See LICENSE for more information and individual crates for details.

(back to top)

Contact

@candle_corp - jarrod@candle.dev

Project Link: https://github.com/candlecorp/wick

(back to top)


lib.rs:

This crate provides a derive macro for the AssetManager trait.

Example

use derive_asset_container::AssetManager;

#[derive(Clone, AssetManager)]
#[asset(asset(TestAsset))]
struct Struct {
  field: TestAsset,
  inner: InnerStruct,
}

#[derive(Clone, AssetManager)]
#[asset(asset(TestAsset), lazy)]
struct InnerStruct {
  field: TestAsset,
}

Dependencies

~1.3–2.2MB
~43K SLoC