@jcbuisson/express-x-plugins 4.0.8 → 4.0.9

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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  # express-x-plugins
3
3
 
4
4
 
5
- IMPORTANT
5
+ IMPORTANT FOR ELECTRIC
6
6
 
7
7
  # set lc_messages=C for the PostgreSQL role so Electric receives recognizable English errors
8
8
  ALTER ROLE chris SET lc_messages = 'C';
@@ -13,9 +13,10 @@ ALTER SYSTEM SET max_replication_slots = 10;
13
13
  ALTER SYSTEM SET max_wal_senders = 10;
14
14
  ALTER ROLE chris WITH REPLICATION;
15
15
 
16
- ## restart postgres
17
- sudo systemctl restart postgresql
16
+ (restart postgres: `sudo systemctl restart postgresql`)
18
17
 
18
+ ## Use HTTP2
19
+ nginx: `listen 443 ssl http2;`
19
20
 
20
21
 
21
22
  Currently includes:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcbuisson/express-x-plugins",
3
- "version": "4.0.8",
3
+ "version": "4.0.9",
4
4
  "description": "Plugins for express-x",
5
5
  "type": "module",
6
6
  "main": "./src/electric-server-plugin.mjs",
@@ -2,17 +2,6 @@ import { Shape, ShapeStream } from '@electric-sql/client'
2
2
  import { firstValueFrom, Observable, Subject, takeUntil } from 'rxjs'
3
3
  import { getCurrentScope, onScopeDispose, ref } from 'vue'
4
4
 
5
- export class DisposableShape extends Shape {
6
- subscribe(callback) {
7
- const unsubscribe = super.subscribe(callback)
8
- return () => {
9
- unsubscribe()
10
- if (this.numSubscribers === 0) this.stream.unsubscribeAll()
11
- }
12
- }
13
- }
14
-
15
-
16
5
  /**
17
6
  * Add Electric-backed reactive models to an Express-X client.
18
7
  *
@@ -100,6 +89,16 @@ export function electricClientPlugin(app, options = {}) {
100
89
 
101
90
  ////////////////////// UTILITIES //////////////////////
102
91
 
92
+ export class DisposableShape extends Shape {
93
+ subscribe(callback) {
94
+ const unsubscribe = super.subscribe(callback)
95
+ return () => {
96
+ unsubscribe()
97
+ if (this.numSubscribers === 0) this.stream.unsubscribeAll()
98
+ }
99
+ }
100
+ }
101
+
103
102
  const IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/
104
103
  const RANGE_OPERATORS = { gt: '>', gte: '>=', lt: '<', lte: '<=' }
105
104
 
@@ -1,3 +1,5 @@
1
+ import { useSessionStorage } from '@vueuse/core'
2
+
1
3
  /**
2
4
  * Enrich `app` with listeners handling socket data transfer on page reload
3
5
  *