@gjsify/message-channel 0.44.0 → 0.46.0
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 +21 -0
- package/package.json +16 -4
package/README.md
CHANGED
|
@@ -33,6 +33,27 @@ port2.start();
|
|
|
33
33
|
port2.close();
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
## `@gjsify/message-channel/core` — the transport seam, on every runtime
|
|
37
|
+
|
|
38
|
+
The `node`, `browser` and `nativescript` slots are `native`, so a build for those
|
|
39
|
+
targets routes the bare `@gjsify/message-channel` specifier to `./globals` and the
|
|
40
|
+
consumer gets the host's own `MessageChannel`. That is right for code that wants a
|
|
41
|
+
transferable port and wrong for code that needs the **pluggable transport**: a host
|
|
42
|
+
port has no `MessagePortTransport` hook and no `_partner`, and answers
|
|
43
|
+
`Symbol.toStringTag` with `EventTarget` rather than `MessagePort`.
|
|
44
|
+
|
|
45
|
+
`./core` is the same implementation at a specifier slot routing never rewrites — the
|
|
46
|
+
alias layer matches exact specifiers, so a subpath passes through. Import it when the
|
|
47
|
+
seam is the point, as `@gjsify/iframe` does for its WebKit bridge:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import { MessagePort, type MessagePortTransport } from '@gjsify/message-channel/core';
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
On GJS both specifiers resolve to the same file, so there is one class and one
|
|
54
|
+
identity. Off GJS they are deliberately two, because the host port cannot keep the
|
|
55
|
+
promise the seam makes.
|
|
56
|
+
|
|
36
57
|
## License
|
|
37
58
|
|
|
38
59
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/message-channel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"description": "W3C MessageChannel + MessagePort for GJS — EventTarget-based, transport-pluggable. Same surface backs in-process channels (default), the @gjsify/iframe WebKit bridge, and (future) @gjsify/worker_threads cross-process workers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
"types": "./lib/types/index.d.ts",
|
|
11
11
|
"default": "./lib/esm/index.js"
|
|
12
12
|
},
|
|
13
|
+
"./core": {
|
|
14
|
+
"types": "./lib/types/index.d.ts",
|
|
15
|
+
"default": "./lib/esm/index.js"
|
|
16
|
+
},
|
|
13
17
|
"./register": {
|
|
14
18
|
"types": "./lib/types/register.d.ts",
|
|
15
19
|
"default": "./lib/esm/register.js"
|
|
@@ -45,13 +49,13 @@
|
|
|
45
49
|
"messageport"
|
|
46
50
|
],
|
|
47
51
|
"devDependencies": {
|
|
48
|
-
"@gjsify/cli": "^0.
|
|
49
|
-
"@gjsify/unit": "^0.
|
|
52
|
+
"@gjsify/cli": "^0.46.0",
|
|
53
|
+
"@gjsify/unit": "^0.46.0",
|
|
50
54
|
"@types/node": "^25.9.2",
|
|
51
55
|
"typescript": "^6.0.3"
|
|
52
56
|
},
|
|
53
57
|
"dependencies": {
|
|
54
|
-
"@gjsify/dom-events": "^0.
|
|
58
|
+
"@gjsify/dom-events": "^0.46.0"
|
|
55
59
|
},
|
|
56
60
|
"license": "MIT",
|
|
57
61
|
"author": "Pascal Garber <pascal@artandcode.studio>",
|
|
@@ -62,6 +66,14 @@
|
|
|
62
66
|
"browser": "native",
|
|
63
67
|
"nativescript": "native"
|
|
64
68
|
},
|
|
69
|
+
"runtimeSubpaths": {
|
|
70
|
+
"./core": {
|
|
71
|
+
"gjs": "polyfill",
|
|
72
|
+
"node": "polyfill",
|
|
73
|
+
"browser": "polyfill",
|
|
74
|
+
"nativescript": "polyfill"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
65
77
|
"tier": 1
|
|
66
78
|
},
|
|
67
79
|
"repository": {
|