Component templates vs component service
The two component models and how they compare
Component templates model
-
In the component template model, component HTML is developed in the local environment and hosted in Git as a source of truth (which makes versioning more difficult).
-
CSS and JavaScript are minified with build tools and then hosted in a Git repository.
-
HTML is copied from the Git repository (commonly a locally-checked-out copy) to the Squiz Content Management System (CMS) as a part of the Component Template Paint Layout (front-end output) and the edit layout.
-
Implementers must perform the following tasks:
-
Manually copy and paste, or utilize an SSJS approach to render through referencing HTML in Git Bridge.
-
Manually implement appropriate keyword replacements.
-
Create and maintain separate metadata schemas.
-
-
Minified CSS and JavaScript is referenced globally via a Git Bridge Asset.
-
This makes versioning more difficult.
-
-
The component and static files are rendered by Squiz CMS.
Component services model
-
Component Code (HTML or JS) developed in local environment and hosted in Git.
-
Static files (client side) hosted in same Git Repository.
-
The version of the Component is deployed to the Component Service (management), and rendered through the Render Service.
-
Component instance stores data (as per component manifest).
-
Reduced CSS or JavaScript is referenced globally through a Git Bridge Asset.
-
Component code and content rendered by CMS.