Skip to content

[wrangler] Update smol-toml to 1.9.0 - #15838

Merged
dario-piotrowicz merged 7 commits into
cloudflare:mainfrom
oddharsh:smol-toml-1.9.0
Sep 24, 2026
Merged

dario-piotrowicz merged 7 commits into
cloudflare:mainfrom
oddharsh:smol-toml-1.9.0

Conversation

@oddharsh

@oddharsh oddharsh commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes: no issue filed; same shape as #15662, a dependency bump small enough to go straight to a PR. Happy to open one if you'd rather track it.

#15662 moved smol-toml to 1.8.0 and merged at 15:52 UTC on 2026-09-22. Forty-eight minutes later, at 16:40, smol-toml published GHSA-r4xh-jqrq-34v2, affecting every version up to and including 1.8.0. 1.9.0 followed at 17:07. So the version that PR landed was covered by an advisory before it reached a release.

That timing is funny, and it also matters. #15662 existed because downstream OSV scans kept flagging wrangler's bundled copy, and the root Dependabot block only allows workerd and @cloudflare/workers-types, so nothing here bumps this on its own. Since that change shipped, the same scans flag the bundle again under the new advisory. Without a manual bump it stays flagged until somebody else notices.

The advisory

parseKey rescanned to the end of the document on every key line, so parse time grows with the square of the key count. Measured on Node 26.9 with smol-toml.parse over k<i> = <i> lines:

key lines 1.8.0 1.9.0
10,000 20.2 ms 6.4 ms
20,000 69.7 ms 10.1 ms
40,000 258.7 ms 16.8 ms
a 63-line wrangler.toml (20 KV bindings) 17.6 µs 18.2 µs

Real exposure through wrangler is small: the file is almost always the user's own, and a normal config parses in the same time on both versions. The case for the bump is the advisory plus the scanner noise, since the release notes' speedup doesn't show up at config sizes.

What changed

  • pnpm-workspace.yaml: smol-toml catalog entry 1.8.0 to 1.9.0. pnpm-lock.yaml changes only the smol-toml lines this time, with none of the peer-suffix drift [wrangler] Update smol-toml to 1.8.0 #15662 had to trim.
  • packages/workers-utils/tests/parse.test.ts: 1.9.0 returns parsed tables with a null prototype, so three toStrictEqual({...}) assertions failed with "expected {} to strictly equal {}". They now use toEqual.
  • packages/wrangler/src/__tests__/pages/pages-build-env.test.ts: one inline snapshot. For INVALID "FILE, 1.9.0 reports illegal character in key at 1:8, pointing at the ", where 1.8.0 reported incomplete key-value: cannot find end of key at 1:0. Updated to the new output, which is more useful.
  • Twelve files: import TOML from "smol-toml" to import * as TOML from "smol-toml" (see below).
  • .changeset/smol-toml-1-9.md: one patch changeset for the four packages that bundle it.

Behaviour changes checked, since this is a larger release than 1.8

  • Null prototype. A consumer calling obj.hasOwnProperty(...) on a parsed table would throw. I grepped workers-utils, wrangler, create-cloudflare and workers-auth source for hasOwnProperty(, instanceof Object, getPrototypeOf, .constructor and isPlainObject. The only hits are Object.prototype.hasOwnProperty.call in vectorize/query.ts, which is safe on a null-prototype object and parses JSON anyway.
  • Dates. validation.ts rejects TOML dates in vars via varValue instanceof Date. On 1.9.0's default path the value is still a TomlDate (which extends Date), so the check still fires. One thing to know for later: 1.9.0 adds opt-in Temporal output (useLegacyDate: false) and says it becomes the default in v2, where that instanceof Date check would stop matching.
  • Default export. 1.9.0 formally deprecates import TOML from "smol-toml", and check:lint (--deny-warnings --type-aware) reports each use as an error. All twelve default imports across the four packages now use import * as TOML from "smol-toml", the form wrangler's tests already used, and parse.ts reads TOML.TomlError off the namespace. My first push missed this because I ran the tests but not the lint locally.

  • 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: dependency update, no user-facing surface changes.

Locally, after pnpm run build --filter wrangler: @cloudflare/workers-utils 1087/1087; wrangler 259 files, 5430 passed, 1 failed, 3 skipped, 9 todo before the snapshot update, where the one failure was the TOML error text above, and pages-build-env.test.ts passes 14/14 after it; create-cloudflare test:unit 262/262; @cloudflare/workers-auth 191 passed, 3 skipped. pnpm check:lint, check:type in all four packages, oxfmt --check and pnpm check:catalog pass.

1.9.0 fixes GHSA-r4xh-jqrq-34v2, which covers every version through 1.8.0.
Parsed tables now have a null prototype, so the parseTOML tests compare
with toEqual, and one TOML error snapshot now points at the bad character.
@changeset-bot

changeset-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6d956bd

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

This PR includes changesets to release 11 packages
Name Type
wrangler Patch
create-cloudflare Patch
@cloudflare/workers-utils Patch
@cloudflare/workers-auth Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-plugin Patch
@cloudflare/autoconfig Patch
@cloudflare/cli-shared-helpers Patch
@cloudflare/containers-shared Patch
@cloudflare/deploy-helpers Patch
@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 24, 2026
@workers-devprod
workers-devprod requested review from a team and tpmmorris and removed request for a team September 24, 2026 14:58
@workers-devprod

workers-devprod commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-integration Bot 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.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

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

Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

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

@cloudflare/build-output-utils

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

@cloudflare/codemods

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

@cloudflare/config

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

@cloudflare/containers-shared

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

create-cloudflare

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

@cloudflare/deploy-helpers

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-functions

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

@cloudflare/pages-shared

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

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@15838

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-plugin

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

@cloudflare/workers-auth

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 6d956bd

oddharsh and others added 3 commits September 24, 2026 11:15
1.9.0 deprecates the default export, and check:lint runs with
--deny-warnings --type-aware, so all twelve default imports failed the
Checks job. TomlError is now read off the namespace in parse.ts.
devin-ai-integration[bot]

This comment was marked as resolved.

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, Thanks for this improvement @oddharsh 😄

Comment thread packages/workers-utils/tests/parse.test.ts 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

@dario-piotrowicz
dario-piotrowicz merged commit 15799d4 into cloudflare:main Sep 24, 2026
54 checks passed
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in workers-sdk Sep 24, 2026
@oddharsh
oddharsh deleted the smol-toml-1.9.0 branch September 24, 2026 19:09
Wichtowski pushed a commit to Wichtowski/workers-sdk that referenced this pull request Sep 24, 2026
Co-authored-by: Aadharsh Pannirselvam <19518661+oddharsh@users.noreply.github.com>
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