Skip to content

Conversation

dario-piotrowicz
Copy link
Contributor

@dario-piotrowicz dario-piotrowicz commented Sep 24, 2024

This PR adds a getCloudflareContext utility to the @opennextjs/cloudflare package so that developers can use it to get the Cloudflare bindings etc...

Warning

The current implementation is only for production/preview, it does not work with next dev


As part of this change I split the code in the cloudflare package into 2 sub directories, cli and api, the former contains the code that goes into the binary that gets run to build the worker while the latter exposes the programmatic APIs that the package offers (which is only getCloudflareContext right now)

@dario-piotrowicz dario-piotrowicz force-pushed the get-cloudflare-context branch 2 times, most recently from 07da3c3 to 6463f2d Compare September 24, 2024 18:40
@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review September 25, 2024 09:37
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments.

Copy link
Contributor

@irvinebroque irvinebroque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple comments but looks good, thanks!

@dario-piotrowicz dario-piotrowicz merged commit af15fd1 into main Sep 25, 2024
2 checks passed
@dario-piotrowicz dario-piotrowicz deleted the get-cloudflare-context branch September 25, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants