Coralite v0.9.0
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 newdefineComponent()
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 withcreateComponent()
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 newCoraliteCollection
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 theCoralite
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 generalparseHTML()
). 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 newCoralite(…).compile()
API. - The
onFileLoaded
callback has been removed in favor of event-based handlers (onFileSet
,onFileUpdate
, andonFileDelete
). Existing implementations using the old callback must be updated to use these new hooks. - The
CoraliteDocumentTokens
typedef has been renamed toCoraliteDocumentValues
, 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 #
npm install coralite@0.9.0
For detailed information on all changes, refer to the git v0.9.0 changelog
Related posts
- Coralite v0.11.3 - 18 June 25
- Coralite v0.11.2 - 15 June 25
- Coralite v0.11.1 - 5 June 25