Since we're Namespacing for clarity (#1318), this opens the opportunity to release a Faker-Lite gem, which could only include the absolute basic generators (e.g. just Address, Alphanumeric, Date, Lorem, Number, Name, Time)
I imagine that there are a lot of projects that don't need to have the entire set of Faker generators for their tests/mockups/seeds and having a simplified stripped-down version for them could be useful to them.
Thoughts?
I'm not opposed... another option is to move namespaces into faker-* gems.
I was also thinking the same thing, but I think it's nice having the full generator package available as the default. Gives developers an easier way to add some fun into their projects.
I agree that it's nice to have everything available by default, but it seems to me that the typical pattern of gem packaging is to have basename-* gems for extras rather than a basename-lite gem.
If we do go that route, adding the faker gem could automatically pull in all the other 'official' plug-in gems and a faker-core gem, which would still allow for getting everything by default
Yeah, I like that idea.
It should be noted that splitting it up like that would break FakerBot #1505. Although, since that's planned on being merged into here, we could do extra fancy stuff with it (eg. part of faker-core, and it can suggest plug-ins that aren't installed)
I like the idea of splitting the namespaces in gems, because we can isolate responsibilities. How would we communicate this change in our README.md? What about starting by opening a PR to suggest the README.md changes and then we go from there?
I'll take a stab at this, but anybody else is welcome to give it a shot as well. :)
I'm thinking we could use this is a V2 effort, including replacing the positional arguments with keyword arguments, and using YARD for documentation.
Edited :)
We should probably rename this ticket to something a bit more descriptive.
So here's my first stab at breaking faker up into multiple gems... first, there's the core gem that all the other faker-* gems will use:
https://github.com/ruby-faker/core
Here's the first of the faker-* gems:
https://github.com/ruby-faker/image
Perhaps the additional gems should also provide all the classes in a namespace. E.g., faker-image would have Faker::Image::Avatar instead of just Faker::Avatar.
The main faker gem would have a dependency on faker-core and all the others.
We would probably want to figure out a method to get the documentation from all the gems into one place. I have a domain we could use for that, if, for example, we wanted to use a rake task to build all the YARD docs and host it via Netlify.
Thoughts on all of the above?
Sounds like a lot of work to get done and I'm excited to help move things forward.
Is faker-ruby a new GitHub community?
I meant GitHub organization.
Yeah, it's a new org... I figured it made sense to use one if we are going to have a bunch of faker-related gems. That said, I'm not 100% convinced this is the way to go. :)
For instance, how would this work with namespace aliases, like comics and movies?
The organization idea is a great idea.
Regarding the namespace aliases, there are two possible solutions that I see right now:
We could have the faker-comics gem which would add everything from the Comics namespace to the top level. So in essence, the new gems would be our namespacing. Though what about generators like HarryPotter which depending on who you talk too would be in faker-movies or faker-books. Then again, that could just fall into faker-harry-potter.
Hey guys,
I feel it is a good idea to break it down into smaller parts. I'm in if you need/want help.
Still, I just have to ask:
Yeah, this is my concern... having worked on it and thought about it over the weekend, I get the feeling it adds complication without much benefit.
Aye. I really only see two things needed. Faker "Full" for developers who want all the generators, and faker "Light" for developers who just need the basics.
I'm not so convinced that is useful. Are people really struggling with the size of the gem or the number of generators in it?
If the problem is just the number of generators that are available, maybe the solution is as simple as curating the docs better? Perhaps in that case even namespaces are unnecessary?
is there a way to measure the use of these generators?
Well, at best, I'd say that the original idea of having a "lite" or "core" version of this gem is nice.
People who only want the basic stuff (lorem ipsum texts, numbers, images, ...) could have them with the faker-core gem.
And people who want more costumized texts like Star Wars characters would install a faker-full gem.
I personally don't see any benefit in spliting faker in more than these two gems.
What do you guys think?
I'm sorry, I don't see the benefit of splitting it even into two gems.
Just catching up on the thread here- I'm afraid I have to agree, splitting the gem into namespaces seems to me like it would add more _complexity_ than it would solve. I'm not sure the size of the gem is a problem at present, plus, given most people run it on their test envs, it sounds sensible to have everything out of the box.
Aye, and for those who really do need just the basics can fork and strip out what they don't need.
Most helpful comment
Just catching up on the thread here- I'm afraid I have to agree, splitting the gem into namespaces seems to me like it would add more _complexity_ than it would solve. I'm not sure the size of the gem is a problem at present, plus, given most people run it on their test envs, it sounds sensible to have everything out of the box.