facioquo / uswds-design-patterns

Design pattern Idea Book for the U.S. Web Design System
https://uswds.facioquo.com
Creative Commons Zero v1.0 Universal
1 stars 1 forks source link

feat: Server-side rendering #96

Closed DaveSkender closed 3 months ago

DaveSkender commented 8 months ago

for consideration only

This adds Angular Universal server-side rendering (SSR). Further troubleshooting and fixes to do:

more info

The issue on the Hero Overlay page when loading doesn't prevent functional use, but produces server-side errors indicating a circular reference; however, it does resolve when removing modal.on(); in ngOnInit. It's likely due to modal script references to window and document, but may be a legitimate circular re-referencing of SASS stylesheets.

Warning ERROR Error: Uncaught (in promise): ReferenceError: Cannot access 'HeroOverlayModule' before initialization ReferenceError: Cannot access 'HeroOverlayModule' before initialization at Module.HeroOverlayModule (./src/app/pages/hero-overlay/hero-overlay.component.ts:16:34)

Warning Error: NG02961: The NgOptimizedImage directive has detected that more than 5 images were marked as priority. This might negatively affect an overall performance of the page.

DaveSkender commented 8 months ago

One thing that's worth noting, adding this server does not preclude build and deploy as a regular SPA as before; the Website.zip package is produced the same as before. There's a separate Server.zip for deploying the SSR app that would launch with a slightly different command. We'd use one or the other, not both?

cloudflare-pages[bot] commented 3 months ago

Deploying uswds-design-patterns with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9bee319
Status:🚫  Build failed.

View logs