Closed Bug 1818341 Opened 2 years ago Closed 1 year ago

Figure out a SSR workaround to allow for using moz-toggle in the about:home page

Categories

(Toolkit :: UI Widgets, task, P3)

task

Tracking

()

RESOLVED INVALID

People

(Reporter: hjones, Assigned: hjones)

References

(Blocks 1 open bug)

Details

(Whiteboard: [recomp])

The about:home page startup cache uses server side rendering for performance reasons. This results in the following error when trying to use moz-toggle (or any web component) on the about:home page:

Error: ReferenceError: HTMLElement is not defined

This makes sense since SSR happens in a non-browser context, so all browser APIs are unusable.

While this error doesn't actually prevent the startup cache from being built or the toggle from rendering, it needs to be addressed before the toggle integration code will be reviewable/shippable. It may be possible to only load web component code on the client, and provide some kind of fallback content for use in SSR.

Whiteboard: [fidefe-reusable-components-ms2] → [fidefe-reusable-components]
Priority: -- → P3
Assignee: nobody → hjones

Resolving this as invalid since we were able to use moz-toggle in the personalization panel without it in Bug 1812135. It's possible the error I was seeing was due to some experimentation we were doing with the Lit-labs React package, or that the toggle just doesn't get rendered initially as it's hidden in a drawer.

We may run into SSR issues if we try to use custom elements on the main view in about:newtab, but we can file bugs for those issues as they arise.

No longer blocks: 1812135
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
Whiteboard: [fidefe-reusable-components] → [recomp]
You need to log in before you can comment on or make changes to this bug.