does anyone know of a multiplatform URL representa...
# multiplatform
t
does anyone know of a multiplatform URL representation, with basic parsing capability? Ktor has one, but it's too heavy to drag into the browser for just one class...
e
but really depends on what you need
t
that has the right feature-set, but it seems to be JVM only?
e
ah yeah, sorry. i include the dep in my
androidMain
, didn’t notice that part
b
As far as existing libraries, Ktor is really what we have for common. Though, I don’t think that building a simple wrapper with expect/actual would be a huge deal.
t
yeah I was thinking of pulling the KTor url class out into its own package with expect/actual - was hoping someone else had bumped into this already 🙂
b
What platforms are you targeting?
t
JVM and JS
b
I assume you really just need stuff like…. and this is probably way more than needed
t
that's it - really just the ability to represent a URL, and parse one from a String
*represent the components of a URL
b
I think that relying on actuals without external libs will be your easiest fastest implementation
👍 1
Sadly — one of the (sometimes fun) pains of us using kotlin in the state it is. I had to do this not long ago for a File representation between iOS, mac, JVM, and Android - that had some Unexpected nonsense.
t
good treeshaking in the browser might be able to solve this - ktor is just too heavy to use in JS, unless you really need the functionality
b
And… in my experience a lot of their builders and internal tools don’t work. That can be a real pain to trace back