Skip to content
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

cffi: always return config values as JSON #3969

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LawnGnome
Copy link

Previously, string JSON values were special cased to be provided as bare strings, which means that CFFI modules have to either know what type each value is expected to be, or use a heuristic such as trying to decode and then treating the value as a string on failure.

Instead, we can always return JSON, and let the downstream consumer handle deserialising the value into whatever type is expected.

The new behaviour is gated on a new ABI version 2: modules built against version 1 will continue to get the old behaviour.

Previously, string JSON values were special cased to be provided as
bare strings, which means that CFFI modules have to either know what
type each value is expected to be, or use a heuristic such as trying to
decode and then treating the value as a string on failure.

Instead, we can always return JSON, and let the downstream consumer
handle deserialising the value into whatever type is expected.

The new behaviour is gated on a new ABI version 2: modules built against
version 1 will continue to get the old behaviour.
LawnGnome added a commit to LawnGnome/waybar-cffi-rs that referenced this pull request Mar 6, 2025
Dependent on Alexays/Waybar#3969 being merged,
obviously.
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.

1 participant