Skip to content

"ADR-000: Astro Performance Starter Template Architecture Decisions"

Accepted

This Astro performance starter template aims to provide a production-ready foundation for building high-performance Astro websites. We need to make foundational decisions that balance performance, developer experience, and maintainability while being opinionated enough to provide value but flexible enough for various use cases.

  • Performance: Must achieve Lighthouse scores of 100 consistently
  • Developer Experience: Should be easy to understand and extend
  • Maintainability: Minimize tooling complexity and dependency sprawl
  • Flexibility: Support both minimal (MVP) and comprehensive (Showcase) implementations
  • Modern Standards: Use current best practices and tools

This starter template is specifically designed as an Astro Performance Starter to achieve 100/100 Lighthouse scores with zero JavaScript by default. The framework choice is Astro 5.11.0, and the decisions below focus on optimal tooling choices within the Astro ecosystem.

  • Pros: Zero JS by default, excellent performance, built-in optimizations, perfect for static sites, islands architecture for selective hydration
  • Rationale: Astro is specifically chosen for performance-first static sites, making this the ideal foundation for a performance-focused starter template
  • Performance Benefits: Sub-second page loads, minimal JavaScript bundles, automatic image optimization
  • Pros: 20x faster than ESLint, single tool for lint + format
  • Cons: Newer tool, less ecosystem
  • Pros: Mature, extensive plugin ecosystem
  • Cons: Slower, requires multiple tools, config complexity
  • Pros: Utility-first, tree-shakeable, design tokens support
  • Cons: Learning curve for newcomers
  • Pros: Familiar to most developers, explicit
  • Cons: More boilerplate, harder to maintain consistency

We will use:

  • Astro 5.11.0 with Vite for the build system
  • Biome for linting and formatting
  • Tailwind CSS 3.4.4 with design tokens
  • TypeScript in strict mode
  • pnpm as package manager
{
"engines": {
"node": ">=22.0.0"
}
}
  • Exceptional performance out of the box with zero JavaScript default
  • Single tool for code quality (Biome) reduces complexity
  • Modern tooling provides excellent developer experience
  • Design tokens ensure consistency and maintainability
  • Type safety catches errors early
  • Biome has less ecosystem support than ESLint
  • Tailwind CSS requires learning utility classes
  • pnpm might be new to some contributors
  • Requires Node.js 22.x+ (LTS version)
  • Opinionated choices may not suit all projects
  • Focus on static/SSG over SSR capabilities

Success metrics:

  • Lighthouse Performance: Consistently ≥ 100
  • Build Time: Under 2 minutes for typical site
  • Developer Onboarding: New devs productive within 1 hour
  • Bundle Size: JS < 160KB, CSS < 50KB
  • Type Coverage: 100% of components typed

This ADR represents the initial decisions for v1.0 of the Astro performance starter template. As the ecosystem evolves, we may need to revisit these choices. Any changes should be documented in new ADRs that supersede this one.

The dual-track approach (MVP vs Showcase) allows teams to choose their complexity level while maintaining the same foundational decisions.


Date: 2024-01-15
Participants: Template maintainers
Outcome: Accepted