You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use shim pattern for CORS detection instead of globalThis.document check
Per review feedback, replace the runtime feature-sniff (globalThis.document)
with the package's existing _shims export-conditions pattern.
Adds CORS_IS_POSSIBLE constant to the client shims:
- shimsNode.ts -> false (Node has no CORS)
- shimsWorkerd.ts -> false (Cloudflare Workers has no CORS)
- shimsBrowser.ts -> true (new file; browser condition now resolves here)
This also fixes the Web Worker / Service Worker gap noted in the PR
description: bundlers resolve those to the 'browser' condition, so
CORS_IS_POSSIBLE is correctly true there — unlike the document check
which would have returned false in workers.
Tests now mock the shim module rather than stubbing globalThis.document.
0 commit comments