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

[opensearch_dashboards_legacy De-Angular] Remove angular part from opensearch_dashboards_legacy plugin #4020

Closed
ananzh opened this issue May 12, 2023 · 1 comment
Labels
de-angular de-angularize work v2.11.0

Comments

@ananzh
Copy link
Member

ananzh commented May 12, 2023

Introduction

The opensearch_dashboards_legacy plugin provides a bridge between the old AngularJS-based architecture and the new React platform architecture. It also has some general legacy code functions (addFatalError, registerListenEventListener, formatMsg, formatStack) aren't Angular-specific, but they're part of the legacy system.

Here's a brief description of the functions when search opensearch_dashboards_legacy in the code base and summarize all the import functions from this package. Here is a quick check on whether they are AngularJS-specific or general legacy/deprecated code:

  • initAngularBootstrap: This is AngularJS-specific. It bootstraps the AngularJS application.

  • configureAppAngularModule: This is AngularJS-specific. It configures the main AngularJS module for the application.

  • addFatalError: This is general legacy code. It is used to report fatal errors that are unhandled elsewhere.

  • AngularHttpError: This is AngularJS-specific. It is an error class for HTTP errors in AngularJS.

  • subscribeWithScope: This is AngularJS-specific. It ties the lifecycle of an RxJS observable subscription to an AngularJS scope, ensuring that the subscription is cleaned up when the scope is destroyed.

  • PrivateProvider: This is AngularJS-specific. It is a service provider for AngularJS's dependency injection system.

  • PromiseServiceCreator: This is AngularJS-specific. It creates a promise service compatible with AngularJS's $q service.

  • registerListenEventListener: This is general legacy code. It is used to register an event listener that gets cleaned up when a scope is destroyed.

  • watchMultiDecorator: This is AngularJS-specific. It is a decorator for AngularJS's $watch service that allows watching multiple expressions.

  • createTopNavDirective: This is AngularJS-specific. It creates a directive for the top navigation bar.

  • createTopNavHelper: This is AngularJS-specific. It creates a helper for managing the top navigation bar.

  • formatMsg: This is general legacy code. It formats an error message.

  • formatStack: This is general legacy code. It formats an error stack trace.

  • OpenSearchDashboardsLegacyPlugin: This is a class representing the legacy plugin for OpenSearch Dashboards, which allows code written for older versions of OpenSearch Dashboards to work with the newer platform.

Work left

If we replace discover, timeline application and dashboard plugin, I only see OpenSearchDashboardsLegacyStart been imported in vis_type_vislib, url_forwarding, tile_map and region_map.

import { OpenSearchDashboardsLegacyStart } from '../../opensearch_dashboards_legacy/public';

So we should be able to start removing angular part from opensearch_dashboards_legacy, which should include:

  • remove src/plugins/opensearch_dashboards_legacy/public/angular
  • remove src/plugins/opensearch_dashboards_legacy/public/angular_bootstrap
  • remove src/plugins/opensearch_dashboards_legacy/public/utils/private.js
  • clean out tests and modify docs
@ashwin-pc
Copy link
Member

Remaining work tracked in #5019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
de-angular de-angularize work v2.11.0
Projects
Development

No branches or pull requests

2 participants