Skip to content

JSON Module Support for Elixir 1.18 and CI Environment Updates #210

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

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

Conversation

michelboaventura
Copy link

@michelboaventura michelboaventura commented Apr 17, 2025

This PR introduces conditional JSON handling and updates our CI environment:

  • Adds a new Cluster.JSON module that automatically uses Elixir 1.18's built-in JSON module when available, falling back to Jason otherwise
  • Makes the Jason dependency optional
  • Updates CI Ubuntu version from 20.04 (deprecated April 15, 2025) to 22.04
  • Adjusts Elixir version testing matrix:
    • Removed: Elixir 1.13 (incompatible with Ubuntu 22.04's OTP 24.3 minimum requirement)
    • Added: Elixir 1.16 and 1.18
    • Now testing against the latest three Elixir versions (1.14, 1.16, 1.18)

These changes maintain backward compatibility while leveraging new language features in Elixir 1.18.

Summary of changes

I'll review the commits, so I mostly want to understand the "why" rather than the "what"

Checklist

  • New functions have typespecs, changed functions were updated
  • Same for documentation, including moduledocs
  • Tests were added or updated to cover changes
  • Commits were squashed into a single coherent commit
  • Notes added to CHANGELOG file which describe changes at a high-level

Elixir 1.18 includes a built-in JSON module. This commit adds a
`Cluster.JSON` module that delegates to the built-in module when
available, and falls back to `Jason` otherwise.
@michelboaventura
Copy link
Author

hey @bitwalker do you think this approach is a good one for we to start using JSON on the lib? Thanks!

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