parse-dashboard 7.3.0-alpha.20 → 7.3.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,46 @@
1
+ const CACHE_NAME = 'dashboard-cache-v1';
2
+
3
+ self.addEventListener('install', () => {
4
+ self.skipWaiting();
5
+ });
6
+
7
+ self.addEventListener('activate', event => {
8
+ event.waitUntil(
9
+ Promise.all([
10
+ self.clients.claim(),
11
+ caches.keys().then(cacheNames => {
12
+ return Promise.all(
13
+ cacheNames.map(cacheName => {
14
+ if (cacheName !== CACHE_NAME) {
15
+ return caches.delete(cacheName);
16
+ }
17
+ })
18
+ );
19
+ })
20
+ ])
21
+ );
22
+ });
23
+
24
+ self.addEventListener('fetch', event => {
25
+ const req = event.request;
26
+ if (req.destination === 'script' || req.destination === 'style' || req.url.includes('/bundles/')) {
27
+ event.respondWith(
28
+ caches.match(req).then(cached => {
29
+ return (
30
+ cached ||
31
+ fetch(req).then(resp => {
32
+ const resClone = resp.clone();
33
+ caches.open(CACHE_NAME).then(cache => cache.put(req, resClone));
34
+ return resp;
35
+ })
36
+ );
37
+ })
38
+ );
39
+ }
40
+ });
41
+
42
+ self.addEventListener('message', event => {
43
+ if (event.data === 'unregister') {
44
+ self.registration.unregister();
45
+ }
46
+ });
package/README.md CHANGED
@@ -43,6 +43,7 @@ Parse Dashboard is a standalone dashboard for managing your [Parse Server](https
43
43
  - [Custom order in the filter popup](#custom-order-in-the-filter-popup)
44
44
  - [Persistent Filters](#persistent-filters)
45
45
  - [Scripts](#scripts)
46
+ - [Resource Cache](#resource-cache)
46
47
  - [Running as Express Middleware](#running-as-express-middleware)
47
48
  - [Deploying Parse Dashboard](#deploying-parse-dashboard)
48
49
  - [Preparing for Deployment](#preparing-for-deployment)
@@ -510,6 +511,37 @@ Parse.Cloud.define('deleteAccount', async (req) => {
510
511
 
511
512
  </details>
512
513
 
514
+ ### Resource Cache
515
+
516
+ 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.
517
+
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. |
521
+
522
+
523
+ Example configuration:
524
+
525
+ ```javascript
526
+ const dashboard = new ParseDashboard({
527
+ enableResourceCache: true,
528
+ apps: [
529
+ {
530
+ serverURL: 'http://localhost:1337/parse',
531
+ appId: 'myAppId',
532
+ masterKey: 'myMasterKey',
533
+ appName: 'MyApp'
534
+ }
535
+ ]
536
+ });
537
+ ```
538
+
539
+ > [!Warning]
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.
544
+
513
545
  # Running as Express Middleware
514
546
 
515
547
  Instead of starting Parse Dashboard with the CLI, you can also run it as an [express](https://github.com/expressjs/express) middleware.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse-dashboard",
3
- "version": "7.3.0-alpha.20",
3
+ "version": "7.3.0-alpha.21",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/parse-community/parse-dashboard"
@@ -41,7 +41,7 @@
41
41
  "body-parser": "2.2.0",
42
42
  "commander": "13.1.0",
43
43
  "connect-flash": "0.1.1",
44
- "cookie-session": "2.1.0",
44
+ "cookie-session": "2.1.1",
45
45
  "copy-to-clipboard": "3.3.3",
46
46
  "core-js": "3.42.0",
47
47
  "csurf": "1.11.0",
@@ -66,7 +66,7 @@
66
66
  "react-dnd": "10.0.2",
67
67
  "react-dnd-html5-backend": "16.0.1",
68
68
  "react-dom": "16.14.0",
69
- "react-draggable": "4.4.6",
69
+ "react-draggable": "4.5.0",
70
70
  "react-helmet": "6.1.0",
71
71
  "react-json-view": "1.21.3",
72
72
  "react-popper-tooltip": "4.4.2",
@@ -82,7 +82,7 @@
82
82
  "@babel/plugin-transform-runtime": "7.28.0",
83
83
  "@babel/preset-env": "7.27.2",
84
84
  "@babel/preset-react": "7.27.1",
85
- "@eslint/compat": "1.2.9",
85
+ "@eslint/compat": "1.3.1",
86
86
  "@saithodev/semantic-release-backmerge": "4.0.1",
87
87
  "@semantic-release/changelog": "6.0.3",
88
88
  "@semantic-release/commit-analyzer": "13.0.1",