saket / unfurl

Generate link previews, inspired by Slack.
Apache License 2.0
266 stars 11 forks source link

Multiplatform Support #1

Open LaatonWalaBhoot opened 10 months ago

LaatonWalaBhoot commented 10 months ago

As the title mentions. Is it possible to port Jsoup implementation to this this I saw on reddit, you were looking to do it earlier so perhaps you maybe still interested. I had been using unfurl in Android projects but since moving to multiplatform I have been out of options.

saket commented 10 months ago

I definitely am. Wanna help me out by migrating unfurl to ksoup and ktor?

LaatonWalaBhoot commented 10 months ago

Yes. I am starting with Ktor. However, I cannot promise a time frame. I am new to this and my day job would not allow me to. Whatever time I can find during weekends and in my spare, I will contribute. We would also want to upgrade the Kotlin version. And some other dependencies like Moshi. Also, I wanted to ask if we can extend it to add functionality similar to this

saket commented 10 months ago

Sure, let's do the migration incrementally then. I'd say migrating to ksoup would be a good first step.

Also, I wanted to ask if we can extend it to add functionality similar to this

Are you referring to article extraction? I think that's out of the scope for unfurl but you can always implement it yourself and use it as an unfurl extension.

LaatonWalaBhoot commented 10 months ago

Do we want to instantly move to sourceSets implementation or replace OkHttp with Ktor-Okhttp client?

LaatonWalaBhoot commented 10 months ago

@saket Please take a look https://github.com/saket/unfurl/pull/2 Have not been able to replace MockWebServer. Looking at how to do that with Ktor. Once you approve this maybe we can work on migrating to sourceSets and proper multiplatform library from a jvm one?

saket commented 10 months ago

Have not been able to replace MockWebServer. Looking at how to do that with Ktor.

Good idea, we can create a Ktor server

LaatonWalaBhoot commented 10 months ago

Yes, I am looking at it. Made some more changes around input stream

LaatonWalaBhoot commented 10 months ago

@saket We will follow this one: https://github.com/saket/unfurl/pull/3 Just adding it here for future reference.

saket commented 1 month ago

I'm sorry, but I had to revert all your KMP changes after failing to make ksoup work with ktor and okio. It also didn't help that ksoup is significantly slower than jsoup.

The author of ksoup seems to be working on fixing these issues in the near future, so I'll keep an eye on it: https://github.com/fleeksoft/ksoup/issues/39