Skip to content

Conversation

@penalosa
Copy link
Contributor

Migrate from @iarna/toml to smol-toml. @iarna/toml no longer appears to be maintained, and smol-toml is a more popular alternative that's also crucially ESM rather than CJS—getting us one step closer to having a fully ESM Wrangler build.


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: no functional change
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: no functional change, and it'd be a complex merge

@penalosa penalosa requested review from a team as code owners November 13, 2025 14:02
@changeset-bot
Copy link

changeset-bot bot commented Nov 13, 2025

🦋 Changeset detected

Latest commit: a809b06

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 13, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: a809b06

binding = \\"UnitTestNamespace\\"
id = \\"some-namespace-id\\"
"
id = \\"some-namespace-id\\""
Copy link
Contributor

Choose a reason for hiding this comment

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

that looks better!

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, what this means is that smol-toml never ends files with a newline, which for many is undesirable.

exports[`pages deploy > with wrangler.json configuration > should warn and ignore the config file, if it doesn't specify the \`pages_build_output_dir\` field 1`] = `[Error: Must specify a project name.]`;

exports[`pages deploy > with wrangler.toml configuration > should always deploy to the Pages project specified by the top-level \`name\` configuration field, regardless of the corresponding env-level configuration 1`] = `"b5f53af7922efd0f0b73c7bf288f7e3f14df5c31e8b654e98027ddf85ea7e574"`;
exports[`pages deploy > with wrangler.toml configuration > should always deploy to the Pages project specified by the top-level \`name\` configuration field, regardless of the corresponding env-level configuration 1`] = `"407a6bdab238180ecb96088b70f740fb2c9a91c179a4291486894f068f054422"`;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this change?

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

LGTM with minor comments/questions

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Nov 13, 2025
@penalosa
Copy link
Contributor Author

penalosa commented Nov 13, 2025

Having reviewed the stylistic changes here more closely, I'm no longer sure about this...

[queues]
[[queues.producers]]
queue = \\"testQueue\\"
binding = \\"testQueue\\"


[containers.configuration.observability]
[containers.configuration.observability.logs]
enabled = true

seems worse than the previous

[[queues.producers]]
queue = \\"testQueue\\"
binding = \\"testQueue\\"


[containers.configuration.observability.logs]
enabled = true

and multiline strings seem quite different (they're no longer multiline...)

@penalosa
Copy link
Contributor Author

I've put up a PR to smol-toml to improve some of the stylistic issues: squirrelchat/smol-toml#46. In the meantime I'll vendor that in.

@petebacondarwin petebacondarwin added the blocked Blocked on other work label Nov 13, 2025
@penalosa penalosa force-pushed the penalosa/smol-toml branch 3 times, most recently from 199e3fc to 6cbf8ec Compare November 14, 2025 01:02
@penalosa penalosa requested a review from a team as a code owner November 14, 2025 01:02
@penalosa penalosa removed the blocked Blocked on other work label Nov 14, 2025
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Just a minor worry that we are now adding an extra newline to the end of each stringified TOML, which may look weird in logged snippets?

Copy link

@cyyynthia cyyynthia left a comment

Choose a reason for hiding this comment

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

I noticed some issues with the newlines handling in smol-toml v1.5.0 raised by this PR; released v1.5.1 that should address these and behave much better. 👍

Edit: spoke too fast, but v1.5.2 should be out in a few minutes and actually address that ;)

@penalosa penalosa merged commit 09cb720 into main Nov 14, 2025
35 of 36 checks passed
@penalosa penalosa deleted the penalosa/smol-toml branch November 14, 2025 17:47
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants