Skip to content

Commit

Permalink
feature #59254 [JsonEncoder] Remove chunk size definition (mtarld)
Browse files Browse the repository at this point in the history
This PR was merged into the 7.3 branch.

Discussion
----------

[JsonEncoder] Remove chunk size definition

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

Remove the `$forceEncodeChunks` boolean.

This boolean was telling if the encoder should use `json_encode` or should yield as small strings as possible.
It was set to `false` by default and not easily configurable yet.

This configurable behavior has been removed.
Instead, we use `json_encode` directly if **the value that does not contain any object**. Otherwise, it'll be split (see the diff in `src/Symfony/Component/JsonEncoder/Tests/Fixtures/encoder/object_in_object.php`)

IMHO, this will fit most of the use cases, and remove a configuration complicated to understand.

Commits
-------

86274994ff [JsonEncoder] Remove chunk size definition
  • Loading branch information
GromNaN committed Dec 21, 2024
2 parents 7b11774 + bc39c5b commit 63ae307
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Resources/config/json_encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
tagged_locator('json_encoder.normalizer'),
service('json_encoder.encode.property_metadata_loader'),
param('.json_encoder.encoders_dir'),
false,
])
->set('json_encoder.decoder', JsonDecoder::class)
->args([
Expand Down Expand Up @@ -113,7 +112,6 @@
service('json_encoder.decode.property_metadata_loader'),
param('.json_encoder.encoders_dir'),
param('.json_encoder.decoders_dir'),
false,
service('logger')->ignoreOnInvalid(),
])
->tag('kernel.cache_warmer')
Expand Down

0 comments on commit 63ae307

Please sign in to comment.