Pattern: How to handle unknown SDK elements (ggs-*) and their propert...

Documentation for Sessions

🎨 Pattern: How to handle unknown SDK elements (ggs-*) and their propert...

Date: 2026-03-24
Time: 17:49:14 UTC
Session: gspace1-264.4
Agent: angular
Confidence: 92%
Status: ✅ Documented


📋 Decision Context

Question:

How to handle unknown SDK elements (ggs-*) and their properties in preview components?

Task: S264: Fix NG0304/NG0303 unknown element and property errors in preview


🎯 Decision Made

Chosen:

Inject NO_ERRORS_SCHEMA into all @Component decorators during enrichment pipeline, applied universally via regex after @Component({ opening brace

Options Considered:

  1. NO_ERRORS_SCHEMA injection into all components (chosen)
  2. CUSTOM_ELEMENTS_SCHEMA (insufficient - doesn't suppress NG0303)
  3. Maintain comprehensive stubs for every ggs-* component+input (endless whack-a-mole)
  4. Add schemas to NgModule instead of components (doesn't work with standalone)

💭 Reasoning

Generated code uses ggs-* SDK components with various inputs (filters, activeFilters, etc.) that may not have matching stubs. CUSTOM_ELEMENTS_SCHEMA only suppresses unknown elements but still throws NG0303 for unknown properties on known (stubbed) elements. NO_ERRORS_SCHEMA suppresses both — correct for preview context. Injection after @Component({ is more reliable than anchoring on standalone:true (not all generated components may have it). Import uses /s flag regex for multi-line @angular/core imports.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation