Giter Site home page Giter Site logo

Comments (2)

itowlson avatar itowlson commented on June 2, 2024

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.

captaincoordinates avatar captaincoordinates commented on June 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.