Closed Bug 1689240 Opened 4 months ago Closed 2 months ago

Clean-up load/shutdown/render functions in view-controller.js and aboutaddons.js

Categories

(Toolkit :: Add-ons Manager, task, P3)

task

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: ntim, Assigned: rpl)

References

Details

Attachments

(10 files, 1 obsolete file)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

I think this is worth doing after bug 1525179 and all the related clean ups.

In short:

  • showView/loadViewInternal are combined into one gViewController method
  • gViewController.initialize/initializeView are combined into an aboutaddons.js method
  • shutdown in view-controller.js is moved into the unload listener added in the initialize method

To make sure gViewController remains an independent component, the view-specific logic from both showView and loadViewInternal can be extracted out into a defineView/registerView method that's called from aboutaddons.js. The newly combined function would loop through the registered views and call the right view load function. This also allows getting rid of the hardcoded viewTypes in loadViewInternal.

gViewController.registerView("discover", (container) => {
  let discoverView = new DiscoveryView();
  let elem = discoverView.render();
  await document.l10n.translateFragment(elem);
  container.append(elem);
});
Summary: [about:addons] Cleanup load/shutdown/render functions in both view-controller.js and aboutaddons.js → [about:addons] Clean-up load/shutdown/render functions in both view-controller.js and aboutaddons.js
Summary: [about:addons] Clean-up load/shutdown/render functions in both view-controller.js and aboutaddons.js → [about:addons] Clean-up load/shutdown/render functions in view-controller.js and aboutaddons.js
Summary: [about:addons] Clean-up load/shutdown/render functions in view-controller.js and aboutaddons.js → Clean-up load/shutdown/render functions in view-controller.js and aboutaddons.js
Severity: -- → N/A
Priority: -- → P3
Attachment #9201389 - Attachment description: Bug 1689240 - Move ScrollOffsets from aboutaddons.js to extensions.js. → Bug 1689240 - Move ScrollOffsets from aboutaddons.js to view-controller.js.
Assignee: nobody → ntim.bugs
Status: NEW → ASSIGNED
Blocks: 1691271

Comment on attachment 9201655 [details]
Bug 1689240 - Make gViewController a custom element.

Revision D104325 was moved to bug 1691271. Setting attachment 9201655 [details] to obsolete.

Attachment #9201655 - Attachment is obsolete: true

ni? rpl about taking over in case he has time :)

Assignee: ntim.bugs → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(lgreco)
Assignee: nobody → ntim.bugs
Status: NEW → ASSIGNED

I'm taking over this bug as agreed with ntim.

Assignee: ntim.bugs → lgreco
Flags: needinfo?(lgreco)

This test-only change does fix a TV job failure that I did notice in some of my last push to try
(the one that I did notice was happening on the TV job while running in linux x65 opt build).

Depends on D108514

Duplicate of this bug: 1689236
Pushed by luca.greco@alcacoop.it:
https://hg.mozilla.org/integration/autoland/rev/3a9c8bc14824
Inline loadViewFn/replaceWithDefaultViewFn functions. r=rpl
https://hg.mozilla.org/integration/autoland/rev/3fbfc79bf96a
Clean-up load/shutdown/render functions in view-controller.js and aboutaddons.js. r=rpl
https://hg.mozilla.org/integration/autoland/rev/292d29ba4e9d
Move ScrollOffsets from aboutaddons.js to view-controller.js. r=rpl
https://hg.mozilla.org/integration/autoland/rev/5f5a855bce31
Move CategoriesBox event handling into handleEvent method and remove listener on disconnection. r=robwu
https://hg.mozilla.org/integration/autoland/rev/b08cd0d38cb5
Move observer server notifications related to the EM-* topic in view-controller.js. r=robwu
https://hg.mozilla.org/integration/autoland/rev/0ce37bd2f2cd
Throw an explicit error if aboutaddons loadView is called too early. r=robwu
https://hg.mozilla.org/integration/autoland/rev/cecb522cad4f
Throw an explicit error if aboutaddons views are being defined more than once. r=robwu
https://hg.mozilla.org/integration/autoland/rev/40cdb964eb03
Rename aboutaddons custom event from ViewChanged to view-loaded. r=robwu
https://hg.mozilla.org/integration/autoland/rev/b900e6890599
Fix intermittent timeout in browser_webext_incognito. r=robwu
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/5ca6c579781e
Port bug 1689240 - Rename aboutaddons custom event from ViewChanged to view-loaded. rs=bustage-fix
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/74e28bcd68ac
Port bug 1689240 (take 2) - Rename aboutaddons custom event from ViewChanged to view-loaded. rs=bustage-fix
Attachment #9211699 - Attachment description: WIP: Bug 1689240 - Remove unused exported ESLint comment from aboutaddons.js. DONTBUILD → Bug 1689240 - Remove unused exported ESLint comment from aboutaddons.js. DONTBUILD
Pushed by ntim.bugs@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/3758b0aed2b9
Remove unused exported ESLint comment from aboutaddons.js. DONTBUILD
You need to log in before you can comment on or make changes to this bug.