kittinunf / fuel

The easiest HTTP networking library for Kotlin/Android
https://fuel.gitbook.io/documentation/
MIT License
4.56k stars 430 forks source link

Support Javascript backend #134

Open cah-andrew-fitzgerald opened 7 years ago

cah-andrew-fitzgerald commented 7 years ago

With the release of Kotlin 1.1, the Javascript backend is no longer experimental. It would be nice if the same HTTP API was available at all layers of the kotlin stack.

kittinunf commented 7 years ago

This is really awesome idea. It is also aligned to this library's vision. However, as discussed, I am no where near expert in JS backend and not sure how to make this happen. You are very happy to help contribute in here. 👍

yoavst commented 7 years ago

I've started working on making Fuel a multi-platform project. It may take long time since I'm having vacation next week, but I plan on finishing it next month.

About making it work in Javascript... It will be easier when fuel will be multi-platform project.

kittinunf commented 7 years ago

@yoavst Awesome man! I am looking forward to seeing that pans out. :)

yoavst commented 7 years ago

The branch will be https://github.com/kittinunf/Fuel/tree/multiplatform_feature

Blocking issue: https://youtrack.jetbrains.com/issue/KT-17005#tab=Changes

yoavst commented 7 years ago

Report: Currently kotlin multi platform feature is too buggy to convert an existing library.

In addition, Fuel is too connected with Java. Instead of working on the multi platform feature, I'll work a bit on hiding implementation details under interfaces. It will probably require a massive refactoring to the library.

The general idea would be to Kotlinify the interfaces used by the project, by hiding everything java by moving it to "internal" (yet public) classes. For normal users with minimal configuration change there should be no migration. For advance users, we can maybe provide extension methods and fields to ease the migration.

What do you think about it, @kittinunf ?

kittinunf commented 7 years ago

OK 👍

nailgilaziev commented 6 years ago

hello! any progress on this? can this lib used for multiplatform project? js / jvm

joelhandwell commented 6 years ago

From Kotlin/Native 0.6 it supports common code with expect and actual keywords. Can the scope of this issue be jvm / jvm-android / js / native-ios / native-macos / native-windows / native-linux, etc? I saw code of other multi platform http kotlin lib egorzhdan/networkinkt and saw that possibly project structure can be similar to that.

iNoles commented 5 years ago

It is getting impossible to do this without removing a lot of code. It also Forced Coroutines to be a part of the core. That may be a huge turn off to some people.

yoavst commented 5 years ago

@iNoles What's about trying to use the official http client as backend, wrapping it with fuel?

iNoles commented 5 years ago

Major Code Rewrite. Ktor is very heavily on Coroutines too.

SleeplessByte commented 5 years ago

Do we really need a major code rewrite? It seems we can write a Client that uses the ktor client,

iNoles commented 5 years ago

ktor client doesn't have parameters and other related Fuel features.

iNoles commented 1 year ago

@yoavst Fuel 3.x SNAPSHOTS supports Javascript

bashor commented 1 year ago

@iNoles do you compare it to ktor in terms of size?