-
Notifications
You must be signed in to change notification settings - Fork 475
FIX: Type definitions to allow passing meta object as second parameter #3947
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
base: main
Are you sure you want to change the base?
Conversation
documentation/language-reference/top-level-functions/NewDnsProvider.md
Outdated
Show resolved
Hide resolved
|
A half-baked thought: What if the parameters/parameter_types only reflected the modern style ( While I'm always concerned about backwards compatibility, I have little sympathy for people that have been ignoring a warning for more than a year. They've been getting warnings that look like this: The docs say "Starting with v4.0 support for the OLD format may be reported as an error." I forgot I wrote that. We should probably do that soon. (Note to self: Also add a warning when the 2nd parameter is "-"). Bottom line: I'm fine with the |
|
@tlimoncelli I think that makes a lot of sense. The type hints should be best-effort at supporting deprecated-but-not-yet-removed syntax. |
Prior to this it would only work if you did the deprecated style of
passing the provider type first.
```js
NewDnsProvider("bind", "BIND" {"stuff": "stuff"})
```
But it wouldn't support omitting the optional provider type and
specifying the extra object.
```js
NewDnsProvider("bind", {"stuff": "stuff"})
```
Now the old style is forbidden (in the type hints) to discourage use of
it, although dnscontrol does still allow it.
Fixes StackExchange#3946
Originally fixed this in 6edfbf5, but I fixed it in the generated file and not the source file. There should probably be a CI check to run the generate and fail if it has any changes.
f507750 to
4ec3b30
Compare
tlimoncelli
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.
Looks good! Could you add a section to documentation/language-reference/top-level-functions/NewDnsProvider.md called # Backwards Compatibility that explains that if you see NewDnsProvider("foo" ,"-" or NewDnsProvider("foo", "PROVIDERNAME this is older syntax that is going away soon. "preview" will print warnings telling you what to change.

Prior to this it would only work if you did
But it wouldn't support omitting the optional provider type and specifying the extra object.
Fixes #3946