Opened 7 months ago

Closed 10 days ago

#5760 closed change (fixed)

Use relative require paths in adblockpluschrome

Reported by: kzar Assignee: jsonesen
Priority: P3 Milestone: Adblock-Plus-for-Chrome-Opera-Firefox-next
Module: Platform Keywords:
Cc: sebastian Blocked By: #5535
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29713631/

Description (last modified by kzar)

Background

Previously we've used our own system for managing modules, the files bundled were specified manually in the metadata and then modules were required with no path part.

With the switch to using webpack for bundling, bundled files are resolved at build time automatically. When modules are required with no path part webpack will check the hard-coded resolve paths for suitable files, but that has several limitations / problems.

What to change

Change all require calls in adblockpluschrome to use relative paths. E.g.

In adblockpluschrome/lib/whitelisting.js this require:

const {RegExpFilter} = require("filterClasses");

should become:

const {RegExpFilter} = require("../adblockpluscore/lib/filterClasses");

The legacy prefix syntax should be replaced too. E.g.

In adblockpluschrome/include.preload.js this require:

let {ElemHideEmulation} = require("content_elemHideEmulation");

should become:

let {ElemHideEmulation} = require("./adblockpluscore/lib/content/elemHideEmulation");

Change History (6)

comment:1 Changed 7 months ago by kzar

  • Description modified (diff)

comment:2 Changed 7 months ago by sebastian

  • Priority changed from Unknown to P3
  • Ready set

comment:3 Changed 7 weeks ago by jsonesen

  • Owner set to jsonesen

comment:4 Changed 7 weeks ago by jsonesen

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:5 Changed 11 days ago by abpbot

A commit referencing this issue has landed:
Issue 5760 - Use relative require

comment:6 Changed 10 days ago by kzar

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Firefox-next
  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.