Opened 3 years ago

Closed 3 years ago

#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)


In order to bundle modules you can add following to the extension's metadata.* file:

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.

Change History (3)

comment:1 Changed 3 years ago by sebastian

  • Blocked By 5080 added; 5077 removed

comment:2 Changed 3 years ago by sebastian

  • Description modified (diff)

comment:3 Changed 3 years ago by sebastian

  • Resolution set to duplicate
  • Status changed from new to closed

This change will be redundant with changes in #5535.

Note: See TracTickets for help on using tickets.