You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/deployment/general/pad/_index.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,11 +55,10 @@ To run your app locally, perform the following steps:
55
55
* For Windows, run the command `set M2EE_ADMIN_PASS=<your password>`
56
56
* For Linux, run the command `export M2EE_ADMIN_PASS=<your password>`
57
57
58
-
{{% alert color="info" %}}
59
-
The Mendix admin port can be used to fetch metrics and other runtime data from an app. It requires a password for security reasons.
60
-
{{% /alert %}}
58
+
{{% alert color="info" %}}The Mendix admin port can be used to fetch metrics and other runtime data from an app. It requires a password for security reasons.
59
+
{{% /alert %}}
61
60
62
-
1. Run the app by using one of the following commands:
61
+
3. Run the app by using one of the following commands:
63
62
64
63
* For Windows, run the command `<your folder location>\bin\start.bat`
65
64
* For Windows Powershell, run the command `<your folder location>\bin\start.ps1`
Copy file name to clipboardExpand all lines: content/en/docs/deployment/on-premises-design/linux/linux-pad.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,14 +52,12 @@ To deploy your app to Linux, perform the following steps:
52
52
* For Debian/Ubuntu-based systems: `sudo apt install temurin-21-jdk -y`
53
53
* For RHEL/CentOS-based systems: `sudo yum install temurin-21-jdk -y` or `sudo dnf install temurin-21-jdk -y`
54
54
55
-
If your application requires it, you can change the Java version on vendor as needed, for example, `openjdk-21-jdk` or `java-21-amazon-corretto`.
55
+
If your application requires it, you can change the Java version on vendor as needed, for example, `openjdk-21-jdk` or `java-21-amazon-corretto`.
56
56
57
-
{{% alert color="info" %}}
58
-
Your Portable App Distribution only requires a Java Runtime Environment (JRE) to run, but it is often recommended to install a full JDK as it includes the JRE and development tools.
59
-
{{% /alert %}}
57
+
{{% alert color="info" %}} Your Portable App Distribution only requires a Java Runtime Environment (JRE) to run, but it is often recommended to install a full JDK as it includes the JRE and development tools. {{% /alert %}}
60
58
61
-
1. Verify that Java is correctly installed by running the following command: `java -version`.
62
-
2. Upload the Portable App Distribution .zip file to a location where your Linux server can access it by using one of the following options, depending on the location and configuration of your Linux machine.
59
+
4. Verify that Java is correctly installed by running the following command: `java -version`.
60
+
5. Upload the Portable App Distribution .zip file to a location where your Linux server can access it by using one of the following options, depending on the location and configuration of your Linux machine.
63
61
64
62
* For Azure Blob Storage (often done as part of a CI/CD pipeline): `az storage blob upload --account-name <your storage account name> --container-name <your container name> --name <your app>.zip --file <your project folder>/build/distributions/your-app.zip --auth-mode login`
65
63
@@ -77,7 +75,7 @@ Your Portable App Distribution only requires a Java Runtime Environment (JRE) to
77
75
78
76
* From a public URL using `wget`: `wget https://<path to your file>.zip`
79
77
80
-
3. Download the .zip file onto your Linux server by using one of the following options, depending on the location and configuration of your Linux machine.
78
+
6. Download the .zip file onto your Linux server by using one of the following options, depending on the location and configuration of your Linux machine.
@@ -95,8 +93,8 @@ Your Portable App Distribution only requires a Java Runtime Environment (JRE) to
95
93
96
94
You can also retrieve the files using `wget`.
97
95
98
-
4. Extract the .zip file by running the following command: `unzip <your app>.zip -d <your desired directory>`.
99
-
5. Navigate into the extracted directory and execute the start script by running the following command:
96
+
7. Extract the .zip file by running the following command: `unzip <your app>.zip -d <your desired directory>`.
97
+
8. Navigate into the extracted directory and execute the start script by running the following command:
100
98
101
99
```text
102
100
cd your-desired-directory
@@ -105,7 +103,7 @@ Your Portable App Distribution only requires a Java Runtime Environment (JRE) to
105
103
106
104
The `bin/start` script is a common convention for Portable App Distributions using the Default configuration. If your application uses a different configuration, start script, or command, adjust accordingly.
107
105
108
-
6. Verify that the application is running by opening the following URL in your browser: `http://<public IP of your Linux instance>:8080`.
106
+
9. Verify that the application is running by opening the following URL in your browser: `http://<public IP of your Linux instance>:8080`.
109
107
110
108
`8080` is the default port. If your application is configured to run on a different port, adjust accordingly.
Keep in mind that changing the ingress type resets the value of all fields in this tab.
85
-
{{% /alert %}}
83
+
{{% alert color="info" %}}Keep in mind that changing the ingress type resets the value of all fields in this tab.{{% /alert %}}
86
84
87
-
1. In the **Registry** tab, specify your network ingress settings. For more information about the available options, see [Registry Configuration](/developerportal/deploy/private-cloud-registry/).
85
+
12. In the **Registry** tab, specify your network ingress settings. For more information about the available options, see [Registry Configuration](/developerportal/deploy/private-cloud-registry/).
2. Optional: If your servers use a self-signed certificate, in the **Custom TLS** tab, configure custom TLS so that the self-signed certificate is accepted.
95
+
14. Optional: If your servers use a self-signed certificate, in the **Custom TLS** tab, configure custom TLS so that the self-signed certificate is accepted.
Ensure that your cluster have access to the Mendix on Kubernetes Portal for adding the storage plans, and that the Private Cloud Portal is safelisted in the cluster.
Copy file name to clipboardExpand all lines: content/en/docs/refguide/mobile/introduction-to-mobile-technologies/progressive-web-app/pwa-service-worker.md
+68-68Lines changed: 68 additions & 68 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,13 +20,13 @@ Scope limits which pages are controlled by a service worker, not which requests
20
20
21
21
To understand how updates to your Mendix PWA are handled, you need to understand the service worker lifecycle. A service worker goes through several distinct phases:
22
22
23
-
1.**Registration**— In this step the browser downloads the service worker file. If the code contains syntax errors, registration fails and the service worker is discarded.
24
-
2.**Installation**— During this phase, the service worker typically caches static assets your PWA needs to function offline. If all assets are successfully pre-cached, the installation succeeds. If installation fails, the service worker is discarded.
23
+
1.**Registration**– In this step the browser downloads the service worker file. If the code contains syntax errors, registration fails and the service worker is discarded.
24
+
2.**Installation**– During this phase, the service worker typically caches static assets your PWA needs to function offline. If all assets are successfully pre-cached, the installation succeeds. If installation fails, the service worker is discarded.
25
25
* Once installed:
26
26
* It becomes activated immediately if no other service worker is currently controlling the page.
27
27
* If there is already an active service worker, the new one will be installed but enters a **Waiting** state. The **Waiting** state, ensures that updates to your application are delivered smoothly and without interrupting your users' current interactions.
28
-
3.**Activation**— Once installed, the service worker enters the **Activating** state, and then becomes **Activated**. An **Activated** service worker takes control of pages within its scope (meaning it is ready to intercept requests).
29
-
4.**Redundant**— A service worker can become redundant if a new version replaces it, or if it fails to install.
28
+
3.**Activation**– Once installed, the service worker enters the **Activating** state, and then becomes **Activated**. An **Activated** service worker takes control of pages within its scope (meaning it is ready to intercept requests).
29
+
4.**Redundant**– A service worker can become redundant if a new version replaces it, or if it fails to install.
30
30
31
31
## Waiting for Service Worker Readiness
32
32
@@ -63,76 +63,76 @@ The [ServiceWorkerRegistration](https://developer.mozilla.org/en-US/docs/Web/API
63
63
64
64
You can implement a custom update mechanism to provide a clear notification and an option to update to the latest version of your app in that same notification. This allows them to update the application without closing all tabs or windows:
65
65
66
-
1.**Listen for service worker updates**— Create a JavaScript Action to listen for service worker updates. This action should run when your application starts up, for example, calling the JavaScript action via nanoflow that triggers by [Events](/appstore/widgets/events/) widget:
66
+
1.**Listen for service worker updates**– Create a JavaScript Action to listen for service worker updates. This action should run when your application starts up, for example, calling the JavaScript action via nanoflow that triggers by [Events](/appstore/widgets/events/) widget:
67
67
68
-
```javascript
69
-
exportasyncfunctionJS_ListenForPWAUpdates() {
70
-
if (!('serviceWorker'innavigator)) {
71
-
console.warn('service workers are not supported in this browser.');
72
-
return;
73
-
}
68
+
```javascript
69
+
exportasyncfunctionJS_ListenForPWAUpdates() {
70
+
if (!('serviceWorker'innavigator)) {
71
+
console.warn('service workers are not supported in this browser.');
// Listen for state changes in the new service worker
85
+
newWorker.addEventListener('statechange', () => {
86
+
// New service worker is installed and ready.
87
+
if (newWorker.state==='installed'){
88
+
// The new service worker is waiting because an existing service worker is active
89
+
if(navigator.serviceWorker.controller) {
90
+
console.log('A new update is available. Notify the user.');
91
+
// Show a confirmation dialog or implement your custom update UI
92
+
// to notify the user that an update is available
93
+
} else {
94
+
console.log("Service Worker installed and ready.");
95
+
// This is the first time a service worker is installed and activated for this page.
96
+
// A page reload is necessary to ensure all assets are served by the new service worker and the app is fully offline ready
97
+
}
97
98
}
98
-
}
99
-
});
99
+
});
100
+
}
101
+
});
102
+
103
+
if (registration.waiting) {
104
+
console.log('An update is already available and waiting. Notify the user.');
105
+
// Show a confirmation dialog or call your custom update flow
106
+
// to notify the user that an update is available
100
107
}
101
-
});
102
-
103
-
if (registration.waiting) {
104
-
console.log('An update is already available and waiting. Notify the user.');
105
-
// Show a confirmation dialog or call your custom update flow
106
-
// to notify the user that an update is available
107
108
}
109
+
} catch (error) {
110
+
console.error('Error setting up service worker update listener:', error);
108
111
}
109
-
} catch (error) {
110
-
console.error('Error setting up service worker update listener:', error);
111
112
}
112
-
}
113
-
```
114
-
115
-
1.**Create a JavaScript Action to activate the new service worker** — When the user confirms the update, use the Client API `skipWaiting()` to activate the new service worker:
116
-
117
-
```javascript
118
-
import { skipWaiting } from"mx-api/pwa";
119
-
120
-
/**
121
-
* @returns{Promise<boolean>} A promise that resolves to true if the update was successfully activated and page reloaded, false otherwise.
122
-
*/
123
-
exportasyncfunctionJS_ActivatePWAUpdate() {
124
-
constactivated=awaitskipWaiting();
125
-
126
-
if (activated) {
127
-
console.log("New service worker activated and controlling the page.");
128
-
129
-
returntrue;
130
-
} else {
131
-
console.warn("No waiting service worker found or activation failed via Mendix API.");
132
-
returnfalse;
113
+
```
114
+
115
+
2.**Create a JavaScript Action to activate the newservice worker** – When the user confirms the update, use the Client API`skipWaiting()` to activate the newservice worker:
116
+
117
+
```javascript
118
+
import { skipWaiting } from "mx-api/pwa";
119
+
120
+
/**
121
+
* @returns {Promise<boolean>} A promise that resolves to true if the update was successfully activated and page reloaded, false otherwise.
122
+
*/
123
+
export async function JS_ActivatePWAUpdate() {
124
+
const activated = await skipWaiting();
125
+
126
+
if (activated) {
127
+
console.log("New service worker activated and controlling the page.");
128
+
129
+
return true;
130
+
} else {
131
+
console.warn("No waiting service worker found or activation failed via Mendix API.");
132
+
return false;
133
+
}
133
134
}
134
-
}
135
-
```
135
+
```
136
136
137
-
1.**Notifying users**— To not interrupt users during critical operations, Mendix recommends notifying them when an update becomes available. For example, you can implement a nanoflow that prompts users to confirm the update when a new version is detected. If the user confirms, the nanoflow can call `JS_ActivatePWAUpdate` to update. This nanoflow can be passed as a parameter to `JS_ListenForPWAUpdates`, which will invoke it when an update is detected.
138
-
2.**Reload the Application**— Trigger a reload, or ask users to reload all open tabs or windows to ensure the application loads with the newly activated service worker.
137
+
3.**Notifying users**– To not interrupt users during critical operations, Mendix recommends notifying them when an update becomes available. For example, you can implement a nanoflow that prompts users to confirm the update when a newversion is detected. If the user confirms, the nanoflow can call `JS_ActivatePWAUpdate` to update. This nanoflow can be passed as a parameter to `JS_ListenForPWAUpdates`, which will invoke it when an update is detected.
138
+
4.**Reload the Application**– Trigger a reload, or ask users to reload all open tabs or windows to ensure the application loads with the newly activated service worker.
0 commit comments