meta-tags icon indicating copy to clipboard operation
meta-tags copied to clipboard

Renaming helpers to prevent collisions?

Open Spone opened this issue 7 years ago • 4 comments

Hello,

I think that title and description are very generic names, likely to cause collisions in apps.

Actually I had strange errors and realized it was caused by helpers that already existed in my app (in a component context, as I use komponent).

I suggest renaming them to page_title and page_description, or meta_title and meta_description. I know this would be a breaking change, but would you consider it for an upcoming major version?

Thanks

Spone avatar Apr 05 '18 11:04 Spone

Yes, this is a great idea, I have been thinking about this change for a while. My only suggestion would be to return title and description back for the next version (2.10) and raise deprecation warnings on every use.

With version 3 we can remove the old methods. What do you think?

kpumuk avatar Apr 08 '18 01:04 kpumuk

Thanks for the reply. I will update the PR to raise deprecation warnings for now. Maybe we could also add an option to manually use the new names only, starting with the next release?

Also, what do you think about the naming? Actually, I think using the meta_ prefix makes more sense (as it's closer to the name of the gem, and less likely to cause collisions):

  • title > meta_title
  • description > meta_description
  • keywords > meta_keywords
  • nofollow > meta_nofollow
  • noindex > meta_noindex
  • refresh > meta_refresh

Spone avatar Apr 09 '18 07:04 Spone

Hi @kpumuk can you reply to my question above about the naming? I'd like to finish this and get it merged :)

Spone avatar Jun 03 '19 20:06 Spone

@kpumuk meta_ prefix seems great to me. Would this pr be merged?

asayamakk avatar Mar 07 '22 12:03 asayamakk

Closing as stale.

Spone avatar Feb 27 '23 20:02 Spone