Opened on 01/14/2016 at 03:01:09 PM
Closed on 01/19/2016 at 04:45:06 PM
Last modified on 01/28/2016 at 11:57:06 AM
#3515 closed change (fixed)
Use ES6 promises
Reported by: | sebastian | Assignee: | sebastian |
---|---|---|---|
Priority: | P3 | Milestone: | Adblock-Plus-1.10.1-for-Chrome-Opera-Safari |
Module: | Platform | Keywords: | |
Cc: | kzar | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | yes | Confidential: | no |
Tester: | Scheer | Verified working: | yes |
Review URL(s): |
https://codereview.adblockplus.org/29333514 |
Description (last modified by sebastian)
Background
Promises make asynchronous code easier to write and read and therefore contribute to a better code quality and fewer bugs.
ES2015 (aka ES6) introduced promises as part of the JavaScript language. This has been implemented by now in recent versions of Chrome, Opera and Safari. Though we still support older versions of these browsers that lack native support. This however isn't a problem as we can use a polyfill.
The extension API and our abstraction layer shouldn't be considered for now. There is a Chrome bug to support promises in the extension API. Theoretically, we could already support promises in our abstraction layer, but I'm still undecided what the approach should be there.
What to change
- Add polyfills for the Promise class and fetch() API.
- Replace usage of XMLHttpRequest with fetch().
- Replace the Prefs.onLoaded event with a Prefs.isLoadedpromise.
Hints for testers
- Make sure that extension initialization works
- so that settings are preserved when restarting the browser or updating the extension.
- so that default filter lists are configured and that the first run page shows for new installs.
- Make sure that the options page, and in particular adding new filter lists from the dropdown, works.
- Also test on older browser versions, in particular Chrome <32 and Safari 6.
Attachments (0)
Change History (8)
comment:3 Changed on 01/14/2016 at 06:05:12 PM by kzar
- Cc kzar added
comment:4 Changed on 01/19/2016 at 12:31:48 PM by sebastian
- Status changed from new to reviewing
comment:5 Changed on 01/19/2016 at 04:45:06 PM by sebastian
- Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
- Resolution set to fixed
- Status changed from reviewing to closed
comment:7 Changed on 01/28/2016 at 11:56:34 AM by scheer
Done.
- Extension initialization works.
- Settings are preserved when restarting the browser or updating the extension.
- Default lists are configured and first page runs on installation.
- Options Page and 'add filter subscription' drop down menu functions.
Chrome 30,31,32,44,45,46,48
Safari 6
Adblock Plus 1.10.0.1534
comment:8 Changed on 01/28/2016 at 11:56:44 AM by scheer
- Tester changed from Unknown to Scheer
- Verified working set
https://hg.adblockplus.org/buildtools/rev/b4e9b7763184
https://hg.adblockplus.org/buildtools/rev/a0d797251f12
https://hg.adblockplus.org/adblockpluschrome/rev/80f55541d837
https://hg.adblockplus.org/adblockpluschrome/rev/0e655124cfa3
https://hg.adblockplus.org/adblockpluschrome/rev/4f49be181cc0
https://hg.adblockplus.org/adblockpluschrome/rev/581c1559c881
https://hg.adblockplus.org/adblockpluschrome/rev/c48d52b25ced
https://hg.adblockplus.org/adblockpluschrome/rev/e8285978f820
https://hg.adblockplus.org/adblockplusui/rev/3fa98b7761aa