Skip to content

json2.decoder2: prepare decoder in json2 to be replaced by json2.decode2#23078

Merged
spytheman merged 7 commits intovlang:masterfrom
enghitalo:decoder/replace
Dec 6, 2024
Merged

json2.decoder2: prepare decoder in json2 to be replaced by json2.decode2#23078
spytheman merged 7 commits intovlang:masterfrom
enghitalo:decoder/replace

Conversation

@enghitalo
Copy link
Copy Markdown
Contributor

@enghitalo enghitalo commented Dec 6, 2024

Comment thread vlib/x/json2/decoder2/decode.v
Comment thread vlib/x/json2/tests/decoder_test.v
Comment thread vlib/x/json2/tests/encoder_test.v Outdated
Comment thread vlib/x/json2/tests/json2_test.v Outdated
@spytheman
Copy link
Copy Markdown
Contributor

spytheman commented Dec 6, 2024

No, deprecations of public functions take time. Add at least 1 month starting from today.
See https://docs.vlang.io/attributes.html, search for the section Function/method deprecations .

Alternatively, just do not deprecate the method, and leave it as it is, including its tests.

@enghitalo
Copy link
Copy Markdown
Contributor Author

No, deprecations of public functions take time. Add at least 1 month starting from today.
See https://docs.vlang.io/attributes.html, search for the section Function/method deprecations .

Alternatively, just do not deprecate the method, and leave it as it is, including its tests.

I prefer to make them deprecated. When x.json2 becomes just json, probably none of these methods will be part of the library. I hope

@spytheman
Copy link
Copy Markdown
Contributor

They are public API, public APIs should have a deprecation period. It is very rude to users of your libraries, to make breaking changes like this, especially if you have an easy way to avoid it.

@spytheman spytheman closed this Dec 6, 2024
@enghitalo enghitalo reopened this Dec 6, 2024
@huly-for-github huly-for-github Bot closed this Dec 6, 2024
@huly-for-github huly-for-github Bot reopened this Dec 6, 2024
Comment thread vlib/x/json2/decoder.v
}

// decode_array is a generic function that decodes a JSON string into the array target type.
pub fn decode_array[T](src string) ![]T {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@spytheman spytheman merged commit de3b184 into vlang:master Dec 6, 2024
@enghitalo enghitalo deleted the decoder/replace branch December 6, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants