Skip to content
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

[FEATURE] improve getCloudflareContext() #229

Open
vicb opened this issue Jan 7, 2025 · 0 comments
Open

[FEATURE] improve getCloudflareContext() #229

vicb opened this issue Jan 7, 2025 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@vicb
Copy link
Contributor

vicb commented Jan 7, 2025

getClouflareContext retrieves the context from either a worker request (through ALS) or by starting a getPlatformProxy in next dev.

There are a few things we could improve:

  • throw in a worker context when getClouflareContext is called outside of a request context (i.e. top level)
  • remove the node specific code in the worker context (we could define WORKER_CONTEXT = true in esbuild to strip the code at build time).

See:

/cc @dario-piotrowicz @james-elicx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

1 participant