History

Serve the worker-bundler artifact from static assets (#1378)

The publish bundler artifact, worker-bundler source and esbuild wasm, is fetched from static assets at first use instead of being inlined into the worker script, returning the script to its previous size. Cold-start latency regressed while the 19MB artifact chunk was part of the script blob.

Rhys Sullivan committed 4 months ago

Commit 56b60bf1 parent 63e19e78 files · +175 −18Browse files

Showing the changes to apps/cloud/src/engine/execution-stack.ts (1 of 8 files). Show all

Unified · Split

apps/cloud/src/engine/execution-stack.ts+2−0
@@ -64,6 +64,7 @@ const cloudPluginFactory = executorConfig.plugins as (deps: { · 63 unmodified lines
6464 readonly activeToolkitSlug?: string;
6565 readonly allowLocalNetwork?: boolean;
6666 readonly workerLoader?: WorkerLoader;
67+ readonly workerAssets?: { readonly fetch: (request: Request) => Promise<Response> };
6768 }) => readonly AnyPlugin[];
6869
6970 // Fresh plugin instances per request, carrying the Worker env's WorkOS Vault
@@ -80,6 +81,7 @@ export const CloudPluginsProvider: Layer.Layer<PluginsProvider> = Layer.succeed( · 10 unmodified lines
8081 context?.mcpResource?.kind === "toolkit" ? context.mcpResource.slug : undefined,
8182 allowLocalNetwork: env.ALLOW_LOCAL_NETWORK === "true",
8283 workerLoader: env.LOADER,
84+ workerAssets: env.ASSETS,
8385 }),
8486 });
8587