Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions docs/runtime/creating-host-plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,91 @@ languages: [Rust]
platforms: [wasmCloud, Wasmtime]
---

import CommunityCalls from '@theme/wasmcloud/components/community-calls';

### Extend wasmCloud hosts with additional capabilities.

The `wash-runtime` crate includes [built-in support](../overview/hosts/plugins.mdx) for common WASI interfaces like HTTP, key-value, and configuration. When you need to provide capabilities that aren't covered by the built-ins—such as integrating with a proprietary database, exposing specialized hardware, or implementing a custom protocol—you can create a custom plugin.

A host plugin is primarily responsible for implementing a specific WIT world as a collection of imports and exports that will be directly linked to the workload's `wasmtime::component::Linker`.

{/* ===================== POC: "Discussed in community meetings" info-bar =====================
Three takes shown stacked for comparison. Keep ONE and delete the others (and these
comment markers + the "POC — Take N" labels) once a design is chosen. ============== */}

**POC — Take 1: native admonition (pure markdown, no component)**

:::info[Discussed in community meetings]

- [wasmCloud V2: The Wasm Component Model & a Simplified Host](/community/2025-09-17-community-meeting/) — Sep 17, 2025
- [12:12 — wRPC layer as an opt-in host plugin](https://youtu.be/vTbKtMkWxBQ?t=732)
- [32:30 — Host plugins in the Wasmtime linker](https://youtu.be/vTbKtMkWxBQ?t=1950)
- [wasmCloud Runtime Crate: Embedding Wasmtime](/community/2025-10-15-community-meeting/) — Oct 15, 2025
- [17:00 — Host plugins: extending the host without capability providers](https://youtu.be/3DlUjl8gQVs?t=1020)
- [wasmCloud v2 on Kubernetes: Runtime Operator & wash host](/community/2025-11-05-community-meeting/) — Nov 5, 2025
- [31:25 — Transport plugins, wRPC, and host plugins as providers](https://youtu.be/FbLNlZgzWOU?t=1885)
- [Endive Java Wasm Host, JCO WASI P3 & the Component Model](/community/2026-05-27-community-meeting/) — May 27, 2026
- [29:22 — Plugin-vs-service decision framework](https://youtu.be/QyVyD37cvrw?t=1762)

:::

**POC — Take 2: branded `<CommunityCalls>` component**

<CommunityCalls
meetings={[
{
title: 'wasmCloud V2: The Wasm Component Model & a Simplified Host',
date: 'Sep 17, 2025',
url: '/community/2025-09-17-community-meeting/',
videoId: 'vTbKtMkWxBQ',
chapters: [
{ t: 732, label: 'wRPC layer as an opt-in host plugin' },
{ t: 1950, label: 'Host plugins in the Wasmtime linker' },
],
},
{
title: 'wasmCloud Runtime Crate: Embedding Wasmtime',
date: 'Oct 15, 2025',
url: '/community/2025-10-15-community-meeting/',
videoId: '3DlUjl8gQVs',
chapters: [{ t: 1020, label: 'Host plugins: extending the host without capability providers' }],
},
{
title: 'wasmCloud v2 on Kubernetes: Runtime Operator & wash host',
date: 'Nov 5, 2025',
url: '/community/2025-11-05-community-meeting/',
videoId: 'FbLNlZgzWOU',
chapters: [{ t: 1885, label: 'Transport plugins, wRPC, and host plugins as providers' }],
},
{
title: 'Endive Java Wasm Host, JCO WASI P3 & the Component Model',
date: 'May 27, 2026',
url: '/community/2026-05-27-community-meeting/',
videoId: 'QyVyD37cvrw',
chapters: [{ t: 1762, label: 'Plugin-vs-service decision framework' }],
},
]}
/>

**POC — Take 3: compact collapsible strip**

<details className="community-calls-compact">
<summary>📺 This topic was discussed in 4 community calls</summary>

- [wasmCloud V2: The Wasm Component Model & a Simplified Host](/community/2025-09-17-community-meeting/) — Sep 17, 2025
- [12:12 — wRPC layer as an opt-in host plugin](https://youtu.be/vTbKtMkWxBQ?t=732)
- [32:30 — Host plugins in the Wasmtime linker](https://youtu.be/vTbKtMkWxBQ?t=1950)
- [wasmCloud Runtime Crate: Embedding Wasmtime](/community/2025-10-15-community-meeting/) — Oct 15, 2025
- [17:00 — Host plugins: extending the host without capability providers](https://youtu.be/3DlUjl8gQVs?t=1020)
- [wasmCloud v2 on Kubernetes: Runtime Operator & wash host](/community/2025-11-05-community-meeting/) — Nov 5, 2025
- [31:25 — Transport plugins, wRPC, and host plugins as providers](https://youtu.be/FbLNlZgzWOU?t=1885)
- [Endive Java Wasm Host, JCO WASI P3 & the Component Model](/community/2026-05-27-community-meeting/) — May 27, 2026
- [29:22 — Plugin-vs-service decision framework](https://youtu.be/QyVyD37cvrw?t=1762)

</details>

{/* ===================== END POC info-bar ===================== */}

### The `HostPlugin` trait

```rust
Expand Down
1 change: 1 addition & 0 deletions src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@import url('./theme/_hubspot.css');
@import url('./theme/_search.css');
@import url('./theme/_admonition.css');
@import url('./theme/_community-callout.css');
@import url('./theme/_announcement-bar.css');
@import url('./theme/_sidebar.css');
@import url('./_shiki.css');
45 changes: 45 additions & 0 deletions src/styles/theme/_community-callout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* Take 3 — compact collapsible "Discussed in community meetings" strip.
Applied to a native <details className="community-calls-compact"> in MDX. */

details.community-calls-compact {
margin: 0 0 1.5rem;
padding: 0.4rem 0.9rem;
border: 1px solid rgba(var(--wasmcloud-color-base-brand-green) / 0.3);
border-left: 4px solid var(--wasmcloud-color-brand-green);
border-radius: 8px;
background: rgba(var(--wasmcloud-color-base-brand-green) / 0.05);
}

details.community-calls-compact > summary {
cursor: pointer;
font-weight: 600;
font-size: 0.9rem;
list-style: none;
display: flex;
align-items: center;
gap: 0.5rem;
}

details.community-calls-compact > summary::-webkit-details-marker {
display: none;
}

details.community-calls-compact > summary::before {
content: '▸';
color: var(--wasmcloud-color-brand-green);
font-weight: 700;
}

details.community-calls-compact[open] > summary::before {
content: '▾';
}

details.community-calls-compact[open] > summary {
margin-bottom: 0.5rem;
}

/* tighten the nested meeting/chapter list inside the compact strip */
details.community-calls-compact ul {
margin-top: 0.25rem;
margin-bottom: 0.25rem;
}
66 changes: 66 additions & 0 deletions src/theme/wasmcloud/components/community-calls/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import React from 'react';
import Link from '@docusaurus/Link';
import styles from './styles.module.css';

type Chapter = { t: number; label: string };
type Meeting = {
title: string;
date: string;
url: string;
videoId: string;
chapters: Chapter[];
};

function formatTime(t: number): string {
const h = Math.floor(t / 3600);
const m = Math.floor((t % 3600) / 60);
const s = t % 60;
const pad = (n: number) => String(n).padStart(2, '0');
return h > 0 ? `${h}:${pad(m)}:${pad(s)}` : `${m}:${pad(s)}`;
}

export default function CommunityCalls({
meetings,
title = 'This topic was discussed in our community calls',
}: {
meetings: Meeting[];
title?: string;
}): JSX.Element {
return (
<aside className={styles.callout} aria-label="Discussed in community meetings">
<p className={styles.header}>
<span className={styles.icon} aria-hidden="true">
📺
</span>
{title}
</p>
<ul className={styles.meetings}>
{meetings.map((m) => (
<li key={m.url} className={styles.meeting}>
<div className={styles.meetingRow}>
<Link to={m.url} className={styles.meetingTitle}>
{m.title}
</Link>
<span className={styles.date}>{m.date}</span>
</div>
<ul className={styles.chapters}>
{m.chapters.map((c) => (
<li key={c.t}>
<a
className={styles.chapter}
href={`https://youtu.be/${m.videoId}?t=${c.t}`}
target="_blank"
rel="noopener noreferrer"
>
<span className={styles.time}>▶ {formatTime(c.t)}</span>
<span className={styles.label}>{c.label}</span>
</a>
</li>
))}
</ul>
</li>
))}
</ul>
</aside>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
.callout {
margin: 0 0 1.5rem;
padding: 0.9rem 1.1rem;
border: 1px solid rgba(var(--wasmcloud-color-base-brand-green) / 0.3);
border-left: 4px solid var(--wasmcloud-color-brand-green);
border-radius: 8px;
background: rgba(var(--wasmcloud-color-base-brand-green) / 0.06);
}

.header {
display: flex;
align-items: center;
gap: 0.5rem;
margin: 0 0 0.65rem;
font-weight: 700;
font-size: 0.95rem;
}

.icon {
font-size: 1.1rem;
line-height: 1;
}

.meetings {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 0.7rem;
}

.meetingRow {
display: flex;
align-items: baseline;
gap: 0.5rem;
flex-wrap: wrap;
}

.meetingTitle {
font-weight: 600;
}

.date {
font-size: 0.72rem;
color: var(--ifm-color-emphasis-700);
background: rgba(var(--wasmcloud-color-base-brand-gunmetal) / 0.1);
border-radius: 999px;
padding: 0.05rem 0.55rem;
white-space: nowrap;
}

.chapters {
list-style: none;
margin: 0.25rem 0 0;
padding: 0 0 0 0.15rem;
display: flex;
flex-direction: column;
gap: 0.1rem;
}

.chapter {
display: inline-flex;
align-items: baseline;
gap: 0.55rem;
padding: 0.1rem 0;
text-decoration: none;
}

.chapter:hover {
text-decoration: none;
}

.chapter:hover .label {
text-decoration: underline;
}

.time {
flex: none;
font-variant-numeric: tabular-nums;
font-weight: 600;
font-size: 0.8rem;
color: var(--wasmcloud-color-brand-green);
white-space: nowrap;
}

.label {
color: var(--ifm-font-color-base);
font-size: 0.9rem;
}
4 changes: 4 additions & 0 deletions src/theme/wasmcloud/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ declare module '@theme/wasmcloud/components/video-modal' {
export * from '@site/src/theme/wasmcloud/components/video-modal';
}

declare module '@theme/wasmcloud/components/community-calls' {
export { default } from '@site/src/theme/wasmcloud/components/community-calls';
}

declare module '@theme/wasmcloud/hooks/use-body-scroll-lock' {
export * from '@site/src/theme/wasmcloud/hooks/use-body-scroll-lock';
}
Expand Down
Loading