Export
Overview
What is the Export Object?
Basic Structure
The Dependency Rule ⚠️ CRITICAL
Why This Rule Exists
The Problem
The Fix
Instance Scope and Isolation
Two Different Contexts
Context
Can Access
Cannot Access
Inside the Component
In an Instance
Why This Happens
Chain of Dependencies
Wrong: Incomplete Dependency Chain
Right: Complete Dependency Chain
What to Put in Export
✅ Put in Export
❌ Keep Outside Export
Complex Nested Instances
Example: House Using Cube
What If House_Base Wasn't Exported?
Common Mistakes
❌ Mistake 1: Missing Simple Dependency
❌ Mistake 2: Partial Dependency Chain
❌ Mistake 3: Not Exporting Nested Object
❌ Mistake 4: Over-Exporting (Anti-pattern)
Debugging Export Issues
Problem: Calculation works in component but returns 0 or wrong value in instance
Problem: Can't access nested object
Problem: Value is infinity or NaN
Problem: Instance seems to have old/wrong values
Best Practices
1. Always Export Dependencies
2. Test with Instances
3. Minimize Export Surface
4. Document Exported Parameters
5. Group Related Exports
6. Trace Dependency Chains
7. Use Meaningful Export Names
Summary
Critical Rules
Quick Checklist
Last updated