-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Pages] Update bindings section of Qwik framework guide #12915
Conversation
|
||
### Deploy via the Cloudflare dashboard | ||
You can instead [connect a GitHub or Gitlab repository](/pages/configuration/git-integration) to your Pages project so that new versions of your project are built and deployed when changes to your git repository are detected. To do so, choose “No” when C3 asks if you’d like to deploy and refer to the guide below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Next.js guide we went quite a different direction in regards to the git integration:
cloudflare-docs/content/pages/framework-guides/nextjs/deploy-a-nextjs-site.md
Lines 40 to 46 in cb0ced8
{{<Aside type="note" header="Git integration">}} | |
The initial deployment created via C3 is referred to as a [Direct Upload](/pages/get-started/direct-upload/). To set up a deployment via the Pages Git integration, refer to the [Git Integration](#git-integration) section below. | |
Git integration cannot currently be added to existing Pages applications. If you have already deployed your application (using C3, for example), you need to create a new Pages application in order to add Git integration to it. | |
{{</Aside>}} |
I think we should be consistent and use the Next.js version (which is the one the team agreed on I think)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I can see the same sort of note below... but I think that this version is more confusing then the Next.js one since here we say "instead" and tell people to say "No" to the C3 deployment, and only later we mention the option to create a new Pages project. 🤔
a870b1d
to
12ea92f
Compare
Deploying with Cloudflare Pages
|
Files with changes (up to 15) |
12ea92f
to
d3de783
Compare
if(process.env.NODE_ENV === 'development') { | ||
const { getBindingsProxy } = await import('wrangler'); | ||
const { bindings } = await getBindingsProxy(); | ||
env = bindings; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since #12957 got merged:
if(process.env.NODE_ENV === 'development') { | |
const { getBindingsProxy } = await import('wrangler'); | |
const { bindings } = await getBindingsProxy(); | |
env = bindings; | |
} | |
if(process.env.NODE_ENV === 'development') { | |
const { getPlatformProxy } = await import('wrangler'); | |
const platformProxy = await getBindingsProxy(); | |
env = platformProxy.env; | |
} |
(following what I did in cloudflare/workers-sdk#5010)
}); | ||
``` | ||
|
||
The `getBindingsProxy` [helper function](/workers/wrangler/api#getbindingsproxy) will automatically detect any bindings defined in the `wrangler.toml` file and emulate them in local development. See [Wrangler configuration](workers/wrangler/configuration/#bindings) for more information on how to configure bindings in `wrangler.toml`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since #12957 got merged:
The `getBindingsProxy` [helper function](/workers/wrangler/api#getbindingsproxy) will automatically detect any bindings defined in the `wrangler.toml` file and emulate them in local development. See [Wrangler configuration](workers/wrangler/configuration/#bindings) for more information on how to configure bindings in `wrangler.toml`. | |
The `getPlatformProxy` [helper function](/workers/wrangler/api#getplatformproxy) will automatically detect any bindings defined in the `wrangler.toml` file and emulate them in local development. See [Wrangler configuration](workers/wrangler/configuration/#bindings) for more information on how to configure bindings in `wrangler.toml`. |
👋Hi there, we’re going to close this PR due to inactivity |
This change adds more detail to the bindings section of the Qwik framework guide on how to configure bindings in dev and production. It covers the recent addition of
getBindingsProxy
to the qwik template in c3: cloudflare/workers-sdk#4927.A few of the sections were re-ordered to bring the page in line with the proposed updates to the Next.js framework guide: #12707