Add initial plumbing for a local explorer worker#12034
Conversation
🦋 Changeset detectedLatest commit: a6b0cff The changes in this PR will be included in the next version bump. 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 |
32b8d90 to
9d828fd
Compare
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
084049e to
8e70548
Compare
| request = new Request(request, { cf }); | ||
|
|
||
| // The proxy client will always specify an operation | ||
| // The magic proxy client (used by getPlatformProxy) will always specify an operation |
There was a problem hiding this comment.
For another day... perhaps we should go through the code and change all "magic proxy" (and other references to this) to just be "platform proxy"?
| }); | ||
|
|
||
| afterAll(async () => { | ||
| await stop?.(); |
There was a problem hiding this comment.
nit: I find it nice to return a fn from BeforeAll for something init'd there
8e8b07b to
85ee118
Compare
85ee118 to
e584ddc
Compare
e584ddc to
a6b0cff
Compare
|
|
||
| export default class LocalExplorerAPI extends WorkerEntrypoint { | ||
| async fetch(): Promise<Response> { | ||
| return new Response("Hello from local explorer API"); |
There was a problem hiding this comment.
NIT:
| return new Response("Hello from local explorer API"); | |
| return Response.json({message: "Hello from local explorer API"}); |
or
| return new Response("Hello from local explorer API"); | |
| return Response.json({}); |
or perhaps some HTTP unimplemented error?
| * `X_LOCAL_EXPLORER` enables the local explorer UI at /cdn-cgi/explorer. | ||
| * This is an experimental feature flag. Defaults to false when not set. | ||
| */ | ||
| export const getLocalExplorerFromEnv = getBooleanEnvironmentVariableFactory({ |
There was a problem hiding this comment.
Can we make this sound more like a boolean flag?
| export const getLocalExplorerFromEnv = getBooleanEnvironmentVariableFactory({ | |
| export const getLocalExplorerEnabledFromEnv = getBooleanEnvironmentVariableFactory({ |
There was a problem hiding this comment.
sgtm! i'll change that in my next PR though if that's okay!
Currently with a no-op local explorer worker.
By commit:
proxyBindingsto give the local explorer worker access to the user's resource bindings, as this already contains the user worker's resource bindings.A picture of a cute animal (not mandatory, but encouraged)
