ignacio-chiazzo / ruby_whatsapp_sdk

A lightweight, efficient Ruby gem for interacting with Whatsapp Cloud API.
https://ignacio-chiazzo.github.io/ruby_whatsapp_sdk/
MIT License
156 stars 33 forks source link

Support jruby #81

Closed jimtng closed 1 year ago

jimtng commented 1 year ago

Hi, I currently can't use this in jruby because it depends on oj, which is a C extension. Would you consider making oj an optional part of this gem and supporting other jruby-compatible json implementations? Thanks!

ignacio-chiazzo commented 1 year ago

Would you consider making oj an optional part of this gem and supporting other jruby-compatible json implementations?

Hey yes, I would consider using a different one. I'd need to do some investigation, do you have a proposal? I'd be happy to review PRs.

I see that support has been removed https://github.com/ohler55/oj/blob/b6b8193d8ba0e6c5fe2664037428c39b0e7e0764/pages/Compatibility.md?plain=1#L6.

jimtng commented 1 year ago

Why was oj chosen in the first place? Is its performance critical for whatsapp_sdk applications? Why not use Ruby's standard json library?

ignacio-chiazzo commented 1 year ago

Mostly performance in Rails apps. We have been using the gem without any perf issues (although there is always room for improvement).

I'm all good to remove OJ dependency and use standard ruby libraries.

ignacio-chiazzo commented 1 year ago

I added support to JRuby to the main branch. I will cut a release in the next few days.

https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/pull/83

jimtng commented 1 year ago

Thank you! Much appreciated!

ignacio-chiazzo commented 1 year ago

Version 0.8.0 was released and removes OJ to support JRuby.

Thanks for the report and please submit an issue if you have any other issue.