@gjsify/http2-native 0.4.43 → 0.4.44

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.
Files changed (2) hide show
  1. package/README.md +38 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # @gjsify/http2-native
2
+
3
+ Optional native Vala bridge enabling advanced HTTP/2 primitives on GJS that are not reachable through libsoup's high-level GIR API: HPACK header-block encoding for PUSH_PROMISE / DATA frames, server-side push stream-ID allocation, and a thin `nghttp2_session` wrapper for future cleartext HTTP/2 (h2c) support. Consumed by `@gjsify/http2` to back `ServerHttp2Stream.pushStream()`, `respondWithFD()`, and `respondWithFile()`.
4
+
5
+ Part of the [gjsify](https://github.com/gjsify/gjsify) project — Node.js and Web APIs for GJS (GNOME JavaScript).
6
+
7
+ ## Installation
8
+
9
+ This is an internal native bridge package — it is loaded automatically by `@gjsify/http2` when installed, not used directly. Install it only when you want to enable HTTP/2 server push and flow-control features (Phase 2):
10
+
11
+ ```bash
12
+ gjsify install @gjsify/http2-native
13
+
14
+ # npm or yarn also work:
15
+ npm install @gjsify/http2-native
16
+ yarn add @gjsify/http2-native
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```typescript
22
+ // Loaded automatically by @gjsify/http2 when the prebuild is present.
23
+ // Gate on the availability predicate before using directly:
24
+ import { hasNativeHttp2, loadNativeHttp2 } from '@gjsify/http2-native';
25
+
26
+ if (hasNativeHttp2()) {
27
+ const mod = loadNativeHttp2()!;
28
+ const alloc = new mod.StreamIdAllocator();
29
+ const streamId = alloc.next_stream_id();
30
+ console.log('next push stream-ID:', streamId);
31
+ }
32
+ ```
33
+
34
+ Ships as a prebuilt `.so` + `.typelib` for `linux-x86_64`. Build from source with `meson` + `valac` + `libnghttp2-devel` if your architecture is not covered.
35
+
36
+ ## License
37
+
38
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/http2-native",
3
- "version": "0.4.43",
3
+ "version": "0.4.44",
4
4
  "description": "Optional Vala/GObject bridge providing nghttp2 primitives unreachable through libsoup's high-level GIR API: HPACK header-block encoding (for PUSH_PROMISE / DATA frames), server-side push stream-ID allocation, and a thin nghttp2_session wrapper for future cleartext HTTP/2 (h2c) support. Used by @gjsify/http2 to back ServerHttp2Stream.pushStream() / respondWithFD() / respondWithFile() and enable createServer() over plain TCP once the full Soup ↔ nghttp2 boundary is in place.",
5
5
  "type": "module",
6
6
  "main": "lib/esm/index.js",
@@ -59,8 +59,8 @@
59
59
  "@girs/gobject-2.0": "2.88.0-4.0.4"
60
60
  },
61
61
  "devDependencies": {
62
- "@gjsify/cli": "^0.4.43",
63
- "@gjsify/unit": "^0.4.43",
62
+ "@gjsify/cli": "^0.4.44",
63
+ "@gjsify/unit": "^0.4.44",
64
64
  "@ts-for-gir/cli": "^4.0.4",
65
65
  "@types/node": "^25.9.1",
66
66
  "typescript": "^6.0.3"