Drop all instances (3) of XMLHttpRequest for Fetch API #650

Closed
opened 2017-10-06 23:48:26 +02:00 by kauffj · 8 comments
kauffj commented 2017-10-06 23:48:26 +02:00 (Migrated from github.com)

The Fetch API is cleaner, simpler and supports promises.

The [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) is cleaner, simpler and supports promises.
thujeevan commented 2017-10-07 08:02:30 +02:00 (Migrated from github.com)

Wish to work on this. What are the things to be considered while implementing this?

Wish to work on this. What are the things to be considered while implementing this?
sovanna commented 2017-10-11 16:33:42 +02:00 (Migrated from github.com)

@thujeevan did you worked on something yet?

@thujeevan did you worked on something yet?
kauffj commented 2017-10-11 16:41:39 +02:00 (Migrated from github.com)

If you just search the js folder for XMLHttpRequest you will find 3 places it is used. These could be re-written to use fetch and promises, resulting in cleaner and more standardized code.

If you just search the `js` folder for `XMLHttpRequest` you will find 3 places it is used. These could be re-written to use `fetch` and promises, resulting in cleaner and more standardized code.
thujeevan commented 2017-10-12 06:18:40 +02:00 (Migrated from github.com)

@kauffj I understand what to be done. Wanted to know anything specifically considered. Was having trouble in building step initially.

@sovanna Working on it.

@kauffj I understand what to be done. Wanted to know anything specifically considered. Was having trouble in building step initially. @sovanna Working on it.
sovanna commented 2017-10-12 10:09:09 +02:00 (Migrated from github.com)

aaa, I worked on it yesterday. I'm going to stop and let you continue.
If it can help, here my work:

miss the last place in jsonrpc.js

aaa, I worked on it yesterday. I'm going to stop and let you continue. If it can help, here my work: - [commit on lybrio.js](https://github.com/sovanna/lbry-app/commit/b8a472e262abc246d0a62c9c5a85fd180cedb600) - [commit on settings.js](https://github.com/sovanna/lbry-app/commit/34c78bd55c284700222199ae1a591d7d5fb1747b) miss the last place in jsonrpc.js
thujeevan commented 2017-10-13 05:33:21 +02:00 (Migrated from github.com)

@kauffj something wrong with the fetch implementation in the PR. It doesn't seem to work. Not sure what am I missing. Sadly, I couldn't find any tests also. Any method to debug this code?

@sovanna Would you mind to CR and let me know any issues?

@kauffj something wrong with the fetch implementation in the PR. It doesn't seem to work. Not sure what am I missing. Sadly, I couldn't find any tests also. Any method to debug this code? @sovanna Would you mind to CR and let me know any issues?
kauffj commented 2017-10-13 21:55:42 +02:00 (Migrated from github.com)

@thujeevan All of them don't work? What do you see in the console? To debug I would suggest using combination of debug toolbar and code modifications or logging statements. With a proper dev setup, you should be able to change code and CTRL+R in the app for very tight feedback.

Also, I do not think this code should require additional dependencies (which I noticed in your PR).

@thujeevan All of them don't work? What do you see in the console? To debug I would suggest using combination of debug toolbar and code modifications or logging statements. With a proper dev setup, you should be able to change code and CTRL+R in the app for very tight feedback. Also, I do not think this code should require additional dependencies (which I noticed in your PR).
thujeevan commented 2017-10-14 06:09:59 +02:00 (Migrated from github.com)

@kauffj Thanks for the info, got it to work. Please have a look at the PR. Drop the unnecessary deps.

@kauffj Thanks for the info, got it to work. Please have a look at the PR. Drop the unnecessary deps.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#650
No description provided.