Skip to content

[create-cloudflare] Enable upload_source_maps by default for new projects#12741

Merged
petebacondarwin merged 2 commits intomainfrom
devin/1772540366-upload-source-maps-central
Mar 23, 2026
Merged

[create-cloudflare] Enable upload_source_maps by default for new projects#12741
petebacondarwin merged 2 commits intomainfrom
devin/1772540366-upload-source-maps-central

Conversation

@penalosa
Copy link
Copy Markdown
Contributor

@penalosa penalosa commented Mar 3, 2026

Supersedes #11726.

Instead of adding upload_source_maps: true to each of the 43 individual template wrangler.jsonc files, this sets it centrally in the updateWranglerConfig function — the same place that already sets name, compatibility_date, observability, and nodejs_compat for all C3 templates.

Like nodejs_compat, upload_source_maps is skipped for Python projects.

Key review points

  • TOML vs JSON behavior difference: For TOML configs, ??= is used (won't override if already set). For JSON configs, appendJSONProperty (which calls assign) is used (will override). This matches the existing pattern for observability vs nodejs_compat but is worth verifying is intentional.
  • Python exclusion: upload_source_maps is grouped with nodejs_compat inside the lang !== "python" guard. The original PR Set upload_source_maps to true for all C3 templates #11726 also removed it from Python templates explicitly.

Link to Devin session: https://app.devin.ai/sessions/9aa9987751da4a5b8ed3cf97a28996f5
Devin PR requested by @penalosa



Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 3, 2026

🦋 Changeset detected

Latest commit: 67f5869

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

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

✅ All changesets look good

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 3, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12741

@cloudflare/workers-editor-shared

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

wrangler

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

commit: 67f5869

@penalosa penalosa force-pushed the devin/1772540366-upload-source-maps-central branch from c5dc447 to f9c48fa Compare March 20, 2026 20:05
@penalosa penalosa marked this pull request as ready for review March 20, 2026 20:05
@penalosa penalosa requested a review from a team as a code owner March 20, 2026 20:05
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 20, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@penalosa
Copy link
Copy Markdown
Contributor Author

/bonk fix the formatting in this pr

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

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

Looks good. The implementation is clean and follows the established patterns well.

What I verified:

  • Correctness: Both TOML (??=) and JSON (appendJSONPropertyassign) paths are consistent with how observability and nodejs_compat are already handled. The ??= for TOML won't override if a template already sets the value; assign for JSON will override, but no C3 templates currently set upload_source_maps, so this is a non-issue in practice.
  • Python exclusion: Correctly grouped inside the lang !== "python" guard alongside nodejs_compat, which makes sense since Python Workers don't produce JS source maps.
  • Tests: Both TOML and JSON Python tests assert upload_source_maps is absent. All existing snapshot tests were updated to include upload_source_maps = true. All 219 tests pass.
  • Changeset: Minor bump for create-cloudflare, description is clear and well-written.

One minor nit below about the doc comment, feel free to take or leave it.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 20, 2026

Minor nit: The doc comment for updateWranglerConfig (config.ts:18-31) lists what the function does but doesn't mention upload_source_maps. Consider adding a bullet like:

 * - enabling upload_source_maps (for non-Python projects)

for completeness alongside the existing items for name, compatibility_date, observability, and nodejs_compat.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 20, 2026

I've reviewed and approved PR #12741. Here's a summary of my findings:

Approved - The implementation is clean and follows established patterns.

Key points verified:

  • TOML uses ??= (won't override existing values), JSON uses appendJSONProperty/assign (will override) -- matches the existing pattern for observability/nodejs_compat; no C3 templates currently set upload_source_maps so the override difference is moot in practice.
  • Python exclusion is correctly placed inside the lang !== "python" guard alongside nodejs_compat.
  • Tests cover both TOML and JSON paths for the Python exclusion, and all snapshot tests are updated. All 219 tests pass.
  • Changeset is well-formatted as a minor bump.

One minor nit posted as a comment: the doc comment on updateWranglerConfig doesn't mention upload_source_maps among its listed behaviors.

github run

@petebacondarwin petebacondarwin force-pushed the devin/1772540366-upload-source-maps-central branch from f9c48fa to ead9aa8 Compare March 22, 2026 22:07
devin-ai-integration bot and others added 2 commits March 23, 2026 11:28
…ects

Add upload_source_maps: true to the central updateWranglerConfig function
so all C3 templates get source maps enabled without needing per-template
changes. Skipped for Python projects.

Co-Authored-By: smacleod <samuel@macleod.space>
@petebacondarwin petebacondarwin force-pushed the devin/1772540366-upload-source-maps-central branch from ead9aa8 to 67f5869 Compare March 23, 2026 11:31
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Mar 23, 2026
@petebacondarwin petebacondarwin merged commit e8f62bb into main Mar 23, 2026
46 of 47 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 23, 2026
@petebacondarwin petebacondarwin deleted the devin/1772540366-upload-source-maps-central branch March 23, 2026 12:00
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