jensljungblad / elemental_components

Simple view components for Rails 5.1+
MIT License
76 stars 5 forks source link

Gem name and release on rubygems #29

Closed msalzburg closed 4 years ago

msalzburg commented 5 years ago

Since the name "components" is already used/blocked on rubygems we should probably find a new name, rename the project/files and work towards an offical release on rubygems?

@jensljungblad do you have any names on your mind already?

fgblomqvist commented 5 years ago

What about simply naming it rails-components? Seems free (there are some variations with an underscore, singular etc.) and more importantly, is really easy to find. A google search for "Rails components" would eventually lead pretty straight to this project (currently ranking 7 for that query for me). Finally, all of the similar-named projects are barely used at all (and barely have any stars) so this one would pretty quickly become the headliner (e.g. be considered the proper rails-components gem).

If you want to go for something more unique I suppose you could do something like "komponents", but tbh, rails-components would get my vote any day.

Anyway, I think releasing this as a gem would make sense now since it would also help with attracting more users :)

jensljungblad commented 5 years ago

Yeah, rails-components sound pretty good to me :) What about the namespace, should we change it or keep Components? It's a pretty generic name so could potentially clash with something, not sure.

fgblomqvist commented 5 years ago

While it certainly looks pretty just as Components, I think it might be better to be on the safer side here and just change it to RailsComponents (maybe less confusing as well, idk). But then again, I don't have a ton of experience with working with a lot of different gems outside the standard Rails ones, so I can't say what the convention is or whether it's likely that it would clash with something.

jensljungblad commented 5 years ago

The naming conventions for gems can be found here: https://guides.rubygems.org/name-your-gem. E.g. rails-components should mean there is a Rails::Components module, and not a RailsComponents one. That would rather be for a gem named rails_components. But people break these rules quite a lot, and there are ways around the autoloading issues.

Could also throw in "view" somewhere in the name perhaps, to make it clear it's view components and some other form of component.. rails_view_components is quite long though!

fgblomqvist commented 5 years ago

I see. I'm not entirely sure if it's allowed/expected but imo using Rails::Components sounds the most logical to me. This gem is a pure Rails add-on after all.

Otherwise, maybe either just stick with components + Components, or go with ViewComponents + view_components? That way it's not awfully long and I guess it follows the conventions. Maybe not crystal clear that it's for Rails, but yeah, these conventions cause sacrifices.

msalzburg commented 5 years ago

The naming conventions for gems can be found here: https://guides.rubygems.org/name-your-gem.

Funny - I was also looking up those naming convention the other day and started wondering if it would be wise to move into the rails namespace via Rails::Components.

Standalone gems often have a rails adapter/integration gem e.g. rspec-rails and define a RSpec::Rails namespace to prevent naming conflicts. Since the components gem is fully dependent on rails and probably will not exist as a standalone gem there is no need to split it up into two gems.

But we could follow the same naming convention and use something like our_name-rails. If I didnt miss anything the components-rails name is not used on rubygems.org yet. In this case we would take the risk to have conflicts with the other 10 year inactive components gem though (https://rubygems.org/gems/components). But why should somebody install two component gems at the same time ...

P.S. view_components is also already taken: https://rubygems.org/gems/view_components

jensljungblad commented 5 years ago

Using the Rails namespace feels a little weird to me. It just looks like it's a part of Rails.

E.g. rails-components using a Rails::Components::Component class name.

Some alternatives:

  1. rails-components with a RailsComponents constant (i.e. cheat a little).
  2. rails_components with a RailsComponents constant (ask if we can take the name, since the repo is archived)
  3. rails_view_components with a RailsViewComponents constant
fgblomqvist commented 5 years ago

Still a big fan of "invading" the Rails namespace, but if I had to pick a different option, I'd vote for number 1.

jensljungblad commented 5 years ago

Wouldn't it make more sense to invade actionview in that case? :) That is probably not as good for search though.

fgblomqvist commented 5 years ago

That does make more sense. Would that result in a name such as actionview-components then? And yeah I agree, not as good for search :/

jensljungblad commented 5 years ago

Yeah. Makes sense if seen as a pure rails/actionview extension, but doesn't exactly roll off the tongue :)

fgblomqvist commented 5 years ago

God, I hate naming stuff lol :P Found this as well: https://rubygems.org/gems/actionview-component

jensljungblad commented 5 years ago

@msalzburg Was your proposal to use components-rails but keep the constant as Components? That is what I've seen that pattern used for mostly. E.g. sass-rails, elasticsearch-rails etc.

jensljungblad commented 5 years ago

@fgblomqvist Haha I know.. At least GitHub works pretty well as a gem repository!

actionview-components is available though :)

fgblomqvist commented 5 years ago

Haha always something. And yeah true :) Alright, my final vote falls on actionview-components with ActionView::Components::Component. It makes logical sense in every way possible in my head, and I'm sure people will find it no matter what. As long as the readme contains the word "rails" it should show up in some Google searches. Maybe it'll get listed in some other spots eventually, or perhaps get featured in some article. Finally, I suppose it's good to think long-term and realize that complex ActionView rendering is probably on the way out (imo), getting replaced by either client-side rendering or just other server-side frameworks (e.g. react server-side rendering). Meaning that, I don't think we're looking at a 10-year lifespan for something like this so probably better to get it out there sooner rather than later ;)

msalzburg commented 5 years ago

Was your proposal to use components-rails but keep the constant as Components?

@jensljungblad kind of. I was thinking we could use a similar pattern like the sass-rails adapter gem. But instead of adapting to a standalone gem we could ship the "core" components gem with it.

Maybe with a structure like this:

components-rails/

This way the components gem can still live in its Components namespace and the rails integration lives in a nested Components::Rails namespace. The gem can be hosted on rubygems as components-rails gem ?!?!

jensljungblad commented 4 years ago

Published to RubyGems finally: https://rubygems.org/gems/elemental_components. Closing :)