Skip to content

Commit 5f757f9

Browse files
authored
Merge pull request #11111 from mendix/qt-review
Review Extension docs
2 parents d66a1fe + 4e3cfe4 commit 5f757f9

4 files changed

Lines changed: 46 additions & 46 deletions

File tree

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
---
22
title: "Packaging Your Extension"
3-
url: /apidocs-mxsdk/apidocs/extensibility-api-11/packaging-your-extension
3+
url: /apidocs-mxsdk/apidocs/extensibility-api-11/packaging-your-extension/
44
weight: 30
5+
description: "Explains how to package extensions into add-on modules and publish them to the Mendix Marketplace."
56
---
67

78
# Packaging Your Extension
89

9-
After completing development on your extension, you can package it into an add-on module so others can use it. Once packaged, the module can be published to the Mendix Marketplace, allowing other users to download it into their Studio Pro apps.
10+
After you complete development on your extension, you can package it into an add-on module so others can use it. You can then publish the module to the Mendix Marketplace so other users can download it into their apps.
1011

11-
To package your extension, follow the steps below:
12+
To package your extension, follow these steps:
1213

13-
1. Make sure you have enabled the [Extension Development](/refguide/preferences-dialog/#extension-development) setting in your app's Preferences. Alternatively, you can start Studio Pro with the `--enable-extension-development` command-line option.
14-
2. In your Studio Pro app, create a new module and include your development extension.
15-
3. Give the module a name.
16-
4. Open the module's settings and in the **Export** tab, choose **Add-on module**.
17-
5. In the **Extension name** drop-down, select the extension you want to package into it.
14+
1. Verify that you have enabled the [Extension Development](/refguide/preferences-dialog/#extension-development) setting in your app's **Preferences**. Alternatively, start Studio Pro with the `--enable-extension-development` command-line option.
15+
2. In your app, create a new module and include your development extension.
16+
3. Name the module.
17+
4. Open the module's settings and on the **Export** tab, select **Add-on module**.
18+
5. In the **Extension name** list, select the extension you want to package.
1819

19-
![Extension Add-on Module](/attachments/apidocs-mxsdk/apidocs/extensibility-api/extensionAddOnModule.png)
20+
{{< figure src="/attachments/apidocs-mxsdk/apidocs/extensibility-api/extensionAddOnModule.png" alt="Extension settings showing Add-on module selected with Extension name dropdown" width="400" >}}
2021

21-
After you have created your add-on module with its extension, you can export it by right-clicking the module in the **App Explorer** and selecting **Export add-on module package**.
22+
After you create your add-on module with its extension, export it by right-clicking the module in the **App Explorer** and selecting **Export add-on module package**.
2223

23-
![Export Module](/attachments/apidocs-mxsdk/apidocs/extensibility-api/exportAddOnModule.png)
24+
{{< figure src="/attachments/apidocs-mxsdk/apidocs/extensibility-api/exportAddOnModule.png" width="400" >}}
2425

2526
You can now save the add-on module to a location of your choice.
2627

2728
# Importing the Extension Add-on Module
2829

29-
When the add-on module is available to a Studio Pro user, they are now able to add it in their application. This is done by right-clicking the app in the **App Explorer** and selecting **Import module package**.
30+
When the add-on module is available to a Studio Pro user, they can add to their app. This is done by right-clicking the app in the **App Explorer** and selecting **Import module package**.
3031

31-
![Import Module](/attachments/apidocs-mxsdk/apidocs/extensibility-api/importAddOnModule.png)
32+
{{< figure src="/attachments/apidocs-mxsdk/apidocs/extensibility-api/importAddOnModule.png" width="400" >}}
3233

33-
When an add-on module containing an extension is imported in the app, Studio Pro will show a warning to the user, asking to trust the extension contained in it. If the user does not choose to trust, the module will still be imported but the extension inside it will not be loaded.
34+
When an add-on module containing an extension is imported in the app, Studio Pro displays a warning to the user, asking to trust the extension contained in it. If the user does not choose to trust the extension, the module is still imported but the extension inside it will not be loaded.
3435

35-
![Trust Extension](/attachments/apidocs-mxsdk/apidocs/extensibility-api/trustExtension.png)
36+
{{< figure src="/attachments/apidocs-mxsdk/apidocs/extensibility-api/trustExtension.png" width="400" >}}

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ For detailed information on how to get started with extensions, see [Get Started
3535

3636
## How-tos
3737

38-
Below is a list of how-tos for you to begin with:
38+
The following how-tos help you get started:
3939

4040
* [How Menus Work](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/)
4141
* [How to Create a Dockable Pane](/apidocs-mxsdk/apidocs/web-extensibility-api-11/dockable-pane-api/)

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/get-started.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ weight: 2
77

88
## Introduction
99

10-
Studio Pro extensions can be developed using TypeScript and use standard web development technologies to extend the Studio Pro development environment. This document describes how to set up a basic development environment for building an extension using the web extensibility API.
10+
Studio Pro extensions can be developed using TypeScript and standard web development technologies to extend the Studio Pro development environment. This document describes how to set up a basic development environment for building an extension using the Web Extensibility API.
1111

1212
For more detailed information, see the [Mendix Studio Pro Web Extensibility API reference documentation](http://apidocs.rnd.mendix.com/11/extensions-api/index.html).
1313

1414
### Prerequisites
1515

16-
You will need the following prerequisites:
16+
You need the following prerequisites:
1717

18-
* [Mendix Studio Pro](https://marketplace.mendix.com/link/studiopro) version 11.2.0 or higher.
19-
* A development IDE to develop your extensions. Mendix recommends using [Visual Studio Code](https://code.visualstudio.com/).
20-
* The latest version 22.x.x of Node: https://nodejs.org/en/download.
18+
* [Mendix Studio Pro](https://marketplace.mendix.com/link/studiopro) version 11.2.0 or above
19+
* A development IDE to develop your extensions; Mendix recommends using [Visual Studio Code](https://code.visualstudio.com/)
20+
* The latest version 22.x.x of Node from [nodejs.org](https://nodejs.org/en/download/)
2121

2222
{{% alert color="info" %}}
2323
Extensions can be built on any operating system, as the underlying framework is cross-platform.
@@ -29,32 +29,32 @@ Extension development is only possible by enabling the [Extension Development](/
2929

3030
## Creating Your First Extension
3131

32-
This section will show you how to build and test an extension.
32+
This section shows you how to build and test an extension.
3333

3434
### Create a Test App
3535

3636
Create a new app using the **Blank Web App** template.
3737

38-
You can also open the application directory containing the application `.mpr` file by clicking the **App** menu > **Show App Directory in Explorer** (or **Show App Directory in Finder**) in Studio Pro.
38+
You can also open the app directory containing the app `.mpr` file by clicking **App** > **Show App Directory in Explorer** (or **Show App Directory in Finder**) in Studio Pro.
3939

4040
### Creating the Extension
4141

4242
To accelerate your extension development, Mendix provides an extension generator that creates a customizable sample extension.
4343

4444
To use the generator, navigate to your desired source code directory and run the command `npm create @mendix/extension@latest`. You may be prompted by `npm` to grant permission to install the generator. After installation, you will be guided through a series of questions to help configure your extension.
4545

46-
You will be asked the following:
46+
The generator asks the following questions:
4747

4848
* Select the programming language (TypeScript is used in the tutorials)
4949
* Specify the extension name
5050
* Choose if you will use React for the extension’s UI
5151

52-
The next two questions, while optional, are highly recommended, as they enable direct debugging and deployment from Visual Studio Code:
52+
The next two questions are optional but highly recommended, as they enable direct debugging and deployment from Visual Studio Code:
5353

5454
* Specify the path to the Studio Pro executable (this allows Visual Studio Code to automatically attach to Studio Pro for debugging)
55-
* Specify the location of the application `.mpr` package (this allows for automatic deployment of your extension build to your app)
55+
* Specify the location of the app `.mpr` package (this allows automatic deployment of your extension build to your app)
5656

57-
The last question allows you to select the Studio Pro version you are targeting; Mendix recommends choosing version 11.
57+
The last question allows you to select the Studio Pro version you are targeting. Mendix recommends choosing version 11.
5858

5959
{{% alert color="info" %}}
6060
On a Windows machine, the Studio Pro executable is typically located at `C:\Program Files\Mendix\<version>\modeler\studiopro.exe`. To find the exact path, follow these steps:
@@ -64,14 +64,13 @@ On a Windows machine, the Studio Pro executable is typically located at `C:\Prog
6464
3. Select **Properties**. The **Target** field displays the executable path.
6565
{{% /alert %}}
6666

67-
Once you have completed the setup, a new directory named after your extension will be created,
68-
containing the source code of the extension.
67+
Once you complete the setup, a new directory named after your extension is created, containing the source code of the extension.
6968

7069
### Exploring the Created Extension
7170

7271
In the following example, the name of your extension is `myextension` and you are exploring it using Visual Studio Code.
7372

74-
Before you begin, your extension will have to get an instance of the Studio Pro API. to do this, from the Explorer window, navigate to `src/main/index.ts` and select it to open the file.
73+
Before you begin, your extension must get an instance of the Studio Pro API. To do this, from the Explorer window, navigate to `src/main/index.ts` and select it to open the file.
7574

7675
In the source code, you should see the following:
7776

@@ -109,13 +108,13 @@ In the source code, you should see the following:
109108
});
110109
```
111110

112-
3. If you navigate to `build-extension.mjs`, you can choose the directory where the extension will be installed to after being built by changing line 6:
111+
3. If you navigate to `build-extension.mjs`, you can choose the directory where the extension will be installed after being built by changing line 6:
113112

114113
```typescript
115114
const appDir = "C:\\TestApps\\AppTestExtensions"
116115
```
117116

118-
4. The file `.vscode\launch.json` specifies the launch configuration and enables debugging. The following lines specify how Studio Pro will be run:
117+
4. The file `.vscode\launch.json` specifies the launch configuration and enables debugging. The following lines specify how Studio Pro will run:
119118

120119
```json
121120
@@ -124,27 +123,27 @@ In the source code, you should see the following:
124123
125124
```
126125

127-
When you install the extension, you will see a new menu item within Studio Pro.
126+
When you install the extension, you see a new menu item in Studio Pro.
128127

129128
### Building, Installing, and Debugging the Extension
130129

131-
The following steps occur within Visual Studio Code:
130+
Complete the following steps in Visual Studio Code:
132131

133132
1. Select **File** > **Open Folder**.
134133
2. Navigate to the folder where you created your extension.
135134
3. Click **Select Folder**.
136135
4. Select **Yes** if you are asked whether you trust this folder.
137-
5. Open a Terminal from the top menu by clicking **Terminal** > **New Terminal**.
138-
6. From the Terminal, type `npm install`. This installs all dependencies for the extension.
139-
7. Build your extension using the command `npm run build` in the terminal. If you provided the path to `.mpr` file in the previous step, this will install the extension into the application directory.
136+
5. Open a terminal from the top menu by clicking **Terminal** > **New Terminal**.
137+
6. From the terminal, type `npm install`. This installs all dependencies for the extension.
138+
7. Build your extension using the command `npm run build` in the terminal. If you provided the path to the `.mpr` file in the previous step, this installs the extension into the app directory.
140139

141-
If the last two questions of the extension generator were answered and you have built and installed the extension, you can debug it by following the steps below:
140+
If you answered the last two questions of the extension generator and have built and installed the extension, you can debug it by completing the following steps:
142141

143142
1. Open the extension source code in Visual Studio Code and set breakpoints.
144143
2. Select **Run and Debug** from the side panel.
145-
3. Click the play button on the top of the panel (or press F5).
144+
3. Click the play button on the top of the panel (or press <kbd>F5</kbd>).
146145

147-
This will run Studio Pro in extension development mode and open the configured application. You will see a new `Extensions` item in the top menu.
146+
This runs Studio Pro in extension development mode and opens the configured app. You see a new **Extensions** item in the top menu.
148147

149148
## Extensibility Feedback
150149

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/migration-guide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ weight: 2
77

88
## Introduction
99

10-
A breaking change in the Web Extensibility API was introduced in Studio Pro 11.6, which changed the way [menus](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/) are created. This guide explains how to update your extension code after upgrading to Studio Pro 11.6 from an earlier version.
10+
Studio Pro 11.6 introduced a breaking change in the Web Extensibility API that changed the way [menus](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/) are created. This guide explains how to update your extension code after you upgrade to Studio Pro 11.6 from an earlier version.
1111

1212
## `MenuItemActivated` Event
1313

14-
If your extension created menus using the `menuId` and the `menuItemActivated` event to trigger actions, you can now use the action that was called when the event was triggered as the actual `action` property of your menu.
14+
If your extension created menus using `menuId` and the `menuItemActivated` event to trigger actions, you can now use the action that was called when the event was triggered as the `action` property of your menu.
1515

1616
For example, if your code looked like this:
1717

@@ -44,15 +44,15 @@ await studioPro.ui.extensionsMenu.add({
4444
});
4545
```
4646

47-
The `menuItemActivated` event no longer exists, so you cannot listen to it anymore.
47+
The `menuItemActivated` event no longer exists.
4848

4949
## Registering Commands
5050

5151
{{%alert type="info" %}}
5252
The command registration API has been removed and is no longer available for Studio Pro 11.6 and above.
5353
{{% /alert%}}
5454

55-
If your extension created menus 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.
55+
If your extension created menus using a command ID of a pre-registered command, the action sent to the command registration API when registering the command can now be used directly as the action of the menu.
5656

5757
For example, if your code looked like this:
5858

@@ -66,7 +66,7 @@ await studioPro.app.commands.registerCommand(
6666
await studioPro.ui.extensionsMenu.add({ caption: "My Menu", menuId: "myextension.menu", commandId });
6767
```
6868

69-
The same action sent to the command registration API can now instead become the `action` property value on the menu:
69+
The same action sent to the command registration API can now become the `action` property value on the menu:
7070

7171
```typescript
7272
await studioPro.ui.extensionsMenu.add({
@@ -78,4 +78,4 @@ await studioPro.ui.extensionsMenu.add({
7878

7979
## Action Arguments
8080

81-
Action arguments are also possible in the new Menu API. Review the [Menus documentation](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/) for a detailed explanation.
81+
Action arguments are also possible in the new Menu API. For a detailed explanation, review [Menus](/apidocs-mxsdk/apidocs/web-extensibility-api-11/menu/).

0 commit comments

Comments
 (0)