Opened 3 years ago

Last modified 3 years ago

#5080 closed change

Switch module system to webpack, use modules for our content scripts — at Version 18

Reported by: kzar Assignee:
Priority: P2 Milestone: Adblock-Plus-3.0.2-for-Firefox
Module: Platform Keywords:
Cc: sebastian Blocked By: #4864, #5028, #5077, #5089, #5535
Blocking: #3138, #5084 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29577555/

Description (last modified by kzar)

Background

With the ESLint changes in #4864 we needed to add some /* globals ... */ comments in order to get linting to pass. We now want to reduce those by breaking the content scripts into proper modules.

Unfortunately our bespoke module system had quite a few limitations, switching our content scripts to use it wasn't easy. So we've replaced it with webpack.

What to change

  • Update the buildtools dependency to hg:e4e7800116f9 git:c8e1af0.
  • Replace the [convert_js] section of our metadata files with [bundles]. Remove autoload, module and injectinfomodule options. Ensure only the modules which need to be autoloaded are listed, the others will be resolved by webpack automatically.
  • Bundle the relevant content scripts, exporting the globals used by the other content sctipts and replacing global comments with proper require statements. (Also require the things exported by lib/elemHideEmulation.js see #5079.)

Change History (18)

comment:1 Changed 3 years ago by kzar

  • Blocked By 4864 added; 4868 removed
  • Description modified (diff)

comment:2 Changed 3 years ago by sebastian

  • Blocking 5084 added

comment:3 Changed 3 years ago by kzar

  • Blocked By 5089 added

comment:4 Changed 3 years ago by kzar

  • Blocked By 5079 removed

comment:5 Changed 3 years ago by kzar

  • Owner kzar deleted

comment:6 Changed 3 years ago by kzar

  • Blocking 3138 added

comment:7 Changed 3 years ago by kzar

  • Blocked By 5535 added

comment:8 Changed 3 years ago by kzar

  • Blocked By 5593 added

comment:9 Changed 3 years ago by kzar

  • Blocked By 5708 added

comment:10 Changed 3 years ago by kzar

  • Blocked By 5593 removed

comment:11 Changed 3 years ago by kzar

  • Blocked By 5708 removed

comment:12 Changed 3 years ago by kzar

  • Blocked By 5593 added

comment:13 Changed 3 years ago by kzar

  • Blocked By 5750 added

comment:14 Changed 3 years ago by kzar

  • Blocked By 5751 added

Blocked by #5751 since we need to remove buildtools/lib to avoid webpack mistakenly resolving the prefs module from there.

comment:15 Changed 3 years ago by sebastian

  • Blocked By 5751 removed

comment:16 Changed 3 years ago by kzar

  • Blocked By 5593 removed

comment:17 Changed 3 years ago by kzar

  • Blocked By 5750 removed

(The optional requires have already been removed as part of #5750 and so that issue is no longer blocking us here, despite being unfinished.)

comment:18 Changed 3 years ago by kzar

  • Blocked By 5028 added
  • Description modified (diff)
  • Review URL(s) modified (diff)
  • Status changed from new to reviewing
  • Summary changed from Start using modules for the content scripts to Switch module system to webpack, use modules for our content scripts

(Marking this as being blocked by #5028 since I'm hoping the buildtools dependency will be updated to the previous commit there, and the copy of ensure_depdencies.py updated along with it. Otherwise the package-lock.json Node.js file could re-appear for people and cause problems.)

Note: See TracTickets for help on using tickets.