Skip to content

Commit 42bd468

Browse files
committed
Added migration guide and release notes with link to it
1 parent b28f16f commit 42bd468

2 files changed

Lines changed: 77 additions & 0 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: "Migration Guide for Web Extensibility API Older Versions"
3+
linktitle: "Migration Guide"
4+
url: /apidocs-mxsdk/apidocs/web-extensibility-api-11/migration-guide/
5+
weight: 2
6+
---
7+
8+
## Introduction
9+
10+
A breaking change was introduced in version 11.6 of the Extensibility API which changed the way [menus](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/) are created. Here we will explain how to fix your extension code if you have upgraded to version 11.6 from an older version.
11+
12+
## MenuItemActivated Event
13+
If your extension created menus using the `menuId` and the `menuItemActivated` event in order to trigger actions, you can now simply use the action that was called when the event was triggered as the actual `action` property of your menu.
14+
15+
So if your code looked like this:
16+
```typescript
17+
18+
const menuId = "myextension.menu";
19+
20+
await studioPro.ui.extensionsMenu.add({
21+
menuId: menuId,
22+
caption: "My Menu",
23+
});
24+
25+
studioPro.ui.extensionsMenu.addEventListener(
26+
"menuItemActivated",
27+
async (args) => {
28+
if (args.menuId === menuId) {
29+
await studioPro.ui.messageBoxes.show("info", "My Menu was Clicked!")
30+
}
31+
}
32+
);
33+
```
34+
35+
The action called when the event triggers for your menu can now be used directly as the menu action:
36+
37+
```typescript
38+
await studioPro.ui.extensionsMenu.add({
39+
menuId: "myextension.menu",
40+
caption: "My Menu",
41+
action: async () => await studioPro.ui.messageBoxes.show("info", "My Menu was Clicked!")
42+
});
43+
```
44+
45+
The `menuItemActivated` event no longer exist so you cannot listen to it anymore.
46+
47+
## Registering Commands
48+
If your extension created menu by using a command id of a pre-registered command, the action that is sent to the command registration api when registering the command can now be used directly as the action of the menu.
49+
50+
So if your code looked like this:
51+
```typescript
52+
const commandId = "myextension.menu-command";
53+
54+
await studioPro.app.commands.registerCommand(
55+
commandId,
56+
async () => await studioPro.ui.messageBoxes.show("info", "My Menu was Clicked!")
57+
);
58+
await studioPro.ui.extensionsMenu.add({ caption: "My Menu", menuId: "myextension.menu", commandId });
59+
```
60+
61+
The same action sent to the command registration api can now instead become the `action` property value on the menu:
62+
63+
```typescript
64+
await studioPro.ui.extensionsMenu.add({
65+
menuId: "myextension.menu",
66+
caption: "My Menu",
67+
action: async () => await studioPro.ui.messageBoxes.show("info", "My Menu was Clicked!")
68+
});
69+
```
70+
71+
The command registration API has also been removed and it is no longer available.
72+
73+
# Action Arguments
74+
Action arguments are also possible in the new Menu API. Please read our [menus documentation](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/) for an in-depth explanation.

content/en/docs/releasenotes/studio-pro/web-extensibility-api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ numberless_headings: true
88

99
These release notes cover changes to the [Extensibility API for Web Developers](/apidocs-mxsdk/apidocs/extensibility-api/).
1010

11+
## Version 11.6.0
12+
We introduced a breaking change in 11.6 version of the Extensibility API. The menus will no longer support commands and will instead allow users to define their own actions. This will affect extension developers upgrading from 11.5 to 11.6. Please see our [migration guide](/apidocs-mxsdk/apidocs/web-extensibility-api-11/migration-guide/) to see how to safely convert your code for the latest version.
13+
1114
## Version 11.5.0
1215

1316
* You can now see all the extensions of your application by clicking **View** > **Extensions**.

0 commit comments

Comments
 (0)