Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[JsonEncoder] Remove chunk size definition #59254

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

Conversation

mtarld
Copy link
Contributor

@mtarld mtarld commented Dec 18, 2024

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.

@chalasr
Copy link
Member

chalasr commented Dec 19, 2024

Build failures look related, could you check?

@mtarld
Copy link
Contributor Author

mtarld commented Dec 20, 2024

Indeed, they're here because of the BC break between FrameworkBundle and JsonEncoder (because of the $forceEncodeChunks removal in constructors). It should disappear once merged

@stof
Copy link
Member

stof commented Dec 20, 2024

This will not disappear once merged. The CI failure are legitimate, because your PR misses the update of service definitions in FrameworkBundle to use the new signature.

@mtarld mtarld force-pushed the feat/json-encoder-remove-force-encode-chunks branch from e782add to 8627499 Compare December 20, 2024 15:20
@mtarld
Copy link
Contributor Author

mtarld commented Dec 20, 2024

It was missing my last update... Should be good then

@GromNaN
Copy link
Member

GromNaN commented Dec 21, 2024

Thank you Mathias.

@GromNaN GromNaN merged commit ca0912f into symfony:7.3 Dec 21, 2024
11 checks passed
@mtarld mtarld deleted the feat/json-encoder-remove-force-encode-chunks branch December 21, 2024 16:46
@fabpot fabpot mentioned this pull request May 2, 2025
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.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.