Commit Detail
Commit 1d8cfaa
Make node:worker_threads independent of expose_global_message_channel flag The node:worker_threads module was previously importing MessageChannel and MessagePort from globalThis, which meant it only worked when the expose_global_message_channel compatibility flag was enabled. This change introduces a new internal module (cloudflare-internal:messagechannel) that exposes MessageChannel and MessagePort for use by built-in modules, independent of the global flag. Changes: - Add MessageChannelModule C++ class in messagechannel.h - Register cloudflare-internal:messagechannel as an internal module - Update node:worker_threads to import from the internal module - Add TypeScript type definitions for the internal module - Remove expose_global_message_channel from worker_threads tests This unblocks cloudflare/workers-sdk#12043 which needs worker_threads to work without requiring the global flag.
Files changed
7 files changed+1 added~6 modified