Comments (2)
This is a great question. As a hosting framework, Spin should ideally not be too prescriptive about how to do things or access things: users must have access to the bottom level (wasi-http
) to build their own choice of abstraction layer on top. But the SDK does provide higher level features too, such as routing or JSON body support. So it wouldn't be inconsistent to offer structured access to the query string, e.g. as a slice of key-value pairs. But we'd still want to keep the baseline representation, so that people who want to use (say) serde_query
could use that instead.
The long-game hope/bet is that WASI Preview 2 (which is what defines Spin's base HTTP types) will become sufficiently widely accepted that the higher-level frameworks and libraries you describe will just transparently work with the WASI incoming-request
type in future, so you won't be limited to what's in the Spin SDK (or what you build on top of it), in a similar way to how you can just use Rust file libraries, rather than being stuck with a Spin File SDK. But that's not where we are today.
So this ends up being kind of an evasive answer. We're certainly open to higher-level APIs in the Spin SDK, and delighted to take PRs that improve usability. Things that are strongly opinionated should typically be outside the SDK, layered above it in their own packages, similar to spin-contrib-http
(https://github.com/ThorstenHans/spin-contrib-http, although a lot of that is pretty low level too!) or leptos-spin
(https://github.com/fermyon/leptos-spin). But for things that are common and non-prescriptive, like extractors, builders, and parsers: yes, we would love to hear more or to accept PRs.
I hope that makes sense, and I know it's a long answer! Always happy to discuss further and to see how we can improve for our users!
from spin.
Thanks for your input, this adds some context that I was missing. I'm currently trying to get my head into the WASI space and understand what's possible or practical. I'll check out spin-contrib-http
and see how the approach might influence something like query string parsing.
from spin.
Related Issues (20)
- spin watch doesn't rebuild/reconfigure on manifest file changes HOT 6
- Different execution times for python spin app on local machine and Fermyon Cloud HOT 6
- Sleeping in a Spin app breaks traces HOT 1
- Templates: support Cargo workspaces
- Upcoming Security Release of Spin (GHSA-f3h7-gpjj-wcvh) HOT 1
- Support exporting application logs through OTel HOT 2
- spin-v2.4.3-macos-amd64.tar.gz contains the wrong architecture HOT 4
- Template install and upgrade commands use different option for Git/URL.
- Dynamically set service name for OTel resource
- `files` manifest option should warn when `destination` does not appear to be a directory HOT 3
- Consider using `http-acl` for enforcing `allowed-outbound-hosts`
- Enhance React application performance to run on embedded devices. HOT 3
- Received runtime error that should be thrown at component build time HOT 1
- Raspberry Pico HOT 1
- [OTel]: Spans produced by `spin_sdk::key_value::Store::set` don't have a parent assigned HOT 3
- Provide multiple entries as a variable for lists in 'spin.toml' HOT 15
- Add escape syntax to variables expansion syntax (`spin-expressions`) HOT 5
- Provide the ability to import manifest and runtime-config as wasm modules (components) HOT 8
- oci loader related problems with spinkube HOT 3
- Push component to registry HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spin.