dashboards-search-relevance icon indicating copy to clipboard operation
dashboards-search-relevance copied to clipboard

Refactor dashboards-search-relevance plugin

Open noCharger opened this issue 1 year ago • 5 comments

Refactoring the dashboards-search-relevance plugin can provide several benefits, making the application more maintainable, scalable, and efficient. The primary purposes for refactoring the plugin are:

  1. Improve code readability and maintainability: Refactoring helps in simplifying complex code structures and making them more readable. This ensures that other contributers can easily understand and maintain the codebase in the long run.

  2. Enhance performance and optimization: By refactoring, contributers can identify and eliminate bugs, optimize code, and improve the app's overall performance. This ensures a better user experience and faster loading times.

  3. Increase reusability and modularity and facilitate easier testing: Breaking down large components into smaller, reusable components enhances the modularity of the application. This makes it easier to manage, test, and scale the application in the future. For example, this index.ts has several functions that cannot be easily unit tested until they are modulated.

  4. Adhere to best practices and design patterns: Refactoring helps in aligning the codebase with industry best practices and widely accepted design patterns. This ensures consistency, reduces the chances of bugs, and makes the codebase easier to work with for other contributers .

Overall, refactoring the dashboards-search-relevance app aims to make the application more efficient, maintainable, and scalable, providing a better experience for both developers and users.

noCharger avatar Apr 19 '23 22:04 noCharger

Can you break this down into specifics? I see that the example of index.ts makes sense to modularize, but what else? Why? Creating PRs with specific refactorings can work, too.

macohen avatar Apr 20 '23 16:04 macohen

@sejli since you're going to be working in this plugin (#195 and #196), can you take a look at some of these issues?

These are much appreciated general guidelines, but if we can turn the big ones into specific tasks then making some of these refactorings an active part of development would be good.

macohen avatar May 02 '23 15:05 macohen

Can we create a checklist here of items to focus on while in the code? There's only one concrete task I see here. I'm create an issue from that one.

macohen avatar May 30 '23 13:05 macohen

One more factor work: reduce the scope of using global context https://github.com/opensearch-project/dashboards-search-relevance/pull/267/files#r1312006788

noCharger avatar Aug 31 '23 18:08 noCharger

In the interest of clarity, can @sejli break this out into targeted issues that can be completed independently?

macohen avatar Sep 21 '23 21:09 macohen