Skip to content

[JsonEncoder] Rename the component to JsonStreamer #59863

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

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

mtarld
Copy link
Contributor

@mtarld mtarld commented Feb 26, 2025

Q A
Branch? 7.3
Bug fix? no
New feature? no
Deprecations? no
Issues
License MIT

In order to make the intent of the component clearer, the JsonEncoder component should be renamed to JsonStreamer, as its main goal is to handle JSON streams as efficiently as possible.

In that way, it'll be harder for developers to get confused between this component and the Serializer's JSON encoder.

In that PR, the following public API has been updated:

  • EncoderInterface::encode() has been renamed to StreamWriterInterface::write()
  • DecoderInterface::decode() has been renamed to StreamReaderInterface::read()
  • the JsonEncoder class has been renamed to JsonStreamWriter
  • the JsonDecoder class has been renamed to JsonStreamReader
  • the JsonEncodable attribute has been renamed to JsonStreamable
  • the EncodedName attribute has been renamed to StreamedName
  • ValueTransformerInterface::getJsonValueType() has been renamed to ValueTransformerInterface::getStreamValueType()
  • ValueTransformer::$toJsonValue has been renamed to ValueTransformer::$nativeToStream
  • ValueTransformer::$toNativeValue has been renamed to ValueTransformer::$streamToNative

@alexandre-daubois
Copy link
Member

Makes sense, even more when I think of how it's leveraged in #59655

@mtarld mtarld force-pushed the chore/json-streamer branch from 657c998 to c0c4c02 Compare February 26, 2025 11:36
@mtarld mtarld force-pushed the chore/json-streamer branch from c0c4c02 to 924a01d Compare February 26, 2025 11:49
@fabpot
Copy link
Member

fabpot commented Mar 3, 2025

Thank you @mtarld.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants