Closed Bug 1614465 Opened 4 years ago Closed 3 years ago

De-couple ASRouter initialization from Activity Stream

Categories

(Firefox :: Messaging System, task, P3)

task

Tracking

()

RESOLVED FIXED
Firefox 75
Tracking Status
firefox74 --- unaffected
firefox75 --- wontfix
firefox76 --- wontfix
firefox77 --- wontfix
firefox78 --- wontfix
firefox79 --- wontfix
firefox84 --- fixed

People

(Reporter: mconley, Assigned: bigiri)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 5 obsolete files)

ASRouter grew out of work from the Activity Stream team, but at this point seems to be a pretty distinct component.

Bug 1614351 and its dependencies hopes to eventually rearchitect how about:home starts up a bit. One of the first things we'd like to do is make it so that ASRouter doesn't depend on Activity Stream for initialization.

We'll still need it so that ASRouter can send snippets to about:home, but there should be a well-defined API for this... I'm not sure having ASRouter send messages down directly through the message channel is the right move. Perhaps ASRouter can talk to AboutNewTabService or something, and then AboutNewTabService does the job of sending the update down to all of the about:home pages.

hey mike, were you planning on working on this? we are doing some refactoring with separating about:welcome from newtab that might overlap

Flags: needinfo?(mconley)

I'm hoping bigiri can work on it soon - we're meeting today about it, and then he'll likely reach out to your team to coordinate.

Flags: needinfo?(mconley)
Assignee: nobody → bigiri
Iteration: --- → 75.2 - Feb 24 - Mar 8
Priority: -- → P1
Target Milestone: --- → Firefox 75

From our chat, it seems like the first step is removing the blocking initialization dependency of ASRouter from new tab page's startup path. So we need to find an appropriate place to initialize and communicate with ActivityStream/new tab modules.

For reference, this is how ASRouter currently initializes at startup:

  1. browser.js _delayedStartup
    https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/browser/base/content/browser.js#1926-1929
  2. AboutNewTabService.jsm constructor
    https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/browser/components/newtab/AboutNewTabService.jsm#56
  3. AboutNewTab.jsm onBrowserReady
    https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/browser/modules/AboutNewTab.jsm#70
  4. ActivityStream.jsm init
    https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/browser/components/newtab/lib/ActivityStream.jsm#690-700
  5. ASRouterFeed.jsm enable
    https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/browser/components/newtab/lib/ASRouterFeed.jsm#21-26
  6. ASRouter init
    https://searchfox.org/mozilla-central/rev/96f1457323cc598a36f5701f8e67aedaf97acfcf/browser/components/newtab/lib/ASRouter.jsm#893-902

The last step 6 actually initializing ASRouter takes parameters for the channel (to communicate with content pages), indexeddb storage (to persist data), and dispatch function (to send actions to activity stream).

Ideally somehow we just straight to step 6 to not rely on any of the other new tab startup behavior. It seems likely the entry point will be similar to existing step 1 as that's where many other things get initialized, but potentially we can delay even more.

I believe this specific bug should focus on breaking the dependency and followup bugs will move various pieces out of the main process. And hopefully with the first step done, new tab page can start sooner without explicitly blocking on ASRouter related code (although might be indirectly delayed when competing for cpu/disk resources).

Iteration: 75.2 - Feb 24 - Mar 8 → 76.1 - Mar 9 - Mar 22

Work in Progress. No tests have been altered or written yet.

Iteration: 76.1 - Mar 9 - Mar 22 → 76.2 - Mar 23 - Apr 5
Iteration: 76.2 - Mar 23 - Apr 5 → 77.1 - Apr 6 - Apr 19
Iteration: 77.1 - Apr 6 - Apr 19 → 77.2 - Apr 20 - May 3
Attached file Bug 1614465 Adding new files r?mconley (obsolete) —

Depends on D71796

Attached file Bug 1614465 Adding new files r?mconley (obsolete) —

Depends on D71797

Attached file Bug 1614465 Adding files r?mconley (obsolete) —

Depends on D71798

Attached file Bug 1614465 Adding new files r?mconley (obsolete) —

Depends on D71799

Hey Bernard, we have this slated for Fx77 Release, will it be completed in time to merge to Beta on Friday?

Flags: needinfo?(bigiri)

(In reply to Ron Manning from comment #10)

Hey Bernard, we have this slated for Fx77 Release, will it be completed in time to merge to Beta on Friday?

No, I don't expect it will.

Flags: needinfo?(bigiri)
Iteration: 77.2 - Apr 20 - May 3 → ---
Priority: P1 → P2
Attachment #9133706 - Attachment is obsolete: true
Attachment #9142115 - Attachment is obsolete: true
Attachment #9142116 - Attachment is obsolete: true
Attachment #9142117 - Attachment is obsolete: true
Attachment #9142119 - Attachment is obsolete: true
Attachment #9142114 - Attachment description: Bug 1614465 - WIP separating snippets from ASRouter to put on content process r?mconley → Bug 1614465 - WIP separating snippets from ASRouter r?mconley
Attachment #9142114 - Attachment description: Bug 1614465 - WIP separating snippets from ASRouter r?mconley → Bug 1614465 - WIP separating snippets from ASRouter
Attachment #9142114 - Attachment description: Bug 1614465 - WIP separating snippets from ASRouter → Bug 1614465 - WIP replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed -r mconley
Attachment #9142114 - Attachment is obsolete: true
Attachment #9142114 - Attachment is obsolete: false
Attachment #9142114 - Attachment description: Bug 1614465 - WIP replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed -r mconley → Bug 1614465 - WIP replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed -rmconley
Attachment #9142114 - Attachment description: Bug 1614465 - WIP replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed -rmconley → Bug 1614465 - WIP replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley
Blocks: 1633903
Attachment #9142114 - Attachment description: Bug 1614465 - WIP replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=andreio,mconley
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=andreio,mconley → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=andreio,k88hudson
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=andreio,k88hudson → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=k88hudson,andreio,mconley
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=k88hudson,andreio,mconley → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley,andreio,k88hudson
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley,andreio,k88hudson → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley,andreio,k88hudson
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley,andreio,k88hudson → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley,andreio,k88hudson
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley,andreio,k88hudson → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley,andreio,k88hudson
Flags: needinfo?(andrei.br92)
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley,andreio,k88hudson → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley,k88hudson
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/01c4f36a13b8
Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=k88hudson
Attachment #9142114 - Attachment description: Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley,k88hudson → Bug 1614465 - Replacing ASRouter calls to MessageChannel with JSWindowActors to eliminate ASRouterFeed r=mconley!,k88hudson!
Pushed by malexandru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0a719a2effaa
Revert mistakenly landed changes to SystemStatusBar.cpp
Blocks: 1673109
Flags: needinfo?(andrei.br92)

Looks like there was a package.json change that didn't update package-lock.json. Bug 1674433 seems to have updated it although curious why tests didn't fail. I suppose we check for bundle differences not package-lock.json differences?

Blocks: 1674433
Regressions: 1675062
Regressions: 1677723
You need to log in before you can comment on or make changes to this bug.