Skip to content

Commit cb54720

Browse files
committed
rename config
1 parent 0c306b1 commit cb54720

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

Parse-Dashboard/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ module.exports = function(config, options) {
219219
<base href="${mountPath}"/>
220220
<script>
221221
PARSE_DASHBOARD_PATH = "${mountPath}";
222-
PARSE_DASHBOARD_ENABLE_SERVICE_WORKER = ${
223-
config.enableBrowserServiceWorker ? 'true' : 'false'
222+
PARSE_DASHBOARD_ENABLE_RESOURCE_CACHE = ${
223+
config.enableResourceCache ? 'true' : 'false'
224224
};
225225
</script>
226226
<title>Parse Dashboard</title>
@@ -254,8 +254,8 @@ module.exports = function(config, options) {
254254
<base href="${mountPath}"/>
255255
<script>
256256
PARSE_DASHBOARD_PATH = "${mountPath}";
257-
PARSE_DASHBOARD_ENABLE_SERVICE_WORKER = ${
258-
config.enableBrowserServiceWorker ? 'true' : 'false'
257+
PARSE_DASHBOARD_ENABLE_RESOURCE_CACHE = ${
258+
config.enableResourceCache ? 'true' : 'false'
259259
};
260260
</script>
261261
<title>Parse Dashboard</title>

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -515,16 +515,16 @@ Parse.Cloud.define('deleteAccount', async (req) => {
515515

516516
Parse Dashboard can cache its resources such as bundles in the browser, so that opening the dashboard in another tab does not reload the dashboard resources from the server but from the local browser cache. Caching only starts after login in the dashboard.
517517

518-
| Parameter | Type | Optional | Default | Example | Description |
519-
|------------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------|
520-
| `enableBrowserServiceWorker` | Boolean | yes | `false` | `true` | Enables the browser service worker to cache dashboard resources in the browser for faster dashboard loading in additional browser tabs. |
518+
| Parameter | Type | Optional | Default | Example | Description |
519+
|-----------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------------------------------------|
520+
| `enableResourceCache` | Boolean | yes | `false` | `true` | Enables caching of dashboard resources in the browser for faster dashboard loading in additional browser tabs. |
521521

522522

523523
Example configuration:
524524

525525
```javascript
526526
const dashboard = new ParseDashboard({
527-
enableBrowserServiceWorker: true,
527+
enableResourceCache: true,
528528
apps: [
529529
{
530530
serverURL: 'http://localhost:1337/parse',
@@ -537,7 +537,10 @@ const dashboard = new ParseDashboard({
537537
```
538538

539539
> [!Warning]
540-
> Enabling this feature will start a browser service worker that caches dashboard resources locally only once. As long as the service worker is running, it will prevent loading any dashboard updates from the server, even if the user reloads the browser tab. The service worker is automatically stopped, once the last dashboard browser tab is closed. On the opening of the first dashboard browser tab, the dashboard resources are again loaded from the server and a new service worker is started.
540+
> This feature can make it more difficult to push dashboard updates to users. Enabling the resource cache will start a browser service worker that caches dashboard resources locally only once. As long as the service worker is running, it will prevent loading any dashboard updates from the server, even if the user reloads the browser tab. The service worker is automatically stopped, once the last dashboard browser tab is closed. On the opening of the first dashboard browser tab, a new service worker is started and the dashboard resources are loaded from the server.
541+
542+
> [!Note]
543+
> For developers: during dashboard development, the resource cache should be disabled to ensure reloading the dashboard tab in the browser loads the new dashboard bundle with any changes you made in the source code. You can inspect the service worker in the developer tools of most browsers. For example in Google Chrome, go to *Developer Tools > Application tab > Service workers* to see whether the dashboard service worker is currently running and to debug it. Updates to the service worker source code in `src/registerServiceWorker.js` requires to restart `npm run dev` as it is not part of the dashboard bundle but the environment in which the bundle is mounted.
541544
542545
# Running as Express Middleware
543546

src/registerServiceWorker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function registerServiceWorker() {
22

3-
if (!window.PARSE_DASHBOARD_ENABLE_SERVICE_WORKER) {
3+
if (!window.PARSE_DASHBOARD_ENABLE_RESOURCE_CACHE) {
44
return;
55
}
66
if (!('serviceWorker' in navigator)) {

0 commit comments

Comments
 (0)