-
Notifications
You must be signed in to change notification settings - Fork 734
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
🚀 Feature Request: improve the wrangler.toml config experience #1165
Comments
This adds a warning for unexpected fields on `[migrations]` config, reported in #1165. It also adds a test for incorrect `renamed_classes` in a migration.
Yeah, we want to change the format (or rather, accept multiple formats), we just haven't gotten around to it yet. Of note with this specific example tho, is that we do log a warning for a missing |
This adds a warning for unexpected fields on `[migrations]` config, reported in #1165. It also adds a test for incorrect `renamed_classes` in a migration.
Supporting multiple formats often becomes a big headache because of increased maintenance and support cost (bugs, extra design time needed for new config keys, extra documentation needed). If we could just land on a single format (or temporarily, during a migration, support two formats) then that would be preferable. |
Closing in favour of #1951 |
Describe the solution
A feedback that often comes up in various discussions is that the toml config file is not ergonomic, error-prone, and generally unpleasant to use.
There are at least three different root causes behind this pain:
We could improve the validation of the toml file (interesting schema-based validator: https://json-schema-everywhere.github.io/toml), but we might as well consider using alternative format altogether.
One alternative to consider is JSON with comments. This format is very popular format (used by TypeScript, Angular, and many others), has great tooling support for validation, formatting, syntax highlighting, docs generation.
In order to smooth out the transition if we do adopt an alternative format, we should also make it easy for people to convert the existing toml file to the new format. This could be a built-in functionality of Wrangler — we could for example automatically prompt the dev and offer the config file to be converted if they are still using toml.
I've seen some people ask for
js
based config language. While there is a space for imperative Wrangler API for general configuration, it is generally much more preferable to stick with declarative languages for configuration because those are more suitable for long-term evolution (via automated config transformation) and are significantly easier to integrate with other tooling (like IDEs) which otherwise would need to execute untrusted code in order to read the config.example of a toml file that passes validation, and critical config property to be ignored during deployment:
The
compatibility_date
property is ignored when it shouldn't be.The text was updated successfully, but these errors were encountered: