Skip to content

Audit js.node.web for Node 24 web globals - #230

Merged
kevinresol merged 1 commit into
HaxeFoundation:masterfrom
kevinresol:audit/web-globals
Jul 14, 2026
Merged

Audit js.node.web for Node 24 web globals#230
kevinresol merged 1 commit into
HaxeFoundation:masterfrom
kevinresol:audit/web-globals

Conversation

@kevinresol

Copy link
Copy Markdown
Contributor

Summary

  • Audit and expand js.node.web against Node.js 24 web platform globals (undici fetch + EventTarget family + streams/messaging).
  • Drop Haxe 3 #if haxe4 import branches; keep Haxe 4 js.lib.* only.
  • Replace loose Dynamic with Any / concrete types where clear; type Blob.stream() / Request/Response.body as ReadableStream.
  • Add missing globals: web streams (+ controllers/readers/writers), compression streams, queuing strategies, BroadcastChannel/MessageChannel/MessagePort/MessageEvent, WebSocket/CloseEvent, EventSource, Navigator/LockManager, Storage, global TextEncoder/TextDecoder (+ stream variants).
  • Fetch/Request accept URL; Request gains isHistoryNavigation / isReloadNavigation.

Coordination TODOs

  • section-1: wire globals on js.Node / globalThis facade (fetch, Abort*, Event*, Blob/File, Navigator, Storage, TextEncoder/Decoder, …).
  • section-4: URLPattern global (URL package affinity); align js.node.util.TextEncoder with global encodeInto if desired; webcrypto remains crypto-util.
  • section-5: tighten MessagePort.postMessage transfer list once worker_threads transferables exist.
  • section-6 (follow-ups): undici Dispatcher typing for RequestInit / WebSocket / EventSource; deeper BYOB/underlying-source callback typing if needed.

Test plan

  • haxe build.hxml (ImportAll + examples) succeeds
  • Spot-check new types against Node 24 docs / undici behavior
  • Confirm section-1 wiring after merge coordination

Made with Cursor

Drop Haxe 3 import gates, tighten Dynamic/Any typing for fetch/abort/events,
and add missing Node 24 web-platform externs (streams, messaging, WebSocket,
EventSource, Navigator/locks, Storage, encoding globals).

Co-authored-by: Cursor <cursoragent@cursor.com>
@kevinresol
kevinresol merged commit 6a7e4c7 into HaxeFoundation:master Jul 14, 2026
10 checks passed
@kevinresol
kevinresol deleted the audit/web-globals branch July 15, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant