Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Fable.Remoting.NodeClient #225

Open
sergey-tihon opened this issue Mar 12, 2021 · 9 comments
Open

Add Fable.Remoting.NodeClient #225

sergey-tihon opened this issue Mar 12, 2021 · 9 comments

Comments

@sergey-tihon
Copy link

sergey-tihon commented Mar 12, 2021

Would be nice to have client library for Fable.Remoting that work in Node.js.

One of use cases is the communication with API from vscode extension written with Fable and hosted in a Node.js process in VS Code.

If/when someone decide to contribute client library for Node.js would be nice to have approved transport library.

What can be used instead of XMLHttpRequest for HTTP calls to be merged in this repo?

Should be one of low-lever fable-node modules (like HTTPS for example) or it can be some popular and lightweight http library like got (that is used in REST Client for example.

@MangelMaxime
Copy link

Hello, I think one of most popular http library is axios the minified version of the library is 15kb.

@Zaid-Ajaj
Copy link
Owner

Zaid-Ajaj commented Mar 12, 2021

Hi @sergey-tihon I always wanted a reason to have this implemented, now there is one 😄 as for the underlying HTTP client, the priority goes to the built-in client so that we have the least amount of dependencies unless other 3rd-party libraries make our lives easier.

I can't promise a timeline for this but I do want to have it at some point as part of the stack. PRs are always welcome of course 💯

@sergey-tihon
Copy link
Author

@MangelMaxime axios looks interesting, because it works inside nodejs process and in the browser.

@Zaid-Ajaj is it an option to port fable client on top of axios? Or 15kb is a large footprint and you prefer to have separate package for nodejs?

@Zaid-Ajaj
Copy link
Owner

15kb is a large footprint

The size is not so much the problem here but the fact that users have to remember to install another package in order to use Fable.Remoting.Client which I would rather avoid.

@sergey-tihon
Copy link
Author

@Zaid-Ajaj
Copy link
Owner

if that works for you then all good but just keep in mind that writing axios.post<Document> won't perform proper deserialization and is just saying "please treat this as if it was a Document" so if you have complex fields in your Document type such as unions or maps, they might not really work

@sergey-tihon
Copy link
Author

ok, thank you, I all take a look at proper deserialization (when it breaks 😉 )

@Zaid-Ajaj
Copy link
Owner

Fable.Remoting.Client uses Fable.SimpleJson for JSON handling and deserialization and it should on nodejs without any dependency

@Darkle
Copy link

Darkle commented Jul 21, 2023

+1 for this. I am writing a service that needs to use a nodejs library, so I'm doing this with fable and the api is using fable remoting, so I would love to have a fable remoting nodejs library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants