angular-ssr

Enable server-side rendering and hydration for Angular applications with ng add @angular/ssr.

1|Updated Oct 12, 2022
One-click install
npx skills add https://github.com/plastikaweb/plastikspace --skill angular-ssr-plastikaweb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-ssr
Source: https://github.com/plastikaweb/plastikspace/tree/main/.agents/skills/angular-ssr
Command: npx skills add https://github.com/plastikaweb/plastikspace --skill angular-ssr-plastikaweb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Angular SSR enables server-side rendering and hydration for modern Angular apps, addressing slow initial loads and limited SEO visibility.

Core Features & Use Cases

  • SSR Setup: Integrates server-side rendering into an Angular project using ng add @angular/ssr and generates browser/server bundles.
  • Hydration & Prerendering: Supports hydration strategies and prerendered routes to improve perceived performance and search indexing.
  • Browser Safety: Offers patterns to safely run browser-only APIs and manage routing on both server and client.

Quick Start

To enable SSR in an Angular project, run ng add @angular/ssr, then configure server routes and hydration settings following the guidance in references/ssr-patterns.md.

Frequently Asked Questions about angular-ssr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable server-side rendering in an Angular application?

To enable Angular server-side rendering, run ng add @angular/ssr to integrate SSR. This generates browser and server bundles, allowing your application to render on the server for faster initial loads and improved SEO visibility.

What does hydration do in Angular SSR?

Hydration in Angular SSR allows the server-rendered HTML to be reused by the client without rebuilding the DOM. This improves perceived performance and ensures a smooth transition from server to browser rendering.

How do I make browser-only APIs safe for Angular server-side rendering?

To make browser-only APIs safe for Angular server-side rendering, apply specific patterns that check the rendering context. This prevents server execution errors when accessing browser objects like window or document during route navigation.

Can I use prerendering for specific routes like product pages in Angular?

Yes, you can use prerendering for specific routes like product pages and dashboards in Angular. This generates static HTML at build time, improving search indexing and perceived performance for those routes without runtime server overhead.