Closed Bug 1447130 Opened 6 years ago Closed 6 years ago

[meta] Component-ify


(Firefox :: New Tab Page, enhancement)

Not set



Firefox 63
63.3 - Aug 6
Tracking Status
firefox60 --- wontfix
firefox61 --- wontfix
firefox63 --- fixed


(Reporter: k88hudson, Unassigned)


(Blocks 3 open bugs)


(Keywords: meta)

We will need to do this in order to support the Add-ons team removing support for boostrapped addons.

There are a few possible ways to do this which we discussed at the San Fran All Hands, including:

* migrating to a web extension
* migrating away from being a system add-on to being a regular Firefox component
When we talked in the SF, it was the case that loading as a web-extension would likely delay startup in some way, but that the WebExtensions team had bug 1378459 tracking that.  That bug just sprouted some proof-of-concept patches; linking to it here.
See Also: → webextensions-startup
Blocks: 1449052
Priority: -- → P3
Priority: P3 → --
Severity: normal → enhancement
Iteration: --- → 62.2 - Jun 4
Priority: -- → P2
Priority: P2 → P3
Blocks: 1439892
Iteration: 62.2 - Jun 4 → 62.3 - Jun 18
Iteration: 62.3 - Jun 18 → 63.1 - July 9
Iteration: 63.1 - July 9 → 63.2 - July 23
Iteration: 63.2 - July 23 → 63.3 - Aug 6
The "basic" steps of component-ify-ing is to replace the functionality provided by legacy bootstrap extensions -- in our case, mainly bootstrap.js and install.rdf. (Where we already have a bunch of custom packaging with already.) Some functionality can just be removed as we don't need to support uninstalling/reinstalling/upgrading/downgrading a live extension.

I believe this is the current lifecycle:

1) activity-stream bootstrap.js is loaded very early as that's when extensions get loaded
- this does minimal startup work waiting for "sessionstore-windows-restored"
2) browser.js starts aboutNewTabService from delayedStartup
3) aboutNewTabService (on main process) loads/calls AboutNewTab.init()
4) AboutNewTab.init() registers RemotePages
- this needs to happen early to catch the initial about:home/newtab
5) "sessionstore-windows-restored" triggers a deferred activity stream startup
- this loads resource://activity-stream/lib/ActivityStream.jsm and the rest of activity stream
- this is deferred to avoid talos sessionrestore
- this also finds all potentially loaded modules to unload them on shutdown (so live upgrade of add-on can re-register)
6) activity stream INIT action and other stuff happens
- this also handles early about:newtab type pages that RemotePages noticed but ActivityStream.jsm wasn't ready yet
7) "quit-application-granted"
- aboutNewTabService calls its uninit and AboutNewTab.uninit (for main)
8) bootstrap.js shutdown
- call activityStream.uninit() to dispatch UNINIT action
- unload modules

We should be able to move bootstrap.js into AboutNewTab. Details: move (1) bootstrap.js startup related bits into (4) AboutNewTab.init to wait for "sessionstore-windows-restored" and move (5) deferred loading as part of AboutNewTab module. Similarly we can move (8) shutdown to be handled in (7) AboutNewTab.uninit().

I think we can break this transition into some steps by having both bootstrap.js and AboutNewTab coexisting without actually moving browser/extensions/activity-stream at the same time. If we have AboutNewTab handle `new ActivityStream()` and `activityStream.uninit()` as described above, we can leave other extension-specific stuff in bootstrap.js.
Iteration: 63.3 - Aug 6 → ---
Keywords: meta
Priority: P3 → --
Summary: Migrate Activity Stream away from being a bootstrapped add-on → Component-ify
Depends on: 1474406
Depends on: 1474410
Depends on: 1474411
Depends on: 1474414
Depends on: 1474419
Depends on: 1472038
Iteration: --- → 63.4 - Aug 20
All dependent bugs resolved and successfully exported with bug 1478870!
Iteration: 63.4 - Aug 20 → 63.3 - Aug 6
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Component: Activity Streams: Newtab → New Tab Page
Summary: Component-ify → [meta] Component-ify
You need to log in before you can comment on or make changes to this bug.