-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
FEFrontend ticketFrontend ticket
Description
Description
Our codebase currently uses barrel exports (index.ts files) throughout the project, particularly in /src/components/index.ts. While this pattern provides shorter import paths, it has several drawbacks:
- Circular dependency risks: Barrel exports can create circular dependency issues that are hard to debug
- Poor tree-shaking: Bundlers may include unused code, resulting in larger bundle sizes
- Reduced code clarity: It's harder to trace where components actually live
- Maintenance overhead: Need to manually maintain export lists
- IDE performance: Can slow down IntelliSense and auto-imports
Proposed Solution
Migrate from barrel exports to direct imports across the codebase.
Before:
// src/components/index.ts
export * from '../features/trainee-profile/profile/components/TraineeProfile';
export * from '../features/trainee-profile/education/EducationInfo';
// Usage
import { TraineeProfile, EducationInfo } from '@/components';After:
// Direct imports
import { TraineeProfile } from '@/features/trainee-profile/profile/components/TraineeProfile';
import { EducationInfo } from '@/features/trainee-profile/education/EducationInfo';Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FEFrontend ticketFrontend ticket
Type
Projects
Status
No status