Best Practices
Code Organization
Use Feature-Based Folder Structure
src/
├── views/ # One folder per view
│ ├── portfolio/
│ ├── details/
│ └── settings/
├── components/ # Shared components
│ ├── location-card/
│ └── stats-summary/
└── forms/ # Form components
└── location-form/Keep Files Small and Focused
Component Patterns
Use registerUI() for Views
registerUI() for ViewsCentralize API Calls in services.ts
Use UXP Components
Styling
Use BEM Naming with App Prefix
Always Use Theme Variables
Data Fetching
Use Hooks for Data Loading
Handle Loading and Error States
TypeScript
Define Types
Use Proper Props Interfaces
Configuration
Keep configuration.yml Clean
Use Meaningful IDs
Performance
Use React.memo for Heavy Components
Avoid Unnecessary Re-renders
Error Handling
Always Handle Errors
Show User-Friendly Messages
Testing During Development
Use Watch Mode
Test in Actual iviva App
Localization
Use $L() for All Text
Organize Translation Keys
Quick Checklist
Common Pitfalls to Avoid
Summary
Last updated