Ship Less JavaScript with Astro
summary
Astro claims to ship less JavaScript by default and the demo shows pages built at compile time unless explicitly server rendered, using content collections (getCollection) to generate hundreds of blog routes and export const getStaticPaths style generation. The workshop uses Astro 2.1 experimental assets and API routes to implement a products endpoint with client-side purchase POSTs, imports React components with Islands architecture with client:visible directives, and shows image optimization cutting a 3.2 MB source to ~27 KB; the examples run and build as shown.
AI-written summary · about
chapters (10)
- 0:00Introduction and setup
- 3:17Astro basics and project creation
- 10:13Front matter and static builds
- 13:05Routing and layouts
- 26:30Collections and content management
- 49:28Fetching data and API examples
- 1:00:11Server-side rendering and hybrid rendering
- 1:22:09Using React components in Astro
- 1:35:22Image optimization in Astro
- 1:46:27Q&A and workshop summary
