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

Use json from Erlang/OTP 27 #41

Closed
wants to merge 0 commits into from

Conversation

eltoncampos1
Copy link
Contributor

changes:

  • create a simple wrapper for :json parser from erlang OTP 27
  • remove jason dependency.
  • change calls from jason lib into new JSON parser
  • create some basic tests for new JSON parser

Copy link

@vanderhoop vanderhoop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change would force consumers of flame to be on OTP 27, and Elixir 1.17 as a result, which I don't think is desired at this time.

See michalmuskala/jason#185 for more info

@@ -0,0 +1,29 @@
defmodule FLAME.Parser.JSON do
@moduledoc """
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module should be private.

"{\"a\":1,\"b\":2}"
"""
@spec encode!(any) :: iodata()
def encode!(data) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check if System.otp_release() >= "27", if so, we can use :json, otherwise we need to use Jason and we add Jason as an optional dependency.

.tool-versions Outdated
@@ -0,0 +1,2 @@
erlang 27.0
elixir 1.17.0-rc.1-otp-27
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should work with older OTP versions accordingly, so we should remove this file.

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.

3 participants