Opened on 03/30/2017 at 06:36:25 AM
Closed on 04/02/2017 at 05:24:46 AM
#5060 closed change (fixed)
Move module code from adblockpluschrome/lib/compat.js into the modules template
Reported by: | kzar | Assignee: | kzar |
---|---|---|---|
Priority: | P2 | Milestone: | |
Module: | Automation | Keywords: | |
Cc: | sebastian | Blocked By: | |
Blocking: | #5077 | Platform: | Unknown / Cross platform |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by kzar)
Background
For #4864 we're making changes to adblockpluschrome so that it validates using ESLint. One rule we have there is no-undef which gives an error for any global variables which haven't been declared in the file.
Therefore we want to reduce the number of these global variables which are declared in one file but then used in another. We want to do this by breaking the code down into proper modules where possible.
In adblockpluschrome/lib/compat.js there is a section titled "Module framework stuff" which contains the code we use to make modules work. So far that is only available from the background context, so we want to move that to somewhere which can be used from the page context too.
What to change
- Take the "Module framework stuff" section from adblockpluschrome/lib/compat.js and move it into buildtools/templates/modules.js.tmpl.
- Turn info into a proper module, which is injected only when available and when the "modules" argument is set.
Integration notes
For adblockpluschrome some changes will be required:
- The "Module framework stuff" section in adblockpluschrome/lib/compat.js will need to be removed.
- /lib/info.js will need to be removed from metdatadata.common.
Attachments (0)
Change History (5)
comment:1 Changed on 03/31/2017 at 05:52:03 AM by kzar
- Blocking 4864 removed
- Description modified (diff)
comment:2 Changed on 03/31/2017 at 05:59:53 AM by kzar
- Blocking 5077 added
comment:3 Changed on 03/31/2017 at 06:04:42 AM by kzar
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:4 Changed on 04/02/2017 at 05:23:04 AM by abpbot
comment:5 Changed on 04/02/2017 at 05:24:46 AM by kzar
- Resolution set to fixed
- Status changed from reviewing to closed
A commit referencing this issue has landed:
Issue 5060 - Move require and info module logic into modules template