How ionic-team/stencil works
Main Components Overview
a. Compiler Core
• Source Code Processing
• TypeScript/JSX Compilation
• Component Generation
• Build Pipeline
b. Runtime
• Component Lifecycle Management
• Shadow DOM Handling
• Virtual DOM Implementation
• Event System
c. Development Tools
• Dev Server
• Hot Module Reload
• Testing Infrastructure
• Screenshot Testing
Detailed Component Breakdown
┌─────────────────────────────────────────────────────────────┐
• Developer Interface │
• ┤
• CLI (src/cli) Dev Server (src/dev-server) │
• ┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Compilation Pipeline │
• ┤
• TypeScript Transpilation │
• JSX Processing │
• Component Transformation │
• Style Processing │
• ┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Runtime System │
• ┤
• Component Lifecycle (src/runtime) │
• Virtual DOM (src/runtime/vdom) │
• Platform Abstractions │
• ┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Output Targets │
• ┤
• Custom Elements │
• Hydrate/SSR │
• Collection │
• ┘
Key Interactions to Highlight
• Data flow from source files through the compilation pipeline
• How the compiler transforms decorators into static metadata
• Demonstrate the build process for different output targets
Important Details
• Component decorator processing pipeline
• Virtual DOM implementation
• Style processing and scoping
• Testing infrastructure
• Development server architecture
• Build optimization pipeline
Specific Implementation Notes
• The compiler's ability to generate different output formats
• The runtime's platform-agnostic nature
• The development server's hot reload capabilities
• The testing system's integration with Jest and Puppeteer
Integration Points
Connections with:
• TypeScript compiler
• Browser APIs
• Testing frameworks
• Build tools