-
Notifications
You must be signed in to change notification settings - Fork 21
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
introduce new initOpenNextCloudflareForDev
utility and make getCloudflareContext
synchronous
#265
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 24fa5a9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
2447a8a
to
f6510ac
Compare
commit: |
ddaa077
to
4753b0a
Compare
6648525
to
09b33de
Compare
Thought: Maybe we can This comment says "the function is an async one but it doesn't need to be awaited", it might be nice to add the rationale if we add the implementation to our repo. |
09b33de
to
59419ca
Compare
Yes, we could, this would mean that everyone would always have to call but again if you strongly prefer us to go that route I'm ok with it
Yes, given the implementation of |
@vicb I've addressed all the feedback, the only thing left is to decide whether we want to force this sort of thing via a up to you, just let me know if you want to me make the change 👍 |
Give me some time to think about it, I'm not settled. Some thoughts I have for now about Cons:
Pros
|
Well there is only one con and many pros, I dislike that we need to then ask users to always call the function, but given the benefits it does seem like it might be worth it By the way, either way I am not too convinced about the name since this is a dev ( |
1c298b1
to
b234e3e
Compare
getCloudflareContext
to work in middlewares via a new enableEdgeDevGetCloudflareContext
utilityinitOpenNextCloudflareForDev
utility and make getCloudflareContext
synchronous
…udflareContext` synchronous
b234e3e
to
d7f6572
Compare
Co-authored-by: Victor Berchet <victor@suumit.com>
ea44365
to
6006cf2
Compare
I've pushed the |
Could you please update the README and opennext.js.org to tell users to add the init? |
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.
Could you please update https://github.com/opennextjs/opennextjs-cloudflare/blob/main/packages/cloudflare/README.md
Either to ask the user to add the call to the init function
Or if you can update opennext.js.org, remove the content and link to the doc site (I was mostly using the content for the experimental branch when the experimental features were not documented anywhere else)
Great stuff, thanks 🚀
Co-authored-by: Victor Berchet <victor@suumit.com>
This PR introduces a new
initOpenNextCloudflareForDev
utility to add to the Next.js config file that makes thegetCloudflareContext
work in middlewares (or more generally, the edge runtime) during local development (vianext dev
)It
getCloudflareContext
has also been converted to be synchronousFor more details see the changeset file:
.changeset/chilly-dryers-begin.md
C3 PR: cloudflare/workers-sdk#7903
Docs relative PR: opennextjs/docs#57
fixes #137
fixes #226