fuel icon indicating copy to clipboard operation
fuel copied to clipboard

Support Javascript backend

Open cah-andrew-fitzgerald opened this issue 7 years ago • 15 comments

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.

cah-andrew-fitzgerald avatar Mar 01 '17 14:03 cah-andrew-fitzgerald

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. 👍

kittinunf avatar Mar 06 '17 01:03 kittinunf

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.

yoavst avatar Aug 12 '17 17:08 yoavst

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

kittinunf avatar Aug 16 '17 08:08 kittinunf

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

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

yoavst avatar Aug 18 '17 12:08 yoavst

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 ?

yoavst avatar Aug 18 '17 18:08 yoavst

OK 👍

kittinunf avatar Aug 19 '17 02:08 kittinunf

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

nailgilaziev avatar Mar 21 '18 12:03 nailgilaziev

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.

joelhandwell avatar Jul 28 '18 01:07 joelhandwell

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.

iNoles avatar Nov 28 '18 21:11 iNoles

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

yoavst avatar Nov 28 '18 21:11 yoavst

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

iNoles avatar Nov 28 '18 21:11 iNoles

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

SleeplessByte avatar Nov 29 '18 00:11 SleeplessByte

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

iNoles avatar Nov 29 '18 01:11 iNoles

@yoavst Fuel 3.x SNAPSHOTS supports Javascript

iNoles avatar Mar 08 '23 02:03 iNoles

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

bashor avatar Mar 12 '23 12:03 bashor