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 #3617.
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 addexperience 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 thespin.tomlbut 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 withspin 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 #3617.