fix(shared): exclude server runtimes from the worker navigator fallback#8840
fix(shared): exclude server runtimes from the worker navigator fallback#8840jacekradko wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR tightens browser detection in ChangesServer-runtime exclusion from browser detection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
🦋 Changeset detectedLatest commit: fe6f0af The changes in this PR will be included in the next version bump. This PR includes changesets to release 21 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
Follow-up to #8827. While reviewing it we checked how the new worker-scope navigator fallback behaves on server runtimes with worker-like globals. Running the probe in real workerd (via miniflare, old and current compatibility dates) showed Cloudflare Workers expose the
WorkerGlobalScopeconstructor butself instanceof WorkerGlobalScopeevaluates to false, so the merged gate excludes them today only through that quirk of workerd's prototype chain. If workerd ever aligns with the spec (whereServiceWorkerGlobalScopeinherits fromWorkerGlobalScope), CF would pass the gate, and since it implements nonavigator.onLine,isBrowserOnlinewould default to true.Server worker runtimes self-identify in
navigator.userAgent(Cloudflare-Workers,Node.js/24,Deno/2.5.0,Bun/1.3.9), so the fallback now rejects those before returning a worker navigator. Browser web/service workers (the MV3 case #8827 fixed) are unaffected; tests cover both today's workerd shape and a simulated spec-compliant one.Summary by CodeRabbit
Bug Fixes
Tests