Opened on 04/01/2017 at 03:46:44 PM
Closed on 09/18/2017 at 03:06:04 PM
#5084 closed change (duplicate)
Rename "convert_js" to "modules" and remove unused code
Reported by: | sebastian | Assignee: | |
---|---|---|---|
Priority: | P3 | Milestone: | |
Module: | Automation | Keywords: | goodfirstbug |
Cc: | kzar, jsonesen | Blocked By: | #5080, #5083 |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by sebastian)
Background
In order to bundle modules you can add following to the extension's metadata.* file:
[convert_js] bundle.js = module_a.js module_b.js module_c.js bundle.js[module] = true
Then the modules can import each other, or get imported by external code, using require("module_a")for example. This is how all extensions code should be structured.
But for legacy use, you can also omit bundle.js[module] above (or set it to false), and the scripts will be concatenated without the module boilerplate. Once #5080 and #5083 landed, we will no longer use this feature. Hence we can ignore that option and just generate modules no matter what, so that we get rid of unused code in buildtools and unnecessary boilerplate in the metadata.* files.
Moreover, the name [convert_js] is just historic, as initially these scripts were converted to ES5-compatible code. But now it merely exists to bundle modules. Hence [modules] would be a better name.
What to change
- Imply the module option, so that always modules are generated, and remove the unused logic.
- Rename the convert_js section to modules.
This change will be redundant with changes in #5535.