Gatsby Compiler (Rust Implementation)
A pure Rust implementation of the Gatsby static site generator, designed for exceptional speed, compatibility, and reliability.
Features
- Pure Rust Implementation: Built entirely in Rust for maximum performance and safety
- No Runtime Dependencies: Self-contained implementation without relying on external runtime features
- Blazing Fast: Leverages Rust's performance characteristics for rapid site generation
- Gatsby Compatibility: Designed to be compatible with existing Gatsby projects
- Type Safety: Full type checking ensures reliable builds
- Asynchronous Processing: Uses Tokio for efficient async operations
Getting Started
Prerequisites
- Rust 1.60+ (stable)
- Cargo (Rust's package manager)
Installation
# Clone the repository
# Build the project
# Run the compiler
Usage
Basic Commands
# Build your site
# Start development server
# Create a new Gatsby site
# Check site health
Configuration
The Gatsby compiler uses a gatsby-config.js file for configuration, just like the original Gatsby. Here's a basic example:
module.exports =
Project Structure
gatsby/
├── bin/
│ └── gatsby.rs # Command-line interface
├── src/
│ ├── lib.rs # Main library entry point
│ ├── compiler/ # Core compilation logic
│ ├── plugin/ # Plugin system
│ ├── plugin_host/ # Plugin execution environment
│ ├── session/ # Session management
│ ├── tools/ # Utility tools
│ └── types/ # Type definitions
├── Cargo.toml # Rust package configuration
└── README.md # This file
Performance
The Rust implementation of Gatsby offers significant performance improvements over the original JavaScript implementation:
- Faster Build Times: Compile sites in a fraction of the time
- Lower Memory Usage: Efficient memory management
- Concurrent Processing: Leverage multi-core systems
- Optimized Asset Handling: Fast processing of images, CSS, and JavaScript
Compatibility
The Rust Gatsby compiler aims to be fully compatible with existing Gatsby projects, including:
- Existing Gatsby configurations
- Gatsby plugins
- Gatsby themes
- Markdown and MDX files
- GraphQL queries
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
# Clone the repository
# Install dependencies
# Run tests
Roadmap
- Core compilation engine
- Plugin system
- GraphQL layer
- Asset processing
- Development server
- Full Gatsby compatibility
- Performance benchmarks
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by the original Gatsby project
- Built with Rust, Tokio, and other great Rust crates
- Part of the rusty-ssg project
Made with ❤️ in Rust