-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use smol-toml for TOML parsing
#11266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest 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 |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
packages/wrangler/src/__tests__/queues/__snapshots__/queues.test.ts.snap
Show resolved
Hide resolved
| binding = \\"UnitTestNamespace\\" | ||
| id = \\"some-namespace-id\\" | ||
| " | ||
| id = \\"some-namespace-id\\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that looks better!
There was a problem hiding this comment.
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"`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this change?
vicb
left a comment
There was a problem hiding this 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
|
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 = trueseems worse than the previous [[queues.producers]]
queue = \\"testQueue\\"
binding = \\"testQueue\\"
[containers.configuration.observability.logs]
enabled = trueand multiline strings seem quite different (they're no longer multiline...) |
|
I've put up a PR to |
199e3fc to
6cbf8ec
Compare
6cbf8ec to
929cfc9
Compare
petebacondarwin
left a comment
There was a problem hiding this 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?
425b95a to
4208357
Compare
There was a problem hiding this 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 ;)
4208357 to
35e9e43
Compare
35e9e43 to
a809b06
Compare
Migrate from
@iarna/tomltosmol-toml.@iarna/tomlno longer appears to be maintained, andsmol-tomlis a more popular alternative that's also crucially ESM rather than CJS—getting us one step closer to having a fully ESM Wrangler build.