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

Action API Migration Tracking #1602

Open
1 task done
illia-solovei-s1 opened this issue Nov 20, 2024 · 2 comments
Open
1 task done

Action API Migration Tracking #1602

illia-solovei-s1 opened this issue Nov 20, 2024 · 2 comments
Assignees
Labels
Kind: Enhancement New Request Kind: Maintenance Maintaining tasks within OpenSCD

Comments

@illia-solovei-s1
Copy link

illia-solovei-s1 commented Nov 20, 2024

The current Action API has known issues with XML processing, including the loss of XML prologs (see #1163). As we transition to the new API, we need to keep track of which plugins are still using the old Action API to ensure a complete migration.

Goal

  • Track migration progress
  • Identify potential dependencies between plugins
  • Ensure no plugins are overlooked during the transition

AC

  • Create a list of plugins that currently use the old API.

Some parts of the codebase have already been marked as deprecated and separated from the rest of the working code, e.g. core/foundation has been moved to core/deprecated/foundation. However, important functions such as newActionEvent and newActionEvent are still imported and used from the deprecated folder.

Assessment

Lists are not sorted.

Plugin Important components/folders involved
SLD packages/plugins/src/editors/SingleLineDiagram.ts
Communication packages/plugins/src/editors/communication/Communication.ts
Templates packages/plugins/src/editors/templates/Templates.ts
IED packages/plugins/src/editors/ied/ied-container.ts
Substation packages/plugins/src/editors/substation/substation-editor.ts

Menu Entries and other components Important components/folders involved
VirtualTemplateIED.ts packages/plugins/src/menu/VirtualTemplateIED.ts
control-blocks-container.ts packages/plugins/src/editors/cleanup/control-blocks-container.ts
datasets-container.ts packages/plugins/src/editors/cleanup/datasets-container.ts
datatypes-container.ts packages/plugins/src/editors/cleanup/datatypes-container.ts
connectedap-editor.ts packages/plugins/src/editors/communication/connectedap-editor.ts
gse-editor.ts packages/plugins/src/editors/communication/gse-editor.ts
smv-editor.ts packages/plugins/src/editors/communication/smv-editor.ts
subnetwork-editor.ts packages/plugins/src/editors/communication/subnetwork-editor.ts
connectedap-editor.ts packages/plugins/src/editors/protocol104/connectedap-editor.ts
network-container.ts packages/plugins/src/editors/protocol104/network-container.ts
tests integration/*
unit/*

Further research and replacement with a new technology

The above lists only highlight the most important files in each plugin represented, the full list includes 55 entries with some kind of relationship to the deprecated API usage.

Search API usage

Look for these patterns in plugin code:

  • Imports or usage of newActionEvent
  • Event dispatches containing actions arrays
  • Document manipulation using document.implementation.createDocument (ExportCommunications.ts)
  • Patterns similar to:
this.dispatchEvent(
  newActionEvent({
    new: {
      parent: this.doc.documentElement,
      element: element,
  },
}));
@clepski
Copy link
Collaborator

clepski commented Nov 22, 2024

There more editors and wizards using the editor action api

Component Location
Wizard Dialog packages/openscd/src/wizard-dialog.ts
Voltage level editor /packages/plugins/src/editors/substation/voltage-level-editor.ts
...

There are about 50 files, do we want to list all of them?

@michelguerin
Copy link

We are willing to wait that the plugins are migrated out of the openscd package before addressing this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kind: Enhancement New Request Kind: Maintenance Maintaining tasks within OpenSCD
Projects
Status: Review
Development

No branches or pull requests

3 participants