Suggestion: Replace Hashie::Mash with OpenStruct
Hashie has generally been noted as having lackluster performance, large memory overhead, and results in a few pitfalls. For instance, see https://www.schneems.com/2014/12/15/hashie-considered-harmful.html.
OpenStruct objects can provide much of the same benefits (e.g. attributes accessible by symbol or string keys, as well as method calls) with less overhead and easier understanding. I tried doing this myself, but some of the Slack client is partially dependent on some strange behavior around Hashie::Mash (particularly on recursive hashes within a Slack::Messages::Message) - this could all be changed, but I felt it was getting to be a larger effort that should have community buy-in before being done. As a result, I figured I would raise this suggestion here. Thanks!
I support this change. It should be probably similar to what we did in Grape, so maybe not OpenStruct.
I also support this.
@dblock What are the advantages of ActiveSupport::HashWithIndifferentAccess over OpenStruct? I see two disadvantages:
HashWithIndifferentAccessdoesn't allow method access, which might be a painful refactor for a lot of people (me included).- This library would need to add back
ActiveSupport, which was removed in #325.
I don't really have any strong feelings about ActiveSupport::HashWithIndifferentAccess over OpenStruct.