@gjsify/xmlhttprequest 0.4.35 → 0.4.36

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/globals.mjs +16 -0
  2. package/package.json +25 -12
package/globals.mjs ADDED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Re-exports native XMLHttpRequest globals for browser builds.
3
+ *
4
+ * XHR is universal in every browser (legacy but always-on).
5
+ *
6
+ * The dynamic resolver in `@gjsify/resolve-npm/runtime-aliases.mjs` routes
7
+ * `@gjsify/xmlhttprequest` here when `package.json#gjsify.runtimes.browser === "native"`.
8
+ *
9
+ * NOT used on Node — Node has no XHR global. `URL.createObjectURL` /
10
+ * `revokeObjectURL` are exposed via `@gjsify/url`'s `globals.mjs`.
11
+ */
12
+
13
+ export const XMLHttpRequest = globalThis.XMLHttpRequest;
14
+ export const XMLHttpRequestUpload = globalThis.XMLHttpRequestUpload;
15
+ export const XMLHttpRequestEventTarget = globalThis.XMLHttpRequestEventTarget;
16
+ export const FormData = globalThis.FormData;
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@gjsify/xmlhttprequest",
3
- "version": "0.4.35",
3
+ "version": "0.4.36",
4
4
  "description": "XMLHttpRequest and URL.createObjectURL/revokeObjectURL for GJS — backed by @gjsify/fetch and GLib",
5
5
  "module": "lib/esm/index.js",
6
6
  "types": "lib/types/index.d.ts",
7
7
  "files": [
8
- "lib"
8
+ "lib",
9
+ "globals.mjs"
9
10
  ],
10
11
  "type": "module",
11
12
  "exports": {
@@ -16,10 +17,12 @@
16
17
  "./register": {
17
18
  "types": "./lib/types/register.d.ts",
18
19
  "default": "./lib/esm/register.js"
19
- }
20
+ },
21
+ "./globals": "./globals.mjs"
20
22
  },
21
23
  "sideEffects": [
22
- "./lib/esm/register.js"
24
+ "./lib/esm/register.js",
25
+ "./globals.mjs"
23
26
  ],
24
27
  "scripts": {
25
28
  "clear": "rm -rf lib tsconfig.tsbuildinfo tsconfig.types.tsbuildinfo || exit 0",
@@ -35,21 +38,31 @@
35
38
  "web-api"
36
39
  ],
37
40
  "dependencies": {
38
- "@girs/gio-2.0": "2.88.0-4.0.1",
39
- "@girs/gjs": "4.0.1",
40
- "@girs/glib-2.0": "2.88.0-4.0.1",
41
- "@gjsify/fetch": "^0.4.35"
41
+ "@girs/gio-2.0": "2.88.0-4.0.4",
42
+ "@girs/gjs": "4.0.4",
43
+ "@girs/glib-2.0": "2.88.0-4.0.4",
44
+ "@gjsify/fetch": "^0.4.36"
42
45
  },
43
46
  "devDependencies": {
44
- "@gjsify/cli": "^0.4.35",
47
+ "@gjsify/cli": "^0.4.36",
45
48
  "@types/node": "^25.9.1",
46
- "typescript": "^6.0.3"
49
+ "typescript": "^5.9.3"
47
50
  },
48
51
  "gjsify": {
49
52
  "runtimes": {
50
53
  "gjs": "polyfill",
51
54
  "node": "none",
52
- "browser": "none"
55
+ "browser": "native"
53
56
  }
54
- }
57
+ },
58
+ "license": "MIT",
59
+ "repository": {
60
+ "type": "git",
61
+ "url": "git+https://github.com/gjsify/gjsify.git",
62
+ "directory": "packages/web/xmlhttprequest"
63
+ },
64
+ "bugs": {
65
+ "url": "https://github.com/gjsify/gjsify/issues"
66
+ },
67
+ "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/web/xmlhttprequest#readme"
55
68
  }