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

Integrating AvramSlugify #786

Merged
merged 1 commit into from Jan 11, 2022
Merged

Integrating AvramSlugify #786

merged 1 commit into from Jan 11, 2022

Conversation

jwoertink
Copy link
Member

Closes luckyframework/avram_slugify#13

This pulls the entire AvramSlugify shard directly in to Avram as Avram::Slugify. No usage or features have changed aside from the name scope. The main considerations for bringing this over are

  • 1 less shard to maintain. Each Avram release required making sure AvramSlugify was also in-sync
  • It's a super small shard with only 1 file (~ 45 LOC)
  • New features become easier to implement with Avram being readily available

The specs weren't copy/paste since the shard was using a User model that wasn't setup the same. I decided to just make a separate model for testing that.

The only other main thing to consider was whether or not to make this an optional require. On the one hand, we could add it as its own module where you'd have to manually require it:

require "avram"
# explicit require
require "avram/slugify"

But then I thought... why? It doesn't interfere with your code by always having it. Crystal is pretty good at optimizing for code that's not being used.

@jwoertink jwoertink merged commit ac281f4 into master Jan 11, 2022
@jwoertink jwoertink deleted the merge_slugify branch January 11, 2022 22:36
@paulcsmith
Copy link
Member

Good idea! 👍

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

Successfully merging this pull request may close these issues.

Should this library be merged into Avram?
3 participants