Closed Bug 2034623 Opened 4 months ago Closed 4 months ago

Create asrouter-newtab-multistage component that allows for embedding multistage messages inline in newtab

Categories

(Firefox :: Messaging System, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: mconley, Assigned: mconley, NeedInfo)

References

()

Details

Attachments

(7 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
132.43 KB, image/png
Details

about:welcome has these really nice multistage messages via the MultiStageAboutWelcome component. I'd like to try adapting this component so that it's less tied to about:welcome, and can be embedded in about:newtab.

I spoke to emcminn and aminomancer and got a high-level okay to dig into this, since part of this is moving a bunch of React component definitions out from browser/components/aboutwelcome to browser/components/asrouter instead.

pdahiya also expressed interest in what I'm doing here.

The default value for importModule was an inline arrow function defined
inside the component's parameter list. JavaScript creates a new function
object each time the component renders, so React's useEffect dependency
comparison always saw importModule as changed, running the effect's
cleanup (which tears down the custom element or unmounts the React
bundle) followed by a full reload on every parent re-render.

Hoisting the default to a module-level constant gives it a stable
identity across renders, so the effect only re-runs when type or
components actually change.

Attached image image.png

Notably, New Tab stories must be disabled in order for this message to appear, but otherwise, kinda incredibly, this seems to work.

Assignee: nobody → mconley
Attachment #9573200 - Attachment description: WIP: Bug 2034623 - Fix ExternalComponentWrapper remounting on every re-render r?#home-newtab-reviewers! → Bug 2034623 - Fix ExternalComponentWrapper remounting on every re-render r?#home-newtab-reviewers!
Status: NEW → ASSIGNED
Attachment #9573201 - Attachment description: WIP: Bug 2034623 - Move about:welcome components out into browser/components/asrouter to be more obviously reusable. r?#omc-reviewers! → Bug 2034623 - Move about:welcome components out into browser/components/asrouter to be more obviously reusable. r?#omc-reviewers!
Attachment #9573202 - Attachment description: WIP: Bug 2034623 - Rename AWScreenUtils to ASRouterScreenUtils and move to browser/components/asrouter. → Bug 2034623 - Rename AWScreenUtils to ASRouterScreenUtils and move to browser/components/asrouter. r?#omc-reviewers!
Attachment #9573203 - Attachment description: WIP: Bug 2034623 - Stub out a new asrouter-newtab-multistage component and bundle, and package it to train-hop. → Bug 2034623 - Stub out a new asrouter-newtab-multistage component and bundle, and package it to train-hop. r?#omc-reviewers!,#home-newtab-reviewers!
Attachment #9573204 - Attachment description: WIP: Bug 2034623 - Embed asrouter-newtab-multistage message in newtab. → Bug 2034623 - Embed asrouter-newtab-multistage message in newtab. r?#omc-reviewers!,#home-newtab-reviewers!
Attachment #9573205 - Attachment description: WIP: Bug 2034623 - Add mochitests for asrouter-newtab-multistage embedding in newtab. → Bug 2034623 - Add mochitests for asrouter-newtab-multistage embedding in newtab. r?#omc-reviewers!
Attachment #9573206 - Attachment is obsolete: true
Priority: -- → P1

To help unblock / avoid bitrotting other patches under browser/components/aboutwelcome and browser/components/asrouter, I'm going to attempt to land the first 3 reviewed patches, which move a bunch of things around in preparation for the multistage message component.

Keywords: leave-open
Pushed by mconley@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7ad096607219 https://hg.mozilla.org/integration/autoland/rev/233dfb424f2b Fix ExternalComponentWrapper remounting on every re-render r=home-newtab-reviewers,thecount https://github.com/mozilla-firefox/firefox/commit/043e5e016b26 https://hg.mozilla.org/integration/autoland/rev/a1c73fb102ca Move about:welcome components out into browser/components/asrouter to be more obviously reusable. r=omc-reviewers,frontend-codestyle-reviewers,mimi https://github.com/mozilla-firefox/firefox/commit/f5acb4ac9f74 https://hg.mozilla.org/integration/autoland/rev/165cf6e0cb88 Rename AWScreenUtils to ASRouterScreenUtils and move to browser/components/asrouter. r=omc-reviewers,mimi
Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ae2c8ef62407 https://hg.mozilla.org/integration/autoland/rev/72a4c8a3af45 Revert "Bug 2034623 - Rename AWScreenUtils to ASRouterScreenUtils and move to browser/components/asrouter. r=omc-reviewers,mimi" for causing node newtab failures
Flags: needinfo?(mconley)
Pushed by mconley@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e4b689a8c116 https://hg.mozilla.org/integration/autoland/rev/f41156ccb6a1 Fix ExternalComponentWrapper remounting on every re-render r=home-newtab-reviewers,thecount https://github.com/mozilla-firefox/firefox/commit/1a2ff4f8a0e5 https://hg.mozilla.org/integration/autoland/rev/2065a7d8c06a Move about:welcome components out into browser/components/asrouter to be more obviously reusable. r=omc-reviewers,frontend-codestyle-reviewers,mimi https://github.com/mozilla-firefox/firefox/commit/49ed13234631 https://hg.mozilla.org/integration/autoland/rev/f438135bcfc1 Rename AWScreenUtils to ASRouterScreenUtils and move to browser/components/asrouter. r=omc-reviewers,mimi
Flags: needinfo?(mconley)
Keywords: leave-open
Pushed by mconley@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2b99c1a0ff99 https://hg.mozilla.org/integration/autoland/rev/1e67a84ba6f3 Stub out a new asrouter-newtab-multistage component and bundle, and package it to train-hop. r=omc-reviewers,home-newtab-reviewers,frontend-codestyle-reviewers,mimi,ini https://github.com/mozilla-firefox/firefox/commit/9a2d5e42c285 https://hg.mozilla.org/integration/autoland/rev/1d864ccf1a23 Embed asrouter-newtab-multistage message in newtab. r=omc-reviewers,home-newtab-reviewers,mimi,ini https://github.com/mozilla-firefox/firefox/commit/1cb38170d24c https://hg.mozilla.org/integration/autoland/rev/cb027f12df23 Add mochitests for asrouter-newtab-multistage embedding in newtab. r=omc-reviewers,emcminn
Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/847eb905466a https://hg.mozilla.org/integration/autoland/rev/a10d01c287a8 Revert "Bug 2034623 - Add mochitests for asrouter-newtab-multistage embedding in newtab. r=omc-reviewers,emcminn" for causing bc failures @browser_asrouter_newtab_multistage_messages.js.

Backed out for causing bc failures @browser_asrouter_newtab_multistage_messages.js.

Flags: needinfo?(mconley)
Blocks: 2037257
Pushed by mconley@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5190848174c3 https://hg.mozilla.org/integration/autoland/rev/40907503d2d9 Stub out a new asrouter-newtab-multistage component and bundle, and package it to train-hop. r=omc-reviewers,home-newtab-reviewers,frontend-codestyle-reviewers,mimi,ini https://github.com/mozilla-firefox/firefox/commit/ffadc5d27757 https://hg.mozilla.org/integration/autoland/rev/3428ba052090 Embed asrouter-newtab-multistage message in newtab. r=omc-reviewers,home-newtab-reviewers,mimi,ini https://github.com/mozilla-firefox/firefox/commit/9c645ae22578 https://hg.mozilla.org/integration/autoland/rev/06a287ff2e0d Add mochitests for asrouter-newtab-multistage embedding in newtab. r=omc-reviewers,emcminn
Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7d103428974b https://hg.mozilla.org/integration/autoland/rev/dc98c5984d59 Revert "Bug 2034623 - Add mochitests for asrouter-newtab-multistage embedding in newtab. r=omc-reviewers,emcminn" for causing bc failures @browser_parsable_css.js.

Backed out for causing bc failures @browser_parsable_css.js.

Pushed by mconley@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f2a53b040236 https://hg.mozilla.org/integration/autoland/rev/c6523682d936 Stub out a new asrouter-newtab-multistage component and bundle, and package it to train-hop. r=omc-reviewers,home-newtab-reviewers,frontend-codestyle-reviewers,mimi,ini https://github.com/mozilla-firefox/firefox/commit/7afb230a292c https://hg.mozilla.org/integration/autoland/rev/11815a141575 Embed asrouter-newtab-multistage message in newtab. r=omc-reviewers,home-newtab-reviewers,mimi,ini https://github.com/mozilla-firefox/firefox/commit/c0a337153a23 https://hg.mozilla.org/integration/autoland/rev/98c68a74e7d1 Add mochitests for asrouter-newtab-multistage embedding in newtab. r=omc-reviewers,emcminn
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
QA Whiteboard: [qa-triage-done-c153/b152]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: