Release

Coralite v0.9.0

Coralite v0.9.0 introduces component-based architecture, plugin integration, and event-driven file handling in its HTML module static site generator. Learn about key improvements and breaking changes.

TD
Thomas David May 23, 2025

Coralite v0.9.0 introduces foundational features for building and rendering static websites, with a focus on component-based architecture, plugin integration, and metadata extraction.

Core Functionality

  • Introduced support for defining and processing custom HTML elements using the Coralite class API through the new defineComponent() plugin. This enables dynamic attribute replacements during template processing.
  • Refactored internal logic to use a component-based architecture, removing legacy parsing methods such as renderDocument() and replacing them with createComponent() for modular and extensible rendering.
  • Introduced event-driven file handling using new callbacks (onFileSet, onFileUpdate, onFileDelete) to support dynamic updates and maintain consistency between pages and custom elements.
  • Refactored the internal data structure from Documents to a new CoraliteCollection class, providing methods for managing HTMLData objects in a structured way. This change introduces more consistent type definitions and API patterns across modules.
  • Added support for plugins through configuration using coralite.config.js, allowing developers to extend Coralite’s functionality dynamically with custom plugin definitions and aggregation capabilities.
  • Implemented a new compile() method in the Coralite class, supporting dynamic path resolution and asynchronous processing of components for enhanced rendering performance.
  • Introduced metadata tracking for HTML documents, including the addition of a type field to differentiate between main pages (’page’) and reusable templates (’template’).

Key Improvements

  • Improved Type Definitions: Updated TypeScript interfaces to better reflect the current data handling patterns, including renaming of document-related types to align with the new collection-based architecture.
  • Simplified API: Removed redundant or unused functions and parameters (e.g., parseHTMLDocument() is no longer used and has been replaced by a more general parseHTML()). This reduces redundancy while improving clarity in the codebase.
  • Better Documentation: Extended documentation to include project structure examples, usage patterns for templates and pages, ignored element handling, and recursive template directory support. A new type definitions reference document has been added for easier navigation of core types.

Breaking Changes

  • The coralite() function is now a class constructor that must be instantiated using the new Coralite(…).compile() API.
  • The onFileLoaded callback has been removed in favor of event-based handlers (onFileSet, onFileUpdate, and onFileDelete). Existing implementations using the old callback must be updated to use these new hooks.
  • The CoraliteDocumentTokens typedef has been renamed to CoraliteDocumentValues, and references to ’tokens’ have been updated to ’values’ in module definitions and type declarations.
  • The CoraliteComponent typedef was removed from the codebase. Any code relying on this type must be adjusted accordingly.

Get the release

bash
Code copied!
  npm install coralite@0.9.0

For detailed information on all changes, refer to the git v0.9.0 changelog

TD

Thomas David

Creator of Coralite. Writing about the intersection of native web APIs, compiler design, and AI-assisted development.