Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(app-aco): introduce Folders features #4513

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

leopuleo
Copy link
Contributor

Changes

This PR introduces a significant structural reorganization of the app-aco package by refactoring folders logic into a new feature-based architecture. The goal is to improve modularity, maintainability, and scalability by moving away from React Context and feature hooks (useFolders) in favor of self-contained feature modules.

1. Introduction of Feature-Based Architecture

  • Each feature is now self-contained, exposing a single-purpose hook (e.g., useCreateFolder()).
  • Every hook corresponds to a specific method (createFolder, etc.), making it explicit and easy to use.

2. New Feature Structure

The feature modules follow a clean separation of concerns:

createFolder/   
├── CreateFolder.test.ts                   # Unit tests for the feature logic  
├── CreateFolder.ts                        # Main entry point for the feature  
├── CreateFolderGqlGateway.ts              # GraphQL gateway implementation for communicating with an API  
├── CreateFolderRepository.ts              # Repository for handling feature data persistence  
├── CreateFolderUseCase.ts                 # Business logic for executing the feature  
├── CreateFolderUseCaseWithLoading.ts      # Decoration of the use case with loading state  
├── FolderDto.ts                           # DTO (Data Transfer Object) for the feature  
├── FolderGqlDto.ts                        # DTO specifically for GraphQL feature data  
├── ICreateFolderGateway.ts                # Interface for different API gateways (GraphQL, etc.)  
├── ICreateFolderRepository.ts             # Interface for the repository layer  
├── ICreateFolderUseCase.ts                # Interface for the feature use case  
├── index.ts                               # Entry point exporting all related modules  
└── useCreateFolder.ts                     # React hook for managing the feature logic  

3. Backward Compatibility

  • The existing useFolders hook and its methods remain available but are now deprecated.
  • All references to the generic useFolders hook in other packages have been replaced with their respective feature-specific hooks (e.g., useCreateFolder()).

How Has This Been Tested?

Jest + manually

@leopuleo leopuleo added the aco label Jan 30, 2025
@leopuleo leopuleo added this to the 5.42.1 milestone Jan 30, 2025
@leopuleo leopuleo requested a review from Pavel910 January 30, 2025 15:16
@leopuleo leopuleo self-assigned this Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant