-
Notifications
You must be signed in to change notification settings - Fork 64
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
Remove dependencies if not needed #138
Conversation
adcd8e2
to
9a39bf2
Compare
Fantastic Nelson! PS: backwards compatibility for OSS is more of a black box but thanks to the setup we have is fairly smooth |
Hey there :) Any updates on this one? Just asking for a timeline, no pressure intended 🥲 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not maintainer, but great job! Thank you!
Unsure why github actions are not triggered. |
@@ -11,8 +11,6 @@ | |||
, public_key | |||
, ssl | |||
, inets | |||
, jsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: one can actually add .app.src.script, see https://rebar3.org/docs/configuration/config_script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but we don't actually need jsx here anyways, this list is for apps to be started, jsx is not an app but only code to be loaded, that rebar will put in the right path for the BEAM to load the code automatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's also for rebar3 release
to find the apps to be copied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely very good point I don't know how could I forget! Fixed! :)
First time contributors. Need to click Checks > CI > Approve and Run. |
@@ -90,7 +90,7 @@ jesse_run(JsonInstance, Schema, Schemata) -> | |||
{ok, _} = application:ensure_all_started(jesse), | |||
ok = add_schemata(Schemata), | |||
{ok, JsonInstanceBinary} = file:read_file(JsonInstance), | |||
JsonInstanceJsx = jsx:decode(JsonInstanceBinary, [{return_maps, false}]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be an ok change, and I don't have all the details in my head at this very moment, but why did you decide to remove return_maps=false ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there's the "no macros in dynamic calls" to fix (see the CI run), and I guess the solution will be to create a function for encapsulation, maybe we just keep the return_maps=false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it because json
does not support it, and I followed the logic and manually verified it is not needed (anymore) 🤔
That CI error, huh, elvis. Will fix 👌🏽
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a fix :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, made a typo on the fix, pushed again 😅
0cc391a
to
238df4f
Compare
238df4f
to
8b0daa2
Compare
@andreineculau any updates on this one? 😇 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your patience and for the reminder.
CI is green 💪
I left some suggestions which are just the beard talking. I wait briefly for your reply, and then merge and schedule a version
Thank YOU!
rebar.config
Outdated
@@ -1,5 +1,5 @@ | |||
%%-*- mode: erlang -*- | |||
{profiles, [{test, [{deps, [{ proper, "1.4.0"}]}]}]}. | |||
{profiles, [{test, [{deps, [{jsx, "3.1.0"}, {proper, "1.4.0"}]}]}]}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{profiles, [{test, [{deps, [{jsx, "3.1.0"}, {proper, "1.4.0"}]}]}]}. | |
{profiles, [{test, [{deps, [{jsx, "3.1.0"}, {rfc3339, "0.9.0"}, {proper, "1.4.0"}]}]}]}. |
src/jesse_lib.erl
Outdated
-else. | ||
%% OTP 26 to 21. | ||
json_decode(Bin) -> | ||
jsx:decode(Bin). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jsx:decode(Bin). | |
jsx:decode(Bin, [{return_maps, false}). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm only afraid this will have suboptimal performance, but well, I guess that if performance is critical it can run an upgrade to OTP27, jsx was lagging behind long ago anyway :)
src/jesse_lib.erl
Outdated
-else. | ||
%% OTP 20 or lower. | ||
json_decode(Bin) -> | ||
jsx:decode(Bin). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jsx:decode(Bin). | |
jsx:decode(Bin, [{return_maps, false}). |
Comments applied 💪🏽 Looking forward for a new version! 🙃 |
Published. Hope everything still works >_< |
Just trying to minimise the amount of code and dependencies a project gets, OTP covers RFC3339 since 21.0, and json since 27.0. I'd like to slim of dependencies my deployments and OTP's libraries have better support (and performance).
Edit: just wrapped the logic around a
OTP_RELEASE
macro, that way we can keep backwards compatibility.