Skip to content

[deploy-helpers] Extract Worker startup profiling from Wrangler - #15612

Merged
petebacondarwin merged 11 commits into
mainfrom
pbd/extract-startup-profile
Sep 15, 2026
Merged

petebacondarwin merged 11 commits into
mainfrom
pbd/extract-startup-profile

Conversation

@petebacondarwin

@petebacondarwin petebacondarwin commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Prerequisite for https://github.com/cloudflare/cf/issues/97.

Summary

Wrangler's startup profiler was private to check startup, so cf could not implement the equivalent command without importing Wrangler internals. This exposes the generic implementation from @cloudflare/deploy-helpers/startup-profile.

  • Share Worker upload parsing, bundle sizing, CPU profiling, and profile summaries.
  • Make deploy startup-limit diagnostics lazy-load the shared profiler.
  • Migrate wrangler check startup, deploy, Pages deploy, and version upload away from Wrangler callback injection.
  • Preserve analyseBundle as an optional deprecated compatibility callback.
  • Harden the inspector lifecycle with command acknowledgements, response correlation, a timeout, and guaranteed cleanup.
  • Add the Wrangler build alias and a minor changeset for the new public subpath and deprecation.

Validation

  • pnpm --filter @cloudflare/deploy-helpers build
  • pnpm --filter @cloudflare/deploy-helpers check:type
  • pnpm --filter @cloudflare/deploy-helpers type:tests
  • pnpm --filter @cloudflare/deploy-helpers test:ci — 141 tests
  • pnpm --filter wrangler build
  • pnpm --filter wrangler check:type
  • Focused Wrangler startup, validator, and deploy suites — 52 tests
  • Focused type-aware lint, formatting, package dependency validation, and git diff --check

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this shares an internal implementation without adding a new Wrangler command or option.

Devin Review

@changeset-bot

changeset-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f9f2487

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cloudflare/deploy-helpers Minor
@cloudflare/remote-bindings Patch

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

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Sep 11, 2026
@workers-devprod
workers-devprod requested review from a team and dario-piotrowicz and removed request for a team September 11, 2026 17:50
@workers-devprod

workers-devprod commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@ask-bonk

ask-bonk Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

devin-ai-integration[bot]

This comment was marked as resolved.

@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15612

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15612

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@15612

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15612

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@15612

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@15612

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15612

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@15612

miniflare

npm i https://pkg.pr.new/miniflare@15612

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15612

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@15612

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@15612

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@15612

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@15612

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15612

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@15612

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15612

wrangler

npm i https://pkg.pr.new/wrangler@15612

commit: f9f2487

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@petebacondarwin petebacondarwin added this to the Birthday Week 2026 milestone Sep 14, 2026
Comment thread packages/wrangler/src/__tests__/startup-profiling.test.ts
Comment thread .changeset/bright-pandas-profile.md Outdated

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@petebacondarwin
petebacondarwin force-pushed the pbd/extract-startup-profile branch from 2fcf18d to a811e32 Compare September 15, 2026 09:23
@petebacondarwin
petebacondarwin enabled auto-merge (squash) September 15, 2026 09:23
@petebacondarwin
petebacondarwin merged commit 74bf083 into main Sep 15, 2026
55 checks passed
@petebacondarwin
petebacondarwin deleted the pbd/extract-startup-profile branch September 15, 2026 10:37
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in workers-sdk Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants