Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Server-side rendering #96

Closed
wants to merge 8 commits into from
Closed

feat: Server-side rendering #96

wants to merge 8 commits into from

Conversation

DaveSkender
Copy link
Member

@DaveSkender DaveSkender commented Oct 21, 2023

for consideration only

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

  • fix ReferenceError error for HeroOverlayModule
  • fix error for NgOptimizedImage on Site Card component and Card Catalog page
  • fix build, it's probably missing a --production flag for the server portion
  • fix possible SASS self-reference loops and other cosmetic code analysis errors, shown in build logs
  • update release pipeline startup command
  • Codacy cleanup

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 DaveSkender linked an issue Oct 21, 2023 that may be closed by this pull request
@DaveSkender
Copy link
Member Author

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?

Signed-off-by: Dave Skender <[email protected]>
Signed-off-by: Dave Skender <[email protected]>
@DaveSkender DaveSkender added the on hold Waiting. Blocked, or started and held for future consideration. label Nov 29, 2023
@DaveSkender DaveSkender changed the title add server-side rendering feat: Server-side rendering Jan 22, 2024
Copy link

cloudflare-workers-and-pages bot commented Mar 30, 2024

Deploying uswds-design-patterns with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9bee319
Status:🚫  Build failed.

View logs

@DaveSkender DaveSkender deleted the ssr branch March 30, 2024 23:18
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
on hold Waiting. Blocked, or started and held for future consideration.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Meta information not showing for page routes when social sharing
1 participant