spinframework / spinframework/spin

DX for scaffolding and adding middleware to an application

Open
#3,618 2 comments 1 reaction 1 assignee View on GitHub

@itowlson is already working on this.

Since Sep 18, 2026.

  • #3697 by @michelleN — open
Dominant language
Rust
Stars
6.5k
Forks
310
Avg merge
1d 20h
Merged PRs (30d)
24

Description

With #3384, we now have the capability and an experience for adding middleware capability in spin applications. How can we build on this foundation to provide a developer experiencing for scaffolding and adding middleware to an application?

In the past, we've used spin templates to help developers scaffold apps and add components to existing apps. At first glance, the spin add experience feels intuitive but the templating system as it stands today requires a [[trigger]] section which is not only not needed when adding a middleware component to the spin.toml but additionally results in an error at runtime. Adding also requires some instructions (adding middleware to dependencies section of trigger) for after component has been added to the app. Scaffolded as a standalone spin application with spin new, a middleware component would be tricky to test, require multiple tools as of now. Additionally, you might be building middleware to be shared and reused across different spin applications (ex. central middleware component for doing auth across your org).

With this context, do we want to provide a template with the templating system as is? Maybe we create a new template type? Is templating the right approach for middleware/dependency/library components? Are there other ideas?

Example template in https://github.com/spinframework/spin/pull/3617.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.