-
Notifications
You must be signed in to change notification settings - Fork 0
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
Minimum set of changes to make bindings work locally #1
Conversation
@@ -34,3 +34,6 @@ yarn-error.log* | |||
# typescript | |||
*.tsbuildinfo | |||
next-env.d.ts | |||
|
|||
# wrangler | |||
.wrangler |
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.
The template we give people should ignore .wrangler
, otherwise you end up committing the temp state of local dev to git history accidentally.
@@ -2,3 +2,17 @@ | |||
const nextConfig = {} | |||
|
|||
module.exports = nextConfig | |||
|
|||
// Everything below *needs* to be part of the default template that running npm create cloudflare@latest gives you |
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.
^ needs to be default, not opt-in.
@@ -2,3 +2,17 @@ | |||
const nextConfig = {} | |||
|
|||
module.exports = nextConfig | |||
|
|||
// Everything below *needs* to be part of the default template that running npm create cloudflare@latest gives you | |||
// It needs to be documented in real dev docs |
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.
This has to be loud, at the top of any getting started path we have (since many people will have existing Next.js apps, or be creating them outside of npm create cloudflare@latest
, outside of dash.
// Everything below *needs* to be part of the default template that running npm create cloudflare@latest gives you | ||
// It needs to be documented in real dev docs | ||
// It needs to be the happy path, not optional thing you discover later | ||
// Assume that every single developer will use one or more of these in their app |
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.
^ really important.
if (process.env.NODE_ENV === 'development') { | ||
import('@cloudflare/next-on-pages/__experimental__next-dev').then(({ setupDevBindings }) => { | ||
|
||
// When Pages has wrangler.toml, just read from that in current directory and can skip this config |
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.
This is a big part of why getting Pages wrangler.toml
matters so much.
// When Pages has wrangler.toml, just read from that in current directory and can skip this config | ||
setupDevBindings({ | ||
kvNamespaces: ['MY_KV_1', 'MY_KV_2'], | ||
}); |
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.
^ this is effectively making people re-create what would otherwise be in wrangler.toml
.
No description provided.