pages: add sections about local support for bindings in wrangler.toml
Updated local bindings sections for: kv, r2, d1, and service bindings since those are currently supported.
Files with changes (up to 15)
| Original Link | Updated Link |
|---|---|
| https://developers.cloudflare.com/pages/functions/bindings/ | https://update-pages-local-bindings.cloudflare-docs-7ou.pages.dev/pages/functions/bindings/ |
Pages using wrangler.toml locally but not when you publish really confuses people. We see it every single week in the Discord.
https://github.com/cloudflare/workers-sdk/issues/3757
It seems a little strange to me to encourage this behaviour until Pages actually has full support for configuration in some capacity.
@Cherry the goal of adding this would be to clear up that confusion for users by stating explicitly what is supported now. We are working towards support for Pages file-based configuration so we're not going to remove what is currently exposed. As we work towards that, we are also using this functionality to support better framework development like in next-on-pages and via the getBindingsProxy API.
I left a comment on the workers-sdk PR, but I'm personally not sure this reduces confusion. 🤷♀️ Leaning into what has been considered a bug for years, with everyone being told that Pages does not support wrangler.toml, seems odd to me.
Especially if folks are going to have to update their configs again when Pages does support configuration.
We are working towards support for Pages file-based configuration
Just to make sure I understand, is the plan to support wrangler.toml configuration for deploys on-par with how Workers work?
I think it would be extremely beneficial to hold this PR until it's made very clear in wrangler pages deploy commands and Pages CI that publishing a project with bindings in your wrangler.toml won't actually make them available in production. This is a serious confusion and pain point people hit constantly with Pages commands, with the wrangler.toml local functionality being described as a bug for years.
This is made especially and even more confusing when these new docs talk about Pages, link to wrangler configuration docs that detail how this does work when deploying (the linked docs pages are tailored for Workers), but then doesn't and no warnings are presented to the user. Most users struggle to understand the nuances between Workers and Pages right now, and I personally think this only adds to the confusion.