Figure out a SSR workaround to allow for using moz-toggle in the about:home page
Categories
(Toolkit :: UI Widgets, task, P3)
Tracking
()
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.
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 1•1 year ago
|
||
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.
Updated•11 months ago
|
Description
•