slack-ruby / slack-ruby/slack-ruby-client

Suggestion: Replace Hashie::Mash with OpenStruct

Open
#371 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

new feature
Dominant language
Ruby
Stars
1.3k
Forks
222
Avg merge
1d 14h
Merged PRs (30d)
3

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Slack client’s Hashie::Mash usage, especially recursive hashes within Slack::Messages::Message, and compare the existing behavior with OpenStruct. The work is complete only when the replacement preserves the required message behavior and the project has tests covering the affected client responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.