hoi hoi! the weekend is coming, and open source is...
# arrow-contributors
a
hoi hoi! the weekend is coming, and open source is a good way to pass these cold days (if you are in the Northern Hemisphere, of course; in the Southern one please rather enjoy the sun). Anyway... after the release of Arrow 2.0 we're trying to expand our integrations with the community. We have recently added new Ktor modules (those will come in 2.1.0), because that was a common use case. We are actively looking for more of those! If you have any idea of use cases or integrations with other libraries we miss in Arrow or the surrounding ecosystem, please drop them in this thread 🧵
p
the ktor modules are a nice addition - we've a similar set of utilities we were about to pull out for an internal library. I think my only concern is that by using
OutgoingContent
I believe you've already sidestepped any handling by the
ContentNegotiation
plugin. We've instead introduced something like
Copy code
data class RawResponse<T>(val payload: T, val statusCode: HttpStatusCode, val typeInfo: TypeInfo)
for our
RoutingContext.respondOrRaise(f: Raise<RawResponse>.() -> T)
DSL and provided some additional reified helpers to be able to
raise(HttpStatusCode)
or
raise(HttpStatusCode, payload)
to effectively replace using
call.respond
by making it terminal
a
@phldavies feel free to open an issue or discussion about this topic, we definitely want to show the best possible API 🙂
p
I'll try and piece together a PR with an alternative/additional DSL/API to showcase it for discussion. What's the expected timeline for 2.1.x as ideally we'd get this aligned enough to not warrant any breaking changes before it's released.
a
no expected timeline; once we're happy with the new modules we'll release them
👌 1
c
A few of mine; • in-progress values • caching • type-safe Ktor (waiting for the Ktor modules to be released to improve it further) • testing with error tracing
a
nice selection! could we maybe link them in our More libraries section? maybe we could even have a page for Quiver
Outcome
and your "in progress values" in the docs pointing people to those, if you don't mind about caching, would you consider making your library implement MemoizationCache, so it's readily available for memoized recursive functions? personally, I think type-safe Ktor is a bit outside of what Arrow aims to offer; as opposed to the current modules, it's not just an integration, but a completely different way to encode your routes
c
could we maybe link them in our More libraries section?
Feel free!
a page for Quiver
Outcome
and your "in progress values" in the docs
I'd love to. I'm not familiar enough with Quiver to write it myself though, but from I read a while ago, the approaches are quite different. My main objective was modeling progress reports, where one function can report how much work left there is, to another. Bundling this into an Either-like type was a logical consequence to get the
Raise
DSL.
would you consider making your library implement MemoizationCache
That's a good idea! I created an issue to remember this, but it probably won't be too soon.
I think type-safe Ktor is a bit outside of what Arrow aims to offer; as opposed to the current modules, it's not just an integration, but a completely different way to encode your routes
Completely agree. I mentioned it because it is built to integrate with
Raise
, but I see it more as part of an "Arrow extended universe" rather than a "Ktor integration for Arrow", which I think Simon was working on.
p
I've raised a draft PR with the start of an alternative Ktor Raise DSL https://github.com/arrow-kt/arrow/pull/3581 - the
RoutingContext.respondOrRaise
function is similar in approach to how we've been integrating it internally, such that a response is always generated from a handler, and
call.respondXxx
is discouraged.
c
uh, I didn't know you could qualify receivers like this, interesting.
s
Qualifying receivers like that is like bread and butter 😜
😄 1