Upgrade to PRO for Only $50/Yearโ€”Limited-Time Offer! ๐Ÿ”ฅ

Astro for Angular astronauts - CSR, SSR, SSG, A...

Avatar for Marcell Kiss Marcell Kiss
May 15, 2024
41

Astro for Angular astronauts - CSR, SSR, SSG, Astro andย Angular

This talk introduces Astro, explaining how it works and why its approach means a huge performance boost. You will learn how to utilize Angular using Astro and get introduced to the built-in Angular SSG support as well.

Avatar for Marcell Kiss

Marcell Kiss

May 15, 2024
Tweet

Transcript

  1. Intro Marcell Kiss, MSc Contractor #EnterpriseArchitecture Angular Hungary ๐Ÿ‡ญ๐Ÿ‡บ Part-time

    trainer #AngularArchitects marcell.tech @marcelltech @marcellkiss @marcellkiss ๐Ÿ‡ฉ๐Ÿ‡ช
  2. Overview โœ… Web Rendering โœ… Intro to Astro โœ… Angular

    in Astro โœ… Angularโ€™s built-in SSG
  3. CSR - Client-Side Rendering Server Browser somesite.com index.html [empty shell]

    Include main.js main.js Request: โ€ฆ/api/info {info: โ€ฆ} ๐Ÿ‘€ โš™ @marcelltech
  4. Server Browser somesite.com Include main.js main.js ๐Ÿ‘€ SSR - Server-Side

    Rendering index.html [with content!] โš™ @marcelltech โš™
  5. SSG - Static Site Generation Server Browser somesite.com index.html [with

    content!] Include main.js main.js ๐Ÿ‘€ โš™ @marcelltech
  6. Performance Summary โŒ CSR is resource-heavy for bots โŒ SSR

    is resource-heavy for us โœ… SSG has the lowest latency @marcelltech
  7. SSG - Build & Deploy Your Astro App (MPA) Index

    .html /home /impressum /user/:id Impressum .html ? @marcelltech
  8. CSR - Build & Deploy Your Angular App (SPA) Index.html

    /home /impressum /user/:id @marcelltech
  9. Application Builder Your Angular App (SPA) @marcelltech CSR SSR SSG

    ๐Ÿ›  Application Builder ๐Ÿ“– Docs: https://angular.dev/tools/cli/esbuild https://angular.dev/guide/prerendering#
  10. Resources @marcelltech [Article] Angular Islands in Astro https://dev.to/brandontroberts/bringing-angular-components-to-astro-islands-52jp [Article] Astro

    + Angular https://medium.com/ngconf/astro-angular-abe926dac097 [Docs] Angular new build system https://angular.io/guide/esbuild [Docs] Angular Pre-rendering https://angular.dev/guide/prerendering# [Docs] Astro integrations https://astro.build/integrations/ [Docs] Astro MDX Docs https://docs.astro.build/en/guides/integrations-guide/mdx/ [OSS] GitHub Repo https://github.com/marcellkiss/angular-astro-example