Open joshuarrrr opened 1 year ago
@joshuarrrr, can I please be assigned to this issue? I'm currently working on two other issues from the same track, and they require a better understanding of this plugin, including the legacy_core_editor. So I might as well take on this issue too.
@joshuarrrr I did some investigation and these are my current findings. If you need more in-depth look at some parts please let me know.
legacy_core_editor
legacy_core_editor
were used./legacy_core_editor/mode
is responsible for Ace Editor rules.containers/legacy/editor
Similarily to CoreEditor, there are several places where the legacy files are used. For example current Editor (containers/editor/editor.tsx
) component imports EditorUI and EditorOutput from the /editor/legacy/
, so clearly some of the legacy components (also methods) are directly used in non-legacy components and containers.
Overall, it seems that the SenseEditor extends the functionality of CoreEditor. My guess is that previously the migration to SenseEditor was performed by moving more of the CoreEditor functionality to SenseEditor step by step. The current legacy code is used in quite a lot of places and it doesn't seem there is an easy way to remove it.
However, it looks like the legacy_core_editor
contains large chunk of the ace editor logic, so if we decide to move to another code editor decent part of the legacy_core_editor
might become irrelevant. So it might be better to first decide whether we will replace ace editor.
As part of our efforts to clean up and remove legacy code, we're interested to figure out where and how any of the code in https://github.com/opensearch-project/OpenSearch-Dashboards/tree/main/src/plugins/console/public/application/models/legacy_core_editor is still used in the developer tools console today. Additionally, what's the role of https://github.com/opensearch-project/OpenSearch-Dashboards/tree/main/src/plugins/console/public/application/containers/editor/legacy ?
Note that we'd also like to better understand the relationship of
legacy_code_editor
and the https://github.com/opensearch-project/OpenSearch-Dashboards/tree/main/src/plugins/console/public/application/models/sense_editor.