How bigcommerce/cornerstone works
Main Components Structure
Frontend Layer:
• Presentation |
• Templates |
• Styles (SCSS) |
• Client-side JS |
Core Architecture:
• Theme Structure |
• Page Types |
• Components |
• Layouts |
• Assets |
Key Relationships to Illustrate
• Page Manager | | Template System | | Asset Pipeline |
• Global | | - Handlebars | | - JavaScript |
• Page-specific | --> | - Components | --> | - SCSS |
Component Architecture
• Components | | Utilities | | Integration |
• Account | | - Stencil Utils | | - BigCommerce |
• Products | --> | - Polyfills | --> | - API |
• Cart | | - Helpers | | - Events |
• Common | | | | |
Important Elements
• Blue: Core theme components
• Green: Integration points
• Orange: Build/compilation processes
• Purple: Runtime features
• Template rendering flow
• Asset compilation pipeline
• Event handling paths
• Data flow between components
• Feature Detection |
• Browser Check --------->|
• Modern Browser |
• > Main Bundle |
• Legacy Browser |
• > Polyfills |
• > Main Bundle |
Implementation Details
Build process flow:
• Source Files | | Build Process | | Output Assets |
• JS (ES6) | | - Webpack | | - Bundled JS |
• SCSS | --> | - Grunt | --> | - CSS |
• Templates | | - SVG Store | | - SVG Sprite |