Closed Bug 1380437 Opened 7 years ago Closed 5 years ago

Implement REST API utility methods in global.js to replace bugzilla_ajax(), eliminate JSON-RPC usage

Categories

(bugzilla.mozilla.org :: General, task)

Production
task
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dylan, Assigned: kohei)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

Per IRC chat, bugzilla_ajax() is very useful and should be available at all times.
* Use Promise and fetch instead of XHR
* Append the API key to the HTTP request header instead of query string

This will eventually replace jQuery.ajax, jQuery.getJSON and YAHOO.util.XHRDataSource.
And YAHOO.util.Connect.asyncRequest
Blocks: 1473261
No longer blocks: 1473261
One more note: since fetch() doesn't support the progress event [1], XMLHttpRequest is still required especially for uploading (large) attachments while showing a progress bar. So my plan is having both `Bugzilla.io.fetch` and `Bugzilla.io.xhr`.

[1] https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress
Assignee: sebastinssanty → kohei.yoshino
The `generate_api_token` variable could be removed as part of this change. It should be defaulted to 1 at least.
Depends on: 1477163
Blocks: 1472565, 1471593
Status: NEW → ASSIGNED
Summary: Add bugzilla_ajax() to global.js (and remove from bug_modal.js) → Replace bugzilla_ajax() in bug_modal.js with new methods in global.js; eliminate JSON-RPC usage
Blocks: 1477163
No longer depends on: 1477163
bugzilla_ajax() has already been moved from bug_modal.js to global.js as part of Bug 1472954. This bug’s scope has changed.
Summary: Replace bugzilla_ajax() in bug_modal.js with new methods in global.js; eliminate JSON-RPC usage → Implement REST API utility methods in global.js to replace bugzilla_ajax(), eliminate JSON-RPC usage
Attached file pull request
Blocks: 1473417
Blocks: 1477931
No longer blocks: 1477931
Depends on: 1480469
Blocks: 1493992
No longer blocks: 1472565
No longer blocks: 1473417
Type: enhancement → task

Merged to master.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Regressions: 1568259
Regressions: 1569194
Blocks: 1599274
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: