feat(cloudflare): add durable.bindingName config#3875
feat(cloudflare): add durable.bindingName config#3875onmax wants to merge 3 commits intonitrojs:mainfrom
Conversation
|
@onmax is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAdds configurable Durable Object binding name for Cloudflare via a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-12-03T19:09:13.905ZApplied to files:
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/presets/cloudflare/utils.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-03T19:09:13.905Z
Learnt from: medz
Repo: nitrojs/nitro PR: 3834
File: src/presets/cloudflare/server-entry.ts:63-63
Timestamp: 2025-12-03T19:09:13.905Z
Learning: In the Nitro Cloudflare preset (src/presets/cloudflare/server-entry.ts), native errors from oxc-parser and Node.js readFile operations should be allowed to bubble up naturally without wrapping, as their native error messages are more user-friendly and provide better diagnostic information.
Applied to files:
src/presets/cloudflare/utils.ts
|
Question about this (and maybe the current implementation of Durable Objects via the |
Summary
Adds
cloudflare.durable.bindingNameconfig option to customize the Durable Object binding name used bydefineWebSocketHandler.Before: Hardcoded
$DurableObjectbinding nameAfter: Configurable via
nitro.cloudflare.durable.bindingNameChanges
cloudflare.durable.bindingName(default:$DurableObject)durable_objectsin wrangler.json whendeployConfig: trueUsage
With
deployConfig: true, wrangler.json auto-includes:{ "durable_objects": { "bindings": [{ "name": "MyDO", "class_name": "$DurableObject" }] } }Reproduction
Reproduction with pnpm patch: https://github.com/onmax/repros/tree/main/nitro-3378
Related
cloudflare_durableWebSockets broken in preview;cloudflare_moduleinconsistent on Workers nuxt-hub/core#722cloudflare_durablepreset #3378