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

How to make REST calls that work in both browsers and Node? #3

Closed
billba opened this issue May 25, 2017 · 2 comments
Closed

How to make REST calls that work in both browsers and Node? #3

billba opened this issue May 25, 2017 · 2 comments

Comments

@billba
Copy link
Owner

billba commented May 25, 2017

Prague is meant to work both in browsers and in Node apps. But browsers and Node have very different runtimes. Browsers have XmlHttpRequest and (increasingly) fetch. Node has HTTP.

Of course, per the "bring your own everything" philosophy of Prague, developers can use whatever they want in coding their bots. But at the very least our LUIS library will have to make some kind of call, and I can imagine adding libraries for other services e.g. cognitive services, Azure Search.

Also it would be nice to make it easy for them to build isomorphic (runs on either browser or server) bots out of the box, where by "out of there box" I mean "in the appropriate recipes".

At the moment we use RxJS' built-in get/post/etc. but they all sit on top of XHR. There are Node polyfills for XHR, but they are not comprehensive. And I don't think our recipes should require that developers use Observables for anything. It's great that they're available for those who want them, but let's keep the learning curve as shallow as possible.

My inclination is to use fetch and add a fetch polyfill for node applications. Opinions?

@billba
Copy link
Owner Author

billba commented May 26, 2017

As an update I have gone with the fetch route for now but I'll leave this issue open for a while in the hopes of gathering other options.

@billba
Copy link
Owner Author

billba commented Aug 12, 2018

Not relevant to latesr version.

@billba billba closed this as completed Aug 12, 2018
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

1 participant