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

Remove dependency on SortedSet #214

Merged
merged 5 commits into from
Jun 7, 2022
Merged

Remove dependency on SortedSet #214

merged 5 commits into from
Jun 7, 2022

Conversation

rmm5t
Copy link
Collaborator

@rmm5t rmm5t commented Apr 27, 2022

🚨 This is currently an experiment. 🚨

This is an experiment open for discussion and review. I'm not yet sure that this is the best approach, but the discussion in #213 got me thinking. Less external dependencies are usually better, and I'm not sure we were gaining a ton by using SortedSet. Now that SortedSet is no longer part of core ruby, these seems like a reasonable trade-off to eliminate its usage.

What does it do?

  • Removes external dependency on SortedSet

What else do you need to know?

  • SortedSet and is no longer part of core Ruby.
  • SortedSet relies on RBTree to perform
  • I don't think we were gaining anything by using a SortedSet vs a regular Set

Related Issues

Copy link

@kimyu92 kimyu92 left a comment

Choose a reason for hiding this comment

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

Considering the benefits of dropping two non-core dependencies 🎉 . I agree we definitely want to call out in release note.

Since set is ordered in ruby, the interface is still mostly preserved. We also have specs coverage for these, I won't worry too much though 🙂

LGTM 👍

@@ -144,7 +144,7 @@ def weekdays
wday_to_int(day_name)
end.compact

self._weekdays = SortedSet.new(days)
self._weekdays = Set.new(days.sort)
Copy link

Choose a reason for hiding this comment

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

Alternatively,

Suggested change
self._weekdays = Set.new(days.sort)
self._weekdays = days.sort.to_set

@rmm5t rmm5t force-pushed the remove-sorted-set branch from 6a21b26 to 8c24402 Compare April 27, 2022 14:24
* develop:
  Update changelog
  Fix load path in test suite
  Update build matrix
@rmm5t
Copy link
Collaborator Author

rmm5t commented Apr 27, 2022

@kimyu92 Could you please do me a favor, and test this branch on your project(s) that rely on business_time?

gem "business_time", github: "bokmann/business_time", branch: "remove-sorted-set"

@kimyu92
Copy link

kimyu92 commented Apr 27, 2022

Could you please do me a favor, and test this branch on your project(s) that rely on business_time?

That's exactly what I did last night against your branch. It works fine in my project 🙂

@kimyu92
Copy link

kimyu92 commented Apr 27, 2022

Update: Validated again. It's all ✅ on my end

@kimyu92
Copy link

kimyu92 commented Apr 28, 2022

What would be the timeline to get this in?

It would be nice to get an official release 1.0.0 😂 instead of pointing to this branch for production grade project

@rmm5t
Copy link
Collaborator Author

rmm5t commented Apr 28, 2022

@kimyu92 I'm planning on testing this with a couple of my own projects today.

My original plans were going to make this a v1.0.0 release, but I've since changed my mind. I'm going to make this a v0.12.0 release and wait a few weeks or so to make sure that unsorted holidays doesn't break the internet. 😉

After that, I think a v1.0.0 release is warranted for this gem.

@rmm5t rmm5t force-pushed the remove-sorted-set branch from ef8b56d to bc878a3 Compare April 28, 2022 20:12
@fonji
Copy link

fonji commented Jun 7, 2022

Hi! Any plan on merging this? 🙏

@rmm5t
Copy link
Collaborator Author

rmm5t commented Jun 7, 2022

Hi! Any plan on merging this? 🙏

I totally forgot about this. Thanks for the nudge.

@rmm5t rmm5t merged commit 9aeff65 into develop Jun 7, 2022
@rmm5t rmm5t deleted the remove-sorted-set branch June 7, 2022 14:30
@fonji
Copy link

fonji commented Jun 7, 2022

Woah thank you!

@rmm5t
Copy link
Collaborator Author

rmm5t commented Jun 7, 2022

v0.12.0 released. Please note the warnings in the CHANGELOG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider dropping external deps: sorted_set and rbtree dependencies?
3 participants